### OpenAI GPT-4 Configuration Example Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt An example configuration block for setting up the OpenAI GPT-4 provider. It includes essential parameters such as API key, model name, temperature, and token limits for both input and output. ```yaml Provider: OpenAI API Key: sk-proj-xxxxxxxxxxxxxxxxxxxxxxx Model: gpt-4o-mini Temperature: 0.7 Max Input Tokens: 1000 Max Output Tokens: 800 ``` -------------------------------- ### OpenRouter Multi-Model Setup Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Sets up connection to OpenRouter, supporting multiple models. Requires an API key and specifies the model, temperature, and token limits. Includes an optional reasoning token budget. ```yaml Provider: OpenRouter API Key: sk-or-xxxxxxxxxxxxxxxxxxxxxxx Model: meta-llama/llama-4-maverick:free Temperature: 0.7 Max Input Tokens: 500 Max Output Tokens: 500 Reasoning Max Tokens: 100 # Optional reasoning budget ``` -------------------------------- ### Google Gemini Provider Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Example configuration for using Google Gemini as the AI provider. This includes the API key, specific Gemini model, temperature, and input/output token limits. ```yaml Provider: Google API Key: AIzaSyxxxxxxxxxxxxx Model: gemini-2.0-flash Temperature: 0.7 Max Input Tokens: 1000 Max Output Tokens: 800 ``` -------------------------------- ### OpenAI Provider Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Example configuration for setting up the AI Automation Suggester to use OpenAI as the AI provider. It includes essential parameters like API key, model name, temperature, and token limits. ```yaml Provider: OpenAI API Key: sk-proj-xxxxxxxxxxxxx Model: gpt-4o-mini Temperature: 0.7 Max Input Tokens: 500 Max Output Tokens: 500 ``` -------------------------------- ### Suggestions Sensor Template Example (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This YAML snippet shows an example of how to use a Jinja2 template to create a sensor that displays the 'yaml_block' attribute from the AI suggestions sensor. ```yaml # Entity: sensor.ai_automation_suggestions_{provider_name} # States: # - "No Suggestions" (no suggestions yet) # - "Suggestions Available" (suggestions exist) # - "New Suggestions Available" (timestamp changed) # Attributes: # suggestions: Full AI response text # description: Text portion (without YAML block) # yaml_block: Extracted YAML code # last_update: ISO timestamp # entities_processed: List of entity IDs analyzed # entities_processed_count: Integer count # provider: Provider name # Template Usage: template: - sensor: - name: "Latest Automation YAML" state: > {{ state_attr('sensor.ai_automation_suggestions_openai', 'yaml_block') }} ``` -------------------------------- ### Configuration Entry Options for AI Providers Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Explains how to configure AI provider settings through the Home Assistant Integrations UI. Shows example options for OpenAI, including API key, model, temperature, and token limits. Notes the priority of configuration sources. ```yaml # Editable via Settings → Integrations → Configure # Provider-specific (example for OpenAI): openai_api_key: string (password) openai_model: string (default: gpt-4o-mini) openai_temperature: float (0.0-2.0, default: 0.7) max_input_tokens: integer (min: 100, default: 500) max_output_tokens: integer (min: 100, default: 500) # Priority: entry.options > entry.data > default ``` -------------------------------- ### Anthropic Provider Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Configuration example for integrating with Anthropic's AI models. This specifies the provider, API key, model, temperature, and token limits suitable for Anthropic services. ```yaml Provider: Anthropic API Key: sk-ant-xxxxxxxxxxxxx Model: claude-3-7-sonnet-latest Temperature: 0.7 Max Input Tokens: 800 Max Output Tokens: 600 ``` -------------------------------- ### HACS Custom Repository Setup Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This snippet shows how to add the AI Automation Suggester as a custom repository in Home Assistant Community Store (HACS). This is the initial step for installing the integration. ```yaml Repository: https://github.com/ITSpecialist111/ai_automation_suggester Category: Integration ``` -------------------------------- ### LocalAI Private Setup Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Sets up a connection to a self-hosted LocalAI instance. Requires the IP address and port of the LocalAI server, and specifies the model, temperature, and token limits. HTTPS usage can be toggled. ```yaml Provider: LocalAI IP Address: 192.168.1.50 Port: 8080 Use HTTPS: false Model: llama3 Temperature: 0.8 Max Input Tokens: 600 Max Output Tokens: 500 ``` -------------------------------- ### Python Coordinator Data Structure Example Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Defines the structure for storing AI automation suggestions and related metadata. Includes fields for the AI's full response, extracted text, YAML code blocks, timestamps, processed entities, provider details, and error messages. ```python { "suggestions": str, # Full AI response "description": str, # Text without YAML block "yaml_block": str, # Extracted YAML code "last_update": str, # ISO timestamp "entities_processed": list, # Entity IDs analyzed "provider": str, # Provider name "last_error": str | None # Error message if failed } ``` -------------------------------- ### Service Call to Analyze All Entities Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This service call instructs the AI Automation Suggester to perform a comprehensive analysis of all entities in the smart home setup, with an option to limit the number of sampled entities. ```yaml service: ai_automation_suggester.generate_suggestions data: all_entities: true entity_limit: 300 ``` -------------------------------- ### Service Call for Domain-Focused Analysis Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This service call allows for targeted analysis of specific entity domains (e.g., light, switch, sensor). It can also include a custom prompt to guide the AI's suggestions, along with an entity limit. ```yaml service: ai_automation_suggester.generate_suggestions data: domains: - light - switch - sensor entity_limit: 100 custom_prompt: "Focus on energy-saving automations that turn off lights and switches when rooms are unoccupied." ``` -------------------------------- ### Implement Throttling for AI Analysis Automation Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt An example Home Assistant automation that throttles AI analysis calls to prevent excessive API usage. It triggers on state changes and ensures a minimum interval between successful runs. ```yaml # Avoid excessive API calls with throttling automation: - alias: Throttled AI Analysis trigger: - platform: event event_type: state_changed condition: - condition: template value_template: > {{ (now() - state_attr('automation.throttled_ai_analysis', 'last_triggered') | default(now() - timedelta(hours=2))).total_seconds() > 3600 }} action: - service: ai_automation_suggester.generate_suggestions data: {} ``` -------------------------------- ### Groq Fast Inference Provider Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Configures the connection to Groq for fast AI inference. Requires a Groq API key and specifies the model, temperature, and token limits. ```yaml Provider: Groq API Key: gsk_xxxxxxxxxxxxxxxxxxxxxxx Model: llama3-8b-8192 Temperature: 0.5 Max Input Tokens: 500 Max Output Tokens: 400 ``` -------------------------------- ### Adjust Token Budget and Entity Limits Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Instructions for increasing token limits and adjusting entity limits to resolve 'Token Budget Exceeded' errors. Also shows how to check actual usage statistics via sensor attributes. ```yaml # If prompts are truncated, adjust limits: # Settings → Integrations → AI Automation Suggester → Configure Max Input Tokens: 2000 # Increase from default 500 Entity Limit: 100 # Reduce from default 200 # Check actual usage in attributes: {{ state_attr('sensor.ai_automation_suggestions_openai', 'entities_processed_count') }} ``` -------------------------------- ### Azure OpenAI Provider Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Sets up a connection to Azure OpenAI services. Requires Azure resource details, deployment ID, and API key. Configurable temperature and token limits. ```yaml Provider: OpenAI Azure Endpoint: myresource.openai.azure.com Deployment ID: gpt-4-deployment API Version: 2024-02-15-preview API Key: xxxxxxxxxxxxxxxxxxxxxxx Temperature: 0.7 Max Input Tokens: 1000 Max Output Tokens: 800 ``` -------------------------------- ### Compare AI Provider Suggestions Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt An automation demonstrating how to use multiple AI providers for comparison. It triggers a suggestion generation service for OpenAI and then Anthropic, with a delay in between. ```yaml automation: - alias: Compare Provider Suggestions trigger: - platform: time at: "09:00:00" action: - service: ai_automation_suggester.generate_suggestions target: entity_id: sensor.ai_automation_suggestions_openai data: all_entities: true - delay: 30 - service: ai_automation_suggester.generate_suggestions target: entity_id: sensor.ai_automation_suggestions_anthropic data: all_entities: true ``` -------------------------------- ### Generic OpenAI Compatible Endpoint Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Configures connection to any OpenAI-compatible API endpoint. Requires the endpoint URL, API key, model name, temperature, and token limits. ```yaml Provider: Generic OpenAI Endpoint: https://api.custom-provider.com/v1/chat/completions API Key: custom-key-xxxxxxxxxxxxxxxxxxxxxxx Model: custom-model-name Temperature: 0.7 Max Input Tokens: 500 Max Output Tokens: 500 ``` -------------------------------- ### Mistral AI Provider Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Configures the connection to Mistral AI services. Requires an API key and specifies the model, temperature, and token limits. ```yaml Provider: Mistral AI API Key: xxxxxxxxxxxxxxxxxxxxxxx Model: mistral-medium Temperature: 0.7 Max Input Tokens: 800 Max Output Tokens: 600 ``` -------------------------------- ### Configuration Entry Options Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Describes the configurable options for the AI Automation Suggester integration, editable via the UI. ```APIDOC ## Configuration Entry Options ### Description Editable via Settings → Integrations → Configure. Provider-specific options may apply. ### Method CONFIGURATION ### Endpoint Settings → Integrations → AI Automation Suggester → Configure ### Parameters #### Provider-Specific Options (Example for OpenAI) - **openai_api_key** (string) - Password - API key for OpenAI - **openai_model** (string) - Default: gpt-4o-mini - Model to use for OpenAI - **openai_temperature** (float) - 0.0-2.0, Default: 0.7 - Sampling temperature - **max_input_tokens** (integer) - Min: 100, Default: 500 - Maximum input tokens - **max_output_tokens** (integer) - Min: 100, Default: 500 - Maximum output tokens ### Priority Configuration is applied in the following order: `entry.options` > `entry.data` > `default` values. ``` -------------------------------- ### Local Ollama Provider Configuration Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Configuration details for connecting to a local AI model through Ollama. It requires the IP address, port, HTTPS setting, model name, temperature, and specific Ollama parameters. ```yaml Provider: Ollama IP Address: 192.168.1.100 Port: 11434 Use HTTPS: false Model: llama2 Temperature: 0.7 Disable Think Mode: false Max Input Tokens: 500 Max Output Tokens: 500 ``` -------------------------------- ### View AI Integration Logs in Home Assistant Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Provides commands to filter Home Assistant logs for the AI Automation Suggester integration and enable debug logging for the component in `configuration.yaml`. ```bash # Home Assistant logs filtered for integration grep "ai_automation_suggester" /config/home-assistant.log # Enable debug logging in configuration.yaml logger: default: info logs: custom_components.ai_automation_suggester: debug ``` -------------------------------- ### generate_suggestions Service API Reference Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Details the parameters for the `generate_suggestions` service, including optional parameters for specifying the provider configuration, custom prompts, entity filtering, and automation analysis settings. ```yaml service: ai_automation_suggester.generate_suggestions data: provider_config: "config_entry_id" # Optional: Specific provider custom_prompt: "string" # Optional: Custom instructions all_entities: boolean # Optional: Default false (only new entities) domains: list # Optional: Default [] (all domains) entity_limit: integer # Optional: Default 200, Range 50-1000 automation_read_yaml: boolean # Optional: Default false automation_limit: integer # Optional: Default 100, Range 10-500 **Parameters:** - `provider_config`: Config entry ID for targeting specific provider (when multiple configured) - `custom_prompt`: Additional instructions appended to system prompt - `all_entities`: If true, analyzes all entities; if false, only new entities since last run - `domains`: List of entity domain strings to filter (e.g., ["light", "switch"]) - `entity_limit`: Maximum entities to sample and send to AI provider - `automation_read_yaml`: If true, reads automations.yaml file (high token usage) - `automation_limit`: Maximum automations to include in analysis **Returns:** Updates coordinator data and all associated sensors ``` -------------------------------- ### Service Call for Climate Optimization Analysis Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This service call directs the AI to focus on climate control automations by analyzing relevant domains like climate, sensor, and weather. It uses a custom prompt to balance comfort and energy efficiency, with a specified entity limit. ```yaml service: ai_automation_suggester.generate_suggestions data: domains: - climate - sensor - weather custom_prompt: "Create smart climate control automations based on occupancy, weather forecasts, and temperature sensors. Balance comfort with energy efficiency." entity_limit: 200 ``` -------------------------------- ### AI Security Analysis Script Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A script employing the AI Automation Suggester for security hardening analysis. It targets relevant security domains and includes a custom prompt for detecting threats, implementing defense-in-depth, and ensuring reliability. ```yaml script: ai_security_analysis: sequence: - service: ai_automation_suggester.generate_suggestions data: domains: ["binary_sensor", "lock", "alarm_control_panel", "camera"] custom_prompt: | Review security setup and suggest automations to: 1. Detect unusual access patterns 2. Implement defense-in-depth strategies 3. Add redundant monitoring for critical sensors 4. Create fail-safe behaviors for network/power loss Prioritize reliability and minimize false positives. entity_limit: 200 ``` -------------------------------- ### AI Energy Analysis Script Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A script that utilizes the AI Automation Suggester to analyze energy consumption patterns. It specifies target domains and a custom prompt focused on energy savings and ROI estimation. ```yaml script: ai_energy_analysis: sequence: - service: ai_automation_suggester.generate_suggestions data: domains: ["light", "switch", "climate", "sensor"] custom_prompt: | Analyze energy consumption patterns and suggest automations to: 1. Reduce vampire power draw 2. Optimize HVAC scheduling based on occupancy 3. Implement smart lighting schedules 4. Add solar production optimization if applicable Focus on measurable energy savings with ROI estimates. entity_limit: 250 ``` -------------------------------- ### AI Automation Suggester - Weekly Review Automation (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This automation performs a full system analysis every Sunday at 3 AM. It generates suggestions for all entities, reads automation YAML, and sends a persistent notification upon completion. ```yaml alias: AI Automation Suggester - Weekly Review description: Full system analysis every Sunday trigger: - platform: time at: "03:00:00" condition: - condition: time weekday: - sun action: - service: ai_automation_suggester.generate_suggestions data: all_entities: true automation_read_yaml: true automation_limit: 100 entity_limit: 500 - service: persistent_notification.create data: title: "Weekly AI Automation Review Complete" message: "Check sensor.ai_automation_suggestions_* for recommendations" notification_id: "weekly_ai_review" mode: single ``` -------------------------------- ### Debug AI Suggestion Service Call Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Tests the `generate_suggestions` service with specific parameters for debugging. Allows setting entity limits, specifying domains, and providing a custom prompt. ```yaml service: ai_automation_suggester.generate_suggestions data: all_entities: false entity_limit: 10 # Very small for testing domains: - light # Single domain for simplicity custom_prompt: "Just say hello and confirm you can see my lights" ``` -------------------------------- ### Calculate Total AI Token Budget Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A template sensor that calculates the total token budget by summing the 'max_input_tokens' and 'max_output_tokens' for a given AI provider. It assumes the existence of 'sensor.max_input_tokens_{provider_name}' and 'sensor.max_output_tokens_{provider_name}' entities. ```yaml template: - sensor: - name: "Total AI Token Budget" unit_of_measurement: "tokens" state: > {{ states('sensor.max_input_tokens_openai') | int + states('sensor.max_output_tokens_openai') | int }} ``` -------------------------------- ### Service Call for Security-Focused Analysis Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This service call focuses the AI's analysis on security-related domains such as binary sensors, alarm control panels, locks, and cameras. It includes a custom prompt to prioritize reliable security automations and an entity limit. ```yaml service: ai_automation_suggester.generate_suggestions data: domains: - binary_sensor - alarm_control_panel - lock - camera custom_prompt: "Suggest security automations including intrusion detection, door/window monitoring, and alarm triggers. Prioritize reliability and fail-safe behaviors." entity_limit: 150 ``` -------------------------------- ### Displaying Automation Description on Dashboard Source: https://github.com/itspecialist111/ai_automation_suggester/blob/main/README.md This Jinja2 template snippet shows how to retrieve and display the human-readable description of AI-generated automations from the integration's sensor. It is useful for presenting suggestions to users on a Home Assistant dashboard. ```jinja {{ state_attr('sensor.ai_automation_suggestions_', 'description') }} ``` -------------------------------- ### Service Call for Multi-Provider Targeting Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt When multiple AI provider configurations are set up, this service call allows specifying which configuration entry ID to use for generating suggestions, ensuring targeted analysis. ```yaml # When multiple providers configured, specify which to use service: ai_automation_suggester.generate_suggestions data: provider_config: "01234567890abcdef" # Config entry ID all_entities: true ``` -------------------------------- ### Display AI Automation Description with Markdown Card Source: https://github.com/itspecialist111/ai_automation_suggester/blob/main/custom_components/dashboard/seperate dashboard.txt This markdown card displays the current status and description for AI automation suggestions. It fetches the status from 'sensor.ai_automation_suggestions_google', displays the last update time, and shows a detailed description attribute from the same sensor. If no description is available, it shows a default message. ```yaml type: markdown title: 🤖 AI Suggestion — Description content: > **Status:** {{ states('sensor.ai_automation_suggestions_google') }} **Last update:** {{ state_attr('sensor.ai_automation_suggestions_google', 'last_update') }} --- {{ state_attr('sensor.ai_automation_suggestions_google', 'description') or '_No description yet._' }} ``` -------------------------------- ### Displaying Automation YAML Block on Dashboard Source: https://github.com/itspecialist111/ai_automation_suggester/blob/main/README.md This Jinja2 template snippet demonstrates how to fetch and display the YAML code block for AI-generated automations. This allows users to easily view or copy the automation configuration directly from their Home Assistant dashboard. ```jinja {{ state_attr('sensor.ai_automation_suggestions_', 'yaml_block') }} ``` -------------------------------- ### Button Card to Trigger AI Suggestions in Lovelace (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A Lovelace button card that, when tapped, calls the `ai_automation_suggester.generate_suggestions` service. This allows for manual triggering of AI suggestions with specific parameters. ```yaml type: button name: Generate AI Suggestions icon: mdi:robot-happy-outline tap_action: action: call-service service: ai_automation_suggester.generate_suggestions service_data: all_entities: true entity_limit: 200 ``` -------------------------------- ### Service Call for Deep Automation Review Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This advanced service call enables a deep review of existing automations by reading the actual YAML content. It's designed to identify redundancies, inefficiencies, and suggest consolidations, with options for entity and automation limits. ```yaml service: ai_automation_suggester.generate_suggestions data: all_entities: true automation_read_yaml: true automation_limit: 50 custom_prompt: "Review my existing automations for redundancy, inefficiency, or potential improvements. Suggest consolidations where multiple automations could be combined." ``` -------------------------------- ### Basic Service Call to Generate Suggestions Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A simple service call to trigger the AI Automation Suggester to generate new automation suggestions. It uses default settings and processes only newly added entities. ```yaml service: ai_automation_suggester.generate_suggestions data: {} ``` -------------------------------- ### AI Automation Suggester - New Entity Detection Automation (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This automation triggers when entity states change, designed to analyze new devices and entities. It is throttled to run at most once per hour to prevent excessive API calls. ```yaml alias: AI Automation Suggester - New Entity Detection description: Automatically analyze new devices and entities trigger: - platform: event event_type: state_changed condition: - condition: template value_template: > {{ (now() - state_attr('automation.ai_automation_suggester_new_entity_detection', 'last_triggered') | default(now() - timedelta(hours=2), true)).total_seconds() > 3600 }} action: - service: ai_automation_suggester.generate_suggestions data: {} mode: single ``` -------------------------------- ### generate_suggestions Service Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Calls the AI service to generate suggestions based on provided parameters. ```APIDOC ## Service: generate_suggestions ### Description Calls the AI service to generate suggestions based on provided parameters. ### Method SERVICE CALL ### Endpoint ai_automation_suggester.generate_suggestions ### Parameters #### Service Data Parameters - **provider_config** (string) - Optional - Config entry ID for targeting specific provider (when multiple configured) - **custom_prompt** (string) - Optional - Additional instructions appended to system prompt - **all_entities** (boolean) - Optional - Default false (only new entities) - **domains** (list) - Optional - Default [] (all domains) - **entity_limit** (integer) - Optional - Default 200, Range 50-1000 - **automation_read_yaml** (boolean) - Optional - Default false - **automation_limit** (integer) - Optional - Default 100, Range 10-500 ### Request Example ```yaml service: ai_automation_suggester.generate_suggestions data: provider_config: "config_entry_id" custom_prompt: "string" all_entities: false domains: ["light", "switch"] entity_limit: 100 automation_read_yaml: true automation_limit: 50 ``` ### Response #### Success Response - Updates coordinator data and all associated sensors ``` -------------------------------- ### AI Suggestions When Everyone Home Automation (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This automation generates AI suggestions when all family members arrive home between 5 PM and 10 PM. It focuses on welcome home automations and evening comfort scenarios. ```yaml alias: AI Suggestions When Everyone Home description: Generate suggestions when all family members arrive home trigger: - platform: state entity_id: group.family to: "home" condition: - condition: time after: "17:00:00" before: "22:00:00" action: - service: ai_automation_suggester.generate_suggestions data: domains: - light - media_player - climate custom_prompt: "Focus on welcome home automations and evening comfort scenarios" mode: single ``` -------------------------------- ### AI Energy Optimization During Peak Hours Automation (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt This automation provides energy-saving suggestions during expensive peak electricity hours, specifically when the electricity price exceeds $0.30. It suggests aggressive energy-saving automations focusing on reducing consumption without sacrificing critical comfort or security. ```yaml alias: AI Energy Optimization During Peak Hours description: Get energy-saving suggestions during expensive peak hours trigger: - platform: time at: "14:00:00" # Peak rate starts condition: - condition: template value_template: "{{ states('sensor.electricity_price') | float > 0.30 }}" action: - service: ai_automation_suggester.generate_suggestions data: all_entities: true entity_limit: 200 custom_prompt: "Suggest aggressive energy-saving automations for peak electricity hours. Focus on reducing consumption without sacrificing security or critical comfort." mode: single ``` -------------------------------- ### Monitor AI Provider Connection Status Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt Checks the connection status of the AI provider using Home Assistant sensors. The sensor reports states like 'initializing', 'connected', 'disconnected', or 'error'. The last error message can also be retrieved. ```yaml # Monitor status sensor sensor.ai_provider_status_openai # States: # - initializing: First run # - connected: Working normally # - disconnected: Cannot reach provider # - error: Error occurred # Check error details sensor.last_error_message_openai ``` -------------------------------- ### Display AI Suggestions in Lovelace Dashboard (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A Lovelace markdown card to display the latest AI automation suggestions. It shows the description, YAML code block, last update timestamp, and the count of entities processed. ```yaml type: markdown title: AI Automation Suggestions content: | ## Latest Suggestions {{ state_attr('sensor.ai_automation_suggestions_openai', 'description') }} ## YAML Code ```yaml {{ state_attr('sensor.ai_automation_suggestions_openai', 'yaml_block') }} ``` **Last Updated:** {{ state_attr('sensor.ai_automation_suggestions_openai', 'last_update') }} **Entities Analyzed:** {{ state_attr('sensor.ai_automation_suggestions_openai', 'entities_processed_count') }} ``` -------------------------------- ### AI Provider Status Card for Lovelace Dashboard (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A Lovelace entities card to display the status of the AI provider. It includes information such as the provider name, model in use, token limits, and the last error message. ```yaml type: entities title: AI Provider Status entities: - entity: sensor.ai_provider_status_openai name: OpenAI Status - entity: sensor.ai_model_in_use_openai name: Model - entity: sensor.max_input_tokens_openai name: Input Token Limit - entity: sensor.max_output_tokens_openai name: Output Token Limit - entity: sensor.last_error_message_openai name: Last Error ``` -------------------------------- ### Alert on AI Provider Failure Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt An automation designed to alert users if an AI provider enters an 'error' state and remains in that state for a defined period (10 minutes). It uses a persistent notification to report the error. ```yaml automation: - alias: Alert on AI Provider Failure trigger: - platform: state entity_id: sensor.ai_provider_status_openai to: "error" for: minutes: 10 action: - service: notify.persistent_notification data: title: "AI Provider Error" message: > Provider has been in error state for 10 minutes. Error: {{ states('sensor.last_error_message_openai') }} ``` -------------------------------- ### Display Suggested Automation YAML with Markdown Card Source: https://github.com/itspecialist111/ai_automation_suggester/blob/main/custom_components/dashboard/seperate dashboard.txt This markdown card renders suggested automation code in YAML format. It retrieves the YAML code block from the 'yaml_block' attribute of the 'sensor.ai_automation_suggestions_google' entity. If the 'yaml_block' attribute is present and not empty, it displays the code within a YAML code block; otherwise, it shows a message indicating that no raw code was found. ```yaml type: markdown title: 📝 Suggested Automation YAML content: > {% set code = state_attr('sensor.ai_automation_suggestions_google', 'yaml_block') %} {% if code %} ```yaml {{ code }} ``` {% else %} _No YAML block found. The most recent AI reply did not contain raw code._ {% endif %} ``` -------------------------------- ### Display AI Automation Status with Template Chips Source: https://github.com/itspecialist111/ai_automation_suggester/blob/main/custom_components/dashboard/seperate dashboard.txt This snippet configures a Home Assistant mushroom chips card to display the status of AI automation suggestions. It uses a template chip to show 'Suggestions Available' or 'All Good' based on the 'sensor.ai_automation_suggestions_google' entity, with color coding for visual cues. It also includes entity chips for update status and a toggle for new entity detection. ```yaml type: vertical-stack cards: - type: custom:mushroom-chips-card alignment: start chips: - type: template entity: sensor.ai_automation_suggestions_google icon: mdi:cloud-check icon_color: > {{ 'yellow' if states(entity) == 'Suggestions Available' else 'green' }} content: > {{ 'Suggestions_Available' if states(entity) == 'Suggestions Available' else 'All_Good' }} - type: entity entity: update.ai_automation_suggester_update name: AI_Suggester icon_color: '{{ ''red'' if is_state(entity,''on'') else ''green'' }}' - type: template entity: automation.ai_suggestions_new_entity_detection icon: mdi:robot icon_color: '{{ ''teal'' if is_state(entity,''on'') else ''grey'' }}' content: > {{ 'New-Entity_Detection_ON' if is_state(entity,'on') else 'New-Entity_Detection_OFF' }} tap_action: action: toggle ``` -------------------------------- ### Conditional AI Provider Error Display in Lovelace (YAML) Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A Lovelace conditional card that displays an error message if the AI provider status sensor is in an 'error' state. It shows the current status and the last error message. ```yaml type: conditional conditions: - entity: sensor.ai_provider_status_openai state: "error" card: type: markdown content: | ## AI Provider Error **Status:** {{ states('sensor.ai_provider_status_openai') }} **Error:** {{ states('sensor.last_error_message_openai') }} Check your API key and network connectivity. ``` -------------------------------- ### Check AI Provider Health Status Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt A template sensor to determine if an AI provider is in a 'connected' state. It checks the state of the 'sensor.ai_provider_status_{provider_name}' entity. This is useful for monitoring the operational status of AI services. ```yaml template: - binary_sensor: - name: "AI Provider Healthy" state: > {{ states('sensor.ai_provider_status_openai') == 'connected' }} ``` -------------------------------- ### Notify on AI Model Change Source: https://context7.com/itspecialist111/ai_automation_suggester/llms.txt An automation that triggers a notification whenever the AI model in use changes. It monitors the 'sensor.ai_model_in_use_{provider_name}' entity and sends a message to the mobile app. ```yaml automation: - alias: Notify on Model Change trigger: - platform: state entity_id: sensor.ai_model_in_use_openai action: - service: notify.mobile_app data: message: "AI model changed to {{ states('sensor.ai_model_in_use_openai') }}" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.