[ { "id": "driveway_video_ai_analysis", "automation": "- id: driveway_video_ai_analysis\n alias: Driveway Video AI Analysis\n description: Analyze driveway video to detect dog walking activity\n triggers:\n - entity_id: input_boolean.driveway_video_ready\n to: 'on'\n trigger: state\n conditions:\n - condition: state\n entity_id: input_boolean.ai_detection_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n actions:\n - data:\n task_name: driveway_video_dog_walk_detection\n instructions: \"If one or more people and a dog are observed moving from the\\\n \\ street towards the house (e.g., entering the driveway, walking towards the\\\n \\ front door from the road, or otherwise returning home from a walk), classify\\\n \\ this activity as 'ending_dog_walk'. If one or more people and a dog are\\\n \\ observed moving from the house towards the street (e.g., leaving the front\\\n \\ door, walking down the driveway onto the road, or otherwise departing for\\\n \\ a walk), classify this activity as 'starting_dog_walk'. Respond with \\\"\\\n starting_dog_walk\\\" or \\\"ending_dog_walk\\\" based on the instructions above.\\n\\\n \\ or \\n - \\\"dog_and_people\\\" - if a dog is seen with a person or\\\n \\ people but not\\n appearing to be starting or ending a walk\\n -\\\n \\ \\\"person_only\\\" - if only a person is seen\\n - \\\"dog_person_separate\\\"\\\n \\ - if a dog and person are seen in the video but\\n not in the same frame.\\n\\\n \\ - \\\"dog_only\\\" if only a dog is seen \\n - \\\"empty\\\" if no relevant\\\n \\ activity is detected\\n Focus on clear dog walking activity and direction\\\n \\ of travel. In a\\n separate paragraph, explain your reasoning.\\n\"\n attachments:\n - media_content_id: media-source://media_source/local/ai_image_notifications/driveway_dogwalk_capture.mp4\n media_content_type: video/mp4\n entity_id: ai_task.google_ai_task\n response_variable: driveway_video_response\n action: ai_task.generate_data\n - target:\n entity_id: input_text.driveway_analysis_result\n data:\n value: '{{ (driveway_video_response.data | lower).split(''\n\n '')[0].strip() }}'\n action: input_text.set_value\n - target:\n entity_id: input_boolean.driveway_video_ready\n action: input_boolean.turn_off\n data: {}\n mode: single", "config": [ { "name": "driveway video ready", "room": "driveway", "type": "input_boolean", "id": { "entity_id": "input_boolean.driveway_video_ready", "device_id": null } }, { "name": "ai detection enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.ai_detection_enabled", "device_id": null } }, { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "google ai task", "room": null, "type": "ai_task", "id": { "entity_id": "ai_task.google_ai_task", "device_id": null } }, { "name": "driveway analysis result", "room": "driveway", "type": "input_text", "id": { "entity_id": "input_text.driveway_analysis_result", "device_id": null } } ] }, { "id": "driveway_image_capture", "automation": "- id: driveway_image_capture\n alias: Driveway Video Capture\n description: Capture video when both person and pet motion detected in driveway\n within 30 seconds, OR when person detected during active walk\n triggers:\n - entity_id: binary_sensor.driveway_person\n to: 'on'\n id: person_motion\n trigger: state\n - entity_id: binary_sensor.driveway_pet\n to: 'on'\n id: pet_motion\n trigger: state\n conditions:\n - condition: time\n after: 06:00:00\n before: '22:00:00'\n - condition: template\n value_template: '{{ states(''input_text.driveway_camera_entity'') not in [''unknown'',\n ''''] }}\n\n '\n actions:\n - choose:\n - conditions:\n - condition: trigger\n id: person_motion\n - condition: state\n state: 'off'\n entity_id: binary_sensor.driveway_pet\n sequence:\n - wait_for_trigger:\n - entity_id: binary_sensor.driveway_pet\n to: 'on'\n trigger: state\n timeout:\n hours: 0\n minutes: 0\n seconds: 15\n milliseconds: 0\n continue_on_timeout: false\n - conditions:\n - condition: trigger\n id: pet_motion\n - condition: state\n state: 'off'\n entity_id: binary_sensor.driveway_person\n sequence:\n - wait_for_trigger:\n - entity_id: binary_sensor.driveway_person\n to: 'on'\n trigger: state\n timeout:\n hours: 0\n minutes: 0\n seconds: 15\n milliseconds: 0\n continue_on_timeout: false\n - target:\n entity_id: input_datetime.last_walk_detection\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n action: input_datetime.set_datetime\n - target:\n entity_id: input_boolean.driveway_video_ready\n action: input_boolean.turn_off\n data: {}\n - action: shell_command.ensure_backup_directories\n continue_on_error: true\n - action: shell_command.backup_driveway_walk_video\n continue_on_error: true\n - delay: 00:00:02\n - target:\n entity_id: '{{ states(''input_text.driveway_camera_entity'') }}'\n data:\n duration: 30\n filename: /config/www/local/ai_image_notifications/driveway_dogwalk_capture.mp4\n lookback: 15\n action: camera.record\n - delay: 00:00:32\n - target:\n entity_id: input_boolean.driveway_video_ready\n action: input_boolean.turn_on\n data: {}\n mode: single", "config": [ { "name": "driveway video ready", "room": "driveway", "type": "input_boolean", "id": { "entity_id": "input_boolean.driveway_video_ready", "device_id": null } }, { "name": "driveway person motion", "room": "driveway", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.driveway_person", "device_id": null } }, { "name": "driveway pet motion", "room": "driveway", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.driveway_pet", "device_id": null } }, { "name": "driveway camera entity", "room": "driveway", "type": "input_text", "id": { "entity_id": "input_text.driveway_camera_entity", "device_id": null } }, { "name": "last walk detection", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.last_walk_detection", "device_id": null } }, { "name": "ensure backup directories", "room": null, "type": "shell_command", "id": { "entity_id": "shell_command.ensure_backup_directories", "device_id": null } }, { "name": "backup driveway walk video", "room": "driveway", "type": "shell_command", "id": { "entity_id": "shell_command.backup_driveway_walk_video", "device_id": null } } ] }, { "id": "evening_dog_walk_reminder", "automation": "- id: evening_dog_walk_reminder\n alias: Evening Dog Walk Reminder\n description: Remind to walk dog in the evening (8:30pm-10pm)\n trigger:\n - platform: time\n at: '20:30:00'\n - platform: time\n at: '21:00:00'\n - platform: time\n at: '21:30:00'\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'off'\n - condition: template\n value_template: '{% set evening_walk = states(''input_datetime.evening_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ evening_walk == ''unknown''\n or evening_walk[:10] != today }}\n\n '\n action:\n - event: UNotify\n event_data_template:\n message_speak: Time for your evening dog walk! Don't forget the leash!\n message_display: Evening Dog Walk Time πŸ•\n message: Time for your evening dog walk! It's {{ now().strftime('%H:%M') }}\n - grab the leash and have a great walk! πŸ•\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: evening_dog_walk", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "evening walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.evening_walk_done", "device_id": null } } ] }, { "id": "evening_walk_auto_complete", "automation": "- id: evening_walk_auto_complete\n alias: Evening Walk Auto Complete\n description: Automatically mark evening walk as complete when detected (3pm-10pm)\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: ending_dog_walk\n condition:\n - condition: time\n after: '15:00:00'\n before: '22:00:00'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{% set evening_walk = states(''input_datetime.evening_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ evening_walk == ''unknown''\n or evening_walk[:10] != today }}\n\n '\n action:\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.walk_in_progress\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.evening_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: evening_dog_walk\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: walk_started\n - event: UNotify\n event_data_template:\n message_speak: Excellent job taking the dog for an evening walk! You're amazing!\n message_display: Evening Walk Complete! πŸŽ‰\n message: \"Great job taking the dog for their evening walk! You''re amazing!\\\n \\ {% set start_time = states('input_datetime.current_walk_started') %} {%\\\n \\ if start_time != 'unknown' %}\\n {% set duration = ((as_timestamp(now())\\\n \\ - as_timestamp(start_time)) / 60) | round(0) %}\\n Walk duration: {{ duration\\\n \\ }} minutes.\\n{% endif %} \\U0001F415❀️\\n\"\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: evening_walk_complete\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: \"Evening walk completed at {{ now().strftime('%H:%M') }}. {% set start_time\\\n \\ = states('input_datetime.current_walk_started') %} {% if start_time != 'unknown'\\\n \\ %}\\n {% set duration = ((as_timestamp(now()) - as_timestamp(start_time))\\\n \\ / 60) | round(0) %}\\n Duration: {{ duration }} minutes.\\n{% endif %}\\n\"\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: evening_walk_status", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "evening walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.evening_walk_done", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } }, { "name": "current walk started", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.current_walk_started", "device_id": null } } ] }, { "id": "trigger_family_room_analysis", "automation": "- id: trigger_family_room_analysis\n alias: Trigger Family Room AI Analysis\n description: Analyze family room tidiness when person motion detected\n trigger:\n - platform: state\n entity_id: binary_sensor.family_room_person_motion\n to: 'on'\n - platform: state\n entity_id: binary_sensor.family_room_person_motion\n to: 'off'\n for:\n minutes: 2\n - platform: state\n entity_id: input_boolean.force_family_room_check\n to: 'on'\n condition:\n - condition: state\n entity_id: input_boolean.ai_detection_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.family_room_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{{ states(''input_text.family_room_camera_entity'') not in [''unknown'',\n ''''] }}\n\n '\n - condition: template\n value_template: '{{ states(''input_text.ai_task_entity'') not in [''unknown'',\n ''unavailable'', ''''] }}\n\n '\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.force_family_room_check\n state: 'on'\n - condition: template\n value_template: \"{% set last_check = states('input_datetime.family_room_last_check')\\\n \\ %} {% if last_check == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_check)) > 300 }}\\n{% endif %}\\n\"\n action:\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.family_room_last_check\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - service: camera.snapshot\n target:\n entity_id: '{{ states(''input_text.family_room_camera_entity'') }}'\n data:\n filename: /config/www/local/ai_image_notifications/family_room_snapshot.jpg\n - service: camera.snapshot\n target:\n entity_id: '{{ states(''input_text.kitchen_camera_entity'') }}'\n data:\n filename: /config/www/local/ai_image_notifications/family_room_kitchen_view_snapshot.jpg\n - service: ai_task.generate_data\n data:\n task_name: family_room_tidiness_analysis\n instructions: 'Analyze these family room/living room images. Focus ONLY on practical\n safety and cleanliness. Rate tidiness 0-100. If below {{ states(''input_number.family_room_cleanliness_threshold'')\n }}, respond \"needs_tidying\" and list issues. If above, respond \"tidy\". Analysis\n of the family_room_kitchen_view_snapshot.jpg should exclude anything that\n is the kitchen. The family room is to the top left of the image, near the\n couch. If you see dirty dishes on the desk area between the kitchen and the\n family room, call that out too, but ignore the general clutter. ONLY flag\n these issues: - Food/drinks left out (especially if sticky/messy) - Dishes\n with food residue - Items on the floor (tripping hazard) - Spills that need\n cleaning IGNORE: blankets on chairs, remotes on tables, books/papers, decorative\n items, stuffed animals on furniture, charging cables\n\n '\n attachments:\n - media_content_id: media-source://media_source/local/ai_image_notifications/family_room_snapshot.jpg\n media_content_type: image/jpeg\n - media_content_id: media-source://media_source/local/ai_image_notifications/family_room_kitchen_view_snapshot.jpg\n media_content_type: image/jpeg\n entity_id: ai_task.google_ai_task\n response_variable: family_room_ai_response\n - service: variable.update_sensor\n data:\n value: \"{% set response = family_room_ai_response.data | lower %} {% if 'needs_tidying'\\\n \\ in response %}\\n needs_tidying\\n{% elif 'tidy' in response %}\\n tidy \\\n \\ \\n{% else %}\\n unknown\\n{% endif %}\\n\"\n attributes:\n timestamp: '{{ now() }}'\n tasks: \"{% set response = family_room_ai_response.data %} {% set ns = namespace(filtered=[])\\\n \\ %} {% for line in response.split('\\\\n') %}\\n {% if not ('needs_tidying'\\\n \\ in line.lower() or 'tidy' in line.lower()) %}\\n {% set ns.filtered\\\n \\ = ns.filtered + [line] %}\\n {% endif %}\\n{% endfor %} {{ ns.filtered\\\n \\ | join('\\\\n') | trim }}\\n\"\n replace_attributes: true\n target:\n entity_id: sensor.family_room_tidy_status\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.force_family_room_check", "config": [ { "name": "ai detection enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.ai_detection_enabled", "device_id": null } }, { "name": "google ai task", "room": null, "type": "ai_task", "id": { "entity_id": "ai_task.google_ai_task", "device_id": null } }, { "name": "family room person motion", "room": "family_room", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.family_room_person_motion", "device_id": null } }, { "name": "force family room check", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.force_family_room_check", "device_id": null } }, { "name": "family room monitoring enabled", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.family_room_monitoring_enabled", "device_id": null } }, { "name": "family room camera entity", "room": "family_room", "type": "input_text", "id": { "entity_id": "input_text.family_room_camera_entity", "device_id": null } }, { "name": "ai task entity", "room": null, "type": "input_text", "id": { "entity_id": "input_text.ai_task_entity", "device_id": null } }, { "name": "family room last check", "room": "family_room", "type": "input_datetime", "id": { "entity_id": "input_datetime.family_room_last_check", "device_id": null } }, { "name": "kitchen camera entity", "room": "kitchen", "type": "input_text", "id": { "entity_id": "input_text.kitchen_camera_entity", "device_id": null } }, { "name": "family room cleanliness threshold", "room": "family_room", "type": "input_number", "id": { "entity_id": "input_number.family_room_cleanliness_threshold", "device_id": null } }, { "name": "family room tidy status", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_tidy_status", "device_id": null } } ] }, { "id": "family_room_tidying_notification", "automation": "- id: family_room_tidying_notification\n alias: Family Room Tidying Notification\n description: Send notifications when family room needs tidying\n trigger:\n - platform: state\n entity_id: sensor.family_room_analysis\n to: needs_tidying\n condition:\n - condition: state\n entity_id: input_boolean.family_room_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: template\n value_template: \"{% set last_notification = states('input_datetime.last_family_room_notification')\\\n \\ %} {% if last_notification == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_notification)) / 60 > states('input_number.notification_cooldown')\\\n \\ | int }}\\n{% endif %}\\n\"\n action:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.last_family_room_notification\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message_speak: Hey Liam, the family room could use some tidying when you have\n a chance\n message_display: Family Room Needs Tidying πŸ›‹οΈ\n message: When you get a chance, {{ state_attr('sensor.family_room_analysis',\n 'specific_tasks') | default('please tidy up the family room') | lower }}.\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: family_room_tidy", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "family room monitoring enabled", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.family_room_monitoring_enabled", "device_id": null } }, { "name": "family room analysis", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_analysis", "device_id": null } }, { "name": "last family room notification", "room": "family_room", "type": "input_datetime", "id": { "entity_id": "input_datetime.last_family_room_notification", "device_id": null } }, { "name": "notification cooldown", "room": null, "type": "input_number", "id": { "entity_id": "input_number.notification_cooldown", "device_id": null } } ] }, { "id": "family_room_tidied_acknowledgment", "automation": "- id: family_room_tidied_acknowledgment\n alias: Family Room Tidied Acknowledgment\n description: Acknowledge when family room has been tidied\n trigger:\n - platform: state\n entity_id: sensor.family_room_analysis\n from: needs_tidying\n to: tidy\n condition:\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: family_room_tidy\n - event: UNotify\n event_data_template:\n message_speak: Fantastic job tidying the family room! You're doing amazing!\n message_display: Family Room Tidy! ✨\n message: Thanks for tidying up the family room! It looks great - you're amazing!\n 🌟\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: family_room_tidied\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Family room tidied at {{ now().strftime('%H:%M') }} - excellent work!\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: family_room_status", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "family room analysis", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_analysis", "device_id": null } } ] }, { "id": "family_room_tidy_notification", "automation": "- id: family_room_tidy_notification\n alias: Family Room Tidy Notification\n description: Send notifications when family room is analyzed as tidy\n trigger:\n - platform: state\n entity_id: sensor.family_room_analysis\n to: tidy\n condition:\n - condition: state\n entity_id: input_boolean.family_room_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: template\n value_template: '{% set from_state = trigger.from_state.state if trigger.from_state\n else ''unknown'' %} {{ from_state in [''unknown'', ''unavailable'', none] }}\n\n '\n action:\n - service: notify.parents\n data:\n title: Family Room Looking Good! ✨\n message: The family room is nice and tidy. Great job keeping it organized!\n data:\n tag: family_room_good", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "family room monitoring enabled", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.family_room_monitoring_enabled", "device_id": null } }, { "name": "family room analysis", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_analysis", "device_id": null } }, { "name": "parents notification", "room": null, "type": "notify", "id": { "entity_id": "notify.parents", "device_id": null } } ] }, { "id": "trigger_kitchen_analysis", "automation": "- id: trigger_kitchen_analysis\n alias: Trigger Kitchen AI Analysis\n description: Analyze kitchen cleanliness when person motion detected\n trigger:\n - platform: state\n entity_id: binary_sensor.kitchen_person_motion\n to: 'on'\n - platform: state\n entity_id: binary_sensor.kitchen_person_motion\n to: 'off'\n for:\n minutes: 2\n - platform: state\n entity_id: input_boolean.force_kitchen_check\n to: 'on'\n condition:\n - condition: state\n entity_id: input_boolean.ai_detection_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.kitchen_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{{ states(''input_text.kitchen_camera_entity'') not in [''unknown'',\n ''''] }}\n\n '\n - condition: template\n value_template: '{{ states(''input_text.ai_task_entity'') not in [''unknown'',\n ''unavailable'', ''''] }}\n\n '\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.force_kitchen_check\n state: 'on'\n - condition: template\n value_template: \"{% set last_check = states('input_datetime.kitchen_last_check')\\\n \\ %} {% if last_check == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_check)) > 300 }}\\n{% endif %}\\n\"\n action:\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.kitchen_last_check\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - service: camera.snapshot\n target:\n entity_id: '{{ states(''input_text.kitchen_camera_entity'') }}'\n data:\n filename: /config/www/local/ai_image_notifications/kitchen_snapshot.jpg\n - service: ai_task.generate_data\n data:\n task_name: kitchen_cleanliness_analysis\n instructions: 'Analyze this kitchen image for food safety and basic cleanliness.\n Focus on: 1. Food items left out on counters (especially perishable items)\n 2. Dirty dishes in sink or on counters 3. Spills or messes that could attract\n pests 4. General tidiness that affects food preparation safety Categorize\n as: - \"clean\" if kitchen is suitable for food preparation - \"needs_attention\"\n if there are minor issues (few dishes, small spills) - \"needs_cleaning\" if\n there are food safety concerns (food left out, many dirty dishes, significant\n mess) Be family-friendly and focus on health/safety rather than perfection.\n Respond with just the category, then provide 2-3 specific helpful suggestions.\n\n '\n attachments:\n - media_content_id: media-source://media_source/local/ai_image_notifications/kitchen_snapshot.jpg\n media_content_type: image/jpeg\n entity_id: ai_task.google_ai_task\n response_variable: kitchen_ai_response\n - service: variable.update_sensor\n data:\n value: \"{% if 'needs_cleaning' in kitchen_ai_response.data | lower %}\\n needs_cleaning\\n\\\n {% elif 'needs_attention' in kitchen_ai_response.data | lower %}\\n needs_attention\\n\\\n {% elif 'clean' in kitchen_ai_response.data | lower %}\\n clean\\n{% else %}\\n\\\n \\ unknown\\n{% endif %}\\n\"\n attributes:\n timestamp: '{{ now() }}'\n tasks: \"{% set response = kitchen_ai_response.data %} {% set ns = namespace(filtered=[])\\\n \\ %} {% for line in response.split('\\\\n') %}\\n {% if not ('needs_cleaning'\\\n \\ in line.lower() or 'needs_attention' in line.lower() or 'clean' in line.lower())\\\n \\ %}\\n {% set ns.filtered = ns.filtered + [line] %}\\n {% endif %}\\n\\\n {% endfor %} {{ ns.filtered | join('\\\\n') | trim }}\\n\"\n replace_attributes: true\n target:\n entity_id: sensor.kitchen_clean_status\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.force_kitchen_check", "config": [ { "name": "ai detection enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.ai_detection_enabled", "device_id": null } }, { "name": "google ai task", "room": null, "type": "ai_task", "id": { "entity_id": "ai_task.google_ai_task", "device_id": null } }, { "name": "ai task entity", "room": null, "type": "input_text", "id": { "entity_id": "input_text.ai_task_entity", "device_id": null } }, { "name": "kitchen camera entity", "room": "kitchen", "type": "input_text", "id": { "entity_id": "input_text.kitchen_camera_entity", "device_id": null } }, { "name": "kitchen person motion", "room": "kitchen", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.kitchen_person_motion", "device_id": null } }, { "name": "force kitchen check", "room": "kitchen", "type": "input_boolean", "id": { "entity_id": "input_boolean.force_kitchen_check", "device_id": null } }, { "name": "kitchen monitoring enabled", "room": "kitchen", "type": "input_boolean", "id": { "entity_id": "input_boolean.kitchen_monitoring_enabled", "device_id": null } }, { "name": "kitchen last check", "room": "kitchen", "type": "input_datetime", "id": { "entity_id": "input_datetime.kitchen_last_check", "device_id": null } }, { "name": "kitchen clean status", "room": "kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_clean_status", "device_id": null } } ] }, { "id": "kitchen_cleaned_acknowledgment", "automation": "- id: kitchen_cleaned_acknowledgment\n alias: Kitchen Cleaned Acknowledgment\n description: Acknowledge when kitchen has been cleaned\n trigger:\n - platform: state\n entity_id: sensor.kitchen_analysis\n from: needs_cleaning\n to: clean\n condition:\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: kitchen_cleanup\n - event: UNotify\n event_data_template:\n message_speak: Awesome job cleaning the kitchen! You're doing great!\n message_display: Kitchen Clean! ✨\n message: Great job cleaning up the kitchen! It looks fantastic - you're awesome!\n 🌟\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: kitchen_cleaned\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Kitchen cleaned at {{ now().strftime('%H:%M') }} - great work!\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: kitchen_status", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "kitchen analysis", "room": "kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_analysis", "device_id": null } } ] }, { "id": "kitchen_cleanup_notification", "automation": "- id: kitchen_cleanup_notification\n alias: Kitchen Cleanup Notification\n description: Send notifications when kitchen needs cleaning\n trigger:\n - platform: state\n entity_id: sensor.kitchen_analysis\n to: needs_cleaning\n condition:\n - condition: state\n entity_id: input_boolean.kitchen_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: template\n value_template: \"{% set last_notification = states('input_datetime.last_kitchen_notification')\\\n \\ %} {% if last_notification == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_notification)) / 60 > states('input_number.notification_cooldown')\\\n \\ | int }}\\n{% endif %}\\n\"\n action:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.last_kitchen_notification\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message_speak: '{% if states(''input_text.notification_target'') == ''liam''\n %} Hey Liam, the kitchen needs some attention when you have a moment {% else\n %} no {% endif %}\n\n '\n message_display: '{% if states(''input_text.notification_target'') == ''liam''\n %} Kitchen Needs Cleaning 🍽️ {% else %} no {% endif %}\n\n '\n message: Hey, when you're done in the kitchen, {{ state_attr('sensor.kitchen_analysis',\n 'specific_tasks') | default('please tidy up a bit') | lower }}.\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: '{{ states(''input_text.notification_target'') }}'\n tag: kitchen_cleanup", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "notification cooldown", "room": null, "type": "input_number", "id": { "entity_id": "input_number.notification_cooldown", "device_id": null } }, { "name": "kitchen monitoring enabled", "room": "kitchen", "type": "input_boolean", "id": { "entity_id": "input_boolean.kitchen_monitoring_enabled", "device_id": null } }, { "name": "kitchen analysis", "room": "kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_analysis", "device_id": null } }, { "name": "last kitchen notification", "room": "kitchen", "type": "input_datetime", "id": { "entity_id": "input_datetime.last_kitchen_notification", "device_id": null } }, { "name": "notification target", "room": null, "type": "input_text", "id": { "entity_id": "input_text.notification_target", "device_id": null } } ] }, { "id": "morning_dog_walk_reminder", "automation": "- id: morning_dog_walk_reminder\n alias: Morning Dog Walk Reminder\n description: Remind to walk dog in the morning/afternoon (12pm-3pm)\n trigger:\n - platform: time\n at: '12:00:00'\n - platform: time\n at: '12:30:00'\n - platform: time\n at: '13:00:00'\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'off'\n - condition: template\n value_template: '{% set morning_walk = states(''input_datetime.morning_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ morning_walk == ''unknown''\n or morning_walk[:10] != today }}\n\n '\n action:\n - event: UNotify\n event_data_template:\n message_speak: Time for your morning dog walk! Don't forget the leash!\n message_display: Morning Dog Walk Time πŸ•\n message: Time for your morning dog walk! It's {{ now().strftime('%H:%M') }}\n - grab the leash and have a great walk! πŸ•\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: morning_dog_walk", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "morning walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.morning_walk_done", "device_id": null } } ] }, { "id": "morning_walk_auto_complete", "automation": "- id: morning_walk_auto_complete\n alias: Morning Walk Auto Complete\n description: Automatically mark morning walk as complete when detected (6am-3pm)\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: ending_dog_walk\n condition:\n - condition: time\n after: 06:00:00\n before: '15:00:00'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{% set morning_walk = states(''input_datetime.morning_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ morning_walk == ''unknown''\n or morning_walk[:10] != today }}\n\n '\n action:\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.walk_in_progress\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.morning_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: morning_dog_walk\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: walk_started\n - event: UNotify\n event_data_template:\n message_speak: Awesome job taking the dog for a morning walk! You're the best!\n message_display: Morning Walk Complete! πŸŽ‰\n message: \"Great job taking the dog for their morning walk! You''re awesome!\\\n \\ {% set start_time = states('input_datetime.current_walk_started') %} {%\\\n \\ if start_time != 'unknown' %}\\n {% set duration = ((as_timestamp(now())\\\n \\ - as_timestamp(start_time)) / 60) | round(0) %}\\n Walk duration: {{ duration\\\n \\ }} minutes.\\n{% endif %} \\U0001F415❀️\\n\"\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: morning_walk_complete\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: \"Morning walk completed at {{ now().strftime('%H:%M') }}. {% set start_time\\\n \\ = states('input_datetime.current_walk_started') %} {% if start_time != 'unknown'\\\n \\ %}\\n {% set duration = ((as_timestamp(now()) - as_timestamp(start_time))\\\n \\ / 60) | round(0) %}\\n Duration: {{ duration }} minutes.\\n{% endif %}\\n\"\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: morning_walk_status", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } }, { "name": "current walk started", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.current_walk_started", "device_id": null } }, { "name": "morning walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.morning_walk_done", "device_id": null } } ] }, { "id": "unclear_walk_return_notification", "automation": "- id: unclear_walk_return_notification\n alias: Unclear Walk Return Notification\n description: Notify user when walk return analysis is unclear during active walk\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: unclear\n condition:\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'on'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Someone returned to the driveway during the walk, but I couldn't clearly\n see if the dog was with them due to lighting or positioning. Did the walk\n just finish?\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: unclear_walk_return\n actions:\n - action: confirm_walk_complete\n title: Yes, Walk Complete βœ…\n - action: walk_still_ongoing\n title: No, Still Walking πŸšΆβ€β™‚οΈ", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } } ] }, { "id": "handle_unclear_walk_response", "automation": "- id: handle_unclear_walk_response\n alias: Handle Unclear Walk Response\n description: Process user's response to unclear walk return notification\n trigger:\n - platform: event\n event_type: mobile_app_notification_action\n event_data:\n action: confirm_walk_complete\n id: walk_complete\n - platform: event\n event_type: mobile_app_notification_action\n event_data:\n action: walk_still_ongoing\n id: still_walking\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: parents\n tag: unclear_walk_return\n - choose:\n - conditions:\n - condition: trigger\n id: walk_complete\n sequence:\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.walk_in_progress\n - choose:\n - conditions:\n - condition: time\n after: 06:00:00\n before: '15:00:00'\n sequence:\n - condition: template\n value_template: '{% set morning_walk = states(''input_datetime.morning_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ morning_walk ==\n ''unknown'' or morning_walk[:10] != today }}\n\n '\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.morning_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: morning_dog_walk\n - event: UNotify\n event_data_template:\n message_speak: Awesome job with the morning walk! You're the best!\n message_display: Morning Walk Complete! πŸ•β€οΈ\n message: Thanks for walking the dog! Morning walk marked as complete\n - you're amazing!\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: walk_acknowledgment\n - conditions:\n - condition: time\n after: '15:00:00'\n before: '22:00:00'\n sequence:\n - condition: template\n value_template: '{% set evening_walk = states(''input_datetime.evening_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ evening_walk ==\n ''unknown'' or evening_walk[:10] != today }}\n\n '\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.evening_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: evening_dog_walk\n - event: UNotify\n event_data_template:\n message_speak: Excellent job with the evening walk! You're amazing!\n message_display: Evening Walk Complete! πŸ•β€οΈ\n message: Thanks for walking the dog! Evening walk marked as complete\n - you're amazing!\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: walk_acknowledgment\n - conditions:\n - condition: trigger\n id: still_walking\n sequence:\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Got it! Walk marked as still in progress. I'll keep monitoring\n for the return.\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: walk_acknowledgment", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "evening walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.evening_walk_done", "device_id": null } }, { "name": "morning walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.morning_walk_done", "device_id": null } } ] }, { "id": "walk_started_detection", "automation": "- id: walk_started_detection\n alias: Walk Started Detection\n description: Detect when someone starts a dog walk and clear reminders\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: starting_dog_walk\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'off'\n action:\n - service: input_boolean.turn_on\n target:\n entity_id: input_boolean.walk_in_progress\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.current_walk_started\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: morning_dog_walk\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: evening_dog_walk\n - event: UNotify\n event_data_template:\n message_speak: Great! You're taking the dog for a walk - have a wonderful time!\n message_display: Walk Started! πŸšΆβ€β™‚οΈπŸ•\n message: Awesome! You're taking the dog for a walk - have a great time together!\n πŸ•β€οΈ\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: walk_started\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Dog walk started at {{ now().strftime('%H:%M') }}.\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: walk_started_status", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } }, { "name": "current walk started", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.current_walk_started", "device_id": null } } ] }, { "id": "driveway_video_ai_analysis", "automation": "- id: driveway_video_ai_analysis\n alias: Driveway Video AI Analysis\n description: Analyze driveway video to detect dog walking activity\n triggers:\n - entity_id: input_boolean.driveway_video_ready\n to: 'on'\n trigger: state\n conditions:\n - condition: state\n entity_id: input_boolean.ai_detection_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n actions:\n - data:\n task_name: driveway_video_dog_walk_detection\n instructions: \"If one or more people and a dog are observed moving from the\\\n \\ street towards the house (e.g., entering the driveway, walking towards the\\\n \\ front door from the road, or otherwise returning home from a walk), classify\\\n \\ this activity as 'ending_dog_walk'.\\nIf one or more people and a dog are\\\n \\ observed moving from the house towards the street (e.g., leaving the front\\\n \\ door, walking down the driveway onto the road, or otherwise departing for\\\n \\ a walk), classify this activity as 'starting_dog_walk'.\\nRespond with \\\"\\\n starting_dog_walk\\\" or \\\"ending_dog_walk\\\" based on the instructions above.\\n\\\n \\n or \\n\\n - \\\"dog_and_people\\\" - if a dog is seen with a person\\\n \\ or people but not\\n appearing to be starting or ending a walk\\n\\n \\\n \\ - \\\"person_only\\\" - if only a person is seen\\n\\n - \\\"dog_person_separate\\\"\\\n \\ - if a dog and person are seen in the video but\\n not in the same frame.\\n\\\n \\n - \\\"dog_only\\\" if only a dog is seen \\n\\n - \\\"empty\\\" if no relevant\\\n \\ activity is detected\\n\\n Focus on clear dog walking activity and direction\\\n \\ of travel. In a\\n separate paragraph, explain your reasoning.\\n\"\n attachments:\n - media_content_id: media-source://media_source/local/ai_image_notifications/driveway_dogwalk_capture.mp4\n media_content_type: video/mp4\n entity_id: ai_task.google_ai_task\n response_variable: driveway_video_response\n action: ai_task.generate_data\n - target:\n entity_id: input_text.driveway_analysis_result\n data:\n value: '{{ (driveway_video_response.data | lower).split(''\n\n '')[0].strip() }}'\n action: input_text.set_value\n - target:\n entity_id: input_boolean.driveway_video_ready\n action: input_boolean.turn_off\n data: {}\n mode: single", "config": [ { "name": "driveway video ready", "room": "driveway", "type": "input_boolean", "id": { "entity_id": "input_boolean.driveway_video_ready", "device_id": null } }, { "name": "ai detection enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.ai_detection_enabled", "device_id": null } }, { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "google ai task", "room": null, "type": "ai_task", "id": { "entity_id": "ai_task.google_ai_task", "device_id": null } }, { "name": "driveway analysis result", "room": "driveway", "type": "input_text", "id": { "entity_id": "input_text.driveway_analysis_result", "device_id": null } } ] }, { "id": "driveway_image_capture", "automation": "- id: driveway_image_capture\n alias: Driveway Video Capture\n description: Capture video when both person and pet motion detected in driveway\n within 30 seconds, OR when person detected during active walk\n triggers:\n - entity_id: binary_sensor.driveway_person\n to: 'on'\n id: person_motion\n trigger: state\n - entity_id: binary_sensor.driveway_pet\n to: 'on'\n id: pet_motion\n trigger: state\n conditions:\n - condition: time\n after: 06:00:00\n before: '22:00:00'\n - condition: template\n value_template: '{{ states(''input_text.driveway_camera_entity'') not in [''unknown'',\n ''''] }}\n\n '\n actions:\n - choose:\n - conditions:\n - condition: trigger\n id: person_motion\n - condition: state\n state: 'off'\n entity_id: binary_sensor.driveway_pet\n sequence:\n - wait_for_trigger:\n - entity_id: binary_sensor.driveway_pet\n to: 'on'\n trigger: state\n timeout:\n hours: 0\n minutes: 0\n seconds: 15\n milliseconds: 0\n continue_on_timeout: false\n - conditions:\n - condition: trigger\n id: pet_motion\n - condition: state\n state: 'off'\n entity_id: binary_sensor.driveway_person\n sequence:\n - wait_for_trigger:\n - entity_id: binary_sensor.driveway_person\n to: 'on'\n trigger: state\n timeout:\n hours: 0\n minutes: 0\n seconds: 15\n milliseconds: 0\n continue_on_timeout: false\n - target:\n entity_id: input_datetime.last_walk_detection\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n action: input_datetime.set_datetime\n - target:\n entity_id: input_boolean.driveway_video_ready\n action: input_boolean.turn_off\n data: {}\n - action: shell_command.ensure_backup_directories\n continue_on_error: true\n - action: shell_command.backup_driveway_walk_video\n continue_on_error: true\n - delay: 00:00:02\n - target:\n entity_id: '{{ states(''input_text.driveway_camera_entity'') }}'\n data:\n duration: 30\n filename: /config/www/local/ai_image_notifications/driveway_dogwalk_capture.mp4\n lookback: 15\n action: camera.record\n - delay: 00:00:32\n - target:\n entity_id: input_boolean.driveway_video_ready\n action: input_boolean.turn_on\n data: {}\n mode: single", "config": [ { "name": "driveway video ready", "room": "driveway", "type": "input_boolean", "id": { "entity_id": "input_boolean.driveway_video_ready", "device_id": null } }, { "name": "driveway person motion", "room": "driveway", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.driveway_person", "device_id": null } }, { "name": "driveway pet motion", "room": "driveway", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.driveway_pet", "device_id": null } }, { "name": "driveway camera entity", "room": "driveway", "type": "input_text", "id": { "entity_id": "input_text.driveway_camera_entity", "device_id": null } }, { "name": "last walk detection", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.last_walk_detection", "device_id": null } }, { "name": "ensure backup directories", "room": null, "type": "shell_command", "id": { "entity_id": "shell_command.ensure_backup_directories", "device_id": null } }, { "name": "backup driveway walk video", "room": "driveway", "type": "shell_command", "id": { "entity_id": "shell_command.backup_driveway_walk_video", "device_id": null } } ] }, { "id": "evening_dog_walk_reminder", "automation": "- id: evening_dog_walk_reminder\n alias: Evening Dog Walk Reminder\n description: Remind to walk dog in the evening (8:30pm-10pm)\n trigger:\n - platform: time\n at: '20:30:00'\n - platform: time\n at: '21:00:00'\n - platform: time\n at: '21:30:00'\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'off'\n - condition: template\n value_template: '{% set evening_walk = states(''input_datetime.evening_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ evening_walk == ''unknown''\n or evening_walk[:10] != today }}\n\n '\n action:\n - event: UNotify\n event_data_template:\n message_speak: Time for your evening dog walk! Don't forget the leash!\n message_display: Evening Dog Walk Time πŸ•\n message: Time for your evening dog walk! It's {{ now().strftime('%H:%M') }}\n - grab the leash and have a great walk! πŸ•\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: evening_dog_walk", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "evening walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.evening_walk_done", "device_id": null } } ] }, { "id": "evening_walk_auto_complete", "automation": "- id: evening_walk_auto_complete\n alias: Evening Walk Auto Complete\n description: Automatically mark evening walk as complete when detected (3pm-10pm)\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: ending_dog_walk\n condition:\n - condition: time\n after: '15:00:00'\n before: '22:00:00'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{% set evening_walk = states(''input_datetime.evening_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ evening_walk == ''unknown''\n or evening_walk[:10] != today }}\n\n '\n action:\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.walk_in_progress\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.evening_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: evening_dog_walk\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: walk_started\n - event: UNotify\n event_data_template:\n message_speak: Excellent job taking the dog for an evening walk! You're amazing!\n message_display: Evening Walk Complete! πŸŽ‰\n message: \"Great job taking the dog for their evening walk! You''re amazing!\\\n \\ {% set start_time = states('input_datetime.current_walk_started') %} {%\\\n \\ if start_time != 'unknown' %}\\n {% set duration = ((as_timestamp(now())\\\n \\ - as_timestamp(start_time)) / 60) | round(0) %}\\n Walk duration: {{ duration\\\n \\ }} minutes.\\n{% endif %} \\U0001F415❀️\\n\"\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: evening_walk_complete\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: \"Evening walk completed at {{ now().strftime('%H:%M') }}. {% set start_time\\\n \\ = states('input_datetime.current_walk_started') %} {% if start_time != 'unknown'\\\n \\ %}\\n {% set duration = ((as_timestamp(now()) - as_timestamp(start_time))\\\n \\ / 60) | round(0) %}\\n Duration: {{ duration }} minutes.\\n{% endif %}\\n\"\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: evening_walk_status", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "evening walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.evening_walk_done", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } }, { "name": "current walk started", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.current_walk_started", "device_id": null } } ] }, { "id": "trigger_family_room_analysis", "automation": "- id: trigger_family_room_analysis\n alias: Trigger Family Room AI Analysis\n description: Analyze family room tidiness when person motion detected\n trigger:\n - platform: state\n entity_id: binary_sensor.family_room_person_motion\n to: 'on'\n - platform: state\n entity_id: binary_sensor.family_room_person_motion\n to: 'off'\n for:\n minutes: 2\n - platform: state\n entity_id: input_boolean.force_family_room_check\n to: 'on'\n condition:\n - condition: state\n entity_id: input_boolean.ai_detection_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.family_room_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{{ states(''input_text.family_room_camera_entity'') not in [''unknown'',\n ''''] }}\n\n '\n - condition: template\n value_template: '{{ states(''input_text.ai_task_entity'') not in [''unknown'',\n ''unavailable'', ''''] }}\n\n '\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.force_family_room_check\n state: 'on'\n - condition: template\n value_template: \"{% set last_check = states('input_datetime.family_room_last_check')\\\n \\ %} {% if last_check == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_check)) > 300 }}\\n{% endif %}\\n\"\n action:\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.family_room_last_check\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - service: camera.snapshot\n target:\n entity_id: '{{ states(''input_text.family_room_camera_entity'') }}'\n data:\n filename: /config/www/local/ai_image_notifications/family_room_snapshot.jpg\n - service: camera.snapshot\n target:\n entity_id: '{{ states(''input_text.kitchen_camera_entity'') }}'\n data:\n filename: /config/www/local/ai_image_notifications/family_room_kitchen_view_snapshot.jpg\n - service: ai_task.generate_data\n data:\n task_name: family_room_tidiness_analysis\n instructions: 'Analyze these family room/living room images. Focus ONLY on practical\n safety and cleanliness. Rate tidiness 0-100. If below {{ states(''input_number.family_room_cleanliness_threshold'')\n }}, respond \"needs_tidying\" and list issues. If above, respond \"tidy\".\n\n Analysis of the family_room_kitchen_view_snapshot.jpg should exclude anything\n that is the kitchen. The family room is to the top left of the image, near\n the couch. If you see dirty dishes on the desk area between the kitchen and\n the family room, call that out too, but ignore the general clutter.\n\n ONLY flag these issues: - Food/drinks left out (especially if sticky/messy)\n - Dishes with food residue - Items on the floor (tripping hazard) - Spills\n that need cleaning\n\n IGNORE: blankets on chairs, remotes on tables, books/papers, decorative items,\n stuffed animals on furniture, charging cables\n\n '\n attachments:\n - media_content_id: media-source://media_source/local/ai_image_notifications/family_room_snapshot.jpg\n media_content_type: image/jpeg\n - media_content_id: media-source://media_source/local/ai_image_notifications/family_room_kitchen_view_snapshot.jpg\n media_content_type: image/jpeg\n entity_id: ai_task.google_ai_task\n response_variable: family_room_ai_response\n - service: variable.update_sensor\n data:\n value: \"{% set response = family_room_ai_response.data | lower %} {% if 'needs_tidying'\\\n \\ in response %}\\n needs_tidying\\n{% elif 'tidy' in response %}\\n tidy \\\n \\ \\n{% else %}\\n unknown\\n{% endif %}\\n\"\n attributes:\n timestamp: '{{ now() }}'\n tasks: \"{% set response = family_room_ai_response.data %} {% set ns = namespace(filtered=[])\\\n \\ %} {% for line in response.split('\\\\n') %}\\n {% if not ('needs_tidying'\\\n \\ in line.lower() or 'tidy' in line.lower()) %}\\n {% set ns.filtered\\\n \\ = ns.filtered + [line] %}\\n {% endif %}\\n{% endfor %} {{ ns.filtered\\\n \\ | join('\\\\n') | trim }}\\n\"\n replace_attributes: true\n target:\n entity_id: sensor.family_room_tidy_status\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.force_family_room_check", "config": [ { "name": "ai detection enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.ai_detection_enabled", "device_id": null } }, { "name": "google ai task", "room": null, "type": "ai_task", "id": { "entity_id": "ai_task.google_ai_task", "device_id": null } }, { "name": "family room person motion", "room": "family_room", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.family_room_person_motion", "device_id": null } }, { "name": "force family room check", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.force_family_room_check", "device_id": null } }, { "name": "family room monitoring enabled", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.family_room_monitoring_enabled", "device_id": null } }, { "name": "family room camera entity", "room": "family_room", "type": "input_text", "id": { "entity_id": "input_text.family_room_camera_entity", "device_id": null } }, { "name": "ai task entity", "room": null, "type": "input_text", "id": { "entity_id": "input_text.ai_task_entity", "device_id": null } }, { "name": "family room last check", "room": "family_room", "type": "input_datetime", "id": { "entity_id": "input_datetime.family_room_last_check", "device_id": null } }, { "name": "kitchen camera entity", "room": "kitchen", "type": "input_text", "id": { "entity_id": "input_text.kitchen_camera_entity", "device_id": null } }, { "name": "family room cleanliness threshold", "room": "family_room", "type": "input_number", "id": { "entity_id": "input_number.family_room_cleanliness_threshold", "device_id": null } }, { "name": "family room tidy status", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_tidy_status", "device_id": null } } ] }, { "id": "family_room_tidying_notification", "automation": "- id: family_room_tidying_notification\n alias: Family Room Tidying Notification\n description: Send notifications when family room needs tidying\n trigger:\n - platform: state\n entity_id: sensor.family_room_analysis\n to: needs_tidying\n condition:\n - condition: state\n entity_id: input_boolean.family_room_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: template\n value_template: \"{% set last_notification = states('input_datetime.last_family_room_notification')\\\n \\ %} {% if last_notification == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_notification)) / 60 > states('input_number.notification_cooldown')\\\n \\ | int }}\\n{% endif %}\\n\"\n action:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.last_family_room_notification\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message_speak: Hey Liam, the family room could use some tidying when you have\n a chance\n message_display: Family Room Needs Tidying πŸ›‹οΈ\n message: When you get a chance, {{ state_attr('sensor.family_room_analysis',\n 'specific_tasks') | default('please tidy up the family room') | lower }}.\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: family_room_tidy", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "family room monitoring enabled", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.family_room_monitoring_enabled", "device_id": null } }, { "name": "family room analysis", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_analysis", "device_id": null } }, { "name": "last family room notification", "room": "family_room", "type": "input_datetime", "id": { "entity_id": "input_datetime.last_family_room_notification", "device_id": null } }, { "name": "notification cooldown", "room": null, "type": "input_number", "id": { "entity_id": "input_number.notification_cooldown", "device_id": null } } ] }, { "id": "family_room_tidied_acknowledgment", "automation": "- id: family_room_tidied_acknowledgment\n alias: Family Room Tidied Acknowledgment\n description: Acknowledge when family room has been tidied\n trigger:\n - platform: state\n entity_id: sensor.family_room_analysis\n from: needs_tidying\n to: tidy\n condition:\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: family_room_tidy\n - event: UNotify\n event_data_template:\n message_speak: Fantastic job tidying the family room! You're doing amazing!\n message_display: Family Room Tidy! ✨\n message: Thanks for tidying up the family room! It looks great - you're amazing!\n 🌟\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: family_room_tidied\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Family room tidied at {{ now().strftime('%H:%M') }} - excellent work!\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: family_room_status", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "family room analysis", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_analysis", "device_id": null } } ] }, { "id": "family_room_tidy_notification", "automation": "- id: family_room_tidy_notification\n alias: Family Room Tidy Notification\n description: Send notifications when family room is analyzed as tidy\n trigger:\n - platform: state\n entity_id: sensor.family_room_analysis\n to: tidy\n condition:\n - condition: state\n entity_id: input_boolean.family_room_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: template\n value_template: '{% set from_state = trigger.from_state.state if trigger.from_state\n else ''unknown'' %} {{ from_state in [''unknown'', ''unavailable'', none] }}\n\n '\n action:\n - service: notify.parents\n data:\n title: Family Room Looking Good! ✨\n message: The family room is nice and tidy. Great job keeping it organized!\n data:\n tag: family_room_good", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "family room monitoring enabled", "room": "family_room", "type": "input_boolean", "id": { "entity_id": "input_boolean.family_room_monitoring_enabled", "device_id": null } }, { "name": "family room analysis", "room": "family_room", "type": "sensor", "id": { "entity_id": "sensor.family_room_analysis", "device_id": null } }, { "name": "parents notification", "room": null, "type": "notify", "id": { "entity_id": "notify.parents", "device_id": null } } ] }, { "id": "trigger_kitchen_analysis", "automation": "- id: trigger_kitchen_analysis\n alias: Trigger Kitchen AI Analysis\n description: Analyze kitchen cleanliness when person motion detected\n trigger:\n - platform: state\n entity_id: binary_sensor.kitchen_person_motion\n to: 'on'\n - platform: state\n entity_id: binary_sensor.kitchen_person_motion\n to: 'off'\n for:\n minutes: 2\n - platform: state\n entity_id: input_boolean.force_kitchen_check\n to: 'on'\n condition:\n - condition: state\n entity_id: input_boolean.ai_detection_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.kitchen_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{{ states(''input_text.kitchen_camera_entity'') not in [''unknown'',\n ''''] }}\n\n '\n - condition: template\n value_template: '{{ states(''input_text.ai_task_entity'') not in [''unknown'',\n ''unavailable'', ''''] }}\n\n '\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.force_kitchen_check\n state: 'on'\n - condition: template\n value_template: \"{% set last_check = states('input_datetime.kitchen_last_check')\\\n \\ %} {% if last_check == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_check)) > 300 }}\\n{% endif %}\\n\"\n action:\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.kitchen_last_check\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - service: camera.snapshot\n target:\n entity_id: '{{ states(''input_text.kitchen_camera_entity'') }}'\n data:\n filename: /config/www/local/ai_image_notifications/kitchen_snapshot.jpg\n - service: ai_task.generate_data\n data:\n task_name: kitchen_cleanliness_analysis\n instructions: 'Analyze this kitchen image for food safety and basic cleanliness.\n Focus on: 1. Food items left out on counters (especially perishable items)\n 2. Dirty dishes in sink or on counters 3. Spills or messes that could attract\n pests 4. General tidiness that affects food preparation safety\n\n Categorize as: - \"clean\" if kitchen is suitable for food preparation - \"needs_attention\"\n if there are minor issues (few dishes, small spills) - \"needs_cleaning\" if\n there are food safety concerns (food left out, many dirty dishes, significant\n mess)\n\n Be family-friendly and focus on health/safety rather than perfection. Respond\n with just the category, then provide 2-3 specific helpful suggestions.\n\n '\n attachments:\n - media_content_id: media-source://media_source/local/ai_image_notifications/kitchen_snapshot.jpg\n media_content_type: image/jpeg\n entity_id: ai_task.google_ai_task\n response_variable: kitchen_ai_response\n - service: variable.update_sensor\n data:\n value: \"{% if 'needs_cleaning' in kitchen_ai_response.data | lower %}\\n needs_cleaning\\n\\\n {% elif 'needs_attention' in kitchen_ai_response.data | lower %}\\n needs_attention\\n\\\n {% elif 'clean' in kitchen_ai_response.data | lower %}\\n clean\\n{% else %}\\n\\\n \\ unknown\\n{% endif %}\\n\"\n attributes:\n timestamp: '{{ now() }}'\n tasks: \"{% set response = kitchen_ai_response.data %} {% set ns = namespace(filtered=[])\\\n \\ %} {% for line in response.split('\\\\n') %}\\n {% if not ('needs_cleaning'\\\n \\ in line.lower() or 'needs_attention' in line.lower() or 'clean' in line.lower())\\\n \\ %}\\n {% set ns.filtered = ns.filtered + [line] %}\\n {% endif %}\\n\\\n {% endfor %} {{ ns.filtered | join('\\\\n') | trim }}\\n\"\n replace_attributes: true\n target:\n entity_id: sensor.kitchen_clean_status\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.force_kitchen_check", "config": [ { "name": "ai detection enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.ai_detection_enabled", "device_id": null } }, { "name": "google ai task", "room": null, "type": "ai_task", "id": { "entity_id": "ai_task.google_ai_task", "device_id": null } }, { "name": "ai task entity", "room": null, "type": "input_text", "id": { "entity_id": "input_text.ai_task_entity", "device_id": null } }, { "name": "kitchen camera entity", "room": "kitchen", "type": "input_text", "id": { "entity_id": "input_text.kitchen_camera_entity", "device_id": null } }, { "name": "kitchen person motion", "room": "kitchen", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.kitchen_person_motion", "device_id": null } }, { "name": "force kitchen check", "room": "kitchen", "type": "input_boolean", "id": { "entity_id": "input_boolean.force_kitchen_check", "device_id": null } }, { "name": "kitchen monitoring enabled", "room": "kitchen", "type": "input_boolean", "id": { "entity_id": "input_boolean.kitchen_monitoring_enabled", "device_id": null } }, { "name": "kitchen last check", "room": "kitchen", "type": "input_datetime", "id": { "entity_id": "input_datetime.kitchen_last_check", "device_id": null } }, { "name": "kitchen clean status", "room": "kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_clean_status", "device_id": null } } ] }, { "id": "kitchen_cleaned_acknowledgment", "automation": "- id: kitchen_cleaned_acknowledgment\n alias: Kitchen Cleaned Acknowledgment\n description: Acknowledge when kitchen has been cleaned\n trigger:\n - platform: state\n entity_id: sensor.kitchen_analysis\n from: needs_cleaning\n to: clean\n condition:\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: kitchen_cleanup\n - event: UNotify\n event_data_template:\n message_speak: Awesome job cleaning the kitchen! You're doing great!\n message_display: Kitchen Clean! ✨\n message: Great job cleaning up the kitchen! It looks fantastic - you're awesome!\n 🌟\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: kitchen_cleaned\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Kitchen cleaned at {{ now().strftime('%H:%M') }} - great work!\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: kitchen_status", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "kitchen analysis", "room": "kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_analysis", "device_id": null } } ] }, { "id": "kitchen_cleanup_notification", "automation": "- id: kitchen_cleanup_notification\n alias: Kitchen Cleanup Notification\n description: Send notifications when kitchen needs cleaning\n trigger:\n - platform: state\n entity_id: sensor.kitchen_analysis\n to: needs_cleaning\n condition:\n - condition: state\n entity_id: input_boolean.kitchen_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: template\n value_template: \"{% set last_notification = states('input_datetime.last_kitchen_notification')\\\n \\ %} {% if last_notification == 'unknown' %}\\n true\\n{% else %}\\n {{ (as_timestamp(now())\\\n \\ - as_timestamp(last_notification)) / 60 > states('input_number.notification_cooldown')\\\n \\ | int }}\\n{% endif %}\\n\"\n action:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.last_kitchen_notification\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message_speak: '{% if states(''input_text.notification_target'') == ''liam''\n %} Hey Liam, the kitchen needs some attention when you have a moment {% else\n %} no {% endif %}\n\n '\n message_display: '{% if states(''input_text.notification_target'') == ''liam''\n %} Kitchen Needs Cleaning 🍽️ {% else %} no {% endif %}\n\n '\n message: Hey, when you're done in the kitchen, {{ state_attr('sensor.kitchen_analysis',\n 'specific_tasks') | default('please tidy up a bit') | lower }}.\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: '{{ states(''input_text.notification_target'') }}'\n tag: kitchen_cleanup", "config": [ { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "notification cooldown", "room": null, "type": "input_number", "id": { "entity_id": "input_number.notification_cooldown", "device_id": null } }, { "name": "kitchen monitoring enabled", "room": "kitchen", "type": "input_boolean", "id": { "entity_id": "input_boolean.kitchen_monitoring_enabled", "device_id": null } }, { "name": "kitchen analysis", "room": "kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_analysis", "device_id": null } }, { "name": "last kitchen notification", "room": "kitchen", "type": "input_datetime", "id": { "entity_id": "input_datetime.last_kitchen_notification", "device_id": null } }, { "name": "notification target", "room": null, "type": "input_text", "id": { "entity_id": "input_text.notification_target", "device_id": null } } ] }, { "id": "morning_dog_walk_reminder", "automation": "- id: morning_dog_walk_reminder\n alias: Morning Dog Walk Reminder\n description: Remind to walk dog in the morning/afternoon (12pm-3pm)\n trigger:\n - platform: time\n at: '12:00:00'\n - platform: time\n at: '12:30:00'\n - platform: time\n at: '13:00:00'\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.notifications_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'off'\n - condition: template\n value_template: '{% set morning_walk = states(''input_datetime.morning_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ morning_walk == ''unknown''\n or morning_walk[:10] != today }}\n\n '\n action:\n - event: UNotify\n event_data_template:\n message_speak: Time for your morning dog walk! Don't forget the leash!\n message_display: Morning Dog Walk Time πŸ•\n message: Time for your morning dog walk! It's {{ now().strftime('%H:%M') }}\n - grab the leash and have a great walk! πŸ•\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: morning_dog_walk", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "notifications enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.notifications_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "morning walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.morning_walk_done", "device_id": null } } ] }, { "id": "morning_walk_auto_complete", "automation": "- id: morning_walk_auto_complete\n alias: Morning Walk Auto Complete\n description: Automatically mark morning walk as complete when detected (6am-3pm)\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: ending_dog_walk\n condition:\n - condition: time\n after: 06:00:00\n before: '15:00:00'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: template\n value_template: '{% set morning_walk = states(''input_datetime.morning_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ morning_walk == ''unknown''\n or morning_walk[:10] != today }}\n\n '\n action:\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.walk_in_progress\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.morning_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: morning_dog_walk\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: walk_started\n - event: UNotify\n event_data_template:\n message_speak: Awesome job taking the dog for a morning walk! You're the best!\n message_display: Morning Walk Complete! πŸŽ‰\n message: \"Great job taking the dog for their morning walk! You''re awesome!\\\n \\ {% set start_time = states('input_datetime.current_walk_started') %} {%\\\n \\ if start_time != 'unknown' %}\\n {% set duration = ((as_timestamp(now())\\\n \\ - as_timestamp(start_time)) / 60) | round(0) %}\\n Walk duration: {{ duration\\\n \\ }} minutes.\\n{% endif %} \\U0001F415❀️\\n\"\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: morning_walk_complete\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: \"Morning walk completed at {{ now().strftime('%H:%M') }}. {% set start_time\\\n \\ = states('input_datetime.current_walk_started') %} {% if start_time != 'unknown'\\\n \\ %}\\n {% set duration = ((as_timestamp(now()) - as_timestamp(start_time))\\\n \\ / 60) | round(0) %}\\n Duration: {{ duration }} minutes.\\n{% endif %}\\n\"\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: morning_walk_status", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } }, { "name": "current walk started", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.current_walk_started", "device_id": null } }, { "name": "morning walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.morning_walk_done", "device_id": null } } ] }, { "id": "unclear_walk_return_notification", "automation": "- id: unclear_walk_return_notification\n alias: Unclear Walk Return Notification\n description: Notify user when walk return analysis is unclear during active walk\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: unclear\n condition:\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'on'\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Someone returned to the driveway during the walk, but I couldn't clearly\n see if the dog was with them due to lighting or positioning. Did the walk\n just finish?\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: unclear_walk_return\n actions:\n - action: confirm_walk_complete\n title: Yes, Walk Complete βœ…\n - action: walk_still_ongoing\n title: No, Still Walking πŸšΆβ€β™‚οΈ", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } } ] }, { "id": "handle_unclear_walk_response", "automation": "- id: handle_unclear_walk_response\n alias: Handle Unclear Walk Response\n description: Process user's response to unclear walk return notification\n trigger:\n - platform: event\n event_type: mobile_app_notification_action\n event_data:\n action: confirm_walk_complete\n id: walk_complete\n - platform: event\n event_type: mobile_app_notification_action\n event_data:\n action: walk_still_ongoing\n id: still_walking\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n action:\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: parents\n tag: unclear_walk_return\n - choose:\n - conditions:\n - condition: trigger\n id: walk_complete\n sequence:\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.walk_in_progress\n - choose:\n - conditions:\n - condition: time\n after: 06:00:00\n before: '15:00:00'\n sequence:\n - condition: template\n value_template: '{% set morning_walk = states(''input_datetime.morning_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ morning_walk ==\n ''unknown'' or morning_walk[:10] != today }}\n\n '\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.morning_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: morning_dog_walk\n - event: UNotify\n event_data_template:\n message_speak: Awesome job with the morning walk! You're the best!\n message_display: Morning Walk Complete! πŸ•β€οΈ\n message: Thanks for walking the dog! Morning walk marked as complete\n - you're amazing!\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: walk_acknowledgment\n - conditions:\n - condition: time\n after: '15:00:00'\n before: '22:00:00'\n sequence:\n - condition: template\n value_template: '{% set evening_walk = states(''input_datetime.evening_walk_done'')\n %} {% set today = now().strftime(''%Y-%m-%d'') %} {{ evening_walk ==\n ''unknown'' or evening_walk[:10] != today }}\n\n '\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.evening_walk_done\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: evening_dog_walk\n - event: UNotify\n event_data_template:\n message_speak: Excellent job with the evening walk! You're amazing!\n message_display: Evening Walk Complete! πŸ•β€οΈ\n message: Thanks for walking the dog! Evening walk marked as complete\n - you're amazing!\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: walk_acknowledgment\n - conditions:\n - condition: trigger\n id: still_walking\n sequence:\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Got it! Walk marked as still in progress. I'll keep monitoring\n for the return.\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: walk_acknowledgment", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "evening walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.evening_walk_done", "device_id": null } }, { "name": "morning walk done", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.morning_walk_done", "device_id": null } } ] }, { "id": "walk_started_detection", "automation": "- id: walk_started_detection\n alias: Walk Started Detection\n description: Detect when someone starts a dog walk and clear reminders\n trigger:\n - platform: state\n entity_id: sensor.driveway_analysis\n to: starting_dog_walk\n condition:\n - condition: state\n entity_id: input_boolean.dog_walk_monitoring_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.walk_in_progress\n state: 'off'\n action:\n - service: input_boolean.turn_on\n target:\n entity_id: input_boolean.walk_in_progress\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.current_walk_started\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: morning_dog_walk\n - event: UNotify\n event_data_template:\n message: clear_notification\n message_target: liam\n tag: evening_dog_walk\n - event: UNotify\n event_data_template:\n message_speak: Great! You're taking the dog for a walk - have a wonderful time!\n message_display: Walk Started! πŸšΆβ€β™‚οΈπŸ•\n message: Awesome! You're taking the dog for a walk - have a great time together!\n πŸ•β€οΈ\n priority: normal\n channel: General\n aiprompt: 'no'\n message_target: liam\n tag: walk_started\n - event: UNotify\n event_data_template:\n message_speak: 'no'\n message_display: 'no'\n message: Dog walk started at {{ now().strftime('%H:%M') }}.\n priority: low\n channel: General\n aiprompt: 'no'\n message_target: parents\n tag: walk_started_status", "config": [ { "name": "dog walk monitoring enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.dog_walk_monitoring_enabled", "device_id": null } }, { "name": "walk in progress", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.walk_in_progress", "device_id": null } }, { "name": "driveway analysis", "room": "driveway", "type": "sensor", "id": { "entity_id": "sensor.driveway_analysis", "device_id": null } }, { "name": "current walk started", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.current_walk_started", "device_id": null } } ] } ]