[ { "id": "adaptive_lighting_sleep_mode", "automation": "- id: adaptive_lighting_sleep_mode\n alias: Adaptive Lighting Sleep Mode\n description: Turn on sleep mode lighting.\n mode: restart\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: state\n id: night\n entity_id: input_select.occupancy_mode\n to: Night\n for: 5\n - trigger: state\n id: morning\n entity_id: input_select.occupancy_mode\n from: Night\n for: 5\n - trigger: state\n id: switch\n entity_id: switch.adaptive_lighting\n to: 'on'\n from: 'off'\n conditions:\n - condition: state\n entity_id: switch.adaptive_lighting\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n actions:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n then:\n - parallel:\n - sequence:\n - action: switch.turn_on\n target:\n entity_id: switch.adaptive_lighting_sleep_mode_main_lights\n - sequence:\n - wait_template: \"{{ is_state('binary_sensor.bathroom_sensor_motion', 'off')\\n\\\n \\ and is_state('timer.bathroom_vanity_light', 'idle') }}\\n\"\n - action: switch.turn_on\n target:\n entity_id: switch.adaptive_lighting_sleep_mode_bathroom_lights\n - sequence:\n - wait_template: '{{ is_state(''light.dining_room_light_rgb'', ''off'') }}'\n - action: switch.turn_on\n target:\n entity_id: switch.adaptive_lighting_sleep_mode_rgb_lights\n - sequence:\n - wait_template: \"{{ is_state('light.bedroom_fan_light', 'off')\\n and is_state('light.bedroom_potlights',\\\n \\ 'off') }}\\n\"\n - action: switch.turn_on\n target:\n entity_id: switch.adaptive_lighting_sleep_mode_bedroom_lights\n - sequence:\n - action: switch.turn_on\n target:\n entity_id: switch.adaptive_lighting_sleep_mode_cabinet_lights\n else:\n - action: switch.turn_off\n target:\n entity_id:\n - switch.adaptive_lighting_sleep_mode_bathroom_lights\n - switch.adaptive_lighting_sleep_mode_outside_lights\n - if: '{{ is_state(''script.waketime'', ''on'') }}'\n then:\n - wait_template: '{{ is_state(''script.waketime'', ''off'') }}'\n - action: switch.turn_off\n target:\n entity_id:\n - switch.adaptive_lighting_sleep_mode_bathroom_lights\n - switch.adaptive_lighting_sleep_mode_outside_lights\n - switch.adaptive_lighting_sleep_mode_bedroom_lights\n - switch.adaptive_lighting_sleep_mode_main_lights\n - switch.adaptive_lighting_sleep_mode_rgb_lights\n - switch.adaptive_lighting_sleep_mode_cabinet_lights", "config": [ { "name": "adaptive lighting sleep mode main lights", "room": "main", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_sleep_mode_main_lights", "device_id": null } }, { "name": "adaptive lighting sleep mode bathroom lights", "room": "bathroom", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_sleep_mode_bathroom_lights", "device_id": null } }, { "name": "adaptive lighting sleep mode rgb lights", "room": "dining room", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_sleep_mode_rgb_lights", "device_id": null } }, { "name": "adaptive lighting sleep mode bedroom lights", "room": "bedroom", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_sleep_mode_bedroom_lights", "device_id": null } }, { "name": "adaptive lighting sleep mode cabinet lights", "room": "cabinet", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_sleep_mode_cabinet_lights", "device_id": null } }, { "name": "adaptive lighting sleep mode outside lights", "room": "outside", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_sleep_mode_outside_lights", "device_id": null } }, { "name": "bathroom sensor motion", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_sensor_motion", "device_id": null } }, { "name": "bathroom vanity light timer", "room": "bathroom", "type": "timer", "id": { "entity_id": "timer.bathroom_vanity_light", "device_id": null } }, { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "bedroom fan light", "room": "bedroom", "type": "light", "id": { "entity_id": "light.bedroom_fan_light", "device_id": null } }, { "name": "bedroom potlights", "room": "bedroom", "type": "light", "id": { "entity_id": "light.bedroom_potlights", "device_id": null } }, { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "adaptive lighting", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "waketime script", "room": null, "type": "script", "id": { "entity_id": "script.waketime", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } } ] }, { "id": "alarm_announcements", "automation": "- id: alarm_announcements\n alias: Alarm Announcements\n description: House alarm TTS announcements.\n mode: queued\n variables:\n mode: '{{ state_attr(''alarm_control_panel.house'', ''arm_mode'') | replace(''armed_'',\n '''') }}'\n current_alarm: '{{ states(''input_text.current_alarm'') }}'\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to:\n - pending\n - triggered\n for: 5\n - trigger: state\n id: master\n entity_id: alarm_control_panel.house\n to:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n - arming\n - trigger: state\n id: master\n entity_id: alarm_control_panel.house\n to: disarmed\n from:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n - triggered\n conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_enabled\n - input_boolean.alarm_announcements\n state: 'on'\n - condition: template\n value_template: \"{{ iif(trigger.to_state.state in ['disarmed', 'armed_home', 'armed_night',\\\n \\ 'armed_away', 'armed_vacation'],\\n is_state('input_boolean.occupancy_announcements',\\\n \\ 'off'), true) }}\\n\"\n actions:\n - choose:\n - conditions: '{{ is_state(''alarm_control_panel.house'', ''arming'') }}'\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: The alarm is now being armed in {{ mode }} mode.\n save_message: false\n ignore_away: true\n continue_on_error: true\n - conditions: '{{ is_state(''alarm_control_panel.house'', ''pending'') }}'\n sequence:\n - repeat:\n while: '{{ is_state(''alarm_control_panel.house'', ''pending'') }}'\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'Warning! The alarm has been triggered by the {{ current_alarm\n }}.\n\n Disarm the system or the alarm will sound.\n\n '\n media_player: media_player.broadcast_speakers\n provider: HASS\n language: English (USA)\n voice: Tony:excited\n min_volume: 40\n always_play: true\n save_message: false\n continue_on_error: true\n - wait_template: '{{ not is_state(''alarm_control_panel.house'', ''pending'')\n }}'\n timeout: 30\n - conditions:\n - condition: template\n value_template: '{{ is_state(''alarm_control_panel.house'', ''triggered'')\n }}'\n - condition: state\n entity_id:\n - binary_sensor.smoke_alarm\n - binary_sensor.co_alarm\n - binary_sensor.heat_alarm\n state: 'off'\n sequence:\n - wait_template: '{{ not current_alarm == '''' }}'\n timeout: 10\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: Attention! Alarm! {{ current_alarm }}\n alert: true\n save_message: false\n continue_on_error: true\n - delay: 30\n - if: '{{ is_state(''alarm_control_panel.house'', ''triggered'') }}'\n then:\n - repeat:\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'Attention! Alarm! {{ current_alarm }}\n\n Your intrusion has been detected and confirmed.\n\n The owners have been notified and the police have now been called.\n\n '\n provider: HASS\n language: English (USA)\n voice: Tony:angry\n alert: true\n save_message: false\n continue_on_error: true\n - wait_template: '{{ not is_state(''alarm_control_panel.house'', ''triggered'')\n }}'\n timeout: 60\n until: '{{ not is_state(''alarm_control_panel.house'', ''triggered'')\n }}'\n - conditions:\n - condition: template\n value_template: \"{{ states('alarm_control_panel.house')\\n in ['disarmed',\\\n \\ 'armed_home', 'armed_night', 'armed_away', 'armed_vacation'] }}\\n\"\n - condition: template\n value_template: \"{{ not is_state('alarm_control_panel.house', 'disarmed')\\n\\\n \\ if is_state('binary_sensor.alarm_open_sensor_alert', 'on') else true\\\n \\ }}\\n\"\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: '{%- if is_state(''alarm_control_panel.house'', ''disarmed'')\n %} The alarm has been disarmed.\n\n {%- else %} The alarm is armed in {{ mode }} mode.\n\n {%- endif -%}\n\n '\n ignore_away: true", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm announcements", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_announcements", "device_id": null } }, { "name": "current alarm", "room": null, "type": "input_text", "id": { "entity_id": "input_text.current_alarm", "device_id": null } }, { "name": "occupancy announcements", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_announcements", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "broadcast speakers", "room": null, "type": "media_player", "id": { "entity_id": "media_player.broadcast_speakers", "device_id": null } }, { "name": "smoke alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.smoke_alarm", "device_id": null } }, { "name": "co alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.co_alarm", "device_id": null } }, { "name": "heat alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.heat_alarm", "device_id": null } }, { "name": "alarm open sensor alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_open_sensor_alert", "device_id": null } } ] }, { "id": "alarm_arming", "automation": "- id: alarm_arming\n alias: Alarm Arming\n description: Start/cancel alarm arming timer.\n mode: restart\n variables:\n arm_mode: '{{ trigger.to_state.attributes[''arm_mode''] }}'\n alarm_delay: '{{ state_attr(''alarm_control_panel.house'', ''delay'') | int(0)\n }}'\n triggers:\n - trigger: state\n id: arming\n entity_id: alarm_control_panel.house\n to: arming\n - trigger: state\n id: finished\n entity_id: alarm_control_panel.house\n from: arming\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - if: '{{ is_state(''alarm_control_panel.house'', ''arming'') }}'\n then:\n - action: input_select.select_option\n target:\n entity_id: input_select.current_arm_mode\n data:\n option: '{{ arm_mode }}'\n - if: '{{ alarm_delay > 0 }}'\n then:\n - action: timer.start\n target:\n entity_id: timer.alarm_arming\n data:\n duration:\n seconds: '{{ alarm_delay }}'\n else:\n - if:\n - condition: state\n entity_id: timer.alarm_arming\n state: active\n then:\n - action: timer.cancel\n target:\n entity_id: timer.alarm_arming", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "current arm mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.current_arm_mode", "device_id": null } }, { "name": "alarm arming timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_arming", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } } ] }, { "id": "alarm_arming_lights", "automation": "- id: alarm_arming_lights\n alias: Alarm Arming Lights\n description: House alarm arming lighting.\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to: arming\n - trigger: state\n entity_id: alarm_control_panel.house\n from: arming\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n match: any\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: alarm_control_panel.house\n state: arming\n then:\n - action: scene.create\n data:\n scene_id: alarm_arming_lights_restore\n snapshot_entities:\n - light.side_entrance_light\n - light.kitchen_potlights\n - light.dining_room_potlights\n - if:\n - condition: state\n entity_id: alarm_control_panel.house\n attribute: arm_mode\n match: any\n state:\n - armed_away\n - armed_vacation\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n then:\n - action: script.turn_light_on\n data:\n entity_id:\n - light.side_entrance_light\n - light.kitchen_potlights\n - light.dining_room_potlights\n activate_timer: false\n else:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n match: any\n state:\n - Home\n - Guest\n then:\n - action: script.light_scene_on\n data:\n scene: alarm_arming_lights_restore\n else:\n - action: light.turn_off\n target:\n entity_id:\n - light.side_entrance_light\n - light.kitchen_potlights\n - light.dining_room_potlights", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "kitchen potlights", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_potlights", "device_id": null } }, { "name": "dining room potlights", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_potlights", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "scene create service", "room": null, "type": "service", "id": { "entity_id": "scene.create", "device_id": null } } ] }, { "id": "alarm_automation_check", "automation": "- id: alarm_automation_check\n alias: Alarm Automation Check\n description: Turn entity back on if alarm not disarmed.\n initial_state: true\n mode: parallel\n max: 30\n triggers:\n - trigger: state\n entity_id:\n - automation.alarm_announcements\n - automation.alarm_arming_lights\n - automation.alarm_arming\n - automation.alarm_bypassed_sensor\n - automation.alarm_check_automation_check\n - automation.alarm_code_error\n - automation.alarm_code_error_reset\n - automation.alarm_disabled\n - automation.alarm_disarmed\n - automation.alarm_mode_reset\n - automation.alarm_open_sensor\n - automation.alarm_pending\n - automation.alarm_pending_lights\n - automation.alarm_triggered_camera_monitors\n - automation.alarm_triggered_lights\n - automation.alarm_triggered_notification\n - automation.alarm_triggered_reset\n - automation.alarm_triggered_siren\n - automation.alarm_triggered\n - automation.arm_alarm\n - automation.current_alarm_trigger\n - automation.disarm_alarm\n - automation.doorbell_notification\n - automation.enable_alarm\n - automation.intruder_warning\n - automation.kiosk_alarm_display\n - automation.nest_protect_reload\n - automation.turn_alarm_auto_arming_on\n - automation.update_alarm_group_entities\n - input_boolean.alarm_alerts\n - input_boolean.alarm_announcements\n - input_boolean.alarm_notifications\n - input_boolean.alarm_auto_arming\n - input_boolean.alarm_emails\n - input_boolean.alarm_enabled\n to: 'off'\n conditions:\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state: disarmed\n actions:\n - action: homeassistant.turn_on\n target:\n entity_id: '{{ trigger.entity_id }}'\n - action: system_log.write\n data:\n logger: '{{ this.entity_id }}'\n level: warning\n message: '{{ trigger.entity_id }} changed while alarm was armed. Reverting to\n previous state.'\n - action: browser_mod.notification\n data:\n duration: 10000\n message: Settings cannot be changed while alarm is armed.", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm announcements", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_announcements", "device_id": null } }, { "name": "alarm announcements automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_announcements", "device_id": null } }, { "name": "alarm arming lights automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_arming_lights", "device_id": null } }, { "name": "alarm arming automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_arming", "device_id": null } }, { "name": "alarm bypassed sensor automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_bypassed_sensor", "device_id": null } }, { "name": "alarm check automation check automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_check_automation_check", "device_id": null } }, { "name": "alarm code error automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_code_error", "device_id": null } }, { "name": "alarm code error reset automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_code_error_reset", "device_id": null } }, { "name": "alarm disabled automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_disabled", "device_id": null } }, { "name": "alarm disarmed automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_disarmed", "device_id": null } }, { "name": "alarm mode reset automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_mode_reset", "device_id": null } }, { "name": "alarm open sensor automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_open_sensor", "device_id": null } }, { "name": "alarm pending automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_pending", "device_id": null } }, { "name": "alarm pending lights automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_pending_lights", "device_id": null } }, { "name": "alarm triggered automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_triggered", "device_id": null } }, { "name": "alarm triggered reset automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_triggered_reset", "device_id": null } }, { "name": "alarm triggered camera monitors automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_triggered_camera_monitors", "device_id": null } }, { "name": "alarm triggered lights automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_triggered_lights", "device_id": null } }, { "name": "alarm triggered notification automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_triggered_notification", "device_id": null } }, { "name": "alarm triggered siren automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_triggered_siren", "device_id": null } }, { "name": "alarm alerts", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_alerts", "device_id": null } }, { "name": "alarm notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_notifications", "device_id": null } }, { "name": "alarm auto arming", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_auto_arming", "device_id": null } }, { "name": "alarm emails", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_emails", "device_id": null } }, { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } }, { "name": "kiosk alarm display", "room": null, "type": "automation", "id": { "entity_id": "automation.kiosk_alarm_display", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "system log write service", "room": null, "type": "service", "id": { "entity_id": "system_log.write", "device_id": null } }, { "name": "nest protect reload", "room": null, "type": "automation", "id": { "entity_id": "automation.nest_protect_reload", "device_id": null } }, { "name": "Arm Alarm Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.arm_alarm", "device_id": null } }, { "name": "Current Alarm Trigger Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.current_alarm_trigger", "device_id": null } }, { "name": "Disarm Alarm Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.disarm_alarm", "device_id": null } }, { "name": "Doorbell Notification Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.doorbell_notification", "device_id": null } }, { "name": "Enable Alarm Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.enable_alarm", "device_id": null } }, { "name": "Intruder Warning Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.intruder_warning", "device_id": null } }, { "name": "Turn Alarm Auto Arming On Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.turn_alarm_auto_arming_on", "device_id": null } }, { "name": "Update Alarm Group Entities Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.update_alarm_group_entities", "device_id": null } } ] }, { "id": "alarm_check_automation_check", "automation": "- id: alarm_check_automation_check\n alias: Alarm Check Automation Check\n description: Turn entity back off if alarm not disarmed.\n initial_state: true\n triggers:\n - trigger: state\n entity_id: automation.alarm_automation_check\n to: 'off'\n conditions:\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state: disarmed\n actions:\n - action: automation.turn_on\n entity_id: automation.alarm_automation_check\n - action: system_log.write\n data:\n logger: '{{ this.entity_id }}'\n level: error\n message: '{{ trigger.entity_id }} changed while alarm was armed. Reverting to\n previous state.'\n - action: browser_mod.notification\n data:\n duration: 10000\n message: Settings cannot be changed while alarm is armed.", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm automation check", "room": null, "type": "automation", "id": { "entity_id": "automation.alarm_automation_check", "device_id": null } }, { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } }, { "name": "system log write service", "room": null, "type": "service", "id": { "entity_id": "system_log.write", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } } ] }, { "id": "alarm_bypassed_sensor", "automation": "- id: alarm_bypassed_sensor\n alias: Alarm Bypassed Sensor\n description: Announcement, notification on alarm bypassed sensor.\n mode: restart\n triggers:\n - trigger: state\n entity_id: binary_sensor.alarm_bypassed_sensor_alert\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_enabled\n - input_boolean.alarm_notifications\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.alarm_bypassed_sensor_alert\n state: 'on'\n then:\n - action: notify.jason\n data:\n title: Bypassed Sensors\n message: \"{%- set sensors = expand(state_attr('alarm_control_panel.house',\\\n \\ 'bypassed_sensors'))\\n | map(attribute='name') | sort %}\\n{%- for\\\n \\ item in sensors %}\\n{{ item | replace('Alert', '') }}\\n{%- endfor -%}\\n\"\n data:\n tag: bypassed_sensor\n group: Alarm\n channel: Urgent\n persistant: true\n sticky: true\n notification_icon: '{{ state_attr(''binary_sensor.alarm_bypassed_sensor_alert'',\n ''icon'') }}'\n icon_url: secret ALARM_ICON\n ledColor: secret WARNING_COLOR\n color: secret WARNING_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/alarm\n actions:\n - title: Cameras\n action: URI\n uri: secret LOREX_URI\n else:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: bypassed_sensor", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_notifications", "device_id": null } }, { "name": "alarm bypassed sensor alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_bypassed_sensor_alert", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "alarm_clock_failed", "automation": "- id: alarm_clock_failed\n alias: Alarm Clock Failed\n description: Play announcement, reset alarm clock when failed.\n max_exceeded: silent\n variables:\n person: \"{% if is_state('input_boolean.alarm_clock_notifications', 'on')\\n \\\n \\ and is_state('binary_sensor.jason_home', 'on') %} jason\\n{% else %} none {%\\\n \\ endif %}\\n\"\n triggers:\n - trigger: state\n id: failed\n entity_id: input_boolean.alarm_clock_failed\n to: 'on'\n conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_clock_alerts\n - binary_sensor.alarm_clock\n state: 'on'\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.alarm_clock_failed\n - if: '{{ person in [''jason''] }}'\n then:\n - action: notify.jason\n data:\n title: Alarm Clock Failed\n message: Alarm clock failed at {{ now().strftime('%-I:%M %p') }}.\n data:\n tag: alarm_clock_failed\n visibility: public\n persistent: true\n channel: alarm_stream\n group: Alarm Clock\n notification_icon: '{{ state_attr(''input_boolean.alarm_clock_failed'',\n ''icon'') }}'\n icon_url: secret ALARM_CLOCK_ICON\n ledColor: secret CRITICAL_COLOR\n color: secret CRITICAL_COLOR\n vibrationPattern: secret ALARM_STREAM_VIBRATION\n clickAction: /ui-mobile/schedule\n actions:\n - title: Turn Off\n action: turn_off_alarm_clock\n - repeat:\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'Attention\n\n A scheduled alarm clock has failed to play.\n\n Again, a scheduled alarm clock has failed to play.\n\n '\n media_player: media_player.dining_room_hub\n min_volume: 70\n alert: true\n save_message: false\n continue_on_error: true\n - delay: 120\n until:\n - condition: state\n entity_id: input_boolean.alarm_clock_failed\n state: 'off'", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "alarm clock failed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_failed", "device_id": null } }, { "name": "alarm clock notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_notifications", "device_id": null } }, { "name": "alarm clock alerts", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_alerts", "device_id": null } }, { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "alarm_clock_media_player_turned_off", "automation": "- id: alarm_clock_media_player_turned_off\n alias: Alarm Clock Media Player Turned Off\n description: Turn off active alarm when alarm clock media player is turned off.\n max_exceeded: silent\n variables:\n alarm_type: '{{ states(''input_select.alarm_clock_type'') }}'\n media_player: '{{ states(''sensor.alarm_clock_active_media_player'') }}'\n triggers:\n - trigger: state\n entity_id: include /config/include/media_player_entities_single.yaml\n to:\n - 'off'\n - idle\n - unavailable\n - unknown\n for:\n seconds: 5\n conditions:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'on'\n - condition: template\n alias: Media player is an active alarm_clock player\n value_template: '{% from ''alarm_clock.jinja'' import alarm_clock_player %} {{\n bool(alarm_clock_player(trigger.entity_id)) }}\n\n '\n - condition: template\n alias: Media player is not an active tts player\n value_template: '{% from ''tts.jinja'' import tts_player %} {{ not bool(tts_player(trigger.entity_id))\n }}\n\n '\n - condition: state\n entity_id:\n - switch.alarm_clock_snooze\n - script.alarm_clock_play\n - script.alarm_clock_stop\n state: 'off'\n actions:\n - if: '{{ trigger.to_state.state in [''unknown'', ''unavailable''] }}'\n then:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.alarm_clock_failed\n else:\n - action: switch.turn_off\n target:\n entity_id: switch.alarm_clock_{{ alarm_type }}", "config": [ { "name": "alarm clock failed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_failed", "device_id": null } }, { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock type", "room": null, "type": "input_select", "id": { "entity_id": "input_select.alarm_clock_type", "device_id": null } }, { "name": "alarm clock active media player", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_active_media_player", "device_id": null } }, { "name": "alarm clock snooze", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_snooze", "device_id": null } }, { "name": "alarm clock play script", "room": null, "type": "script", "id": { "entity_id": "script.alarm_clock_play", "device_id": null } }, { "name": "alarm clock stop script", "room": null, "type": "script", "id": { "entity_id": "script.alarm_clock_stop", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "alarm_clock_notification", "automation": "- id: alarm_clock_notification\n alias: Alarm Clock Notification\n description: Notifications for active alarm clock.\n mode: restart\n variables:\n person: jason\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.alarm_clock\n - switch.alarm_clock_snooze\n to: 'on'\n from: 'off'\n for: 5\n - trigger: state\n entity_id:\n - switch.alarm_clock_snooze\n - binary_sensor.alarm_clock\n to: 'off'\n from: 'on'\n - trigger: event\n id: dismiss\n event_type: mobile_app_notification_action\n event_data:\n action: dismiss_alarm_clock\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_clock_test_play\n state: 'off'\n - condition: template\n alias: Person is valid\n value_template: '{{ person in [''jason''] }}'\n actions:\n - if:\n - condition: or\n conditions:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'off'\n - condition: template\n value_template: '{{ trigger.id == ''dismiss'' }}'\n then:\n - action: notify.{{ person }}\n data:\n message: clear_notification\n data:\n tag: alarm_clock\n else:\n - if:\n - condition: state\n entity_id: switch.alarm_clock_snooze\n state: 'on'\n then:\n - action: script.alarm_clock_notification\n data:\n type: snooze\n person: '{{ person }}'\n else:\n - repeat:\n sequence:\n - if:\n - condition: state\n entity_id: switch.alarm_clock_snooze\n state: 'off'\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'on'\n then:\n - action: script.alarm_clock_notification\n data:\n type: alarm\n person: '{{ person }}'\n - wait_template: '{{ is_state(''binary_sensor.alarm_clock'', ''off'') }}'\n timeout: 120\n until:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'off'", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock snooze", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_snooze", "device_id": null } }, { "name": "alarm clock test play", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_test_play", "device_id": null } }, { "name": "alarm clock notification script", "room": null, "type": "script", "id": { "entity_id": "script.alarm_clock_notification", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "upcoming_alarm_clock_notification", "automation": "- id: upcoming_alarm_clock_notification\n alias: Upcoming Alarm Clock Notification\n description: Notifications for upcoming alarm clock.\n triggers:\n - trigger: template\n value_template: \"{{ false if not has_value('sensor.alarm_clock_next_alarm')\\n\\\n \\ else now() > states('sensor.alarm_clock_next_alarm')\\n | as_datetime\\\n \\ - timedelta(minutes=60) }}\\n\"\n - trigger: state\n entity_id: binary_sensor.alarm_clock\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_clock_notifications\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'on'\n then:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: upcoming_alarm_clock\n else:\n - action: notify.jason\n data:\n title: Upcoming Alarm\n message: '{% set alarm_time = states(''sensor.alarm_clock_next_alarm'') |\n as_datetime | as_local %}\n\n Alarm Time: {{ alarm_time.strftime(''%-I:%M %p'') }}\n\n '\n data:\n tag: upcoming_alarm_clock\n visibility: public\n persistent: true\n channel: Night\n group: Alarm Clock\n notification_icon: '{{ state_attr(''binary_sensor.alarm_clock'', ''icon'')\n }}'\n icon_url: secret ALARM_CLOCK_ICON\n clickAction: /ui-mobile/schedule\n actions:\n - title: Skip Alarm\n action: skip_next_alarm", "config": [ { "name": "alarm clock notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_notifications", "device_id": null } }, { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock next alarm", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_next_alarm", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "select_active_alarm_clock", "automation": "- id: select_active_alarm_clock\n alias: 'Select Active Alarm Clock '\n description: Turn on alarm clock launcher booleans for active alarm.\n mode: restart\n triggers:\n - trigger: state\n entity_id: binary_sensor.alarm_clock\n to: 'on'\n from: 'off'\n for: 1\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_clock_test_play\n state: 'off'\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.media_launcher_alarm_clock\n - action: input_boolean.turn_on\n target:\n entity_id: '{% set alarm_type = states(''input_select.alarm_clock_type'') %}\n input_boolean.alarm_clock_launcher_{{ alarm_type }}\n\n '", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock type", "room": null, "type": "input_select", "id": { "entity_id": "input_select.alarm_clock_type", "device_id": null } }, { "name": "alarm clock test play", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_test_play", "device_id": null } }, { "name": "media launcher alarm clock", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_alarm_clock", "device_id": null } } ] }, { "id": "reset_alarm_clock_options_view", "automation": "- id: reset_alarm_clock_options_view\n alias: Reset Alarm Clock Options View\n description: Reset view alarm clock options boolean.\n triggers:\n - trigger: state\n entity_id: input_boolean.show_alarm_clock_settings\n to: 'on'\n for:\n minutes: 5\n - trigger: state\n entity_id:\n - input_boolean.alarm_clock_launcher_daily\n - input_boolean.alarm_clock_launcher_manual\n - input_boolean.alarm_clock_launcher_nap\n - input_boolean.alarm_clock_launcher_other\n to: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.show_alarm_clock_settings", "config": [ { "name": "alarm clock launcher daily", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_daily", "device_id": null } }, { "name": "show alarm clock settings", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.show_alarm_clock_settings", "device_id": null } }, { "name": "alarm clock launcher manual", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_manual", "device_id": null } }, { "name": "alarm clock launcher nap", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_nap", "device_id": null } }, { "name": "alarm clock launcher other", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_other", "device_id": null } } ] }, { "id": "reset_alarm_clock_selection", "automation": "- id: reset_alarm_clock_selection\n alias: Reset Alarm Clock Selection\n description: Reset alarm clock selection booleans.\n mode: restart\n triggers:\n - trigger: state\n entity_id:\n - input_boolean.alarm_clock_launcher_daily\n - input_boolean.alarm_clock_launcher_manual\n - input_boolean.alarm_clock_launcher_nap\n - input_boolean.alarm_clock_launcher_other\n to: null\n actions:\n - action: automation.turn_off\n target:\n entity_id: '{{ this.entity_id }}'\n data:\n stop_actions: false\n - action: input_boolean.turn_off\n target:\n entity_id: \"{{ expand('group.alarm_clock_launchers') | rejectattr('entity_id',\\\n \\ 'eq', trigger.entity_id)\\n | map(attribute='entity_id') | list }}\\n\"\n continue_on_error: true\n - action: automation.turn_on\n target:\n entity_id: '{{ this.entity_id }}'\n - if: '{{ is_state(''binary_sensor.alarm_clock'', ''on'') }}'\n then:\n - wait_template: ('is_state('binary_sensor.alarm_clock', 'on') }}\n timeout: 900\n else:\n - delay: 600\n - action: automation.turn_off\n target:\n entity_id: '{{ this.entity_id }}'\n data:\n stop_actions: false\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ expand(''group.alarm_clock_launchers'') | map(attribute=''entity_id'')\n | list }}'\n continue_on_error: true\n - action: input_select.select_option\n target:\n entity_id: input_select.alarm_clock_selection\n data:\n option: Jason Phone\n - action: automation.turn_on\n target:\n entity_id: '{{ this.entity_id }}'", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock launcher daily", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_daily", "device_id": null } }, { "name": "alarm clock launcher manual", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_manual", "device_id": null } }, { "name": "alarm clock launcher nap", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_nap", "device_id": null } }, { "name": "alarm clock launcher other", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_other", "device_id": null } }, { "name": "alarm clock selection", "room": null, "type": "input_select", "id": { "entity_id": "input_select.alarm_clock_selection", "device_id": null } }, { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } } ] }, { "id": "turn_on_skip_next_alarm_clock", "automation": "- id: turn_on_skip_next_alarm_clock\n alias: Turn On Skip Next Alarm Clock\n description: Turn on skip next alarm clock.\n triggers:\n - trigger: event\n id: skip\n event_type: mobile_app_notification_action\n event_data:\n action: skip_next_alarm\n - trigger: event\n id: enable\n event_type: mobile_app_notification_action\n event_data:\n action: enable_next_alarm\n actions:\n - action: input_boolean.turn_{{ iif(trigger.id == 'skip' , 'on', 'off') }}\n target:\n entity_id: input_boolean.alarm_clock_skip_next", "config": [ { "name": "alarm clock skip next", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_skip_next", "device_id": null } } ] }, { "id": "turn_off_skip_next_alarm_clock", "automation": "- id: turn_off_skip_next_alarm_clock\n alias: Turn Off Skip Next Alarm Clock\n description: Turn off skip next alarm_clock.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: sensor.alarm_clock_next_alarm\n to: unknown\n not_from: unavailable\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.alarm_clock_skip_next", "config": [ { "name": "alarm clock next alarm", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_next_alarm", "device_id": null } }, { "name": "alarm clock skip next", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_skip_next", "device_id": null } } ] }, { "id": "alarm_clock_skipped", "automation": "- id: alarm_clock_skipped\n alias: Alarm Clock Skipped\n description: Notifications for skipped upcoming alarm clock.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_clock_skip_next\n to: null\n actions:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_clock_skip_next\n state: 'on'\n then:\n - if: '{{ has_value(''sensor.alarm_clock_next_alarm'') }}'\n then:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_clock_notifications\n state: 'on'\n then:\n - action: notify.jason\n data:\n title: Alarm Skipped\n message: '{% set alarm_time = states(''sensor.alarm_clock_next_alarm'')\n | as_datetime | as_local %}\n\n Alarm Time: {{ alarm_time.strftime(''%-I:%M %p'') }}\n\n '\n data:\n tag: skipped_alarm_clock\n visibility: public\n persistent: true\n channel: Night\n group: Alarm Clock\n notification_icon: '{{ state_attr(''binary_sensor.alarm_clock'', ''icon'')\n }}'\n icon_url: secret ALARM_CLOCK_ICON\n clickAction: /ui-mobile/schedule\n actions:\n - title: Enable Alarm\n action: enable_next_alarm\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.alarm_clock_skip_next\n - action: browser_mod.notification\n data:\n message: There is no alarm clock set to skip\n else:\n - if: '{{ has_value(''sensor.alarm_clock_next_alarm'') }}'\n then:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: skipped_alarm_clock", "config": [ { "name": "alarm clock notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_notifications", "device_id": null } }, { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock next alarm", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_next_alarm", "device_id": null } }, { "name": "alarm clock skip next", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_skip_next", "device_id": null } }, { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "turn_alarm_clock_snooze_on", "automation": "- id: turn_alarm_clock_snooze_on\n alias: Turn Alarm Clock Snooze On\n description: Turn on alarm clock snooze.\n max_exceeded: silent\n variables:\n media_player: '{{ states(''sensor.alarm_clock_active_media_player'') }}'\n triggers:\n - trigger: state\n id: player\n entity_id: include /config/include/media_player_entities_single.yaml\n to: paused\n - trigger: event\n id: timer\n event_type: timer.started\n event_data:\n entity_id: timer.alarm_clock_snooze\n - trigger: event\n event_type: shelly.click\n event_data:\n device: shellybutton1-E8DB84AA2E96\n click_type: single\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: snooze_alarm_clock\n conditions:\n - condition: state\n entity_id: switch.alarm_clock_snooze\n state: 'off'\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'on'\n - condition: template\n alias: Trigger is an active alarm_clock media player\n value_template: \"{% if trigger.id == 'player' and has_value(media_player) %}\\n\\\n \\ {{ trigger.entity_id in state_attr('sensor.alarm_clock_active_media_player',\\\n \\ 'entity_id') }}\\n{% else %} {{ true }} {% endif %}\\n\"\n actions:\n - if: '{{ trigger.id in [''player'', ''timer''] }}'\n then:\n - delay: 1\n - if:\n - condition: state\n entity_id: switch.alarm_clock_snooze\n state: 'off'\n then:\n - action: switch.turn_on\n target:\n entity_id: switch.alarm_clock_snooze", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock active media player", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_active_media_player", "device_id": null } }, { "name": "alarm clock snooze", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_snooze", "device_id": null } }, { "name": "alarm clock snooze timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_snooze", "device_id": null } }, { "name": "shelly click event", "room": null, "type": "event", "id": { "entity_id": "shelly.click", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } }, { "name": "shelly button device", "room": "bedroom", "type": "device", "id": { "entity_id": null, "device_id": "shellybutton1-E8DB84AA2E96" } }, { "name": "alarm clock snooze timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_snooze", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "turn_alarm_clock_snooze_off", "automation": "- id: turn_alarm_clock_snooze_off\n alias: Turn Alarm Clock Snooze Off\n description: Turn off alarm clock snooze.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: binary_sensor.alarm_clock\n to: 'off'\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.alarm_clock_snooze\n - trigger: event\n event_type: timer.cancelled\n event_data:\n entity_id: timer.alarm_clock_snooze\n - trigger: event\n event_type: timer.paused\n event_data:\n entity_id: timer.alarm_clock_snooze\n conditions:\n - condition: state\n entity_id: switch.alarm_clock_snooze\n state: 'on'\n actions:\n - action: switch.turn_off\n target:\n entity_id: switch.alarm_clock_snooze", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock snooze", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_snooze", "device_id": null } }, { "name": "alarm clock snooze timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_snooze", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "alarm clock snooze timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_snooze", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "reset_alarm_clock_snooze_switch", "automation": "- id: reset_alarm_clock_snooze_switch\n alias: Reset Alarm Clock Snooze Switch\n description: Turn off snooze switch if alarm clock is not on.\n mode: parallel\n triggers:\n - trigger: state\n entity_id: switch.alarm_clock_snooze\n to: 'on'\n from: 'off'\n conditions:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'off'\n actions:\n - action: switch.turn_off\n target:\n entity_id: switch.alarm_clock_snooze", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock snooze", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_snooze", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "alarm_clock_volume_changed", "automation": "- id: alarm_clock_volume_changed\n alias: Alarm Clock Volume Changed\n description: Change alarm clock player volume when media volume control changed.\n mode: restart\n variables:\n alarm_type: '{{ states(''input_select.alarm_clock_type'') }}'\n alarm_volume: '{{ states(trigger.entity_id) | float(0) }}'\n media_player: '{{ states(''sensor.alarm_clock_active_media_player'') }}'\n triggers:\n - trigger: state\n entity_id:\n - input_number.alarm_clock_volume_daily\n - input_number.alarm_clock_volume_manual\n - input_number.alarm_clock_volume_nap\n conditions:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'on'\n - condition: template\n alias: New set volume is not equal to the current media player volume\n value_template: \"{{ '%0.2f' | format(states(trigger.entity_id) | float(0)/100)\\n\\\n \\ != '%0.2f' | format(state_attr(media_player, 'volume_level') | float(0))\\\n \\ }}\\n\"\n actions:\n - action: media_player.volume_set\n target:\n entity_id: '{{ media_player }}'\n data:\n volume_level: '{{ states(trigger.entity_id) | float/100 }}'", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock type", "room": null, "type": "input_select", "id": { "entity_id": "input_select.alarm_clock_type", "device_id": null } }, { "name": "alarm clock active media player", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_active_media_player", "device_id": null } }, { "name": "alarm clock volume daily", "room": null, "type": "input_number", "id": { "entity_id": "input_number.alarm_clock_volume_daily", "device_id": null } }, { "name": "alarm clock volume manual", "room": null, "type": "input_number", "id": { "entity_id": "input_number.alarm_clock_volume_manual", "device_id": null } }, { "name": "alarm clock volume nap", "room": null, "type": "input_number", "id": { "entity_id": "input_number.alarm_clock_volume_nap", "device_id": null } }, { "name": "Alarm Clock Volume Input Number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.alarm_clock_volume_", "device_id": null } } ] }, { "id": "alarm_code_error", "automation": "- id: alarm_code_error\n alias: Alarm Code Error\n description: Increment code error, send notification if threshold reached.\n mode: queued\n triggers:\n - trigger: event\n event_type: system_log_event\n event_data:\n level: WARNING\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n - condition: template\n value_template: '{{ ''custom_components.alarmo.alarm_control_panel'' in trigger.event.data.name\n }}'\n - condition: template\n value_template: '{{ ''Wrong code provided'' in trigger.event.data.message[0] }}'\n actions:\n - action: counter.increment\n entity_id: counter.alarm_code_error_count\n - if:\n - condition: numeric_state\n entity_id: counter.alarm_code_error_count\n above: 5\n then:\n - action: notify.jason\n data:\n title: Alarm Code Error\n message: Alarm code errors exceeded\n data:\n tag: alarm_code_error\n group: Alarm\n channel: Urgent\n notification_icon: mdi:shield-alert\n icon_url: secret ALARM_ICON\n ledColor: secret SEVERE_COLOR\n color: secret SEVERE_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/alarm\n actions:\n - title: Reset\n action: alarm_code_error_reset\n - title: Cameras\n action: URI\n uri: secret LOREX_URI", "config": [ { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm code error count", "room": null, "type": "counter", "id": { "entity_id": "counter.alarm_code_error_count", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "system log event event", "room": null, "type": "event", "id": { "entity_id": "system_log_event", "device_id": null } } ] }, { "id": "alarm_code_error_reset", "automation": "- id: alarm_code_error_reset\n alias: Alarm Code Error Reset\n description: Reset alarm code error counter.\n max_exceeded: silent\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: alarm_code_error_reset\n conditions:\n - condition: numeric_state\n entity_id: counter.alarm_code_error_count\n above: 0\n actions:\n - action: counter.reset\n entity_id: counter.alarm_code_error_count\n - action: browser_mod.notification\n data:\n duration: 10000\n message: Alarm error code counter has been reset.", "config": [ { "name": "alarm code error count", "room": null, "type": "counter", "id": { "entity_id": "counter.alarm_code_error_count", "device_id": null } }, { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } } ] }, { "id": "alarm_disabled", "automation": "- id: alarm_disabled\n alias: Alarm Disabled\n description: Disable house alarm.\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_enabled\n to: 'off'\n for: 5\n actions:\n - action: script.turn_off\n target:\n entity_id: script.arm_alarm\n - action: input_boolean.turn_off\n target:\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n - action: input_text.set_value\n target:\n entity_id: input_text.current_alarm\n data:\n value: ''\n - action: script.disarm_alarm", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "current alarm", "room": null, "type": "input_text", "id": { "entity_id": "input_text.current_alarm", "device_id": null } }, { "name": "arm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.arm_alarm", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "disarm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.disarm_alarm", "device_id": null } }, { "name": "input text set value service", "room": null, "type": "service", "id": { "entity_id": "input_text.set_value", "device_id": null } }, { "name": "turn off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_off", "device_id": null } } ] }, { "id": "alarm_disarmed", "automation": "- id: alarm_disarmed\n alias: Alarm Disarmed\n description: Set occupancy mode.\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to: disarmed\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n - alias: Alarm not disarmed by Alarmo\n condition: state\n entity_id:\n - binary_sensor.alarm_open_sensor_alert\n - binary_sensor.alarm_bypassed_sensor_alert\n state: 'off'\n actions:\n - action: input_select.select_option\n target:\n entity_id: input_select.occupancy_mode\n data:\n option: '{% from ''presence.jinja'' import occupancy_mode %} {{ occupancy_mode()\n }}\n\n '", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm open sensor alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_open_sensor_alert", "device_id": null } }, { "name": "alarm bypassed sensor alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_bypassed_sensor_alert", "device_id": null } } ] }, { "id": "alarm_mode_reset", "automation": "- id: alarm_mode_reset\n alias: Alarm Mode Reset\n description: Keep alarm armed state in sync with occupancy mode.\n triggers:\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n for: 30\n - trigger: state\n id: alarm\n entity_id:\n - input_boolean.alarm_enabled\n - input_boolean.alarm_auto_arming\n to: 'on'\n conditions:\n - condition: or\n conditions:\n - condition: and\n conditions:\n - condition: not\n conditions:\n - condition: state\n entity_id: alarm_control_panel.house\n state:\n - armed_away\n - armed_vacation\n - condition: or\n conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'off'\n - condition: state\n entity_id: input_select.occupancy_mode\n state:\n - Away\n - Vacation\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: alarm_control_panel.house\n state:\n - armed_away\n - armed_vacation\n - condition: and\n conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: not\n conditions:\n - condition: state\n entity_id: alarm_control_panel.house\n state: armed_night\n - condition: state\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id:\n - input_boolean.alarm_enabled\n - input_boolean.alarm_auto_arming\n state: 'on'\n actions:\n - wait_template: '{{ not is_state(''alarm_control_panel.house'', ''arming'') }}'\n - choose:\n - conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'off'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Vacation\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state: armed_vacation\n sequence:\n - action: script.arm_alarm\n data:\n mode: vacation\n force: true\n skip_delay: true\n - conditions:\n - or:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'off'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Away\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state: armed_away\n sequence:\n - action: script.arm_alarm\n data:\n mode: away\n force: true\n skip_delay: true\n - conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state: armed_night\n sequence:\n - action: script.arm_alarm\n data:\n mode: night\n force: true\n skip_delay: true\n - conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Home\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state:\n - armed_home\n - disarmed\n sequence:\n - action: script.arm_alarm\n data:\n mode: home\n force: true\n skip_delay: true", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm auto arming", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_auto_arming", "device_id": null } }, { "name": "arm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.arm_alarm", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } } ] }, { "id": "alarm_open_sensor", "automation": "- id: alarm_open_sensor\n alias: Alarm Open Sensor\n description: Announcement, notification on alarm open sensor.\n max_exceeded: silent\n variables:\n alarm_mode: '{{ states(''input_select.current_arm_mode'') | replace(''armed_'',\n '''') }}'\n triggers:\n - trigger: state\n entity_id: binary_sensor.alarm_open_sensor_alert\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n for: 5\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.alarm_open_sensor_alert\n state: 'on'\n then:\n - repeat:\n sequence:\n - if:\n - condition: state\n entity_id: alarm_control_panel.house\n state: disarmed\n then:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_announcements\n state: 'on'\n then:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: \"{%- from 'speech_helpers.jinja' import array_to_clist\\\n \\ %}\\n{%- from 'speech_helpers.jinja' import plural_verb %}\\n\\\n {%- set entities = expand(state_attr('alarm_control_panel.house',\\\n \\ 'open_sensors'))\\n | map(attribute='name') | list %}\\n{%- set\\\n \\ sensors = array_to_clist(entities, true) | replace(' Open Alert',\\\n \\ '') %}\\nAttention The house alarm could not be armed\\nThe {{\\\n \\ sensors }}{{ plural_verb(entities|count) }} open\\n\"\n alert: true\n save_message: false\n continue_on_error: true\n - if:\n - condition: state\n entity_id: input_boolean.alarm_notifications\n state: 'on'\n then:\n - action: notify.jason\n data:\n title: Open Sensors\n message: \"{%- set sensors = expand(state_attr('alarm_control_panel.house',\\\n \\ 'open_sensors'))\\n | map(attribute='name') | sort -%}\\n{%-\\\n \\ for item in sensors %}\\n{{ item | replace('Alert', '') }}\\n{%-\\\n \\ endfor -%}\\n\"\n data:\n tag: open_sensor\n group: Alarm\n channel: Urgent\n persistant: true\n sticky: true\n notification_icon: '{{ state_attr(''binary_sensor.alarm_open_sensor_alert'',\n ''icon'') }}'\n icon_url: secret ALARM_ICON\n ledColor: secret CRITICAL_COLOR\n color: secret CRITICAL_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/alarm\n actions:\n - title: Home\n action: arm_alarm_home\n - title: Night\n action: arm_alarm_night\n - title: Away\n action: arm_alarm_away\n - wait_template: '{{ is_state(''binary_sensor.alarm_open_sensor_alert'', ''off'')\n }}'\n timeout:\n seconds: 60\n until: '{{ is_state(''binary_sensor.alarm_open_sensor_alert'', ''off'') or\n repeat.index == 3 }}'\n - if:\n - condition: state\n entity_id: alarm_control_panel.house\n state: disarmed\n then:\n - action: script.arm_alarm\n data:\n mode: '{{ alarm_mode }}'\n force: true\n else:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: open_sensor", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm announcements", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_announcements", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "alarm open sensor alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_open_sensor_alert", "device_id": null } }, { "name": "current arm mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.current_arm_mode", "device_id": null } }, { "name": "alarm notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_notifications", "device_id": null } }, { "name": "arm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.arm_alarm", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "alarm_pending", "automation": "- id: alarm_pending\n alias: Alarm Pending\n description: Alarm pending boolean and timer control.\n mode: restart\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to: pending\n - trigger: state\n entity_id: alarm_control_panel.house\n from: pending\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: alarm_control_panel.house\n state: pending\n then:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.alarm_pending\n - variables:\n alarm_delay: '{{ state_attr(trigger.entity_id, ''delay'') | int(0) }}'\n - if: '{{ alarm_delay > 0 }}'\n then:\n - action: timer.start\n target:\n entity_id: timer.alarm_pending\n data:\n duration:\n seconds: '{{ alarm_delay }}'\n else:\n - action: timer.cancel\n target:\n entity_id: timer.alarm_pending\n - wait_template: '{{ is_state(''input_boolean.alarm_triggered'', ''on'') }}'\n timeout: 5\n - if:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n then:\n - wait_template: '{{ is_state(''input_boolean.alarm_triggered'', ''off'') }}'\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.alarm_pending", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "alarm pending timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_pending", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } } ] }, { "id": "alarm_pending_lights", "automation": "- id: alarm_pending_lights\n alias: Alarm Pending Lights\n description: House alarm pending lighting.\n mode: queued\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_pending\n to: 'on'\n - trigger: state\n entity_id: input_boolean.alarm_pending\n to: 'off'\n for: 5\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_pending\n state: 'on'\n then:\n - action: scene.create\n data:\n scene_id: alarm_pending_lights_restore\n snapshot_entities:\n - light.side_entrance_light\n - light.kitchen_potlights\n - light.dining_room_potlights\n - light.hallway_potlights\n - action: script.light_scene_on\n data:\n scene: alarm_pending\n else:\n - action: script.light_scene_on\n data:\n scene: alarm_pending_lights_restore", "config": [ { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "kitchen potlights", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_potlights", "device_id": null } }, { "name": "dining room potlights", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_potlights", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "hallway potlights", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway_potlights", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "scene create service", "room": null, "type": "service", "id": { "entity_id": "scene.create", "device_id": null } } ] }, { "id": "alarm_triggered", "automation": "- id: alarm_triggered\n alias: Alarm Triggered\n description: Turn alarm triggered boolean on.\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to: triggered\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - action: input_boolean.turn_on\n entity_id: input_boolean.alarm_triggered", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } } ] }, { "id": "alarm_triggered_reset", "automation": "- id: alarm_triggered_reset\n alias: Alarm Triggered Reset\n description: Reset alarm triggered when someone comes home.\n triggers:\n - trigger: state\n entity_id: binary_sensor.someone_home\n to: 'on'\n from: 'off'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n actions:\n - wait_template: \"{{ is_state('alarm_control_panel.house', 'disarmed')\\n and\\\n \\ is_state('input_boolean.alarm_triggered', 'off') }}\\n\"\n timeout:\n minutes: 5\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.alarm_triggered", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } } ] }, { "id": "alarm_triggered_camera_monitors", "automation": "- id: alarm_triggered_camera_monitors\n alias: Alarm Triggered Camera Monitors\n description: Turn camera monitors on.\n mode: restart\n variables:\n danger: '{{ is_state(''binary_sensor.danger_alarm'', ''on'') }}'\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_triggered\n to:\n - 'on'\n - 'off'\n for: 1\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n then:\n - repeat:\n while:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n sequence:\n - parallel:\n - sequence:\n - if: '{{ danger }}'\n then:\n - if:\n - condition: state\n entity_id: media_player.living_room_chromecast\n state: 'off'\n then:\n - action: media_player.turn_on\n target:\n entity_id: media_player.living_room_chromecast\n continue_on_error: true\n - wait_template: '{{ not is_state(''media_player.living_room_tv'',\n ''off'') }}'\n timeout: 30\n else:\n - if: '{{ is_state(''media_player.living_room_tv'', ''off'') }}'\n then:\n - action: media_player.turn_on\n target:\n entity_id: media_player.living_room_tv\n continue_on_error: true\n - wait_template: '{{ state_attr(''media_player.living_room_tv'', ''is_volume_muted'')\n != none }}'\n timeout: 30\n - if: '{{ state_attr(''media_player.living_room_tv'', ''is_volume_muted'')\n != true }}'\n then:\n - action: media_player.volume_mute\n target:\n entity_id: media_player.living_room_tv\n data:\n is_volume_muted: true\n continue_on_error: true\n - if: '{{ danger }}'\n then:\n - wait_template: '{{ ''HDMI 2'' in state_attr(''media_player.living_room_tv'',\n ''source_list'') }}'\n timeout: 30\n - if: '{{ wait.completed and state_attr(''media_player.living_room_tv'',\n ''source'') != ''HDMI 2'' }}'\n then:\n - action: media_player.select_source\n target:\n entity_id: media_player.living_room_tv\n data:\n source: HDMI 2\n continue_on_error: true\n - if: '{{ state_attr(''media_player.living_room_chromecast'', ''media_title'')\n != ''Cast: Danger''}}'\n then:\n - action: cast.show_lovelace_view\n data:\n dashboard_path: ui-cast\n entity_id: media_player.living_room_chromecast\n view_path: danger\n continue_on_error: true\n else:\n - wait_template: '{{ ''HDMI 1'' in state_attr(''media_player.living_room_tv'',\n ''source_list'') }}'\n timeout: 30\n - if: '{{ wait.completed and state_attr(''media_player.living_room_tv'',\n ''source'') != ''HDMI 1'' }}'\n then:\n - delay: 5\n - action: media_player.select_source\n target:\n entity_id: media_player.living_room_tv\n data:\n source: HDMI 1\n continue_on_error: true\n - sequence:\n - if: '{{ not danger and state_attr(''media_player.bedroom_tv'', ''source_list'')\n != ''HDMI 1'' }}'\n then:\n - if: '{{ is_state(''media_player.bedroom_tv'', ''off'') }}'\n then:\n - action: media_player.turn_on\n target:\n entity_id: media_player.bedroom_tv\n continue_on_error: true\n - wait_template: '{{ not state_attr(''media_player.bedroom_tv'', ''is_volume_muted'')\n == none }}'\n timeout: 30\n - if: '{{ state_attr(''media_player.bedroom_tv'', ''is_volume_muted'')\n != true }}'\n then:\n - action: media_player.volume_mute\n target:\n entity_id: media_player.bedroom_tv\n data:\n is_volume_muted: true\n continue_on_error: true\n - wait_template: '{{ ''HDMI 1'' in state_attr(''media_player.bedroom_tv'',\n ''source_list'') }}'\n timeout: 30\n - if: '{{ wait.completed and state_attr(''media_player.bedroom_tv'',\n ''source'') != ''HDMI 1'' }}'\n then:\n - delay: 5\n - action: media_player.select_source\n target:\n entity_id: media_player.bedroom_tv\n data:\n source: HDMI 1\n continue_on_error: true\n - sequence:\n - if: '{{ not danger }}'\n then:\n - if:\n - condition: state\n entity_id: media_player.office_tv\n state:\n - 'off'\n - standby\n then:\n - action: media_player.turn_on\n target:\n entity_id: media_player.office_tv\n continue_on_error: true\n - delay: 5\n - action: media_player.volume_mute\n target:\n entity_id: media_player.office_tv\n data:\n is_volume_muted: true\n continue_on_error: true\n - wait_template: '{{ ''Camera'' in state_attr(''media_player.office_tv'',\n ''source_list'') }}'\n timeout: 30\n - if: '{{ wait.completed and state_attr(''media_player.office_tv'',\n ''source'') != ''Camera'' }}'\n then:\n - delay: 1\n - action: media_player.select_source\n target:\n entity_id: media_player.office_tv\n data:\n source: Camera\n continue_on_error: true\n - sequence:\n - parallel:\n - sequence:\n - if: '{{ danger and states(''sensor.kiosk_browser_path'') != ''/ui-cast/danger''\n }}'\n then:\n - action: browser_mod.navigate\n data:\n path: /ui-cast/danger\n browser_id: kiosk\n continue_on_error: true\n - sequence:\n - if: '{{ danger and state_attr(''media_player.dining_room_hub'',\n ''media_title'') != ''ui-cast: Danger'' }}'\n then:\n - action: cast.show_lovelace_view\n data:\n dashboard_path: ui-cast\n entity_id: media_player.dining_room_hub\n view_path: danger\n continue_on_error: true\n - sequence:\n - if: '{{ danger and state_attr(''media_player.kitchen_hub'', ''media_title'')\n != ''ui-cast: Danger'' }}'\n then:\n - action: cast.show_lovelace_view\n data:\n dashboard_path: ui-cast\n entity_id: media_player.kitchen_hub\n view_path: danger\n continue_on_error: true\n - sequence:\n - if: '{{ danger and state_attr(''media_player.bedroom_hub'', ''media_title'')\n != ''ui-cast: Danger'' }}'\n then:\n - action: cast.show_lovelace_view\n data:\n dashboard_path: ui-cast\n entity_id: media_player.bedroom_hub\n view_path: danger\n continue_on_error: true\n - wait_template: '{{ is_state(''input_boolean.alarm_triggered'', ''off'')\n }}'\n timeout: 60\n else:\n - parallel:\n - sequence:\n - if: '{{ states(''sensor.kiosk_browser_path'') == ''/ui-cast/danger'' }}'\n then:\n - action: button.press\n target:\n entity_id: button.kiosk_tablet_load_start_url\n continue_on_error: true\n - sequence:\n - if: '{{ state_attr(''media_player.living_room_chromecast'', ''media_title'')\n == ''ui-cast: Danger''}}'\n then:\n - action: media_player.select_source\n target:\n entity_id: media_player.living_room_tv\n data:\n source: Live TV\n continue_on_error: true\n - action: media_player.volume_mute\n target:\n entity_id: media_player.living_room_tv\n data:\n is_volume_muted: false\n continue_on_error: true\n - action: media_player.turn_off\n entity_id:\n - media_player.living_room_chromecast\n - media_player.living_room_tv\n continue_on_error: true\n - sequence:\n - if: '{{ state_attr(''media_player.living_room_tv'', ''source'') == ''HDMI\n 1'' }}'\n then:\n - action: media_player.select_source\n target:\n entity_id: media_player.living_room_tv\n data:\n source: Live TV\n continue_on_error: true\n - action: media_player.volume_mute\n target:\n entity_id: media_player.living_room_tv\n data:\n is_volume_muted: false\n continue_on_error: true\n - action: media_player.turn_off\n target:\n entity_id: media_player.living_room_tv\n continue_on_error: true\n - sequence:\n - if: '{{ state_attr(''media_player.bedroom_tv'', ''source'') == ''HDMI 1''\n }}'\n then:\n - action: media_player.select_source\n target:\n entity_id: media_player.bedroom_tv\n data:\n source: Live TV\n continue_on_error: true\n - action: media_player.volume_mute\n target:\n entity_id: media_player.bedroom_tv\n data:\n is_volume_muted: false\n continue_on_error: true\n - action: media_player.turn_off\n target:\n entity_id: media_player.bedroom_tv\n continue_on_error: true\n - sequence:\n - if: '{{ state_attr(''media_player.office_tv'', ''source'') == ''Camera''\n }}'\n then:\n - action: media_player.volume_mute\n target:\n entity_id: media_player.office_tv\n data:\n is_volume_muted: false\n continue_on_error: true\n - action: media_player.turn_off\n target:\n entity_id: media_player.office_tv\n continue_on_error: true\n - sequence:\n - if: '{{ state_attr(''media_player.dining_room_hub'', ''media_title'') ==\n ''ui-cast: Danger'' }}'\n then:\n - action: media_player.turn_off\n target:\n entity_id: media_player.dining_room_hub\n - sequence:\n - if: '{{ state_attr(''media_player.kitchen_hub'', ''media_title'') == ''ui-cast:\n Danger'' }}'\n then:\n - action: media_player.turn_off\n target:\n entity_id: media_player.kitchen_hub\n - sequence:\n - if: '{{ state_attr(''media_player.bedroom_hub'', ''media_title'') == ''ui-cast:\n Danger'' }}'\n then:\n - action: media_player.turn_off\n target:\n entity_id: media_player.bedroom_hub", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "danger alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.danger_alarm", "device_id": null } }, { "name": "living room chromecast", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_chromecast", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "office tv", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_tv", "device_id": null } }, { "name": "kiosk browser path", "room": null, "type": "sensor", "id": { "entity_id": "sensor.kiosk_browser_path", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "kitchen hub", "room": "kitchen", "type": "media_player", "id": { "entity_id": "media_player.kitchen_hub", "device_id": null } }, { "name": "bedroom hub", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_hub", "device_id": null } }, { "name": "kiosk tablet load start url button", "room": null, "type": "button", "id": { "entity_id": "button.kiosk_tablet_load_start_url", "device_id": null } }, { "name": "browser mod navigate service", "room": null, "type": "service", "id": { "entity_id": "browser_mod.navigate", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "media player turn on service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_on", "device_id": null } }, { "name": "media player select source service", "room": null, "type": "service", "id": { "entity_id": "media_player.select_source", "device_id": null } }, { "name": "media player turn off service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_off", "device_id": null } } ] }, { "id": "alarm_triggered_lights", "automation": "- id: alarm_triggered_lights\n alias: Alarm Triggered Lights\n description: House alarm triggered lighting.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_triggered\n to:\n - 'on'\n - 'off'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n then:\n - action: scene.create\n data:\n scene_id: alarm_triggered_lights_restore\n snapshot_entities: '{{ state_attr(''group.lights'', ''entity_id'') }}'\n - action: switch.turn_off\n target:\n entity_id: switch.adaptive_lighting\n - action: script.turn_light_on\n data:\n activate_timer: false\n profile: default_max\n else:\n - action: script.light_scene_on\n data:\n scene: alarm_triggered_lights_restore\n - delay: 5\n - action: switch.turn_on\n target:\n entity_id: switch.adaptive_lighting\n - and:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'on'\n - action: script.light_scene_on\n data:\n scene: night_lights", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "adaptive lighting", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "lights group", "room": null, "type": "group", "id": { "entity_id": "group.lights", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "scene create service", "room": null, "type": "service", "id": { "entity_id": "scene.create", "device_id": null } } ] }, { "id": "alarm_triggered_notification", "automation": "- id: alarm_triggered_notification\n alias: Alarm Triggered Notification\n description: Create alarm snapshots, send alarm notifications.\n mode: restart\n variables:\n trigger_entity: \"{% set open_sensors = expand(state_attr('alarm_control_panel.house',\\\n \\ 'open_sensors'))\\n | map(attribute='entity_id') | list %}\\n{{ 'unknown'\\\n \\ if open_sensors | count == 0 else open_sensors[0] }}\\n\"\n message: '{%- if states.alarm_control_panel.house.last_triggered is defined -%}\n\n Trigger: {{ states(''input_text.current_alarm'') }}\n\n Time: {{ as_local(states.alarm_control_panel.house.last_triggered).strftime(''%-I:%M\n %p'') }}\n\n {%- endif -%}\n\n '\n triggers:\n - trigger: state\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n to: 'on'\n for: 5\n conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_enabled\n - input_boolean.alarm_notifications\n state: 'on'\n - condition: state\n entity_id: binary_sensor.danger_alarm\n state: 'off'\n actions:\n - choose:\n - conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n sequence:\n - action: persistent_notification.create\n data:\n title: Alarm Triggered\n message: '{{ message }}'\n notification_id: alarm_triggered\n continue_on_error: true\n - action: script.notify_tv\n data:\n message: '{{ message }}'\n - conditions:\n - condition: state\n entity_id: input_boolean.alarm_pending\n state: 'on'\n sequence:\n - action: script.notify_tv\n data:\n message: '{{ message }}'\n - variables:\n cam1: \"{% if trigger_entity in state_attr('group.south_side_house_sensors',\\\n \\ 'entity_id') %}\\n side_door\\n{% elif trigger_entity in state_attr('group.front_house_sensors',\\\n \\ 'entity_id') %}\\n front_door\\n{% elif trigger_entity in state_attr('group.front_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n side_gate_front\\n{% elif trigger_entity in state_attr('group.back_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n side_gate_back\\n{% elif trigger_entity in state_attr('group.back_house_sensors',\\\n \\ 'entity_id') %}\\n back_house\\n{% elif trigger_entity in state_attr('group.garage_sensors',\\\n \\ 'entity_id') %}\\n side_door\\n{% elif trigger_entity in state_attr('group.inside_sensors',\\\n \\ 'entity_id') %}\\n charlie_cam\\n{% else %}\\n front_door\\n{% endif %}\\n\"\n cam2: \"{% if trigger_entity in state_attr('group.south_side_house_sensors',\\\n \\ 'entity_id') %}\\n side_driveway\\n{% elif trigger_entity in state_attr('group.front_house_sensors',\\\n \\ 'entity_id') %}\\n front_driveway\\n{% elif trigger_entity in state_attr('group.front_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n front_yard\\n{% elif trigger_entity in state_attr('group.back_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n patio_door\\n{% elif trigger_entity in state_attr('group.back_house_sensors',\\\n \\ 'entity_id') %}\\n patio_door\\n{% elif trigger_entity in state_attr('group.garage_sensors',\\\n \\ 'entity_id') %}\\n back_house\\n{% elif trigger_entity in state_attr('group.inside_sensors',\\\n \\ 'entity_id') %}\\n living_room\\n{% else %}\\n side_door\\n{% endif %}\\n\"\n cam3: \"{% if trigger_entity in state_attr('group.south_side_house_sensors',\\\n \\ 'entity_id') %}\\n front_door\\n{% elif trigger_entity in state_attr('group.front_house_sensors',\\\n \\ 'entity_id') %}\\n front_yard\\n{% elif trigger_entity in state_attr('group.front_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n front_door\\n{% elif trigger_entity in state_attr('group.back_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n back_house\\n{% elif trigger_entity in state_attr('group.back_house_sensors',\\\n \\ 'entity_id') %}\\n back_house\\n{% elif trigger_entity in state_attr('group.garage_sensors',\\\n \\ 'entity_id') %}\\n side_driveway\\n{% elif trigger_entity in state_attr('group.inside_sensors',\\\n \\ 'entity_id') %}\\n charlie_cam\\n{% else %}\\n back_house\\n{% endif %}\\n\"\n cam4: \"{% if trigger_entity in state_attr('group.south_side_house_sensors',\\\n \\ 'entity_id') %}\\n back_house\\n{% elif trigger_entity in state_attr('group.front_house_sensors',\\\n \\ 'entity_id') %}\\n side_driveway\\n{% elif trigger_entity in state_attr('group.front_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n side_gate_front\\n{% elif trigger_entity in state_attr('group.back_north_side_house_sensors',\\\n \\ 'entity_id') %}\\n side_gate_back\\n{% elif trigger_entity in state_attr('group.back_house_sensors',\\\n \\ 'entity_id') %}\\n side_gate_back\\n{% elif trigger_entity in state_attr('group.garage_sensors',\\\n \\ 'entity_id') %}\\n back_door\\n{% elif trigger_entity in state_attr('group.inside_sensors',\\\n \\ 'entity_id') %}\\n living_room\\n{% else %}\\n patio_door\\n{% endif %}\\n\"\n - choose:\n - conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n sequence:\n - repeat:\n sequence:\n - variables:\n file1: alarm_snapshots/{% from 'camera.jinja'import snapshot_filename\n %}{{ snapshot_filename(cam1) }}\n file2: alarm_snapshots/{% from 'camera.jinja'import snapshot_filename\n %}{{ snapshot_filename(cam2) }}\n file3: alarm_snapshots/{% from 'camera.jinja'import snapshot_filename\n %}{{ snapshot_filename(cam3) }}\n file4: alarm_snapshots/{% from 'camera.jinja'import snapshot_filename\n %}{{ snapshot_filename(cam4) }}\n - action: camera.snapshot\n target:\n entity_id: camera.{{ cam1 }}\n data:\n filename: /config/www/{{ file1 }}\n continue_on_error: true\n - action: camera.snapshot\n target:\n entity_id: camera.{{ cam2 }}\n data:\n filename: /config/www/{{ file2 }}\n continue_on_error: true\n - action: camera.snapshot\n target:\n entity_id: camera.{{ cam3 }}\n data:\n filename: /config/www/{{ file3 }}\n continue_on_error: true\n - action: camera.snapshot\n target:\n entity_id: camera.{{ cam4 }}\n data:\n filename: /config/www/{{ file4 }}\n continue_on_error: true\n - action: persistent_notification.create\n data:\n title: Alarm Snapshots\n notification_id: alarm_snapshots{{ repeat.index }}\n message: 'Snapshot Time: {{ now().strftime(''%a %-I:%M %p'') }}\n\n\n [image](/local/{{ file1 }})\n\n\n [image](/local/{{ file2 }})\n\n\n [image](/local/{{ file3 }})\n\n\n [image](/local/{{ file4 }})\n\n '\n continue_on_error: true\n - action: notify.jason\n data:\n title: Alarm Triggered\n message: '{{ message }}'\n data:\n tag: alarm_triggered{{ repeat.index }}\n group: Alarm\n channel: alarm_stream\n persistent: true\n sticky: true\n notification_icon: '{{ state_attr(''input_boolean.alarm_triggered'',\n ''icon'') }}'\n icon_url: secret ALARM_ICON\n image: /local/{{ file1 }}\n ledColor: secret CRITICAL_COLOR\n color: secret CRITICAL_COLOR\n vibrationPattern: secret ALARM_STREAM_VIBRATION\n clickAction: /ui-mobile/alarm\n actions:\n - title: Cameras\n action: URI\n uri: secret LOREX_URI\n continue_on_error: true\n - if:\n - condition: state\n entity_id: input_boolean.alarm_emails\n state: 'on'\n - '{{ repeat.index == 1 }}'\n then:\n - action: '{{ ''notify.jason_email_work'' if is_state(''person.jason'',\n ''Work'') else ''notify.jason_email'' }}'\n data:\n title: House Alarm Triggered\n message: '{%- from ''speech_helpers.jinja'' import array_to_clist\n %}\n\n {%- from ''speech_helpers.jinja'' import plural_verb %}\n\n {%- set home = state_attr(''binary_sensor.someone_home'', ''home'')\n %}\n\n The house alarm was triggered by the {{ states(''input_text.current_alarm'')\n }} at {{ now().strftime(''%-I:%M %p'') }}.\n\n {{ array_to_clist(home, true) }} {{ plural_verb(home | count) }}\n home.\n\n '\n data:\n images:\n - /config/www/{{ file1 }}\n - /config/www/{{ file2 }}\n - /config/www/{{ file3 }}\n - /config/www/{{ file4 }}\n html: \" \\n\\\n \\ \\n \\n \\n \\\n \\ \\n House Alarm Alert\\n \\n \\n \\n \\n \\n\\\n \\
\\n
\\n

ALARM TRIGGERED

\\n
\\n\\\n \\
\\n
\\n \\\n \\
Trigger: {{ states('input_text.current_alarm')\\\n \\ }}\\n
Time: {{ as_local(states.alarm_control_panel.house.last_triggered).strftime('%-I:%M\\\n \\ %p') }}
\\n
\\n
\\n
\\n
\\n \\n \\\"snapshot1\\\"\\\n\\n
\\n \\n \\\"snapshot2\\\"\\\n\\n
\\n
\\n\\\n \\
\\n \\n \\n \\n \\n\\n\"\n continue_on_error: true\n - wait_template: '{{ not is_state(''alarm_control_panel.house'', ''triggered'')\n }}'\n timeout: 60\n until: '{{ repeat.index == 4 or not is_state(''alarm_control_panel.house'',\n ''triggered'') }}'\n - conditions:\n - condition: state\n entity_id: input_boolean.alarm_pending\n state: 'on'\n sequence:\n - variables:\n file1: alarm_snapshots/{% from 'camera.jinja'import snapshot_filename %}{{\n snapshot_filename(cam1) }}\n - action: camera.snapshot\n target:\n entity_id: camera.{{ cam1 }}\n data:\n filename: /config/www/{{ file1 }}\n continue_on_error: true\n - action: notify.jason\n data:\n title: Alarm Pending\n message: {{ message }}\n data:\n tag: alarm_pending\n group: Alarm\n channel: Urgent\n persistent: true\n sticky: true\n chronometer: true\n when: '{{ now().timestamp() + state_attr(''alarm_control_panel.house'',\n ''delay'') | int(0) }}'\n notification_icon: '{{ state_attr(''input_boolean.alarm_pending'', ''icon'')\n }}'\n icon_url: secret ALARM_ICON\n image: /local/{{ file1 }}\n ledColor: secret CRITICAL_COLOR\n color: secret CRITICAL_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/alarm\n actions:\n - title: Cameras\n action: URI\n uri: secret LOREX_URI\n continue_on_error: true", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "current alarm", "room": null, "type": "input_text", "id": { "entity_id": "input_text.current_alarm", "device_id": null } }, { "name": "alarm notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_notifications", "device_id": null } }, { "name": "alarm emails", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_emails", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "danger alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.danger_alarm", "device_id": null } }, { "name": "notify tv script", "room": null, "type": "script", "id": { "entity_id": "script.notify_tv", "device_id": null } }, { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "group front house sensors", "room": "front", "type": "group", "id": { "entity_id": "group.front_house_sensors", "device_id": null } }, { "name": "group front north side house sensors", "room": "front north side", "type": "group", "id": { "entity_id": "group.front_north_side_house_sensors", "device_id": null } }, { "name": "group back north side house sensors", "room": "back north side", "type": "group", "id": { "entity_id": "group.back_north_side_house_sensors", "device_id": null } }, { "name": "group back house sensors", "room": "back", "type": "group", "id": { "entity_id": "group.back_house_sensors", "device_id": null } }, { "name": "group garage sensors", "room": "garage", "type": "group", "id": { "entity_id": "group.garage_sensors", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } } ] }, { "id": "alarm_triggered_siren", "automation": "- id: alarm_triggered_siren\n alias: Alarm Triggered Siren\n description: Turn alarm siren on/off.\n mode: restart\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to: triggered\n - trigger: state\n entity_id: alarm_control_panel.house\n from: triggered\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n - condition: state\n entity_id: binary_sensor.danger_alarm\n state: 'off'\n actions:\n - if:\n - condition: state\n entity_id: alarm_control_panel.house\n state: triggered\n then:\n - action: switch.turn_on\n target:\n entity_id:\n - switch.charlie_cam_camera_power\n - switch.living_room_camera_power\n - parallel:\n - sequence:\n - wait_template: '{{ is_state(''switch.charlie_cam_camera_power'', ''on'')\n }}'\n timeout: 60\n continue_on_timeout: false\n - action: siren.turn_on\n target:\n entity_id: siren.charlie_cam_camera_alarm\n - sequence:\n - wait_template: '{{ is_state(''switch.living_room_camera_power'', ''on'')\n }}'\n timeout: 60\n continue_on_timeout: false\n - action: siren.turn_on\n target:\n entity_id: siren.living_room_camera_alarm\n else:\n - action: siren.turn_off\n target:\n entity_id:\n - siren.charlie_cam_camera_alarm\n - siren.living_room_camera_alarm", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "danger alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.danger_alarm", "device_id": null } }, { "name": "charlie cam camera power", "room": null, "type": "switch", "id": { "entity_id": "switch.charlie_cam_camera_power", "device_id": null } }, { "name": "living room camera power", "room": "living room", "type": "switch", "id": { "entity_id": "switch.living_room_camera_power", "device_id": null } }, { "name": "charlie cam camera alarm", "room": null, "type": "siren", "id": { "entity_id": "siren.charlie_cam_camera_alarm", "device_id": null } }, { "name": "living room camera alarm", "room": "living room", "type": "siren", "id": { "entity_id": "siren.living_room_camera_alarm", "device_id": null } } ] }, { "id": "alert_announcements", "automation": "- id: alert_announcements\n alias: Alert Announcements\n description: Play alert tts announcement.\n mode: parallel\n variables:\n message: \"{%- from 'speech_helpers.jinja' import array_to_clist %}\\n{%- from 'speech_helpers.jinja'\\\n \\ import plural %}\\n{%- from 'speech_helpers.jinja' import plural_verb %}\\n\\\n {%- set t = trigger.entity_id %}\\n{%- if t == 'alert.open_windows' %}\\nLooks\\\n \\ like a beautiful {{ states('sensor.tod_greeting') }} out there!\\nPerhaps you\\\n \\ should open up a few windows?\\n{%- elif t == 'alert.air_quality' %}\\nAttention!\\\n \\ There is an active air quality alert.\\nThe current air quality index is {{\\\n \\ states('sensor.aqi_risk_level') }}.\\n{%- elif t == 'alert.flu_risk' %}\\nAttention!\\\n \\ The flu risk alert is now on.\\nThe flu risk for today is {{ states('sensor.flu_risk_today')\\\n \\ }}.\\n{%- elif t == 'alert.asthma_risk' %}\\nAttention! The asthma risk alert\\\n \\ is now on.\\nThe asthma risk for today is {{ states('sensor.asthma_risk_today')\\\n \\ }}, and it will be {{ states('sensor.asthma_risk_tomorrow') }} tomorrow.\\n\\\n {%- elif t == 'alert.allergy_risk' %}\\nAttention! The allergy risk alert is\\\n \\ now on.\\nThe allergy risk for today is {{ states('sensor.allergy_risk_today')\\\n \\ }}, and it will be {{ states('sensor.allergy_risk_tomorrow') }} tomorrow.\\n\\\n {%- elif t == 'alert.precipitation' %}\\n{%- from 'weather.jinja' import precipitation_text\\\n \\ %}\\nAttention! {{- precipitation_text() }}\\nCheck the Jeep windows and make\\\n \\ sure you get Charlie walked!\\n{%- elif t == 'alert.wind' %}\\nHang on to yer\\\n \\ hats people! It's getting a little windy out there!\\nWind speed is {{ states('sensor.wind_speed')\\\n \\ | int('unknown') }} kilometers per hour, with gusts approaching {{ states('sensor.wind_gust')\\\n \\ | int('unknown') }} kilometers per hour.\\n{%- elif t == 'alert.uv_risk' %}\\n\\\n Attention! The UV risk for today is {{ states('sensor.uv_risk_today') }}.\\n\\\n You need to hide all your pastey red headed step children right now!\\nThe UV\\\n \\ risk level is {{ states('sensor.current_uv_level') }}.\\n{%- elif t == 'alert.indoor_camera'\\\n \\ %}\\nJust a heads up, the indoor cameras are on and someone is home!\\n{%- elif\\\n \\ t == 'alert.outdoor_low_temperature' %}\\nOh Yah! She's a colder den duh witches\\\n \\ titties out dare now!\\nThe wind chill is {{ states('sensor.outdoor_apparent_temperature')\\\n \\ | int('unknown') }} degrees.\\n{%- elif t == 'alert.outdoor_high_temperature'\\\n \\ %}\\nHeads up! It's hot as balls out there today folks!\\nThe current humidex\\\n \\ is {{ states('sensor.outdoor_apparent_temperature') | int('unknown') }} nut\\\n \\ sack soakin degrees.\\n{%- elif t == 'alert.spa_low_temperature' %}\\nThe spa\\\n \\ temperature alert is on! The spa temperature is only {{ states('sensor.spa_temperature')\\\n \\ | int('unknown') }} degrees.\\n{%- elif t == 'alert.spa_offline' %}\\nThe spa\\\n \\ is offline. Check the breaker and make sure the spa is on.\\n{%- elif t ==\\\n \\ 'alert.leak_detected' %}\\n{%- set entities = expand(state_attr('binary_sensor.leak_detected_alert',\\\n \\ 'entity_id')) | map(attribute='name') | list %}\\nAttention! Moisture has been\\\n \\ detected by the {{ array_to_clist(entities) }} {{ plural('leak_sensor', entities\\\n \\ | count, false) }}!\\n{%- elif t == 'alert.unavailable_leak_sensor' %}\\n{%-\\\n \\ set entities = expand(state_attr('binary_sensor.unavailable_leak_sensor',\\\n \\ 'entity_id')) | map(attribute='name') | list %}\\nAttention! The {{ array_to_clist(entities)\\\n \\ }} {{ plural('sensor', entities | count, false) }} {{ plural_verb(entities\\\n \\ | count) }} offline!\\n{%- elif t == 'alert.indoor_sump' %}\\nAttention! There\\\n \\ is a critical issue with the indoor sump pump!\\n{%- elif t == 'alert.outdoor_sump'\\\n \\ %}\\nAttention! There is a critical issue with the outdoor sump pump!\\n{%-\\\n \\ elif t == 'alert.power_use' %}\\nAttention! The household power use alert is\\\n \\ active.\\nThe current power usage is {{ states('sensor.current_power_use_kw')\\\n \\ }} kilowatts!\\nYou should probably turn something off.\\n{%- elif t == 'alert.garage_heat_door_open'\\\n \\ %}\\nAttention! The garage heat cannot be turned on because the garage door\\\n \\ is open!\\n{%- elif t == 'alert.garage_extended_heat' %}\\nAttention! The garage\\\n \\ heat has been on for a while.\\nThe garage temperature is {{ '%0.1f' | format(states('sensor.garage_sensor_air_temperature')\\\n \\ | float(-99)) }} degrees.\\n{%- elif t == 'alert.garage_high_temperature' %}\\n\\\n Attention! The garage heat has been turned off because the high temperature\\\n \\ alert is active.\\nThe garage temperature is {{ '%0.1f' | format(states('sensor.garage_sensor_air_temperature')\\\n \\ | float(-99)) }} degrees,\\nbut the thermostat is set to {{ '%0.1f' | format(state_attr('climate.garage',\\\n \\ 'temperature') | float(-99)) }} degrees.\\n{%- elif t == 'alert.garage_low_temperature'\\\n \\ %}\\nAttention! The garage low temperature alert is active.\\nThe garage temperature\\\n \\ is {{ '%0.1f' | format(states('sensor.garage_sensor_air_temperature') | float(-99))\\\n \\ }} degrees,\\nbut the thermostat is set to {{ '%0.1f' | format(state_attr('climate.garage',\\\n \\ 'temperature') | float(-99)) }} degrees.\\n{%- elif t == 'alert.garage_temperature_throttle'\\\n \\ %}\\nAttention! The garage temperature is {{ state_attr('climate.garage', 'current_temperature')\\\n \\ }} degrees,\\nand the thermostat is set to {{ state_attr('climate.garage',\\\n \\ 'temperature') }} degrees.\\nThe furnace has been temporarily turned off.\\n\\\n {%- elif t == 'alert.indoor_high_humidity' %}\\nAttention! The indoor humidity\\\n \\ alert is active.\\n{%- set entities = state_attr('binary_sensor.indoor_high_humidity_alert',\\\n \\ 'entity_id') %}\\n{%- if entities != none %}\\n {%- for item in entities %}\\n\\\n The {{ area_name(item) }} humidity is {{ states(item) | int }} percent.\\n {%-\\\n \\ endfor %}\\n{%- endif %}\\n{%- elif t == 'alert.indoor_high_temperature' %}\\n\\\n Attention! The indoor high temperature alert is active.\\n{%- set entities =\\\n \\ state_attr('binary_sensor.indoor_high_temperature_alert', 'entity_id') %}\\n\\\n {%- if entities != none %}\\n {%- for item in entities %}\\nThe {{ area_name(item)\\\n \\ }} temperature is {{ states(item) | int }} degrees.\\n {%- endfor %}\\n{%-\\\n \\ endif %}\\n{%- elif t == 'alert.indoor_low_temperature' %}\\nAttention! The\\\n \\ indoor low temperature alert is active.\\n{%- set entities = state_attr('binary_sensor.indoor_low_temperature_alert',\\\n \\ 'entity_id') %}\\n{%- if entities != none %}\\n {%- for item in entities %}\\n\\\n The {{ area_name(item) }} temperature is {{ states(item) | int }} degrees.\\n\\\n \\ {%- endfor %}\\n{%- endif %}\\n{%- elif t == 'alert.climate_window_door_open'\\\n \\ %}\\n{%- set entities = expand(state_attr('binary_sensor.climate_window_door_open_alert',\\\n \\ 'entity_id'))\\n | map(attribute='name') | list %}\\n{%- set open_names = array_to_clist(entities,\\\n \\ true) | replace(' Open Alert', '') %}\\nAttention! The thermostat has been\\\n \\ turned off because the {{ open_names }}{{ plural_verb(entities | count) }}\\\n \\ open!\\n{%- elif t == 'alert.bathroom_mold_risk' %}\\nAttention! The bathroom\\\n \\ mold risk alert is active.\\n{%- elif t == 'alert.door_lock_jammed' %}\\n{%\\\n \\ from 'lock.jinja' import list_locks %}\\n{%- set entities = states.binary_sensor\\n\\\n \\ | selectattr('entity_id', 'contains', '_door_lock_lock_jammed')\\n \\\n \\ | selectattr('state', 'eq', 'on')\\n | map(attribute='object_id')\\n\\\n \\ | map('regex_replace', find='(.*)_door_lock_lock_jammed',\\n \\\n \\ replace='lock.\\\\\\\\1_door_lock', ignorecase=False)\\n | sort %}\\nAttention!\\\n \\ The {{ list_locks(entities, 'lock') }} jammed!\\n{%- elif t == 'alert.door_lock_failed'\\\n \\ %}\\n{%- from 'lock.jinja' import list_locks %}\\n{%- set entities = states.binary_sensor\\n\\\n \\ | selectattr('entity_id', 'contains', '_door_lock_system_hardware_failure')\\n\\\n \\ | selectattr('state', 'eq', 'on')\\n | map(attribute='object_id')\\n\\\n \\ | map('regex_replace', find='(.*)_door_lock_system_hardware_failure',\\n\\\n \\ replace='lock.\\\\\\\\1_door_lock', ignorecase=False)\\n | sort %}\\n\\\n {%- set plural = 's have' if entities | count > 1 else ' has' -%}\\nAttention!\\\n \\ The {{ list_locks(entities, 'lock failed alert') }} on!\\n{%- elif t == 'alert.door_lock_keypad_disabled'\\\n \\ %}\\n{%- from 'lock.jinja' import list_locks %}\\n{%- set entities = states.binary_sensor\\n\\\n \\ | selectattr('entity_id', 'contains', '_door_lock_keypad_temporary_disabled')\\n\\\n \\ | selectattr('state', 'eq', 'on')\\n | map(attribute='object_id')\\n\\\n \\ | map('regex_replace', find='(.*)_door_lock_keypad_temporary_disabled',\\n\\\n \\ replace='lock.\\\\\\\\1_door_lock', ignorecase=False)\\n | sort %}\\n\\\n Attention! The {{ list_locks(entities, 'lock keypad') }} disabled!\\n{%- elif\\\n \\ t == 'alert.unknown_browsers' %}\\nAttention! There is an unknown browser accessing\\\n \\ Home Assistant!\\n{%- elif t == 'alert.presence_override_jason' %}\\nHey Jay!\\\n \\ Your presence override is on! Did your phone battery die?\\n{%- endif %}\\n\"\n alert: '{{ is_state_attr(trigger.entity_id, ''alert'', true) }}'\n quiet_play: '{{ is_state_attr(trigger.entity_id, ''quiet_play'', true) }}'\n always_play: '{{ is_state_attr(trigger.entity_id, ''always_play'', true) }}'\n save_message: '{{ is_state_attr(trigger.entity_id, ''save_message'', true) }}'\n tts_repeat: '{{ is_state_attr(trigger.entity_id, ''tts_repeat'', true) }}'\n tts_timeout: '{{ state_attr(trigger.entity_id, ''tts_timeout'') | float(0) }}'\n triggers:\n - trigger: state\n entity_id:\n - alert.climate_window_door_open\n - alert.door_lock_failed\n - alert.door_lock_jammed\n - alert.door_lock_keypad_disabled\n - alert.indoor_sump\n - alert.leak_detected\n - alert.open_windows\n - alert.outdoor_sump\n - alert.power_use\n to: 'on'\n - trigger: state\n entity_id:\n - alert.air_quality\n - alert.allergy_risk\n - alert.asthma_risk\n - alert.flu_risk\n - alert.garage_extended_heat\n - alert.garage_heat_door_open\n - alert.garage_high_temperature\n - alert.garage_low_temperature\n - alert.garage_temperature_throttle\n - alert.indoor_camera\n - alert.outdoor_low_temperature\n - alert.outdoor_high_temperature\n - alert.presence_override_jason\n - alert.spa_low_temperature\n - alert.spa_offline\n - alert.precipitation\n - alert.unavailable_leak_sensor\n - alert.unknown_browsers\n - alert.uv_risk\n - alert.wind\n to: 'on'\n for:\n minutes: 5\n - trigger: state\n entity_id:\n - alert.bathroom_mold_risk\n - alert.indoor_high_humidity\n - alert.indoor_high_temperature\n - alert.indoor_low_temperature\n to: 'on'\n for:\n minutes: 15\n actions:\n - if: '{{ tts_repeat and tts_timeout > 0 }}'\n then:\n - repeat:\n sequence:\n - action: script.tts_play\n data:\n message: '{{ message }}'\n provider: HASS\n language: English (USA)\n voice: Tony:excited\n alert: '{{ alert }}'\n quiet_play: '{{ quiet_play }}'\n always_play: '{{ always_play }}'\n save_message: '{{ save_message }}'\n continue_on_error: true\n - wait_template: '{{ not is_state(trigger.entity_id, ''on'') }}'\n timeout:\n minutes: '{{ tts_timeout }}'\n until:\n - condition: template\n value_template: '{{ not is_state(trigger.entity_id, ''on'') }}'\n else:\n - action: script.tts_play\n data:\n message: '{{ message }}'\n provider: HASS\n language: English (USA)\n voice: Tony:excited\n alert: '{{ alert }}'\n quiet_play: '{{ quiet_play }}'\n always_play: '{{ always_play }}'\n save_message: '{{ save_message }}'", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "tod greeting", "room": null, "type": "sensor", "id": { "entity_id": "sensor.tod_greeting", "device_id": null } }, { "name": "aqi risk level", "room": null, "type": "sensor", "id": { "entity_id": "sensor.aqi_risk_level", "device_id": null } }, { "name": "flu risk today", "room": null, "type": "sensor", "id": { "entity_id": "sensor.flu_risk_today", "device_id": null } }, { "name": "asthma risk today", "room": null, "type": "sensor", "id": { "entity_id": "sensor.asthma_risk_today", "device_id": null } }, { "name": "asthma risk tomorrow", "room": null, "type": "sensor", "id": { "entity_id": "sensor.asthma_risk_tomorrow", "device_id": null } }, { "name": "allergy risk today", "room": null, "type": "sensor", "id": { "entity_id": "sensor.allergy_risk_today", "device_id": null } }, { "name": "allergy risk tomorrow", "room": null, "type": "sensor", "id": { "entity_id": "sensor.allergy_risk_tomorrow", "device_id": null } }, { "name": "wind speed", "room": null, "type": "sensor", "id": { "entity_id": "sensor.wind_speed", "device_id": null } }, { "name": "wind gust", "room": null, "type": "sensor", "id": { "entity_id": "sensor.wind_gust", "device_id": null } }, { "name": "uv risk today", "room": null, "type": "sensor", "id": { "entity_id": "sensor.uv_risk_today", "device_id": null } }, { "name": "current uv level", "room": null, "type": "sensor", "id": { "entity_id": "sensor.current_uv_level", "device_id": null } }, { "name": "outdoor apparent temperature", "room": null, "type": "sensor", "id": { "entity_id": "sensor.outdoor_apparent_temperature", "device_id": null } }, { "name": "spa temperature", "room": null, "type": "sensor", "id": { "entity_id": "sensor.spa_temperature", "device_id": null } }, { "name": "leak detected alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.leak_detected_alert", "device_id": null } }, { "name": "unavailable leak sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.unavailable_leak_sensor", "device_id": null } }, { "name": "current power use kw", "room": null, "type": "sensor", "id": { "entity_id": "sensor.current_power_use_kw", "device_id": null } }, { "name": "garage sensor air temperature", "room": "garage", "type": "sensor", "id": { "entity_id": "sensor.garage_sensor_air_temperature", "device_id": null } }, { "name": "garage climate", "room": "garage", "type": "climate", "id": { "entity_id": "climate.garage", "device_id": null } }, { "name": "indoor high humidity alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.indoor_high_humidity_alert", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.indoor_high_temperature_alert", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.indoor_low_temperature_alert", "device_id": null } }, { "name": "climate window door open alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_window_door_open_alert", "device_id": null } }, { "name": "climate window door open alert", "room": null, "type": "alert", "id": { "entity_id": "alert.climate_window_door_open", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "garage high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_high_temperature", "device_id": null } }, { "name": "unknown browsers alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unknown_browsers", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } }, { "name": "Air Quality Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.air_quality", "device_id": null } }, { "name": "Allergy Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.allergy_risk", "device_id": null } }, { "name": "Asthma Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.asthma_risk", "device_id": null } }, { "name": "Bathroom Mold Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.bathroom_mold_risk", "device_id": null } }, { "name": "Door Lock Failed Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.door_lock_failed", "device_id": null } }, { "name": "Door Lock Jammed Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.door_lock_jammed", "device_id": null } }, { "name": "Door Lock Keypad Disabled Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.door_lock_keypad_disabled", "device_id": null } }, { "name": "Flu Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.flu_risk", "device_id": null } }, { "name": "Garage Extended Heat Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_extended_heat", "device_id": null } }, { "name": "Garage Heat Door Open Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_heat_door_open", "device_id": null } }, { "name": "Garage Low Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_low_temperature", "device_id": null } }, { "name": "Garage Temperature Throttle Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_temperature_throttle", "device_id": null } }, { "name": "Indoor Camera Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_camera", "device_id": null } }, { "name": "Indoor High Humidity Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_humidity", "device_id": null } }, { "name": "Indoor Sump Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_sump", "device_id": null } }, { "name": "Leak Detected Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.leak_detected", "device_id": null } }, { "name": "Open Windows Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.open_windows", "device_id": null } }, { "name": "Outdoor High Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.outdoor_high_temperature", "device_id": null } }, { "name": "Outdoor Low Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.outdoor_low_temperature", "device_id": null } }, { "name": "Outdoor Sump Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.outdoor_sump", "device_id": null } }, { "name": "Power Use Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.power_use", "device_id": null } }, { "name": "Precipitation Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.precipitation", "device_id": null } }, { "name": "Presence Override Jason Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.presence_override_jason", "device_id": null } }, { "name": "Spa Low Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.spa_low_temperature", "device_id": null } }, { "name": "Spa Offline Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.spa_offline", "device_id": null } }, { "name": "Unavailable Leak Sensor Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unavailable_leak_sensor", "device_id": null } }, { "name": "UV Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.uv_risk", "device_id": null } }, { "name": "Wind Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.wind", "device_id": null } } ] }, { "id": "alert_persistent_notification", "automation": "- id: alert_persistent_notification\n alias: Alert Persistent Notification\n description: Create persistent notification for alert.\n mode: parallel\n variables:\n alert_id: '{{ states[trigger.entity_id].object_id }}'\n message: \"{%- set t = trigger.entity_id %}\\n {%- if t == 'alert.calendar_empty'\\\n \\ %}\\n {%- set calendars = state_attr('binary_sensor.calendar_empty_alert',\\\n \\ 'entity_id') %}\\n {%- if calendars != none %}\\n {%- for item in calendars\\\n \\ %}\\n {%- if not loop.first %}
{% endif %}\\nThe {{ item }} calendar\\\n \\ is empty or not connected.\\n {%- endfor %}\\n {%- endif -%}\\n{%- endif\\\n \\ -%}\\n\"\n triggers:\n - trigger: state\n entity_id:\n - alert.calendar_empty\n to: 'on'\n from: idle\n actions:\n - action: persistent_notification.create\n data:\n title: '{{ alert_id | replace(''_'', '' '') | title }}'\n message: '{{ message }}'\n notification_id: '{{ alert_id }}'", "config": [ { "name": "calendar empty alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.calendar_empty_alert", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "Calendar Empty Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.calendar_empty", "device_id": null } } ] }, { "id": "pause_alert_notifications", "automation": "- id: pause_alert_notifications\n alias: Pause Alert Notifications\n description: Pause alert.\n mode: parallel\n variables:\n alert: '{{ trigger.event.data[''action''] | replace(''pause_alert_'', '''') }}'\n clear: \"{{ alert in ['door_lock_jammed', 'door_lock_keypad_disabled',\\n 'door_lock_intrusion',\\\n \\ 'door_lock_failed'] }}\\\"\\n\"\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n conditions: '{{ trigger.event.data[''action''] | contains(''pause_alert_'') }}'\n actions:\n - if: '{{ not clear }}'\n then:\n - action: automation.turn_off\n target:\n entity_id: automation.alert_notification_cleared\n data:\n stop_actions: false\n - action: alert.turn_off\n target:\n entity_id: alert.{{ alert }}\n continue_on_error: true\n - if: '{{ not clear }}'\n then:\n - action: automation.turn_on\n target:\n entity_id: automation.alert_notification_cleared", "config": [ { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } }, { "name": "Alert Notification Cleared Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alert_notification_cleared", "device_id": null } } ] }, { "id": "resume_alert_notifications", "automation": "- id: resume_alert_notifications\n alias: Resume Alert Notifications\n description: Resume alert notification.\n mode: parallel\n triggers:\n - trigger: state\n id: offline_integrations\n entity_id: group.offline_integrations\n attribute: entity_id\n to: null\n for: 60\n conditions: '{{ is_state(''alert.'' ~ trigger.id, ''off'') }}'\n actions:\n - action: alert.turn_on\n target:\n entity_id: alert.{{ trigger.id }}", "config": [ { "name": "offline integrations group", "room": null, "type": "group", "id": { "entity_id": "group.offline_integrations", "device_id": null } } ] }, { "id": "alert_notification_cleared", "automation": "- id: alert_notification_cleared\n alias: Alert Notification Cleared\n description: Clear notifications on other devices.\n mode: parallel\n max: 25\n variables:\n device: '{% if trigger.event.data[''device_id''] == ''15794844f58b3dd7'' %} mobile_app_jtablet\n {% elif trigger.event.data[''device_id''] == ''e1953623009e7ae0'' %} mobile_app_jphone\n {% else %} {{ none }} {% endif %}\n\n '\n triggers:\n - trigger: event\n event_type: mobile_app_notification_cleared\n conditions:\n - '{{ device != none }}'\n - '{{ trigger.event.data.tag is defined }}'\n actions:\n - action: automation.turn_off\n target:\n entity_id: automation.alert_notification_cleared\n data:\n stop_actions: false\n - action: notify.{{ device }}\n data:\n message: clear_notification\n data:\n tag: '{{ trigger.event.data[''tag''] }}'\n continue_on_error: true\n - action: automation.turn_on\n target:\n entity_id: automation.alert_notification_cleared", "config": [ { "name": "jason tablet", "room": null, "type": null, "id": { "entity_id": null, "device_id": "mobile_app_jtablet" } }, { "name": "jason phone", "room": null, "type": null, "id": { "entity_id": null, "device_id": "mobile_app_jphone" } }, { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } }, { "name": "Alert Notification Cleared Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alert_notification_cleared", "device_id": null } } ] }, { "id": "clear_alert_notification", "automation": "- id: clear_alert_notification\n alias: Clear Alert Notification\n description: Clear notification when alert is turned off.\n mode: parallel\n max: 25\n variables:\n tag: '{{ states[trigger.entity_id].object_id }}'\n triggers:\n - trigger: state\n id: mobile\n entity_id:\n - alert.alarm_clock_presence\n - alert.alarm_disabled\n - alert.offline_cameras\n - alert.jason_phone_battery_low\n - alert.jason_phone_bluetooth_disconnected\n - alert.jason_phone_bluetooth_device\n - alert.jason_phone_bluetooth_off\n - alert.jason_phone_high_accuracy\n - alert.jason_phone_offline\n - alert.jason_phone_ringer_off\n - alert.jason_phone_wifi_disconnected\n - alert.jason_phone_wifi_off\n - alert.presence_override_jason\n - alert.occupancy_mode\n - alert.google_traffic_connected\n - alert.work_commute_jason\n - alert.home_commute_jason\n - alert.late_for_work_jason\n - alert.door_lock_keypad_disabled\n - alert.door_lock_jammed\n - alert.door_lock_failed\n - alert.garage_extended_heat\n - alert.garage_high_temperature\n - alert.garage_low_temperature\n - alert.garage_temperature_throttle\n - alert.processor_temperature\n - alert.disk_use\n - alert.memory_use\n - alert.processor_use\n - alert.swap_use\n - alert.offline_zwave_device\n - alert.zwave_network\n - alert.pihole_connected\n - alert.pihole_disabled\n - alert.pihole_rpi_update\n - alert.indoor_high_humidity\n - alert.indoor_high_temperature\n - alert.indoor_low_temperature\n - alert.climate_window_door_open\n - alert.bathroom_mold_risk\n - alert.outdoor_low_temperature\n - alert.outdoor_high_temperature\n - alert.precipitation\n - alert.wind\n - alert.air_quality\n - alert.flu_risk\n - alert.asthma_risk\n - alert.allergy_risk\n - alert.uv_risk\n - alert.spa_low_temperature\n - alert.leak_detected\n - alert.unavailable_leak_sensor\n - alert.indoor_sump\n - alert.outdoor_sump\n - alert.power_use\n - alert.kiosk_offline\n - alert.low_battery\n - alert.remote_ui\n - alert.hass_backup\n - alert.available_updates\n - alert.offline_integrations\n - alert.unavailable_entities\n - alert.unavailable_media_players\n - alert.unknown_browsers\n to: 'off'\n - trigger: state\n id: persistent\n entity_id:\n - alert.calendar_empty\n to:\n - 'off'\n - idle\n actions:\n - action: automation.turn_off\n target:\n entity_id: automation.alert_notification_cleared\n data:\n stop_actions: false\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: '{{ tag }}'\n continue_on_error: true\n - if:\n - condition: trigger\n id: persistent\n then:\n - action: persistent_notification.dismiss\n data:\n notification_id: '{{ tag }}'\n continue_on_error: true\n - action: automation.turn_on\n target:\n entity_id: automation.alert_notification_cleared", "config": [ { "name": "climate window door open alert", "room": null, "type": "alert", "id": { "entity_id": "alert.climate_window_door_open", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "garage high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_high_temperature", "device_id": null } }, { "name": "available updates alert", "room": null, "type": "alert", "id": { "entity_id": "alert.available_updates", "device_id": null } }, { "name": "offline integrations alert", "room": null, "type": "alert", "id": { "entity_id": "alert.offline_integrations", "device_id": null } }, { "name": "unavailable entities alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unavailable_entities", "device_id": null } }, { "name": "unknown browsers alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unknown_browsers", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "jason phone wifi off alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_wifi_off", "device_id": null } }, { "name": "jason phone wifi disconnected alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_wifi_disconnected", "device_id": null } }, { "name": "jason phone ringer off alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_ringer_off", "device_id": null } }, { "name": "jason phone offline alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_offline", "device_id": null } }, { "name": "jason phone bluetooth off alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_bluetooth_off", "device_id": null } }, { "name": "jason phone bluetooth disconnected alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_bluetooth_disconnected", "device_id": null } }, { "name": "jason phone bluetooth device alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_bluetooth_device", "device_id": null } }, { "name": "jason phone battery low alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_battery_low", "device_id": null } }, { "name": "jason phone high accuracy alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_high_accuracy", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } }, { "name": "occupancy mode alert entity", "room": null, "type": "alert", "id": { "entity_id": "alert.occupancy_mode", "device_id": null } }, { "name": "work commute jason alert", "room": null, "type": "alert", "id": { "entity_id": "alert.work_commute_jason", "device_id": null } }, { "name": "late for work jason alert", "room": null, "type": "alert", "id": { "entity_id": "alert.late_for_work_jason", "device_id": null } }, { "name": "Air Quality Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.air_quality", "device_id": null } }, { "name": "Alarm Clock Presence Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.alarm_clock_presence", "device_id": null } }, { "name": "Alarm Disabled Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.alarm_disabled", "device_id": null } }, { "name": "Allergy Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.allergy_risk", "device_id": null } }, { "name": "Asthma Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.asthma_risk", "device_id": null } }, { "name": "Bathroom Mold Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.bathroom_mold_risk", "device_id": null } }, { "name": "Calendar Empty Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.calendar_empty", "device_id": null } }, { "name": "Disk Use Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.disk_use", "device_id": null } }, { "name": "Door Lock Failed Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.door_lock_failed", "device_id": null } }, { "name": "Door Lock Jammed Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.door_lock_jammed", "device_id": null } }, { "name": "Door Lock Keypad Disabled Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.door_lock_keypad_disabled", "device_id": null } }, { "name": "Flu Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.flu_risk", "device_id": null } }, { "name": "Garage Extended Heat Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_extended_heat", "device_id": null } }, { "name": "Garage Low Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_low_temperature", "device_id": null } }, { "name": "Garage Temperature Throttle Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_temperature_throttle", "device_id": null } }, { "name": "Google Traffic Connected Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.google_traffic_connected", "device_id": null } }, { "name": "Hass Backup Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.hass_backup", "device_id": null } }, { "name": "Home Commute Jason Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.home_commute_jason", "device_id": null } }, { "name": "Indoor High Humidity Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_humidity", "device_id": null } }, { "name": "Indoor Sump Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_sump", "device_id": null } }, { "name": "Kiosk Offline Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.kiosk_offline", "device_id": null } }, { "name": "Leak Detected Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.leak_detected", "device_id": null } }, { "name": "Low Battery Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.low_battery", "device_id": null } }, { "name": "Memory Use Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.memory_use", "device_id": null } }, { "name": "Offline Cameras Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.offline_cameras", "device_id": null } }, { "name": "Offline Zwave Device Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.offline_zwave_device", "device_id": null } }, { "name": "Outdoor High Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.outdoor_high_temperature", "device_id": null } }, { "name": "Outdoor Low Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.outdoor_low_temperature", "device_id": null } }, { "name": "Outdoor Sump Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.outdoor_sump", "device_id": null } }, { "name": "Pihole Connected Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.pihole_connected", "device_id": null } }, { "name": "Pihole Disabled Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.pihole_disabled", "device_id": null } }, { "name": "Pihole Rpi Update Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.pihole_rpi_update", "device_id": null } }, { "name": "Power Use Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.power_use", "device_id": null } }, { "name": "Precipitation Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.precipitation", "device_id": null } }, { "name": "Presence Override Jason Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.presence_override_jason", "device_id": null } }, { "name": "Processor Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.processor_temperature", "device_id": null } }, { "name": "Processor Use Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.processor_use", "device_id": null } }, { "name": "Remote UI Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.remote_ui", "device_id": null } }, { "name": "Spa Low Temperature Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.spa_low_temperature", "device_id": null } }, { "name": "Swap Use Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.swap_use", "device_id": null } }, { "name": "Unavailable Leak Sensor Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unavailable_leak_sensor", "device_id": null } }, { "name": "Unavailable Media Players Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unavailable_media_players", "device_id": null } }, { "name": "UV Risk Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.uv_risk", "device_id": null } }, { "name": "Wind Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.wind", "device_id": null } }, { "name": "Zwave Network Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.zwave_network", "device_id": null } }, { "name": "Alert Notification Cleared Automation", "room": null, "type": "automation", "id": { "entity_id": "automation.alert_notification_cleared", "device_id": null } } ] }, { "id": "arm_alarm", "automation": "- id: arm_alarm\n alias: Arm Alarm\n description: Arm house alarm.\n mode: restart\n triggers:\n - trigger: state\n id: disarmed\n entity_id: alarm_control_panel.house\n to: disarmed\n for: 1\n - trigger: state\n id: away\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for: 1\n - trigger: state\n id: night\n entity_id: input_select.occupancy_mode\n to:\n - Night\n for: 1\n - trigger: state\n id: keypad\n entity_id:\n - sensor.back_door_lock_status\n - sensor.front_door_lock_status\n - sensor.side_door_lock_status\n to: Locked (Keypad)\n not_from:\n - unknown\n - unavailable\n - trigger: state\n id: lock_code\n entity_id:\n - sensor.back_door_lock_status\n - sensor.front_door_lock_status\n - sensor.side_door_lock_status\n - sensor.garage_side_door_lock_status\n to:\n - Locked (Jason)\n - Locked (Guest)\n not_from:\n - unknown\n - unavailable\n - trigger: state\n id: manual\n entity_id:\n - sensor.back_door_lock_status\n - sensor.front_door_lock_status\n - sensor.side_door_lock_status\n - sensor.garage_side_door_lock_status\n to: Locked (Manual)\n not_from:\n - unknown\n - unavailable\n - trigger: event\n id: action\n event_type: mobile_app_notification_action\n event_data:\n action: arm_alarm_home\n - trigger: event\n id: action\n event_type: mobile_app_notification_action\n event_data:\n action: arm_alarm_away\n - trigger: event\n id: action\n event_type: mobile_app_notification_action\n event_data:\n action: arm_alarm_night\n conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_enabled\n - input_boolean.alarm_auto_arming\n state: 'on'\n actions:\n - choose:\n - conditions:\n - condition: trigger\n id: action\n sequence:\n - action: script.arm_alarm\n data:\n mode: '{{ trigger.event.data[''action''] | replace(''arm_alarm_'', '''')\n }}'\n force: true\n skip_delay: true\n - conditions:\n - condition: trigger\n id: disarmed\n sequence:\n - choose:\n - conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'off'\n sequence:\n - wait_template: '{{ is_state(''binary_sensor.someone_home'', ''on'') }}'\n timeout:\n minutes: 10\n - if:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'off'\n then:\n - action: script.arm_alarm\n data:\n mode: away\n skip_delay: true\n - conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: template\n alias: Someone just arrived home\n value_template: '{{ is_state_attr(''binary_sensor.someone_home'', ''just_arrived'',\n true) }}'\n sequence:\n - delay:\n minutes: 10\n - wait_template: '{% from ''alarm.jinja'' import arm_alarm_check %} {{ arm_alarm_check(''night'')\n }}\n\n '\n timeout:\n minutes: 5\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - action: script.arm_alarm\n data:\n mode: night\n - conditions:\n - condition: trigger\n id: night\n sequence:\n - wait_template: '{% from ''alarm.jinja'' import arm_alarm_check %} {{ arm_alarm_check(''night'')\n }}\n\n '\n timeout:\n minutes: 5\n - if:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n then:\n - action: script.arm_alarm\n data:\n mode: night\n - conditions:\n - condition: trigger\n id: away\n sequence:\n - wait_template: '{% from ''alarm.jinja'' import arm_alarm_check %} {{ arm_alarm_check(''away'')\n }}\n\n '\n timeout:\n minutes: 5\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Away\n then:\n - action: script.arm_alarm\n data:\n mode: away\n - conditions:\n - condition: trigger\n id: lock_code\n sequence:\n - delay: 60\n - if: '{{ states(trigger.entity_id) == trigger.to_state.state }}'\n then:\n - wait_template: '{% from ''alarm.jinja'' import arm_alarm_check %} {{ arm_alarm_check(''away'')\n }}\n\n '\n timeout:\n minutes: 5\n - action: script.arm_alarm\n data:\n mode: away\n - conditions:\n - condition: trigger\n id: manual\n sequence:\n - wait_template: '{% from ''alarm.jinja'' import arm_alarm_check %} {{ arm_alarm_check(''away'')\n }}\n\n '\n timeout:\n minutes: 5\n - if:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n then:\n - action: script.arm_alarm\n data:\n mode: '{{ ''night'' if is_state(''input_select.occupancy_mode'', ''Night'')\n else ''home'' }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm auto arming", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_auto_arming", "device_id": null } }, { "name": "arm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.arm_alarm", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "back door lock status", "room": "back", "type": "sensor", "id": { "entity_id": "sensor.back_door_lock_status", "device_id": null } }, { "name": "front door lock status", "room": "front", "type": "sensor", "id": { "entity_id": "sensor.front_door_lock_status", "device_id": null } }, { "name": "side door lock status", "room": "side", "type": "sensor", "id": { "entity_id": "sensor.side_door_lock_status", "device_id": null } }, { "name": "garage side door lock status", "room": "garage", "type": "sensor", "id": { "entity_id": "sensor.garage_side_door_lock_status", "device_id": null } } ] }, { "id": "arrive_home_lighting", "automation": "- id: arrive_home_lighting\n alias: Arrive Home Lighting\n description: Turn on arrive home lighting.\n mode: single\n max_exceeded: silent\n variables:\n first_home: '{{ state_attr(''binary_sensor.someone_home'', ''home'') | count <\n 2 }}'\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.jason_home\n - binary_sensor.guest_home\n to: 'on'\n from: 'off'\n - trigger: state\n entity_id: binary_sensor.jason_almost_home\n to: 'on'\n for: 1\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.daytime_illuminance\n - binary_sensor.nighttime_illuminance\n match: any\n state: 'on'\n actions:\n - action: script.turn_light_on\n data:\n entity_id: light.side_entrance_light\n activate_timer: true\n override: true\n continue_on_error: true\n - if: '{{ not first_home }}'\n then:\n - action: scene.create\n data:\n scene_id: arrive_home_lights_restore\n snapshot_entities: &id001\n - light.kitchen_potlights\n - light.dining_room_potlights\n - light.hallway_potlights\n - action: script.light_scene_on\n data:\n scene: arrive_home\n continue_on_error: true\n - alias: Wait for just arrived to turn off\n wait_for_trigger:\n - trigger: state\n entity_id: binary_sensor.someone_home\n attribute: just_arrived\n to: false\n - if: '{{ first_home }}'\n then:\n - if:\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'off'\n then:\n - action: script.turn_light_off\n data:\n entity_id: *id001\n reset: false\n else:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n match: any\n state:\n - Home\n - Guest\n then:\n - action: script.light_scene_on\n data:\n scene: arrive_home_lights_restore", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "kitchen potlights", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_potlights", "device_id": null } }, { "name": "dining room potlights", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_potlights", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "hallway potlights", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway_potlights", "device_id": null } }, { "name": "turn light off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_off", "device_id": null } }, { "name": "guest home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.guest_home", "device_id": null } }, { "name": "jason almost home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_almost_home", "device_id": null } }, { "name": "daytime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.daytime_illuminance", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "scene create service", "room": null, "type": "service", "id": { "entity_id": "scene.create", "device_id": null } } ] }, { "id": "arrive_home_notification", "automation": "- id: arrive_home_notification\n alias: Arrive Home Notification\n description: Send notification when someone almost home or home.\n mode: parallel\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: state\n id: almost\n entity_id: binary_sensor.jason_almost_home\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.occupancy_notifications\n state: 'on'\n actions:\n - action: notify.{{ person }}\n data:\n message: Arriving Home\n data:\n tag: '{{ person }}_arriving_home'\n persistent: true\n sticky: \"{{ true if is_state('binary_sensor.' ~ person ~ '_home', 'off')\\n\\\n \\ or states.binary_sensor[person ~ '_home'].last_changed\\n > now()\\\n \\ - timedelta(minutes=5) else false }}\\n\"\n timeout: 900\n chronometer: true\n when: '{{ (now().timestamp() + 600) | int }}'\n notification_icon: mdi:home-account\n icon_url: secret ARRIVE_HOME_ICON\n clickAction: /ui-mobile/alarm\n actions:\n - title: Disarm\n action: arriving_home_{{ person }}\n - title: Garage\n action: arriving_home_garage_{{ person }}\n - wait_template: \"{{ is_state('binary_sensor.' ~ person ~ '_home', 'on')\\n and\\\n \\ is_state('alarm_control_panel.house', 'disarmed')\\n and is_state('lock.side_door_lock',\\\n \\ 'unlocked') }}\\n\"\n timeout: 600\n - action: notify.{{ person }}\n data:\n message: clear_notification\n data:\n tag: '{{ person }}_arriving_home'", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "side door lock", "room": "side", "type": "lock", "id": { "entity_id": "lock.side_door_lock", "device_id": null } }, { "name": "jason almost home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_almost_home", "device_id": null } }, { "name": "occupancy notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_notifications", "device_id": null } } ] }, { "id": "turn_bathroom_shower_light_off", "automation": "- id: turn_bathroom_shower_light_off\n alias: Turn Bathroom Shower Light Off\n description: Turn off light.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: event\n id: timer\n event_type: timer.finished\n event_data:\n entity_id: timer.bathroom_shower_light\n conditions:\n - condition: state\n entity_id: light.bathroom_shower_light\n state: 'on'\n - condition: state\n entity_id: timer.bathroom_shower_light\n state: idle\n - condition: state\n entity_id:\n - input_boolean.alarm_triggered\n - switch.shower_scene\n state: 'off'\n actions:\n - action: light.turn_off\n target:\n entity_id: light.bathroom_shower_light", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "bathroom shower light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_shower_light", "device_id": null } }, { "name": "bathroom shower light timer", "room": "bathroom", "type": "timer", "id": { "entity_id": "timer.bathroom_shower_light", "device_id": null } }, { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } } ] }, { "id": "turn_bathroom_vanity_light_on", "automation": "- id: turn_bathroom_vanity_light_on\n alias: Turn Bathroom Vanity Light On\n description: Turn on light.\n mode: restart\n triggers:\n - trigger: state\n id: motion\n entity_id: binary_sensor.bathroom_sensor_motion\n to: 'on'\n from: 'off'\n conditions:\n - or:\n - condition: state\n entity_id: light.bathroom_vanity_light_rgb\n state: 'off'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: state\n entity_id: binary_sensor.bathroom_illuminance\n match: any\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: switch.adaptive_lighting_bathroom_lights\n state: 'on'\n - condition: state\n entity_id: switch.shower_scene\n state: 'off'\n then:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n then:\n - action: script.turn_light_on\n data:\n entity_id: light.bathroom_vanity_light_rgb\n brightness: 70\n activate_timer: true\n else:\n - action: script.turn_light_on\n data:\n entity_id: light.bathroom_vanity_light_rgb\n else:\n - action: script.turn_light_on\n data:\n entity_id: light.bathroom_vanity_light_rgb\n profile: '{% if is_state(''switch.shower_scene'', ''on'') %} default_max {%\n elif is_state(''input_select.occupancy_mode'', ''Night'') %} night {% else\n %} default {% endif %}\n\n '", "config": [ { "name": "bathroom sensor motion", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_sensor_motion", "device_id": null } }, { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "adaptive lighting", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "adaptive lighting bathroom lights", "room": "bathroom", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_bathroom_lights", "device_id": null } }, { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "bathroom vanity light rgb", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light_rgb", "device_id": null } }, { "name": "bathroom illuminance", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_illuminance", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "bathroom vanity light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light", "device_id": null } } ] }, { "id": "turn_bathroom_vanity_light_off", "automation": "- id: turn_bathroom_vanity_light_off\n alias: Turn Bathroom Vanity Light Off\n description: Turn off light.\n mode: restart\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n id: motion\n entity_id: binary_sensor.bathroom_sensor_motion\n to: 'off'\n from: 'on'\n for:\n minutes: 5\n - trigger: state\n id: night\n entity_id: input_select.occupancy_mode\n from: Night\n for: 1\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.bathroom_vanity_light\n conditions:\n - condition: state\n entity_id: light.bathroom_vanity_light_rgb\n state: 'on'\n - condition: state\n entity_id:\n - input_boolean.alarm_triggered\n - switch.shower_scene\n state: 'off'\n - condition: state\n entity_id: binary_sensor.bathroom_sensor_motion\n state: 'off'\n for:\n minutes: 5\n - condition: state\n entity_id: timer.bathroom_vanity_light\n state: idle\n actions:\n - action: script.turn_light_off\n data:\n entity_id: light.bathroom_vanity_light_rgb", "config": [ { "name": "bathroom sensor motion", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_sensor_motion", "device_id": null } }, { "name": "bathroom vanity light timer", "room": "bathroom", "type": "timer", "id": { "entity_id": "timer.bathroom_vanity_light", "device_id": null } }, { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "turn light off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_off", "device_id": null } }, { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "bathroom vanity light rgb", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light_rgb", "device_id": null } }, { "name": "bathroom vanity light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light", "device_id": null } } ] }, { "id": "bathroom_vanity_night_light", "automation": "- id: bathroom_vanity_night_light\n alias: Bathroom Vanity Night Light\n description: Turn bathroom vanity night lighting on.\n mode: restart\n triggers:\n - trigger: state\n entity_id: light.bathroom_vanity_light_rgb\n to: 'off'\n for: 5\n - trigger: state\n entity_id: input_select.occupancy_mode\n to: Night\n for: 15\n conditions:\n - condition: state\n entity_id: binary_sensor.bathroom_illuminance\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: state\n entity_id:\n - binary_sensor.bathroom_sensor_motion\n - input_boolean.alarm_triggered\n - switch.shower_scene\n state: 'off'\n actions:\n - if:\n - condition: state\n entity_id: switch.adaptive_lighting_bathroom_lights\n state: 'on'\n then:\n - action: script.turn_light_on\n data:\n entity_id: light.bathroom_vanity_light_rgb\n activate_timer: false\n else:\n - action: script.turn_light_on\n data:\n entity_id: light.bathroom_vanity_light_rgb\n profile: night_dim\n activate_timer: false", "config": [ { "name": "bathroom sensor motion", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_sensor_motion", "device_id": null } }, { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "adaptive lighting", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "adaptive lighting bathroom lights", "room": "bathroom", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_bathroom_lights", "device_id": null } }, { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "bathroom vanity light rgb", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light_rgb", "device_id": null } }, { "name": "bathroom illuminance", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_illuminance", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "bathroom vanity light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light", "device_id": null } } ] }, { "id": "udpate_bathroom_vanity_light_timer", "automation": "- id: udpate_bathroom_vanity_light_timer\n alias: Update Bathroom Vanity Light Timer\n description: Reset bathroom vanity timer to match shower light timer.\n mode: restart\n triggers:\n - trigger: state\n entity_id: timer.bathroom_shower_light\n to: active\n - trigger: state\n entity_id: timer.bathroom_shower_light\n to: idle\n conditions:\n - condition: state\n entity_id: light.bathroom_vanity_light_rgb\n state: 'on'\n actions:\n - action: timer.start\n target:\n entity_id: timer.bathroom_vanity_light\n data:\n duration: \"{{ iif(is_state('timer.bathroom_shower_light', 'active'),\\n state_attr('timer.bathroom_shower_light',\\\n \\ 'duration'),'00:10:00') }}\\n\"", "config": [ { "name": "bathroom vanity light timer", "room": "bathroom", "type": "timer", "id": { "entity_id": "timer.bathroom_vanity_light", "device_id": null } }, { "name": "bathroom shower light timer", "room": "bathroom", "type": "timer", "id": { "entity_id": "timer.bathroom_shower_light", "device_id": null } }, { "name": "bathroom vanity light rgb", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light_rgb", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } }, { "name": "bathroom vanity light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light", "device_id": null } } ] }, { "id": "turn_bathroom_vent_fan_on", "automation": "- id: turn_bathroom_vent_fan_on\n alias: Turn Bathroom Vent Fan On\n description: Turn on bathroom vent fan.\n mode: restart\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.bathroom_humidity_fan\n - binary_sensor.bathroom_mold_fan\n - binary_sensor.bathroom_temperature_fan\n - alert.indoor_high_temperature\n - switch.shower_scene\n to: 'on'\n from: 'off'\n actions:\n - action: script.turn_fan_on\n data:\n entity_id: fan.bathroom_fan\n speed: \"{% if is_state('binary_sensor.bathroom_humidity_fan', 'on')\\n or\\\n \\ is_state('switch.shower_scene', 'on') %} 100\\n{% elif is_state('binary_sensor.bathroom_mold_fan',\\\n \\ 'on') %} 66 {% else %} 33 {% endif %}\\n\"", "config": [ { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "bathroom humidity fan", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_humidity_fan", "device_id": null } }, { "name": "bathroom mold fan", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_mold_fan", "device_id": null } }, { "name": "bathroom temperature fan", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_temperature_fan", "device_id": null } }, { "name": "bathroom fan", "room": "bathroom", "type": "fan", "id": { "entity_id": "fan.bathroom_fan", "device_id": null } }, { "name": "turn fan on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_on", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } } ] }, { "id": "turn_bathroom_vent_fan_off", "automation": "- id: turn_bathroom_vent_fan_off\n alias: Turn Bathroom Vent Fan Off\n description: Turn vent fan off when alerts turn off.\n mode: restart\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.bathroom_humidity_fan\n - binary_sensor.bathroom_mold_fan\n - binary_sensor.bathroom_temperature_fan\n - switch.shower_scene\n to: 'off'\n from: 'on'\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.bathroom_fan\n - trigger: state\n id: alert\n entity_id: alert.indoor_high_temperature\n to: idle\n conditions:\n - condition: state\n entity_id: fan.bathroom_fan\n state: 'on'\n - condition: state\n entity_id:\n - binary_sensor.bathroom_humidity_fan\n - binary_sensor.bathroom_mold_fan\n - binary_sensor.bathroom_temperature_fan\n - switch.shower_scene\n state: 'off'\n - condition: state\n entity_id: alert.indoor_high_temperature\n state: idle\n actions:\n - action: script.turn_fan_off\n data:\n entity_id: fan.bathroom_fan\n override: false", "config": [ { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "bathroom humidity fan", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_humidity_fan", "device_id": null } }, { "name": "bathroom mold fan", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_mold_fan", "device_id": null } }, { "name": "bathroom temperature fan", "room": "bathroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bathroom_temperature_fan", "device_id": null } }, { "name": "bathroom fan", "room": "bathroom", "type": "fan", "id": { "entity_id": "fan.bathroom_fan", "device_id": null } }, { "name": "bathroom fan timer", "room": "bathroom", "type": "timer", "id": { "entity_id": "timer.bathroom_fan", "device_id": null } }, { "name": "turn fan off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_off", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } } ] }, { "id": "battery_replaced", "automation": "- id: battery_replaced\n alias: Battery Replaced\n description: Reset battery replaced value when battery level has increased by threshold.\n mode: queued\n triggers:\n - trigger: event\n event_type: battery_notes_battery_increased\n actions:\n - action: battery_notes.set_battery_replaced\n data:\n device_id: '{{ trigger.event.data.device_id }}'\n source_entity_id: '{{ trigger.event.data.source_entity_id }}'\n - action: persistent_notification.create\n data:\n title: '{{ trigger.event.data.device_name }} Battery Increased'\n message: The device has increased its battery level and was marked replaced.", "config": [ { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } } ] }, { "id": "battery_reporting_check", "automation": "- id: battery_reporting_check\n alias: Battery Reporting Check\n description: Check if batteries have been reporting\n mode: single\n triggers:\n - platform: time\n at: 09:00:00\n actions:\n - action: battery_notes.check_battery_last_reported\n data:\n days_last_reported: 2", "config": [] }, { "id": "battery_not_reporting", "automation": "- id: battery_not_reporting\n alias: Battery Not Reporting\n description: Battery not reporting, send notification.\n mode: queued\n max: 30\n triggers:\n - trigger: event\n event_type: battery_notes_battery_not_reported\n actions:\n - action: persistent_notification.create\n data:\n title: '{{ trigger.event.data.device_name }} Battery Not Reported\n\n '\n message: 'The device has not reported its battery level for {{ trigger.event.data.battery_last_reported_days\n }} days {{ ''\\n'' -}} Its last reported level was {{ trigger.event.data.battery_last_reported_level\n }}% {{ ''\\n'' -}} You need {{ trigger.event.data.battery_quantity }}× {{ trigger.event.data.battery_type\n }}\n\n '", "config": [ { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } } ] }, { "id": "turn_bedroom_ceiling_fan_on", "automation": "- id: turn_bedroom_ceiling_fan_on\n alias: Turn Bedroom Ceiling Fan On\n description: Turn on bedroom ceiling fan.\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.climate_fan\n - binary_sensor.schedule_fan\n - binary_sensor.bedroom_temperature_fan\n to: 'on'\n from: 'off'\n - trigger: state\n id: alert\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: 'on'\n conditions:\n - condition: state\n entity_id: fan.bedroom_fan\n state: 'off'\n - condition: state\n alias: Not waketime or bedtime\n entity_id:\n - binary_sensor.bedtime_active\n - binary_sensor.waketime_active\n state: 'off'\n - not:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n actions:\n - action: script.turn_fan_on\n data:\n entity_id: fan.bedroom_fan\n speed: 50\n override: '{{ trigger.id == ''alert'' }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "turn fan on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_on", "device_id": null } }, { "name": "climate fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_fan", "device_id": null } }, { "name": "schedule fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.schedule_fan", "device_id": null } }, { "name": "bedroom temperature fan", "room": "bedroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bedroom_temperature_fan", "device_id": null } }, { "name": "bedroom fan", "room": "bedroom", "type": "fan", "id": { "entity_id": "fan.bedroom_fan", "device_id": null } }, { "name": "bedtime active", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bedtime_active", "device_id": null } }, { "name": "waketime active", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.waketime_active", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } } ] }, { "id": "turn_bedroom_ceiling_fan_off", "automation": "- id: turn_bedroom_ceiling_fan_off\n alias: Turn Bedroom Ceiling Fan Off\n description: Turn off bedroom ceiling fan.\n mode: queued\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for:\n minutes: 1\n - trigger: state\n entity_id:\n - binary_sensor.climate_fan\n - binary_sensor.schedule_fan\n - binary_sensor.bedroom_temperature_fan\n to: 'off'\n from: 'on'\n - trigger: state\n id: alert\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: idle\n conditions:\n - condition: state\n entity_id: fan.bedroom_fan\n state: 'on'\n - condition: state\n entity_id:\n - binary_sensor.schedule_fan\n - binary_sensor.bedroom_temperature_fan\n state: 'off'\n - condition: state\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n state: idle\n actions:\n - action: script.turn_fan_off\n data:\n entity_id: fan.bedroom_fan\n override: '{{ trigger.id == ''occupancy'' }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "turn fan off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_off", "device_id": null } }, { "name": "climate fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_fan", "device_id": null } }, { "name": "schedule fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.schedule_fan", "device_id": null } }, { "name": "bedroom temperature fan", "room": "bedroom", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bedroom_temperature_fan", "device_id": null } }, { "name": "bedroom fan", "room": "bedroom", "type": "fan", "id": { "entity_id": "fan.bedroom_fan", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } } ] }, { "id": "wake_bedroom_tv_on", "automation": "- id: wake_bedroom_tv_on\n alias: Wake Bedroom TV On\n description: Wake On Lan for WebOS TV.\n triggers:\n - trigger: webostv.turn_on\n entity_id: media_player.bedroom_tv\n actions:\n - action: wake_on_lan.send_magic_packet\n data:\n mac: secret BEDROOM_TV_MAC", "config": [ { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "webostv turn on trigger", "room": null, "type": "trigger", "id": { "entity_id": "webostv.turn_on", "device_id": null } }, { "name": "wake on lan send magic packet service", "room": null, "type": "service", "id": { "entity_id": "wake_on_lan.send_magic_packet", "device_id": null } } ] }, { "id": "turn_bedroom_tv_on", "automation": "- id: turn_bedroom_tv_on\n alias: Turn Bedroom TV On\n description: Turn TV on, select chromecast input.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: media_player.bedroom_chromecast\n to:\n - playing\n - buffering\n - paused\n from:\n - 'off'\n - idle\n - unknown\n - unavailable\n - trigger: state\n entity_id: media_player.bedroom_chromecast\n to: playing\n from: paused\n conditions:\n - or:\n - condition: state\n entity_id: media_player.bedroom_tv\n state: 'off'\n - not:\n - condition: state\n entity_id: media_player.bedroom_tv\n attribute: source\n state: HDMI 2\n actions:\n - if:\n - condition: state\n entity_id: media_player.bedroom_tv\n state: 'off'\n then:\n - action: media_player.turn_on\n target:\n entity_id: media_player.bedroom_tv\n - wait_template: '{{ is_state(''media_player.bedroom_tv'', ''on'') }}'\n timeout: 30\n continue_on_timeout: false\n - wait_template: '{{ state_attr(''media_player.bedroom_tv'', ''source'') = none\n }}'\n timeout: 30\n continue_on_timeout: false\n - if:\n - not:\n - condition: state\n entity_id: media_player.bedroom_tv\n attribute: source\n state: HDMI 2\n then:\n - action: media_player.select_source\n target:\n entity_id: media_player.bedroom_tv\n data:\n source: HDMI 2", "config": [ { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "bedroom chromecast", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_chromecast", "device_id": null } }, { "name": "media player turn on service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_on", "device_id": null } }, { "name": "media player select source service", "room": null, "type": "service", "id": { "entity_id": "media_player.select_source", "device_id": null } } ] }, { "id": "turn_bedroom_tv_off", "automation": "- id: turn_bedroom_tv_off\n alias: Turn Bedroom TV Off\n description: Turn off TV if still on Chromecast input.\n triggers:\n - trigger: state\n entity_id: media_player.bedroom_chromecast\n to: 'off'\n conditions:\n - condition: state\n entity_id: media_player.bedroom_tv\n attribute: source\n state: HDMI 2\n actions:\n - action: media_player.turn_off\n target:\n entity_id: media_player.bedroom_tv", "config": [ { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "bedroom chromecast", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_chromecast", "device_id": null } }, { "name": "media player turn off service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_off", "device_id": null } } ] }, { "id": "turn_bedroom_chromecast_on", "automation": "- id: turn_bedroom_chromecast_on\n alias: Turn Bedroom Chromecast On\n description: Turn on chromecast if TV source is turned to HDMI 2.\n triggers:\n - platform: state\n entity_id: media_player.bedroom_tv\n attribute: source\n to: HDMI 2\n for: 5\n conditions:\n - condition: state\n entity_id: media_player.bedroom_chromecast\n state:\n - 'off'\n - unknown\n - unavailable\n actions:\n - action: media_player.turn_on\n target:\n entity_id: media_player.bedroom_chromecast", "config": [ { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "bedroom chromecast", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_chromecast", "device_id": null } }, { "name": "media player turn on service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_on", "device_id": null } } ] }, { "id": "turn_bedroom_chromecast_off", "automation": "- id: turn_bedroom_chromecast_off\n alias: Turn Bedroom Chromecast Off\n description: Turn off chromecast if TV is turned off.\n triggers:\n - trigger: state\n entity_id: media_player.bedroom_tv\n to: 'off'\n conditions:\n - condition: not\n conditions:\n - condition: state\n entity_id: media_player.bedroom_chromecast\n state:\n - 'off'\n - unknown\n - unavailable\n actions:\n - action: media_player.turn_off\n target:\n entity_id: media_player.bedroom_chromecast", "config": [ { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "bedroom chromecast", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_chromecast", "device_id": null } }, { "name": "media player turn off service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_off", "device_id": null } } ] }, { "id": "bedtime", "automation": "- id: bedtime\n alias: Bedtime\n description: Run bed time routine.\n triggers:\n - trigger: time\n id: bedtime\n at: sensor.bedtime_warning\n conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n state:\n - Home\n - Guest\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: or\n conditions:\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.work_tomorrow\n state: 'on'\n - condition: state\n entity_id: input_boolean.workday_night\n state: 'on'\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.work_tomorrow\n state: 'off'\n - condition: state\n entity_id: input_boolean.weekend_night\n state: 'on'\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.owner_home\n state: 'off'\n - condition: state\n entity_id: input_boolean.guest_night\n state: 'on'\n actions:\n - action: script.bedtime\n data:\n warning: true", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "work tomorrow", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_tomorrow", "device_id": null } }, { "name": "workday night", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.workday_night", "device_id": null } }, { "name": "weekend night", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.weekend_night", "device_id": null } }, { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "guest night", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.guest_night", "device_id": null } }, { "name": "bedtime script", "room": null, "type": "script", "id": { "entity_id": "script.bedtime", "device_id": null } }, { "name": "bedtime warning", "room": null, "type": "sensor", "id": { "entity_id": "sensor.bedtime_warning", "device_id": null } } ] }, { "id": "bedtime_delay_turned_on", "automation": "- id: bedtime_delay_turned_on\n alias: Bedtime Delay Turned On\n description: Bedtime delay turned on.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_boolean.bedtime_delayed\n to: 'on'\n actions:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state:\n - Night\n - Away\n - Vacation\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.bedtime_delayed\n - action: browser_mod.notification\n data:\n duration: 10000\n message: 'Bedtime delay has been turned off.\n\n The house is in {{ states(''input_select.occupancy_mode'') }} mode.\n\n '\n - stop: Occupancy mode is {{ states('input_select.occupancy_mode') }}.\n else:\n - action: script.delay_bedtime", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "bedtime delayed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.bedtime_delayed", "device_id": null } }, { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } } ] }, { "id": "bedtime_delay_changed", "automation": "- id: bedtime_delay_changed\n alias: Bedtime Delay Changed\n description: Restart bedtime delay if delay changed.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_number.bedtime_delay\n to: null\n for: 5\n conditions:\n - condition: state\n entity_id: timer.bedtime_delay\n state: active\n actions:\n - action: timer.start\n target:\n entity_id: timer.bedtime_delay\n data:\n duration:\n minutes: '{{ states(''input_number.bedtime_delay'') | int }}'", "config": [ { "name": "bedtime delay timer", "room": null, "type": "timer", "id": { "entity_id": "timer.bedtime_delay", "device_id": null } }, { "name": "bedtime delay input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.bedtime_delay", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } } ] }, { "id": "bedtime_delay_turned_off", "automation": "- id: bedtime_delay_turned_off\n alias: Bedtime Delay Turned Off\n description: Run bedtime script.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.bedtime_delayed\n to: 'off'\n actions:\n - choose:\n - conditions:\n - condition: state\n entity_id: binary_sensor.scene_active\n state: 'on'\n sequence:\n - action: automation.turn_off\n target:\n entity_id: automation.bedtime_delay_turned_on\n data:\n stop_actions: false\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.bedtime_delayed\n - action: browser_mod.notification\n data:\n duration: 10000\n message: Bedtime delay cannot be turned off when a scene is active.\n - action: automation.turn_on\n target:\n entity_id: automation.bedtime_delay_turned_on\n - conditions:\n - condition: state\n entity_id: binary_sensor.bedtime_active\n state: 'on'\n - condition: state\n entity_id: script.bedtime\n state: 'off'\n sequence:\n - action: timer.cancel\n target:\n entity_id: timer.bedtime_delay\n - action: script.bedtime\n data:\n warning: false\n default:\n - action: timer.cancel\n target:\n entity_id: timer.bedtime_delay", "config": [ { "name": "bedtime active", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.bedtime_active", "device_id": null } }, { "name": "bedtime script", "room": null, "type": "script", "id": { "entity_id": "script.bedtime", "device_id": null } }, { "name": "bedtime delayed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.bedtime_delayed", "device_id": null } }, { "name": "bedtime delay timer", "room": null, "type": "timer", "id": { "entity_id": "timer.bedtime_delay", "device_id": null } }, { "name": "scene active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.scene_active", "device_id": null } }, { "name": "bedtime delay turned on automation", "room": null, "type": "automation", "id": { "entity_id": "automation.bedtime_delay_turned_on", "device_id": null } }, { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } } ] }, { "id": "turn_bedtime_delay_on", "automation": "- id: turn_bedtime_delay_on\n alias: Turn Bedtime Delay On\n description: Turn on bedtime delay boolean.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: bedtime_delay_on\n - trigger: state\n entity_id: binary_sensor.scene_active\n to: 'on'\n from: 'off'\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.bedtime_delayed", "config": [ { "name": "bedtime delayed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.bedtime_delayed", "device_id": null } }, { "name": "scene active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.scene_active", "device_id": null } } ] }, { "id": "turn_bedtime_delay_off", "automation": "- id: turn_bedtime_delay_off\n alias: Turn Bedtime Delay Off\n description: Turn off bedtime delay boolean.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: bedtime_delay_off\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.bedtime_delay\n - trigger: event\n event_type: timer.cancelled\n event_data:\n entity_id: timer.bedtime_delay\n - trigger: state\n entity_id: binary_sensor.scene_active\n to: 'off'\n from: 'on'\n - trigger: state\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.bedtime_delayed", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "bedtime delayed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.bedtime_delayed", "device_id": null } }, { "name": "bedtime delay timer", "room": null, "type": "timer", "id": { "entity_id": "timer.bedtime_delay", "device_id": null } }, { "name": "scene active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.scene_active", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } } ] }, { "id": "clear_bedtime_notification", "automation": "- id: clear_bedtime_notification\n alias: Clear Bedtime Notification\n description: Clear notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.bedtime_delayed\n to: 'off'\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to: Night\n for: 1\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: clear_bedtime\n actions:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: bedtime_alert", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "bedtime delayed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.bedtime_delayed", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "before_leaving_work", "automation": "- id: before_leaving_work\n alias: Before Leaving Work\n description: Override occupancy mode to preheat/cool house before leaving work.\n triggers:\n - trigger: state\n entity_id: binary_sensor.home_commute_active\n to: 'on'\n from: 'off'\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.someone_home\n - input_boolean.climate_manual_mode\n state: 'off'\n - condition: state\n entity_id: person.jason\n state: Work\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.climate_presence_override", "config": [ { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "home commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.home_commute_active", "device_id": null } }, { "name": "climate manual mode input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_manual_mode", "device_id": null } }, { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "climate presence override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_presence_override", "device_id": null } } ] }, { "id": "before_work", "automation": "- id: before_work\n alias: Before Work\n description: Play announcement when before work active turns on.\n mode: restart\n triggers:\n - trigger: state\n entity_id: binary_sensor.work_commute_active\n to: 'on'\n from: 'off'\n - trigger: state\n entity_id: binary_sensor.jason_home\n to: 'on'\n from: 'off'\n for:\n minutes: 5\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.work_commute_active\n state: 'on'\n - condition: state\n entity_id: binary_sensor.jason_home\n state: 'on'\n then:\n - action: script.work_commute_lights\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'Hey Jason! Time to get your ass in gear!\n\n {%- from ''schedule.jinja'' import leave_home_time %}\n\n {{ leave_home_time(''jason'') }}\n\n {%- from ''weather.jinja'' import commute_weather %}\n\n {{ commute_weather() }}\n\n {%- if is_state(''alert.jason_phone_battery_low'', ''active'') %}\n\n Your phone battery is only {{ states(''sensor.jphone_battery_level'')\n }} percent.\n\n {%- endif %}\n\n '\n media_player: media_player.inside_speakers\n min_volume: 50\n always_play: true\n continue_on_error: true", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "work commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_commute_active", "device_id": null } }, { "name": "work commute lights script", "room": null, "type": "script", "id": { "entity_id": "script.work_commute_lights", "device_id": null } }, { "name": "inside speakers media player", "room": null, "type": "media_player", "id": { "entity_id": "media_player.inside_speakers", "device_id": null } }, { "name": "jason phone battery low alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_battery_low", "device_id": null } }, { "name": "jphone battery level sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jphone_battery_level", "device_id": null } } ] }, { "id": "turn_camera_alerts_on", "automation": "- id: turn_camera_alerts_on\n alias: Turn Camera Alerts On\n description: Turn on camera alerts.\n triggers:\n - trigger: state\n entity_id: input_boolean.camera_alerts\n to: 'off'\n for:\n hours: 8\n - trigger: state\n entity_id: alarm_control_panel.house\n to:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.camera_alerts", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "camera alerts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_alerts", "device_id": null } } ] }, { "id": "turn_camera_alerts_off", "automation": "- id: turn_camera_alerts_off\n alias: Turn Camera Alerts Off\n description: Turn Camera Alerts Off\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_off_camera_alerts\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.camera_alerts", "config": [ { "name": "camera alerts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_alerts", "device_id": null } } ] }, { "id": "indoor_camera_control", "automation": "- id: indoor_camera_control\n alias: Indoor Camera Control\n description: Turn indoor cameras on or off.\n mode: restart\n triggers:\n - trigger: state\n entity_id: group.indoor_cameras\n attribute: entity_id\n to: null\n - trigger: state\n entity_id: binary_sensor.someone_home\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n - trigger: state\n entity_id: input_boolean.alarm_triggered\n to: null\n conditions:\n - condition: state\n entity_id: input_boolean.startup_pending\n state: 'off'\n actions:\n - wait_template: '{{ state_attr(''group.indoor_camera_stream_switches'', ''entity_id'')\n != none }}'\n timeout:\n minutes: 2\n continue_on_timeout: false\n - if:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n then:\n - action: switch.turn_off\n target:\n entity_id: group.indoor_camera_stream_switches\n else:\n - action: switch.turn_on\n target:\n entity_id: group.indoor_camera_stream_switches", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "indoor cameras group", "room": null, "type": "group", "id": { "entity_id": "group.indoor_cameras", "device_id": null } }, { "name": "indoor camera stream switches group", "room": null, "type": "group", "id": { "entity_id": "group.indoor_camera_stream_switches", "device_id": null } } ] }, { "id": "camera_object_detected", "automation": "- id: camera_object_detected\n alias: Camera Object Detected\n description: Camera object detected notification.\n max_exceeded: silent\n trace:\n stored_traces: 100\n variables:\n id: '{{ trigger.payload_json[''after''][''id''] }}'\n camera: '{{ trigger.payload_json[''after''][''camera''] }}'\n object: '{{ trigger.payload_json[''after''][''label''] }}'\n start_time: '{{ trigger.payload_json[''after''][''start_time''] }}'\n score: '{{ trigger.payload_json[''after''][''score''] | float(-1) }}'\n snapshot: '{{ trigger.payload_json[''after''][''has_snapshot''] }}'\n triggers:\n - trigger: mqtt\n id: update\n topic: frigate/events\n payload: alert\n value_template: '{{ value_json.after[''max_severity''] }}'\n conditions:\n - condition: template\n alias: Throttle notifications\n value_template: \"{{ true if this.attributes.last_triggered == none\\n else now()\\\n \\ - this.attributes.last_triggered > timedelta(seconds=60) }}\\n\"\n - condition: state\n alias: Someone hasn't just arrived home\n entity_id: binary_sensor.someone_home\n attribute: just_arrived\n state: false\n - condition: template\n alias: New valid object\n value_template: \"{{ now() - as_datetime(start_time) < timedelta(seconds=60)\\n\\\n \\ and ((object == 'person' and score >= 0.65)\\n or (object == 'car'\\\n \\ and score >= 0.65))\\n and snapshot }}\\n\"\n actions:\n - parallel:\n - sequence:\n - if:\n - condition: template\n alias: Someone home and camera event tod, or alarm not disarmed, or priority\n camera\n value_template: \"{{ is_state('input_boolean.camera_object_announcements',\\\n \\ 'on')\\n and is_state('binary_sensor.someone_home', 'on')\\n and\\\n \\ (is_state('binary_sensor.camera_event_announce_tod', 'on')\\n or\\\n \\ not is_state('alarm_control_panal.home', 'disarmed')\\n or camera\\\n \\ in ['front_driveway', 'front_door']) }}\\n\"\n then:\n - if:\n - condition: template\n alias: At least 2 minutes since last announcement or camera is front door\n value_template: \"{{ true if this.attributes.last_triggered == none\\n \\\n \\ or camera in ['front_door', 'side_door']\\n else now() - this.attributes.last_triggered\\\n \\ > timedelta(minutes=2) }}\\n\"\n then:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: \"Attention\\n{%- if camera in ['front_door', 'side_door',\\\n \\ 'back_door', 'patio_door', 'back_house',\\n 'side_gate_front',\\\n \\ 'side_gate_back'] %} {% set prep = 'at' %}\\n{%- else %} {% set\\\n \\ prep = 'in' %}\\n{%- endif %}\\nThere is a {{ object }} {{ prep\\\n \\ }} the {{ camera | replace('_', ' ') }}\\n\"\n provider: HASS\n language: English (USA)\n voice: Jenny:assistant\n always_play: true\n save_message: false\n continue_on_error: true\n - action: script.turn_on\n target:\n entity_id: script.kiosk_display_camera\n data:\n variables:\n camera: '{{ camera }}'\n continue_on_error: true\n - sequence:\n - if:\n - condition: state\n entity_id: input_boolean.camera_object_notifications\n state: 'on'\n then:\n - delay: 5\n - action: notify.jason\n data:\n title: '{{ camera | replace(''_'', '' '') | title }} Camera'\n message: '{{ object |title }} detected at {{ start_time | timestamp_custom(''%-I:%M\n %p'') }}.'\n data:\n tag: '{{ id }}'\n group: Camera\n channel: Camera\n visibility: public\n when: '{{ start_time }}'\n notification_icon: mdi:cctv\n icon_url: secret CAMERA_ICON\n image: '{{ states(''sensor.hass_base_url'') }}/api/frigate/notifications/{{\n id }}/thumbnail.jpg?format=android'\n ledColor: secret WARNING_COLOR\n color: secret WARNING_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/{{ camera | replace('_', '-') ~ '-camera' }}\n actions:\n - title: Pause\n action: pause_camera_object_notifications\n - title: Disable Cam\n action: disable_{{ camera }}_camera_events\n - title: Cameras\n action: URI\n uri: secret LOREX_URI", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "camera object announcements input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_object_announcements", "device_id": null } }, { "name": "camera object notifications input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_object_notifications", "device_id": null } }, { "name": "camera event announce tod binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.camera_event_announce_tod", "device_id": null } }, { "name": "kiosk display camera script", "room": null, "type": "script", "id": { "entity_id": "script.kiosk_display_camera", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "Hass Base URL Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.hass_base_url", "device_id": null } }, { "name": "Alarm Control Panel", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panal.home", "device_id": null } } ] }, { "id": "camera_object_detection_control", "automation": "- id: camera_object_detection_control\n alias: Camera Object Detection Control\n description: Control camera event detection modes.\n mode: queued\n triggers:\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n - trigger: state\n entity_id: binary_sensor.frigate_integration_connected\n to: 'on'\n from: 'off'\n - trigger: state\n id: disabled\n entity_id: switch.camera_object_detection\n to: 'off'\n from: 'on'\n for:\n hours: 8\n - trigger: state\n entity_id: alarm_control_panel.house\n to:\n - disarmed\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n conditions:\n - condition: state\n entity_id: input_boolean.startup_pending\n state: 'off'\n actions:\n - if: '{{ trigger.id == ''disabled'' }}'\n then:\n - action: switch.turn_on\n target:\n entity_id: switch.camera_object_detection\n - wait_template: \"{% set cameras = state_attr('group.frigate_cameras', 'entity_id')\\\n \\ %} {% set cam_count = cameras | count if cameras != none else -1 %} {{ is_state('binary_sensor.frigate_integration_connected',\\\n \\ 'on')\\n and is_state('binary_sensor.wyze_integration_connected', 'on')\\n\\\n \\ and cameras != none and cam_count > 0 }}\\n\"\n timeout:\n minutes: 5\n - variables:\n state: \"{{ states('alarm_control_panel.house')\\n | replace('armed_vacation',\\\n \\ 'armed_away')\\n | replace('armed_', '') }}\\n\"\n on_cameras: \"{{ expand('group.frigate_cameras')\\n | selectattr('attributes.'\\\n \\ ~ state, 'eq', true)\\n | map(attribute='entity_id') | list }}\\n\"\n off_cameras: \"{{ expand('group.frigate_cameras')\\n | rejectattr('attributes.'\\\n \\ ~ state, 'eq', true)\\n | map(attribute='entity_id') | list }}\\n\"\n - action: switch.turn_on\n target:\n entity_id: \"{% set detect = on_cameras | map('regex_replace',\\n find='camera.(.*)',\\\n \\ replace='switch.\\\\\\\\1_detect', ignorecase=False) | list %}\\n{% set motion\\\n \\ = on_cameras | map('regex_replace',\\n find='camera.(.*)', replace='switch.\\\\\\\n \\\\1_motion', ignorecase=False) | list %}\\n{% set recordings = on_cameras |\\\n \\ map('regex_replace',\\n find='camera.(.*)', replace='switch.\\\\\\\\1_recordings',\\\n \\ ignorecase=False) | list %}\\n{% set snapshots = on_cameras | map('regex_replace',\\n\\\n \\ find='camera.(.*)', replace='switch.\\\\\\\\1_snapshots', ignorecase=False)\\\n \\ | list %}\\n{{ detect + motion + recordings + snapshots }}\\n\"\n - action: switch.turn_off\n target:\n entity_id: \"{% set detect = off_cameras | map('regex_replace',\\n find='camera.(.*)',\\\n \\ replace='switch.\\\\\\\\1_detect', ignorecase=False) | list %}\\n{% set recordings\\\n \\ = off_cameras | map('regex_replace',\\n find='camera.(.*)', replace='switch.\\\\\\\n \\\\1_recordings', ignorecase=False) | list %}\\n{% set snapshots = off_cameras\\\n \\ | map('regex_replace',\\n find='camera.(.*)', replace='switch.\\\\\\\\1_snapshots',\\\n \\ ignorecase=False) | list %}\\n{{ detect + recordings + snapshots }}\\n\"\n - action: switch.turn_off\n target:\n entity_id: \"{{ off_cameras | map('regex_replace', find='camera.(.*)',\\n \\\n \\ replace='switch.\\\\\\\\1_motion', ignorecase=False) | list }}\\n\"", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "frigate integration connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.frigate_integration_connected", "device_id": null } }, { "name": "wyze integration connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wyze_integration_connected", "device_id": null } }, { "name": "frigate cameras group", "room": null, "type": "group", "id": { "entity_id": "group.frigate_cameras", "device_id": null } }, { "name": "camera object detection switch", "room": null, "type": "switch", "id": { "entity_id": "switch.camera_object_detection", "device_id": null } } ] }, { "id": "turn_camera_object_detection_off", "automation": "- id: turn_camera_object_detection_off\n alias: Turn Camera Object Detection Off\n description: Turn off camera event detection.\n max_exceeded: silent\n variables:\n camera: '{{ [''camera.'' ~ trigger.id ] }}'\n triggers:\n - trigger: event\n id: side_driveway\n event_type: mobile_app_notification_action\n event_data:\n action: disable_side_driveway_camera_events\n - trigger: event\n id: side_door\n event_type: mobile_app_notification_action\n event_data:\n action: disable_side_door_camera_events\n - trigger: event\n id: front_driveway\n event_type: mobile_app_notification_action\n event_data:\n action: disable_front_driveway_camera_events\n - trigger: event\n id: front_door\n event_type: mobile_app_notification_action\n event_data:\n action: disable_front_door_camera_events\n - trigger: event\n id: front_yard\n event_type: mobile_app_notification_action\n event_data:\n action: disable_front_yard_camera_events\n - trigger: event\n id: side_gate_front\n event_type: mobile_app_notification_action\n event_data:\n action: disable_side_gate_front_camera_events\n - trigger: event\n id: side_gate_back\n event_type: mobile_app_notification_action\n event_data:\n action: disable_side_gate_back_camera_events\n - trigger: event\n id: back_yard\n event_type: mobile_app_notification_action\n event_data:\n action: disable_back_yard_camera_events\n - trigger: event\n id: back_door\n event_type: mobile_app_notification_action\n event_data:\n action: disable_back_door_camera_events\n - trigger: event\n id: patio_door\n event_type: mobile_app_notification_action\n event_data:\n action: disable_patio_door_camera_events\n - trigger: event\n id: back_house\n event_type: mobile_app_notification_action\n event_data:\n action: disable_back_house_camera_events\n - trigger: event\n id: garage_inside\n event_type: mobile_app_notification_action\n event_data:\n action: disable_garage_inside_camera_events\n - trigger: event\n id: living_room\n event_type: mobile_app_notification_action\n event_data:\n action: disable_living_room_camera_events\n - trigger: event\n id: charlie_cam_camera\n event_type: mobile_app_notification_action\n event_data:\n action: disable_charlie_cam_camera_events\n actions:\n - action: switch.turn_off\n target:\n entity_id: \"{% set detect = camera | map('regex_replace',\\n find='camera.(.*)',\\\n \\ replace='switch.\\\\\\\\1_detect', ignorecase=False) | list %}\\n{% set recordings\\\n \\ = camera | map('regex_replace',\\n find='camera.(.*)', replace='switch.\\\\\\\n \\\\1_recordings', ignorecase=False) | list %}\\n{% set snapshots = camera |\\\n \\ map('regex_replace',\\n find='camera.(.*)', replace='switch.\\\\\\\\1_snapshots',\\\n \\ ignorecase=False) | list %}\\n{{ detect + recordings + snapshots }}\\n\"\n - action: switch.turn_off\n target:\n entity_id: \"{{ camera | map('regex_replace', find='camera.(.*)',\\n replace='switch.\\\\\\\n \\\\1_motion', ignorecase=False) | list }}\\n\"", "config": [] }, { "id": "turn_camera_object_notifications_on", "automation": "- id: turn_camera_object_notifications_on\n alias: Turn Camera Object Notifications On\n description: Turn on camera object notifications.\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - input_boolean.camera_object_announcements\n - input_boolean.camera_object_notifications\n to: 'off'\n for:\n hours: 4\n - trigger: state\n entity_id: alarm_control_panel.house\n to:\n - disarmed\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id:\n - input_boolean.camera_object_announcements\n - input_boolean.camera_object_notifications", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "camera object announcements input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_object_announcements", "device_id": null } }, { "name": "camera object notifications input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_object_notifications", "device_id": null } } ] }, { "id": "turn_camera_object_notifications_off", "automation": "- id: turn_camera_object_notifications_off\n alias: Turn Camera Object Notifications Off\n description: Pause camera object notifications.\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: pause_camera_object_notifications\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id:\n - input_boolean.camera_object_announcements\n - input_boolean.camera_object_notifications", "config": [ { "name": "camera object announcements input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_object_announcements", "device_id": null } }, { "name": "camera object notifications input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.camera_object_notifications", "device_id": null } } ] }, { "id": "play_charlie_media_preset", "automation": "- id: play_charlie_media_preset\n alias: Play Charlie Media Preset\n description: Play Charlie media preset.\n triggers:\n - trigger: state\n entity_id: binary_sensor.someone_home\n to: 'off'\n for:\n minutes: 30\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.charlie_home\n - input_boolean.media_enabled_charlie\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Away\n actions:\n - action: script.media_play\n data:\n preset: charlie", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "charlie home binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.charlie_home", "device_id": null } }, { "name": "media enabled charlie input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_enabled_charlie", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } }, { "name": "Media Enabled Input Boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_enabled_", "device_id": null } } ] }, { "id": "stop_charlie_media_preset", "automation": "- id: stop_charlie_media_preset\n alias: Stop Charlie Media Preset\n description: Stop Charlie media preset.\n max_exceeded: silent\n variables:\n media_player: \"{{ expand('group.media_players')\\n | selectattr('name', 'eq',\\n\\\n \\ iif(is_state('input_select.media_type_charlie', 'Video'),\\n states('select.media_video_display_charlie'),\\n\\\n \\ states('select.media_speaker_charlie')))\\n | map(attribute='entity_id')\\\n \\ | join }}\\n\"\n triggers:\n - trigger: state\n entity_id: binary_sensor.someone_home\n to: 'on'\n - trigger: state\n entity_id: input_select.occupancy_mode\n to: Night\n for: 1\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.charlie_home\n - input_boolean.media_enabled_charlie\n state: 'on'\n - condition: template\n alias: Preset media player is active\n value_template: '{{ states(media_player) in [''playing'', ''paused'', ''buffering'',\n ''on'', ''idle''] }}'\n actions:\n - action: script.turn_media_player_off\n data:\n entity_id: '{{ media_player }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "charlie home binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.charlie_home", "device_id": null } }, { "name": "media enabled charlie input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_enabled_charlie", "device_id": null } }, { "name": "media players group", "room": null, "type": "group", "id": { "entity_id": "group.media_players", "device_id": null } }, { "name": "media type charlie input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_charlie", "device_id": null } }, { "name": "media video display charlie select", "room": null, "type": "select", "id": { "entity_id": "select.media_video_display_charlie", "device_id": null } }, { "name": "media speaker charlie select", "room": null, "type": "select", "id": { "entity_id": "select.media_speaker_charlie", "device_id": null } }, { "name": "turn media player off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_media_player_off", "device_id": null } }, { "name": "Media Enabled Input Boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_enabled_", "device_id": null } } ] }, { "id": "charlie_staying_home", "automation": "- id: charlie_staying_home\n alias: Charlie Staying Home\n description: Play announcement when Charlie home turned on.\n mode: parallel\n triggers:\n - trigger: state\n entity_id: input_boolean.charlie_home\n to: 'on'\n from: 'off'\n actions:\n - action: script.tts_play\n data:\n message: Looks like Charlie has to stay home alone. I'm sure he'll be a good\n doggie!\n provider: HASS\n language: English (USA)\n voice: Jane:sad\n quiet_play: true\n save_message: true", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "charlie home input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_home", "device_id": null } } ] }, { "id": "turn_charlie_home_on", "automation": "- id: turn_charlie_home_on\n alias: Turn Charlie Home On\n description: Turn Charlie Home boolean on.\n triggers:\n - trigger: state\n entity_id: person.jason\n to: Work\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.charlie_home", "config": [ { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "charlie home input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_home", "device_id": null } } ] }, { "id": "turn_charlie_home_off", "automation": "- id: turn_charlie_home_off\n alias: Turn Charlie Home On\n description: Turn Charlie Home boolean off.\n triggers:\n - trigger: state\n entity_id: binary_sensor.jason_home\n to: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.charlie_home", "config": [ { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "charlie home input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_home", "device_id": null } } ] }, { "id": "turn_charlie_mealtime_on", "automation": "- id: turn_charlie_mealtime_on\n alias: Turn Charlie Mealtime On\n description: Turn on reminder active boolean.\n triggers:\n - trigger: template\n value_template: \"{% if is_state('input_boolean.charlie_mealtime_enabled', 'on')\\n\\\n \\ and not is_state('input_select.occupancy_mode','Vacation') %}\\n {% set\\\n \\ time = states('sensor.time') %}\\n {% set shift = state_attr('sensor.work_status',\\\n \\ 'shift') %}\\n {{ (shift == 'Days' and time == states('input_datetime.charlie_mealtime_days_1')[0:5])\\n\\\n \\ or (shift == 'Days' and time == states('input_datetime.charlie_mealtime_days_2')[0:5])\\n\\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.charlie_mealtime_afternoons_1')[0:5])\\n\\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.charlie_mealtime_afternoons_2')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.charlie_mealtime_weekends_1')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.charlie_mealtime_weekends_2')[0:5])\\\n \\ }}\\n{% endif %}\\n\"\n conditions:\n - condition: template\n alias: Not done within last 4 hours\n value_template: '{% set done = as_datetime(states(''button.charlie_mealtime_done''),\n now()) %} {{ now() - done > timedelta(hours=4) }}\n\n '\n actions:\n - if: '{{ is_state(''input_boolean.charlie_mealtime_active'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.charlie_mealtime_active\n - if: '{{ is_state(''input_boolean.charlie_mealtime_paused'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.charlie_mealtime_paused\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.charlie_mealtime_paused\n - if: '{{ is_state(''input_boolean.charlie_mealtime_skipped'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.charlie_mealtime_skipped\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.charlie_mealtime_active", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "charlie mealtime enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_enabled", "device_id": null } }, { "name": "work status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_status", "device_id": null } }, { "name": "charlie mealtime days 1 input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.charlie_mealtime_days_1", "device_id": null } }, { "name": "charlie mealtime days 2 input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.charlie_mealtime_days_2", "device_id": null } }, { "name": "charlie mealtime afternoons 1 input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.charlie_mealtime_afternoons_1", "device_id": null } }, { "name": "charlie mealtime afternoons 2 input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.charlie_mealtime_afternoons_2", "device_id": null } }, { "name": "charlie mealtime weekends 1 input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.charlie_mealtime_weekends_1", "device_id": null } }, { "name": "charlie mealtime weekends 2 input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.charlie_mealtime_weekends_2", "device_id": null } }, { "name": "charlie mealtime active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_active", "device_id": null } }, { "name": "charlie mealtime paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_paused", "device_id": null } }, { "name": "charlie mealtime skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_skipped", "device_id": null } }, { "name": "charlie mealtime done button", "room": null, "type": "button", "id": { "entity_id": "button.charlie_mealtime_done", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } } ] }, { "id": "charlie_mealtime_done", "automation": "- id: charlie_mealtime_done\n alias: Charlie Mealtime Done\n description: Mark reminder completed.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n actions: charlie_mealtime_done\n conditions:\n - condition: state\n entity_id: input_boolean.charlie_mealtime_active\n state: 'on'\n actions:\n - action: button.press\n target:\n entity_id: button.charlie_mealtime_done", "config": [ { "name": "charlie mealtime active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_active", "device_id": null } }, { "name": "charlie mealtime done button", "room": null, "type": "button", "id": { "entity_id": "button.charlie_mealtime_done", "device_id": null } } ] }, { "id": "skip_charlie_mealtime", "automation": "- id: skip_charlie_mealtime\n alias: Skip Charlie Mealtime\n description: Skip reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n actions: skip_charlie_mealtime\n actions:\n - action: button.press\n target:\n entity_id: button.skip_charlie_mealtime", "config": [ { "name": "skip charlie mealtime button", "room": null, "type": "button", "id": { "entity_id": "button.skip_charlie_mealtime", "device_id": null } } ] }, { "id": "pause_charlie_mealtime", "automation": "- id: pause_charlie_mealtime\n alias: Pause Charlie Mealtime\n description: Pause reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n actions: pause_charlie_mealtime\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.charlie_mealtime_paused", "config": [ { "name": "charlie mealtime paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_paused", "device_id": null } } ] }, { "id": "reset_pause_charlie_mealtime", "automation": "- id: reset_pause_charlie_mealtime\n alias: Reset Pause Charlie Mealtime\n description: Reset reminder paused boolean.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.charlie_mealtime_skipped\n to: 'on'\n - trigger: state\n entity_id: input_boolean.charlie_mealtime_paused\n to: 'on'\n for:\n hours: 2\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'on'\n for:\n minutes: 15\n conditions:\n - condition: state\n entity_id: input_boolean.charlie_mealtime_paused\n state: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.charlie_mealtime_paused", "config": [ { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "charlie mealtime paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_paused", "device_id": null } }, { "name": "charlie mealtime skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_skipped", "device_id": null } } ] }, { "id": "reset_charlie_mealtime_booleans", "automation": "- id: reset_charlie_mealtime_booleans\n alias: Reset Charlie Mealtime Booleans\n description: Reset reminder booleans if reminder disabled, completed, or not active.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: enabled\n entity_id: input_boolean.charlie_mealtime_enabled\n to: 'off'\n - trigger: state\n id: done\n entity_id: input_boolean.charlie_mealtime_active\n to: 'off'\n - trigger: state\n id: entity\n entity_id: &id002\n - input_boolean.charlie_mealtime_active\n - input_boolean.charlie_mealtime_paused\n - input_boolean.charlie_mealtime_skipped\n to: 'on'\n conditions:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.charlie_mealtime_enabled\n state: 'off'\n - condition: template\n alias: Pause boolean turned on when reminder is skipped or isn't active\n value_template: \"{{ trigger.entity_id == 'input_boolean.charlie_mealtime_paused'\\n\\\n \\ and (is_state('input_boolean.charlie_mealtime_active', 'off')\\n \\\n \\ or is_state('input_boolean.charlie_mealtime_skipped', 'on')) }}\\n\"\n - condition: template\n alias: Reminder completed\n value_template: '{{ trigger.id == ''done'' }}'\n actions:\n - if: '{{ trigger.id == ''entity'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: *id002", "config": [ { "name": "charlie mealtime enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_enabled", "device_id": null } }, { "name": "charlie mealtime active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_active", "device_id": null } }, { "name": "charlie mealtime paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_paused", "device_id": null } }, { "name": "charlie mealtime skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_skipped", "device_id": null } } ] }, { "id": "charlie_mealtime_notification", "automation": "- id: charlie_mealtime_notification\n alias: Charlie Mealtime Notification\n description: Send notification until reminder is off.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_boolean.charlie_mealtime_active\n to: 'on'\n - trigger: state\n entity_id: input_boolean.charlie_mealtime_paused\n to: 'off'\n conditions:\n - condition: state\n entity_id: input_boolean.charlie_mealtime_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.charlie_mealtime_paused\n state: 'off'\n actions:\n - repeat:\n sequence:\n - if: '{{ not is_state(''input_select.occupancy_mode'', ''Night'') }}'\n then:\n - action: notify.jason\n data:\n message: Time to feed Charlie\n data:\n tag: charlie_mealtime_reminder\n group: Reminder\n visibility: public\n persistent: true\n notification_icon: mdi:dog\n icon_url: secret CHARLIE_ICON\n actions:\n - title: Pause\n actions: pause_charlie_mealtime\n - title: Skip\n actions: skip_charlie_mealtime\n - title: Done\n actions: charlie_mealtime_done\n - wait_template: \"{{ is_state('input_boolean.charlie_mealtime_active', 'off')\\n\\\n \\ or is_state('input_boolean.charlie_mealtime_paused', 'on') }}\\n\"\n timeout:\n minutes: 2\n - if:\n - condition: state\n entity_id: input_boolean.charlie_mealtime_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.charlie_mealtime_paused\n state: 'off'\n then:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'Hey Charlie\n\n Charlie Pay attention\n\n Are you a hungry doggie?\n\n It''s time to get your food\n\n '\n provider: HASS\n language: English (USA)\n voice: Nancy:excited\n quiet_play: true\n - wait_template: \"{{ is_state('input_boolean.charlie_mealtime_active', 'off')\\n\\\n \\ or is_state('input_boolean.charlie_mealtime_paused', 'on') }}\\n\"\n timeout:\n minutes: '{{ states(''input_number.charlie_mealtime_notification_interval'')\n | int }}'\n until:\n - or:\n - condition: state\n entity_id: input_boolean.charlie_mealtime_active\n state: 'off'\n - condition: state\n entity_id: input_boolean.charlie_mealtime_paused\n state: 'on'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "charlie mealtime active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_active", "device_id": null } }, { "name": "charlie mealtime paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_paused", "device_id": null } }, { "name": "charlie mealtime notification interval input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.charlie_mealtime_notification_interval", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "clear_charlie_mealtime_notification", "automation": "- id: clear_charlie_mealtime_notification\n alias: Clear Charlie Mealtime Notification\n description: Clear reminder notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.charlie_mealtime_active\n to: 'off'\n - trigger: state\n entity_id:\n - input_boolean.charlie_mealtime_paused\n - input_boolean.charlie_mealtime_skipped\n to: 'on'\n actions:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: charlie_mealtime_reminder", "config": [ { "name": "charlie mealtime active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_active", "device_id": null } }, { "name": "charlie mealtime paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_paused", "device_id": null } }, { "name": "charlie mealtime skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_mealtime_skipped", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "turn_chill_scene_off", "automation": "- id: turn_chill_scene_off\n alias: Turn Chill Scene Off\n description: Turn off chill scene.\n max_exceeded: silent\n trigger:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.chill_scene\n action:\n - action: switch.turn_off\n target:\n entity_id: switch.chill_scene", "config": [ { "name": "chill scene timer", "room": null, "type": "timer", "id": { "entity_id": "timer.chill_scene", "device_id": null } }, { "name": "chill scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.chill_scene", "device_id": null } } ] }, { "id": "clear_idle_media_player", "automation": "- id: clear_idle_media_player\n alias: Clear Idle Media Player\n description: Clear idle media player playlist.\n mode: parallel\n max: 20\n triggers:\n - trigger: state\n entity_id:\n - media_player.hass_media_player_mass\n - media_player.kiosk_speaker_mass\n to: idle\n for:\n seconds: 30\n conditions: '{{ trigger.to_state.attributes.supported_features | bitwise_and(256)\n == 256 }}'\n actions:\n - action: media_player.clear_playlist\n target:\n entity_id: '{{ trigger.entity_id }}'", "config": [ { "name": "hass media player mass media player", "room": null, "type": "media_player", "id": { "entity_id": "media_player.hass_media_player_mass", "device_id": null } }, { "name": "kiosk speaker mass media player", "room": null, "type": "media_player", "id": { "entity_id": "media_player.kiosk_speaker_mass", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } } ] }, { "id": "climate_window_door_open", "automation": "- id: climate_window_door_open\n alias: Climate Window Door Open\n description: Turn off thermostat if window or door is open.\n mode: restart\n triggers:\n - trigger: state\n entity_id: alert.climate_window_door_open\n to: 'on'\n actions:\n - action: climate.set_hvac_mode\n target:\n entity_id: climate.house\n data:\n hvac_mode: 'off'\n - repeat:\n sequence:\n - wait_for_trigger:\n - trigger: state\n entity_id: alert.climate_window_door_open\n from: 'on'\n - trigger: state\n entity_id: alert.climate_window_door_open\n from: 'off'\n timeout:\n minutes: 15\n - if:\n - not:\n - condition: state\n alias: Thermostat is turned back on\n entity_id: climate.house\n state: 'off'\n - condition: state\n alias: Alert is still active\n entity_id: alert.climate_window_door_open\n state: 'on'\n then:\n - action: alert.turn_off\n entity_id: alert.climate_window_door_open\n - wait_for_trigger:\n - trigger: state\n entity_id: alert.climate_window_door_open\n to: idle\n timeout:\n hours: 2\n - if: '{{ not wait.completed }}'\n then:\n - action: alert.turn_on\n target:\n entity_id: alert.climate_window_door_open\n until:\n - condition: state\n entity_id: alert.climate_window_door_open\n state:\n - idle\n - 'off'\n - action: climate.set_hvac_mode\n target:\n entity_id: climate.house\n data:\n hvac_mode: '{{ states(''input_select.climate_mode'') }}'", "config": [ { "name": "climate window door open alert", "room": null, "type": "alert", "id": { "entity_id": "alert.climate_window_door_open", "device_id": null } }, { "name": "climate house climate", "room": null, "type": "climate", "id": { "entity_id": "climate.house", "device_id": null } }, { "name": "climate mode input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.climate_mode", "device_id": null } } ] }, { "id": "close_garage_door", "automation": "- id: close_garage_door\n alias: Close Garage Door\n description: Close garage door.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: state\n id: alarm\n entity_id: alarm_control_panel.house\n to:\n - armed_home\n - armed_night\n - armed_away\n - trigger: state\n id: manual\n entity_id:\n - sensor.side_door_lock_status\n - sensor.front_door_lock_status\n - sensor.back_door_lock_status\n to: Locked (Manual)\n not_from:\n - unknown\n - unavailable\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: close_garage_door\n conditions:\n - condition: state\n entity_id: binary_sensor.garage_door\n state: 'on'\n actions:\n - action: script.garage_door", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "back door lock status", "room": "back", "type": "sensor", "id": { "entity_id": "sensor.back_door_lock_status", "device_id": null } }, { "name": "front door lock status", "room": "front", "type": "sensor", "id": { "entity_id": "sensor.front_door_lock_status", "device_id": null } }, { "name": "side door lock status", "room": "side", "type": "sensor", "id": { "entity_id": "sensor.side_door_lock_status", "device_id": null } }, { "name": "garage door binary sensor", "room": "garage", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_door", "device_id": null } }, { "name": "garage door script", "room": null, "type": "script", "id": { "entity_id": "script.garage_door", "device_id": null } } ] }, { "id": "garage_door_closed", "automation": "- id: garage_door_closed\n alias: Garage Door Closed\n description: Announcement when door is closed, turn off garage alert.\n trigger:\n - trigger: state\n entity_id: cover.garage_door\n attribute: current_position\n to: 0\n not_from: None\n condition:\n - condition: state\n entity_id: input_boolean.garage_door_announcements\n state: 'on'\n actions:\n - action: script.tts_play\n data:\n message: The garage door is closed.\n provider: HASS\n language: English (USA)\n voice: Guy:newscast\n ignore_away: true", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "garage door cover", "room": "garage", "type": "cover", "id": { "entity_id": "cover.garage_door", "device_id": null } }, { "name": "garage door announcements input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_door_announcements", "device_id": null } } ] }, { "id": "commute_map_directions", "automation": "- id: commute_map_directions\n alias: Commute Map Directions\n description: Open google map directions to location.\n max_exceeded: silent\n triggers:\n - platform: event\n id: work\n event_type: mobile_app_notification_action\n event_data:\n action: work_directions\n - platform: event\n id: home\n event_type: mobile_app_notification_action\n event_data:\n action: home_directions\n actions:\n - if: '{{ trigger.id == ''work'' }}'\n then:\n - action: button.press\n target:\n entity_id: button.directions_to_work\n else:\n - action: button.press\n target:\n entity_id: button.directions_to_home", "config": [ { "name": "directions to work button", "room": null, "type": "button", "id": { "entity_id": "button.directions_to_work", "device_id": null } }, { "name": "directions to home button", "room": null, "type": "button", "id": { "entity_id": "button.directions_to_home", "device_id": null } } ] }, { "id": "turn_company_scene_off", "automation": "- id: turn_company_scene_off\n alias: Turn Company Scene Off\n description: Turn off company scene.\n max_exceeded: silent\n trigger:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.company_scene\n action:\n - action: switch.turn_off\n target:\n entity_id: switch.company_scene", "config": [ { "name": "company scene timer", "room": null, "type": "timer", "id": { "entity_id": "timer.company_scene", "device_id": null } }, { "name": "company scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.company_scene", "device_id": null } } ] }, { "id": "current_alarm_trigger", "automation": "- id: current_alarm_trigger\n alias: Current Alarm Trigger\n description: Set active alarm trigger message for tts, display in UI\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n to:\n - 'on'\n - 'off'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - choose:\n - conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n state: 'off'\n sequence:\n - action: input_text.set_value\n target:\n entity_id: input_text.current_alarm\n data:\n value: ''\n - conditions:\n - or:\n - and:\n - condition: state\n entity_id: input_boolean.alarm_pending\n state: 'off'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n - and:\n - condition: state\n entity_id: input_boolean.alarm_pending\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n sequence:\n - variables:\n trigger_entity: \"{% set sensors = state_attr('alarm_control_panel.house',\\\n \\ 'open_sensors') %} {% if sensors != none and sensors | count > 0 %}\\\n \\ {{ (expand(sensors)\\n | map(attribute='name') | list)[0]\\n | replace('Open\\\n \\ Alert', '')\\n | replace('Motion motion', '')\\n | title }}\\n{%\\\n \\ endif %}\\n\"\n - action: input_text.set_value\n target:\n entity_id: input_text.current_alarm\n data:\n value: '{% if is_state(''binary_sensor.smoke_alarm'', ''on'') %} Smoke Alert\n {% elif is_state(''binary_sensor.co_alarm'', ''on'') %} Carbon Monoxide\n Alert {% elif is_state(''binary_sensor.heat_alarm'', ''on'') %} Heat/Fire\n Alert {% else %} {{ trigger_entity }} {% endif %}\n\n '", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "current alarm", "room": null, "type": "input_text", "id": { "entity_id": "input_text.current_alarm", "device_id": null } }, { "name": "smoke alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.smoke_alarm", "device_id": null } }, { "name": "co alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.co_alarm", "device_id": null } }, { "name": "heat alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.heat_alarm", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "input text set value service", "room": null, "type": "service", "id": { "entity_id": "input_text.set_value", "device_id": null } } ] }, { "id": "turn_deck_tv_on", "automation": "- id: turn_deck_tv_on\n alias: Turn Deck TV On\n description: Wake On Lan for WebOS TV.\n triggers:\n - trigger: webostv.turn_on\n entity_id: media_player.deck_tv\n actions:\n - action: wake_on_lan.send_magic_packet\n data:\n mac: secret DECK_TV_MAC", "config": [ { "name": "deck tv media player", "room": "deck", "type": "media_player", "id": { "entity_id": "media_player.deck_tv", "device_id": null } }, { "name": "webostv turn on trigger", "room": null, "type": "trigger", "id": { "entity_id": "webostv.turn_on", "device_id": null } }, { "name": "wake on lan send magic packet service", "room": null, "type": "service", "id": { "entity_id": "wake_on_lan.send_magic_packet", "device_id": null } } ] }, { "id": "dining_room_hub_light_color_sync", "automation": "- id: dining_room_hub_light_color_sync\n alias: Dining Room Hub Light Color Sync\n description: Sync RGB Light to media player picture entity color.\n mode: queued\n variables:\n picture: '{{ state_attr(''media_player.dining_room_hub'', ''entity_picture'')\n }}'\n triggers:\n - trigger: state\n id: player\n entity_id: media_player.dining_room_hub\n attribute: entity_picture\n - trigger: state\n id: light\n entity_id:\n - input_boolean.media_color_light_sync\n - light.dining_room_light_rgb\n to: 'on'\n conditions:\n - condition: state\n entity_id:\n - input_boolean.media_color_light_sync\n - light.dining_room_light_rgb\n state: 'on'\n - condition: template\n value_template: '{{ picture != none }}'\n - condition: template\n alias: Media player is not an active tts player\n value_template: '{% from ''tts.jinja'' import tts_player %} {{ not tts_player(''media_player.dining_room_hub'')\n }}\n\n '\n actions:\n - action: color_extractor.turn_on\n target:\n entity_id: light.dining_room_light_rgb\n data:\n color_extract_url: '{{ picture }}'\n brightness_pct: 80\n transition: 5", "config": [ { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "media color light sync input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_color_light_sync", "device_id": null } }, { "name": "color extractor service", "room": null, "type": null, "id": { "entity_id": "color_extractor.turn_on", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } } ] }, { "id": "turn_off_light_color_sync", "automation": "- id: turn_off_light_color_sync\n alias: Turn Off Light Color Sync\n description: Turn off light color sync.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: light.dining_room_light_rgb\n to: 'off'\n - trigger: state\n entity_id: media_player.dining_room_hub\n to:\n - idle\n - 'off'\n for: 60\n conditions:\n - condition: state\n entity_id: input_boolean.media_color_light_sync\n state: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.media_color_light_sync", "config": [ { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "media color light sync input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_color_light_sync", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } } ] }, { "id": "reset_dining_room_light_color", "automation": "- id: reset_dining_room_light_color\n alias: Reset Dining Room Light Color\n description: Reset dining room light color.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: switch\n entity_id: input_boolean.media_color_light_sync\n to: 'off'\n - trigger: state\n id: player\n entity_id: media_player.dining_room_hub\n to: 'off'\n for: 15\n - trigger: state\n entity_id:\n - binary_sensor.work_commute_active\n - alert.work_commute_jason\n - alert.late_for_work_jason\n to:\n - 'off'\n - idle\n from:\n - 'on'\n - 'off'\n - trigger: state\n entity_id: binary_sensor.scene_active\n to: 'off'\n from: 'on'\n conditions:\n - condition: state\n entity_id: light.dining_room_light_rgb\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: timer.dining_room_light\n state: idle\n - condition: template\n value_template: '{{ iif(trigger.id == ''player'', is_state(''input_boolean.media_color_light_sync'',\n ''on''), true) }}'\n - condition: template\n value_template: \"{% set entities = state_attr('binary_sensor.scene_active', 'entity_id')\\\n \\ %} {% if entities != none %}\\n {{ 'light.dining_room_light_rgb' not in state_attr('binary_sensor.scene_active',\\\n \\ 'entity_id') }}\\n{% else %} {{ true }} {% endif %}\\n\"\n actions:\n - if:\n - condition: or\n conditions:\n - condition: state\n entity_id: binary_sensor.work_commute_active\n state: 'on'\n - condition: state\n entity_id: alert.work_commute_jason\n state: 'on'\n - condition: state\n entity_id: alert.late_for_work_jason\n state: 'on'\n then:\n - action: script.work_commute_lights\n else:\n - action: script.reset_rgb_lights\n data:\n entity_id: light.dining_room_light_rgb\n - if:\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'off'\n - condition: state\n entity_id: binary_sensor.daytime_illuminance\n state: 'off'\n then:\n - action: light.turn_off\n target:\n entity_id: light.dining_room_light_rgb", "config": [ { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "daytime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.daytime_illuminance", "device_id": null } }, { "name": "scene active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.scene_active", "device_id": null } }, { "name": "work commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_commute_active", "device_id": null } }, { "name": "work commute lights script", "room": null, "type": "script", "id": { "entity_id": "script.work_commute_lights", "device_id": null } }, { "name": "media color light sync input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_color_light_sync", "device_id": null } }, { "name": "dining room light timer", "room": "dining room", "type": "timer", "id": { "entity_id": "timer.dining_room_light", "device_id": null } }, { "name": "reset rgb lights script", "room": null, "type": "script", "id": { "entity_id": "script.reset_rgb_lights", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } }, { "name": "work commute jason alert", "room": null, "type": "alert", "id": { "entity_id": "alert.work_commute_jason", "device_id": null } }, { "name": "late for work jason alert", "room": null, "type": "alert", "id": { "entity_id": "alert.late_for_work_jason", "device_id": null } } ] }, { "id": "disable_guest_wifi", "automation": "- id: disable_guest_wifi\n alias: Disable Guest WIFI\n description: Disable guest WIFI.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n for: 1\n actions:\n - action: switch.turn_off\n target:\n entity_id:\n - switch.jnet_guest\n - switch.rt_ax58u_guest_2_4_ghz_1\n - switch.rt_ax58u_guest_5_ghz_1", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "jnet guest switch", "room": null, "type": "switch", "id": { "entity_id": "switch.jnet_guest", "device_id": null } }, { "name": "rt ax58u guest 2.4 ghz 1 switch", "room": null, "type": "switch", "id": { "entity_id": "switch.rt_ax58u_guest_2_4_ghz_1", "device_id": null } }, { "name": "rt ax58u guest 5 ghz 1 switch", "room": null, "type": "switch", "id": { "entity_id": "switch.rt_ax58u_guest_5_ghz_1", "device_id": null } } ] }, { "id": "disarm_alarm", "automation": "- id: disarm_alarm\n alias: Disarm Alarm\n description: Disarm house alarm.\n max_exceeded: silent\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: state\n id: lock\n entity_id:\n - sensor.side_door_lock_status\n - sensor.front_door_lock_status\n - sensor.back_door_lock_status\n - sensor.garage_side_door_lock_status\n to:\n - Unlocked (Jason)\n - Unlocked (Guest)\n - Unlocked (Keypad)\n not_from:\n - unknown\n - unavailable\n - trigger: event\n id: disarm\n event_type: mobile_app_notification_action\n event_data:\n action: disarm_alarm_jason\n - trigger: event\n id: doorbell\n event_type: mobile_app_notification_action\n event_data:\n action: doorbell_unlock_door\n - trigger: state\n id: danger\n entity_id: binary_sensor.danger_alarm\n to: 'off'\n from: 'on'\n - trigger: event\n id: arriving\n event_type: mobile_app_notification_action\n event_data:\n action: arriving_home_jason\n - trigger: event\n id: arriving\n event_type: mobile_app_notification_action\n event_data:\n action: arriving_home_garage_jason\n - trigger: event\n id: disarm_danger_alarm\n event_type: mobile_app_notification_action\n event_data:\n action: disarm_danger_alarm\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_enabled\n state: 'on'\n actions:\n - if: '{{ trigger.id == ''disarm_danger_alarm'' }}'\n then:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: danger_alarm\n - if: '{{ trigger.id == ''arriving'' }}'\n then:\n - wait_template: '{% from ''alarm.jinja'' import disarm_alarm_check %} {{ disarm_alarm_check()\n }}\n\n '\n - action: script.disarm_alarm\n data:\n person: '{{ person }}'", "config": [ { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "disarm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.disarm_alarm", "device_id": null } }, { "name": "danger alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.danger_alarm", "device_id": null } }, { "name": "back door lock status", "room": "back", "type": "sensor", "id": { "entity_id": "sensor.back_door_lock_status", "device_id": null } }, { "name": "front door lock status", "room": "front", "type": "sensor", "id": { "entity_id": "sensor.front_door_lock_status", "device_id": null } }, { "name": "side door lock status", "room": "side", "type": "sensor", "id": { "entity_id": "sensor.side_door_lock_status", "device_id": null } }, { "name": "garage side door lock status", "room": "garage", "type": "sensor", "id": { "entity_id": "sensor.garage_side_door_lock_status", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "dishwasher_rinse_refill", "automation": "- id: dishwasher_rinse_refill\n alias: Dishwasher Rinse Refill\n description: Dishwasher rinse agent refill announcment.\n triggers:\n - trigger: state\n entity_id: sensor.dishwasher\n to: 'on'\n not_from:\n - unknown\n - unavailable\n for:\n minutes: 5\n conditions:\n - condition: state\n entity_id: sensor.dishwasher\n attribute: rinse_refill\n state: 'on'\n actions:\n - action: script.tts_play\n data:\n message: Attention! The dishwasher rinse agent needs to be refilled!\n media_player: media_player.dining_room_hub\n quiet_play: true\n save_message: true", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "dishwasher sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.dishwasher", "device_id": null } } ] }, { "id": "doorbell_notification", "automation": "- id: doorbell_notification\n alias: Doorbell Notification\n description: Display front porch camera, announcement, send notifcation.\n mode: queued\n triggers:\n - trigger: state\n entity_id: input_button.doorbell\n condition: \"{{ true if this.attributes.last_triggered == none\\n else now() -\\\n \\ this.attributes.last_triggered > timedelta(seconds=30) }}\\n\"\n actions:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: Some ugly schmuck is ringing the doorbell\n media_player: media_player.dining_room_hub\n quiet_play: true\n save_message: false\n continue_on_error: true\n - action: script.turn_on\n target:\n entity_id: script.kiosk_display_camera\n data:\n variables:\n camera: front_door\n continue_on_error: true\n - variables:\n file: alarm_snapshots/{% from 'camera.jinja'import snapshot_filename %}{{ snapshot_filename('front_door')\n }}\n - action: camera.snapshot\n target:\n entity_id: camera.front_door\n data:\n filename: /config/www/{{ file }}\n - delay: 1\n - action: notify.jason\n data:\n message: Front Doorbell\n data:\n tag: doorbell_alert\n group: Alarm\n channel: Alert\n notification_icon: mdi:doorbell\n icon_url: secret DOORBELL_ICON\n image: /local/{{ file }}\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/front-door-camera\n actions:\n - title: Cameras\n action: URI\n uri: secret LOREX_URI\n - title: Unlock\n action: doorbell_unlock_door", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "kiosk display camera script", "room": null, "type": "script", "id": { "entity_id": "script.kiosk_display_camera", "device_id": null } }, { "name": "doorbell input button", "room": "front", "type": "input_button", "id": { "entity_id": "input_button.doorbell", "device_id": null } }, { "name": "front door camera", "room": "front", "type": "camera", "id": { "entity_id": "camera.front_door", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } } ] }, { "id": "turn_downstairs_bathroom_vent_fan_off", "automation": "- id: turn_downstairs_bathroom_vent_fan_off\n alias: Turn Downstairs Bathroom Vent Fan Off\n description: Turn off downstairs bathroom vent fan.\n mode: queued\n triggers:\n - trigger: state\n id: timeout\n entity_id: fan.downstairs_bathroom_fan\n for:\n hours: 1\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for:\n minutes: 1\n - trigger: state\n id: alert\n entity_id: alert.indoor_high_temperature\n to: idle\n conditions:\n - condition: state\n entity_id: fan.downstairs_bathroom_fan\n state: 'on'\n - condition: state\n entity_id: alert.indoor_high_temperature\n state: idle\n actions:\n - action: script.turn_fan_off\n data:\n entity_id: fan.downstairs_bathroom_fan\n override: '{{ trigger.id == ''occupancy'' }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "turn fan off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_off", "device_id": null } }, { "name": "downstairs bathroom fan", "room": "downstairs bathroom", "type": "fan", "id": { "entity_id": "fan.downstairs_bathroom_fan", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } } ] }, { "id": "enable_alarm", "automation": "- id: enable_alarm\n alias: Enable Alarm\n description: Enable house alarm.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: enable_alarm\n actions:\n - action: input_boolean.turn_on\n entity_id: input_boolean.alarm_enabled", "config": [ { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } } ] }, { "id": "turn_alarm_auto_arming_on", "automation": "- id: turn_alarm_auto_arming_on\n alias: Turn Alarm Auto Arming On\n description: Turn on alarm auto arming.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: enable_auto_arming\n actions:\n - action: input_boolean.turn_on\n entity_id: input_boolean.alarm_auto_arming", "config": [ { "name": "alarm auto arming", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_auto_arming", "device_id": null } } ] }, { "id": "enable_pihole", "automation": "- id: enable_pihole\n alias: Enable PiHole\n description: Enable Pihole.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: enable_pihole\n actions:\n - action: switch.turn_on\n target:\n entity_id: switch.pi_hole", "config": [ { "name": "pi hole switch", "room": null, "type": "switch", "id": { "entity_id": "switch.pi_hole", "device_id": null } } ] }, { "id": "envcan_weather_alert", "automation": "- id: envcan_weather_alert\n alias: EnvCan Weather Alert\n description: Display weather alert on UI, play alert/announcement for severe alerts.\n mode: restart\n variables:\n current: '{% set current = state_attr(''binary_sensor.envcan_weather_alert'',\n ''severity'') %} {{ iif(current = none, current, '''') }}\n\n '\n title: '{% set title = state_attr(''binary_sensor.envcan_weather_alert'', ''title'')\n %} {{ iif(title = none, title, '''') }}\n\n '\n triggers:\n - trigger: state\n entity_id:\n - sensor.windsor_warnings\n - sensor.windsor_watches\n - sensor.windsor_statements\n - sensor.windsor_advisory\n to: null\n not_from:\n - unknown\n - unavailable\n for: 10\n conditions:\n - alias: Sensor to and from states are not the same\n condition: template\n value_template: '{{ trigger.from_state.state = trigger.to_state.state }}'\n - alias: Trigger entity has a numerical state\n condition: template\n value_template: '{{ is_number(states(trigger.entity_id)) }}'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.envcan_weather_alert\n state: 'off'\n then:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: envcan_alert\n - action: input_text.set_value\n target:\n entity_id: input_text.previous_envcan_alert_title\n data:\n value: ''\n - action: input_select.select_option\n target:\n entity_id: input_select.previous_envcan_alert_severity\n data:\n option: none\n else:\n - if:\n - or:\n - condition: template\n alias: Current alert is more severe than previous alert\n value_template: \"{% set previous = states('input_select.previous_envcan_alert_severity')\\\n \\ %} {{ (previous == 'watch' and current == 'warning')\\n or (previous\\\n \\ == 'advisory' and current in ['warning', 'watch'])\\n or (previous\\\n \\ == 'statement' and current in ['warning', 'watch', 'advisory'])\\n \\\n \\ or (previous in ['none', 'unknown', 'unavailable']\\n and current\\\n \\ in ['warning', 'watch', 'advisory', 'statement'])\\n if current =\\\n \\ '' else false }}\\n\"\n - condition: template\n alias: Alert title has changed and is not null\n value_template: '{{ title not in ['''', states(''input_text.previous_envcan_alert_title'')]\n }}'\n then:\n - action: notify.jason\n data:\n title: '{{ iif(title = '''', title, ''Weather Alert'') }}'\n message: '{%- set msg = state_attr(''binary_sensor.envcan_weather_alert'',\n ''description'') -%}\n\n {%- if msg = none %} {{ msg }} {% endif -%}\n\n '\n data:\n tag: envcan_alert\n channel: Alert\n group: Weather\n visibility: public\n notification_icon: '{{ state_attr(''binary_sensor.envcan_weather_alert'',\n ''icon'') }}'\n icon_url: secret STORM_ICON\n ledColor: secret WEATHER_COLOR\n color: secret WEATHER_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: secret ENVCAN_ALERTS\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: '{%- set expires = state_attr(''binary_sensor.envcan_weather_alert'',\n ''expires_text'') %}\n\n {%- set description = state_attr(''binary_sensor.envcan_weather_alert'',\n ''description'') %}\n\n Attention Weather Alert\n\n Environment Canada has issued a {{ title }} for your immediate area\n\n {%- if expires = none -%}\n\n , until {{ expires }}\n\n {%- endif %}.\n\n {% if description = none -%}\n\n {{ description.split(''.'')[0] }}\n\n {% endif %}\n\n '\n provider: HASS\n language: English (USA)\n voice: Aria:newscast-formal\n quiet_play: '{{ current in [''warning'', ''watch''] }}'\n save_message: true\n continue_on_error: true\n - action: input_text.set_value\n target:\n entity_id: input_text.previous_envcan_alert_title\n data:\n value: '{{ title }}'\n - action: input_select.select_option\n target:\n entity_id: input_select.previous_envcan_alert_severity\n data:\n option: '{{ current }}'", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "envcan weather alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.envcan_weather_alert", "device_id": null } }, { "name": "windsor warnings sensor", "room": "windsor", "type": "sensor", "id": { "entity_id": "sensor.windsor_warnings", "device_id": null } }, { "name": "windsor watches sensor", "room": "windsor", "type": "sensor", "id": { "entity_id": "sensor.windsor_watches", "device_id": null } }, { "name": "windsor statements sensor", "room": "windsor", "type": "sensor", "id": { "entity_id": "sensor.windsor_statements", "device_id": null } }, { "name": "windsor advisory sensor", "room": "windsor", "type": "sensor", "id": { "entity_id": "sensor.windsor_advisory", "device_id": null } }, { "name": "previous envcan alert title input text", "room": null, "type": "input_text", "id": { "entity_id": "input_text.previous_envcan_alert_title", "device_id": null } }, { "name": "previous envcan alert severity input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.previous_envcan_alert_severity", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "input text set value service", "room": null, "type": "service", "id": { "entity_id": "input_text.set_value", "device_id": null } } ] }, { "id": "turn_fan_schedule_on", "automation": "- id: turn_fan_schedule_on\n alias: Turn Fan Schedule On\n description: Start fan schedule when turned on.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_boolean.fan_schedule\n to: 'on'\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.fan_schedule_delay\n conditions:\n - condition: state\n entity_id: input_boolean.fan_schedule\n state: 'on'\n actions:\n - action: timer.start\n target:\n entity_id: timer.fan_schedule_duration\n data:\n duration:\n minutes: '{{ states(''input_number.fan_schedule_duration'') | int(0) }}'", "config": [ { "name": "fan schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.fan_schedule", "device_id": null } }, { "name": "fan schedule delay timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_delay", "device_id": null } }, { "name": "fan schedule duration timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_duration", "device_id": null } }, { "name": "fan schedule duration input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.fan_schedule_duration", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } } ] }, { "id": "turn_fan_schedule_off", "automation": "- id: turn_fan_schedule_off\n alias: Turn Fan Schedule Off\n description: Stop fan schedule when turned off.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.fan_schedule\n to: 'off'\n - trigger: event\n event_type: timer.cancelled\n event_data:\n entity_id: timer.fan_schedule_duration\n - trigger: event\n event_type: timer.cancelled\n event_data:\n entity_id: timer.fan_schedule_delay\n actions:\n - action: input_boolean.turn_off\n entity_id: input_boolean.fan_schedule\n - if: '{{ is_state_attr(''climate.house'', ''fan_mode'', ''on'') }}'\n then:\n - action: climate.set_fan_mode\n target:\n entity_id: climate.house\n data:\n fan_mode: 'off'\n - if:\n - condition: state\n entity_id: timer.fan_schedule_duration\n state:\n - paused\n - active\n then:\n - action: timer.cancel\n entity_id: timer.fan_schedule_duration\n - if:\n - condition: state\n entity_id: timer.fan_schedule_delay\n state:\n - paused\n - active\n then:\n - action: timer.cancel\n entity_id: timer.fan_schedule_delay", "config": [ { "name": "climate house climate", "room": null, "type": "climate", "id": { "entity_id": "climate.house", "device_id": null } }, { "name": "fan schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.fan_schedule", "device_id": null } }, { "name": "fan schedule delay timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_delay", "device_id": null } }, { "name": "fan schedule duration timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_duration", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } } ] }, { "id": "fan_schedule_delay", "automation": "- id: fan_schedule_delay\n alias: Fan Schedule Delay\n description: Start fan schedule delay.\n mode: restart\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.fan_schedule_duration\n conditions:\n - condition: state\n entity_id: input_boolean.fan_schedule\n state: 'on'\n actions:\n - action: timer.start\n target:\n entity_id: timer.fan_schedule_delay\n data:\n duration:\n minutes: '{{ states(''input_number.fan_schedule_delay'') | int(0) }}'", "config": [ { "name": "fan schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.fan_schedule", "device_id": null } }, { "name": "fan schedule delay timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_delay", "device_id": null } }, { "name": "fan schedule duration timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_duration", "device_id": null } }, { "name": "fan schedule delay input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.fan_schedule_delay", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } } ] }, { "id": "fan_schedule_adjusted", "automation": "- id: fan_schedule_adjusted\n alias: Fan Schedule Adjusted\n description: Reset fan schedule when duration/delay adjusted.\n mode: restart\n triggers:\n - trigger: state\n entity_id:\n - input_number.fan_schedule_duration\n - input_number.fan_schedule_delay\n conditions:\n - condition: state\n entity_id: input_boolean.fan_schedule\n state: 'on'\n actions:\n - delay: 30\n - choose:\n - conditions:\n - condition: state\n entity_id: timer.fan_schedule_duration\n state:\n - active\n - paused\n sequence:\n - action: timer.start\n target:\n entity_id: timer.fan_schedule_duration\n data:\n duration:\n seconds: '{{ states(''input_number.fan_schedule_duration'') | int(0)*60\n + 5 }}'\n - conditions:\n - condition: state\n entity_id: timer.fan_schedule_delay\n state:\n - active\n - paused\n sequence:\n - action: timer.start\n target:\n entity_id: timer.fan_schedule_delay\n data:\n duration:\n seconds: '{{ states(''input_number.fan_schedule_delay'') | int(0)*60 +\n 5 }}'\n - action: browser_mod.notification\n data:\n duration: 10000\n message: Scheduled climate fan timers have been adjusted.", "config": [ { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } }, { "name": "fan schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.fan_schedule", "device_id": null } }, { "name": "fan schedule delay timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_delay", "device_id": null } }, { "name": "fan schedule duration timer", "room": null, "type": "timer", "id": { "entity_id": "timer.fan_schedule_duration", "device_id": null } }, { "name": "fan schedule duration input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.fan_schedule_duration", "device_id": null } }, { "name": "fan schedule delay input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.fan_schedule_delay", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } } ] }, { "id": "turn_fan_timer_on", "automation": "- id: turn_fan_timer_on\n alias: Turn Fan Timer On\n description: Turn timer on when fan state changes.\n mode: parallel\n triggers:\n - trigger: state\n entity_id:\n - fan.bathroom_fan\n - fan.living_room_fan\n - fan.office_fan\n - fan.bedroom_fan\n to:\n - 'on'\n - 'off'\n conditions: '{{ iif(is_state_attr(trigger.entity_id, ''type'', ''vent''), trigger.to_state.state\n != ''off'', true) }}'\n actions:\n - action: timer.start\n target:\n entity_id: '{% from ''fan.jinja'' import fan_timer %} {{ fan_timer(trigger.entity_id)\n }}\n\n '", "config": [ { "name": "bathroom fan", "room": "bathroom", "type": "fan", "id": { "entity_id": "fan.bathroom_fan", "device_id": null } }, { "name": "bedroom fan", "room": "bedroom", "type": "fan", "id": { "entity_id": "fan.bedroom_fan", "device_id": null } }, { "name": "living room fan", "room": "living room", "type": "fan", "id": { "entity_id": "fan.living_room_fan", "device_id": null } }, { "name": "office fan", "room": "office", "type": "fan", "id": { "entity_id": "fan.office_fan", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } } ] }, { "id": "turn_fireplace_on", "automation": "- id: turn_fireplace_on\n alias: Turn Fireplace On\n description: Turn the fireplace on.\n initial_state: true\n triggers:\n - trigger: state\n id: alert\n entity_id: alert.indoor_low_temperature\n to: 'on'\n actions:\n - action: switch.turn_on\n data:\n entity_id: switch.fireplace\n - if:\n - condition: trigger\n id: alert\n then:\n - action: notify.jason\n data:\n title: Fireplace Alert\n message: 'The fireplace has been turned on because the indoor low temperture\n alert is on.\n\n HVAC Mode: {{ states(''climate.house'') }}\n\n HVAC State: {{ state_attr(''climate.house'', ''hvac_action'') }}\n\n Temperature: {{ states(''sensor.indoor_temperature'', with_unit=true) }}\n\n Target: {{ states(''sensor.indoor_temperature_target'', with_unit=true)\n }}\n\n '\n data:\n tag: fireplace_emergency_on\n group: Alert\n channel: alarm_stream\n notification_icon: mdi:fireplace\n icon_url: secret FIREPLACE_ICON\n ledColor: secret WARNING_COLOR\n color: secret WARNING_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/climate\n actions:\n - title: Fireplace Off\n action: fireplace_off", "config": [ { "name": "climate house climate", "room": null, "type": "climate", "id": { "entity_id": "climate.house", "device_id": null } }, { "name": "fireplace switch", "room": null, "type": "switch", "id": { "entity_id": "switch.fireplace", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } }, { "name": "indoor temperature sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.indoor_temperature", "device_id": null } }, { "name": "indoor temperature target sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.indoor_temperature_target", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "turn_fireplace_off", "automation": "- id: turn_fireplace_off\n alias: Turn Fireplace Off\n description: Turn the fireplace off.\n initial_state: true\n triggers:\n - trigger: state\n entity_id: switch.fireplace\n to: 'on'\n for:\n minutes: 60\n - trigger: numeric_state\n entity_id: sensor.living_room_sensor_temperature\n above: 22\n - trigger: state\n id: alert\n entity_id: alert.indoor_low_temperature\n to: idle\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: event\n id: notification\n event_type: mobile_app_notification_action\n event_data:\n action: fireplace_off\n conditions:\n - condition: state\n entity_id: switch.fireplace\n state: 'on'\n - or:\n - condition: numeric_state\n entity_id: sensor.living_room_sensor_temperature\n above: 22\n - condition: state\n entity_id: alert.indoor_low_temperature\n state: idle\n - condition: template\n value_template: '{{ trigger.id == ''notification'' }}'\n actions:\n - action: switch.turn_off\n data:\n entity_id: switch.fireplace", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "fireplace switch", "room": null, "type": "switch", "id": { "entity_id": "switch.fireplace", "device_id": null } }, { "name": "living room sensor temperature sensor", "room": "living room", "type": "sensor", "id": { "entity_id": "sensor.living_room_sensor_temperature", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } } ] }, { "id": "fireplace_safety_check", "automation": "- id: fireplace_safety_check\n alias: Fireplace Safety Check\n description: Fireplace off if nobody home.\n initial_state: true\n triggers:\n - trigger: time_pattern\n minutes: /5\n conditions:\n - condition: state\n entity_id: switch.fireplace\n state: 'on'\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'off'\n - condition: state\n entity_id: alert.indoor_low_temperature\n state: idle\n actions:\n - action: switch.turn_off\n target:\n entity_id: switch.fireplace\n - action: notify.jason\n data:\n title: Fireplace Alert\n message: The fireplace was on but nobody is home. It has been turned off.\n data:\n tag: fireplace_off\n group: Alert\n channel: Urgent\n visibility: public\n notification_icon: mdi:fireplace\n icon_url: secret FIREPLACE_ICON\n ledColor: secret WARNING_COLOR\n color: secret WARNING_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/climate", "config": [ { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "fireplace switch", "room": null, "type": "switch", "id": { "entity_id": "switch.fireplace", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "turn_furnace_filter_on", "automation": "- id: turn_furnace_filter_on\n alias: Turn Furnace Filter On\n description: Turn on reminder active boolean.\n triggers:\n - trigger: template\n value_template: \"{% if is_state('input_boolean.furnace_filter_enabled', 'on')\\\n \\ %}\\n {% set time = states('sensor.time') %}\\n {% set shift = state_attr('sensor.work_status',\\\n \\ 'shift') %}\\n {% set last_run = states('button.furnace_filter_done') %}\\n\\\n \\ {% set filter_hours = states('sensor.furnace_filter_hours') | int(-1) %}\\n\\\n \\ {% set limit = states('input_number.furnace_filter_hours') | int(-1) %}\\n\\\n \\ {{ filter_hours >= limit\\n and ((shift == 'Days' and time == states('input_datetime.furnace_filter_days')[0:5])\\n\\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.furnace_filter_afternoons')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.furnace_filter_weekends')[0:5]))\\\n \\ }}\\n{% endif %}\\n\"\n action:\n - if: '{{ is_state(''input_boolean.furnace_filter_active'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.furnace_filter_active\n - if: '{{ is_state(''input_boolean.furnace_filter_paused'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.furnace_filter_paused\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.furnace_filter_paused\n - if: '{{ is_state(''input_boolean.furnace_filter_skipped'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.furnace_filter_skipped\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.furnace_filter_active", "config": [ { "name": "work status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_status", "device_id": null } }, { "name": "furnace filter enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_enabled", "device_id": null } }, { "name": "furnace filter hours sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.furnace_filter_hours", "device_id": null } }, { "name": "furnace filter hours input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.furnace_filter_hours", "device_id": null } }, { "name": "furnace filter days input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.furnace_filter_days", "device_id": null } }, { "name": "furnace filter afternoons input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.furnace_filter_afternoons", "device_id": null } }, { "name": "furnace filter weekends input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.furnace_filter_weekends", "device_id": null } }, { "name": "furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_active", "device_id": null } }, { "name": "furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_paused", "device_id": null } }, { "name": "furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_skipped", "device_id": null } }, { "name": "furnace filter done button", "room": null, "type": "button", "id": { "entity_id": "button.furnace_filter_done", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } } ] }, { "id": "furnace_filter_done", "automation": "- id: furnace_filter_done\n alias: Furnace Filter Done\n description: Mark reminder completed.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: furnace_filter_done\n condition:\n - condition: state\n entity_id: input_boolean.furnace_filter_active\n state: 'on'\n action:\n - action: button.press\n target:\n entity_id: button.furnace_filter_done", "config": [ { "name": "furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_active", "device_id": null } }, { "name": "furnace filter done button", "room": null, "type": "button", "id": { "entity_id": "button.furnace_filter_done", "device_id": null } } ] }, { "id": "skip_furnace_filter", "automation": "- id: skip_furnace_filter\n alias: Skip Furnace Filter\n description: Skip reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: skip_furnace_filter\n action:\n - action: button.press\n target:\n entity_id: button.skip_furnace_filter", "config": [ { "name": "skip furnace filter button", "room": null, "type": "button", "id": { "entity_id": "button.skip_furnace_filter", "device_id": null } } ] }, { "id": "pause_furnace_filter", "automation": "- id: pause_furnace_filter\n alias: Pause Furnace Filter\n description: Pause reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: pause_furnace_filter\n action:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.furnace_filter_paused", "config": [ { "name": "furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_paused", "device_id": null } } ] }, { "id": "reset_pause_furnace_filter", "automation": "- id: reset_pause_furnace_filter\n alias: Reset Pause Furnace Filter\n description: Reset reminder paused boolean.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.furnace_filter_skipped\n to: 'on'\n - trigger: state\n entity_id: input_boolean.furnace_filter_paused\n to: 'on'\n for:\n hours: 24\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'on'\n for:\n minutes: 15\n condition:\n - condition: state\n entity_id: input_boolean.furnace_filter_paused\n state: 'on'\n action:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.furnace_filter_paused", "config": [ { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_paused", "device_id": null } }, { "name": "furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_skipped", "device_id": null } } ] }, { "id": "reset_furnace_filter_booleans", "automation": "- id: reset_furnace_filter_booleans\n alias: Reset Furnace Filter Booleans\n description: Reset reminder booleans if reminder disabled, completed, or not active.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: enabled\n entity_id: input_boolean.furnace_filter_enabled\n to: 'off'\n - trigger: state\n id: done\n entity_id: input_boolean.furnace_filter_active\n to: 'off'\n - trigger: state\n id: entity\n entity_id: &id003\n - input_boolean.furnace_filter_active\n - input_boolean.furnace_filter_paused\n - input_boolean.furnace_filter_skipped\n to: 'on'\n condition:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.furnace_filter_enabled\n state: 'off'\n - condition: template\n alias: Pause boolean turned on when reminder is skipped or isn't active\n value_template: \"{{ trigger.entity_id == 'input_boolean.furnace_filter_paused'\\n\\\n \\ and (is_state('input_boolean.furnace_filter_active', 'off')\\n or\\\n \\ is_state('input_boolean.furnace_filter_skipped', 'on')) }}\\n\"\n - condition: template\n alias: Reminder completed\n value_template: '{{ trigger.id == ''done'' }}'\n action:\n - if: '{{ trigger.id == ''entity'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: *id003", "config": [ { "name": "furnace filter enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_enabled", "device_id": null } }, { "name": "furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_active", "device_id": null } }, { "name": "furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_paused", "device_id": null } }, { "name": "furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_skipped", "device_id": null } } ] }, { "id": "furnace_filter_notification", "automation": "- id: furnace_filter_notification\n alias: Furnace Filter Notification\n description: Send notification until reminder is off.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_boolean.furnace_filter_active\n to: 'on'\n - trigger: state\n entity_id: input_boolean.furnace_filter_paused\n to: 'off'\n condition:\n - condition: state\n entity_id: input_boolean.furnace_filter_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.furnace_filter_paused\n state: 'off'\n action:\n - repeat:\n sequence:\n - if: '{{ not is_state(''input_select.occupancy_mode'', ''Night'') }}'\n then:\n - action: notify.jason\n data:\n message: Change the Furnace Filter.\n data:\n tag: furnace_filter_reminder\n group: Reminder\n visibility: public\n persistent: true\n notification_icon: mdi:air-filter\n icon_url: secret AIR_FILTER_ICON\n actions:\n - title: Pause\n action: pause_furnace_filter\n - title: Skip\n action: skip_furnace_filter\n - title: Done\n action: furnace_filter_done\n - wait_template: \"{{ is_state('input_boolean.furnace_filter_active', 'off')\\n\\\n \\ or is_state('input_boolean.furnace_filter_paused', 'on') }}\\n\"\n timeout:\n minutes: 2\n - if:\n - condition: state\n entity_id: input_boolean.furnace_filter_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.furnace_filter_paused\n state: 'off'\n then:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: Hey J The furnace filter needs to be changed\n quiet_play: true\n - wait_template: \"{{ is_state('input_boolean.furnace_filter_active', 'off')\\n\\\n \\ or is_state('input_boolean.furnace_filter_paused', 'on') }}\\n\"\n timeout:\n minutes: '{{ states(''input_number.furnace_filter_notification_interval'')\n | int }}'\n until:\n - or:\n - condition: state\n entity_id: input_boolean.furnace_filter_active\n state: 'off'\n - condition: state\n entity_id: input_boolean.furnace_filter_paused\n state: 'on'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_active", "device_id": null } }, { "name": "furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_paused", "device_id": null } }, { "name": "furnace filter notification interval input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.furnace_filter_notification_interval", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "clear_furnace_filter_notification", "automation": "- id: clear_furnace_filter_notification\n alias: Clear Furnace Filter Notification\n description: Clear reminder notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.furnace_filter_active\n to: 'off'\n - trigger: state\n entity_id:\n - input_boolean.furnace_filter_paused\n - input_boolean.furnace_filter_skipped\n to: 'on'\n action:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: furnace_filter_reminder", "config": [ { "name": "furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_active", "device_id": null } }, { "name": "furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_paused", "device_id": null } }, { "name": "furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.furnace_filter_skipped", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "garage_door_check", "automation": "- id: garage_door_check\n alias: Garage Door Check\n description: Send notification, play announcement.\n mode: restart\n trigger:\n - platform: state\n id: open\n entity_id: cover.garage_door\n to: opening\n - platform: state\n id: closed\n entity_id: cover.garage_door\n to: closing\n action:\n - action: script.garage_door_check\n data:\n check_state: '{{ trigger.id }}'", "config": [ { "name": "garage door cover", "room": "garage", "type": "cover", "id": { "entity_id": "cover.garage_door", "device_id": null } }, { "name": "garage door check script", "room": null, "type": "script", "id": { "entity_id": "script.garage_door_check", "device_id": null } }, { "name": "garage door script", "room": null, "type": "script", "id": { "entity_id": "script.garage_door", "device_id": null } } ] }, { "id": "garage_door_extended_open_alert", "automation": "- id: garage_door_extended_open_alert\n alias: Garage Door Extended Open Alert\n description: Send notification, play announcement.\n trigger:\n - platform: state\n entity_id: binary_sensor.garage_door\n to: 'on'\n for:\n minutes: 20\n action:\n - service: input_boolean.turn_on\n target:\n entity_id: input_boolean.garage_door_alert\n - repeat:\n sequence:\n - variables:\n open_time: '{{ as_local(states.binary_sensor.garage_door.last_changed).strftime(''%-I:%M\n %p'') }}'\n open_duration: '{{ time_since(states.binary_sensor.garage_door.last_changed,2)\n }}'\n - service: script.garage_door_notification\n data:\n message: 'Garage door has been open for {{ open_duration }}. Opened at:\n {{ open_time }}\n\n '\n notify: jason\n - wait_template: \"{{ is_state('input_boolean.garage_door_alert','off')\\n \\\n \\ or is_state('binary_sensor.garage_door','off') }}\\n\"\n timeout:\n minutes: 15\n until: \"{{ is_state('input_boolean.garage_door_alert','off')\\n or is_state('binary_sensor.garage_door','off')\\\n \\ }}\\n\"\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.garage_door_alert", "config": [ { "name": "garage door binary sensor", "room": "garage", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_door", "device_id": null } }, { "name": "garage door alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_door_alert", "device_id": null } }, { "name": "garage door notification script", "room": null, "type": "script", "id": { "entity_id": "script.garage_door_notification", "device_id": null } }, { "name": "garage door script", "room": null, "type": "script", "id": { "entity_id": "script.garage_door", "device_id": null } } ] }, { "id": "clear_garage_doo_alert_notification", "automation": "- id: clear_garage_doo_alert_notification\n alias: Clear Garage Door Alert Notification\n description: Turn off alert, clear notification.\n max_exceeded: silent\n trigger:\n - platform: state\n entity_id: input_boolean.garage_door_alert\n to: 'off'\n - platform: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_off_garage_door_alert\n action:\n - service: input_boolean.turn_off\n target:\n entity_id: input_boolean.garage_door_alert\n - service: notify.jason\n data:\n message: clear_notification\n data:\n tag: garage_door_alert", "config": [ { "name": "garage door alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_door_alert", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "turn_garage_freeze_protection_on", "automation": "- id: turn_garage_freeze_protection_on\n alias: Turn Garage Freeze Protection On\n description: Turn garage freeze protection boolean on.\n mode: restart\n triggers:\n - trigger: state\n entity_id: climate.garage\n attribute: preset_mode\n to: eco\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.garage_freeze_protection", "config": [ { "name": "garage climate", "room": "garage", "type": "climate", "id": { "entity_id": "climate.garage", "device_id": null } }, { "name": "garage freeze protection input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_freeze_protection", "device_id": null } } ] }, { "id": "turn_garage_furnace_on", "automation": "- id: turn_garage_furnace_on\n alias: Turn Garage Furnace On\n description: Turn garage furnace on.\n mode: restart\n triggers:\n - trigger: state\n id: freeze\n entity_id: input_boolean.garage_freeze_protection\n to: 'on'\n - trigger: state\n id: furnace\n entity_id: switch.garage_furnace\n to: 'on'\n for: 5\n - trigger: state\n id: thermostat\n entity_id: climate.garage\n to: 'off'\n conditions:\n - condition: state\n entity_id: climate.garage\n state: 'off'\n - condition: template\n value_template: \"{{ is_state('input_boolean.garage_freeze_protection', 'on')\\n\\\n \\ if trigger.id == 'thermostat' else true }}\\n\"\n actions:\n - if: '{{ trigger.id != ''furnace'' }}'\n then:\n - wait_template: '{{ is_state(''binary_sensor.garage_door'', ''off'') }}'\n timeout:\n minutes: 15\n continue_on_timeout: false\n - if: '{{ trigger.id == ''furnace'' or is_state(''binary_sensor.garage_door'', ''off'')\n }}'\n then:\n - action: climate.set_preset_mode\n target:\n entity_id: climate.garage\n data:\n preset_mode: '{{ iif(trigger.id in [''freeze'', ''thermostat''], ''eco'',\n ''home'') }}'\n continue_on_error: true\n - action: climate.turn_on\n target:\n entity_id: climate.garage", "config": [ { "name": "garage climate", "room": "garage", "type": "climate", "id": { "entity_id": "climate.garage", "device_id": null } }, { "name": "garage door binary sensor", "room": "garage", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_door", "device_id": null } }, { "name": "garage freeze protection input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_freeze_protection", "device_id": null } }, { "name": "garage furnace switch", "room": "garage", "type": "switch", "id": { "entity_id": "switch.garage_furnace", "device_id": null } } ] }, { "id": "turn_garage_furnace_off", "automation": "- id: turn_garage_furnace_off\n alias: Turn Garage Furnace Off\n description: Turn garage furnace off.\n mode: restart\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: state\n id: high_temp\n entity_id: alert.garage_high_temperature\n to: 'on'\n for:\n minutes: 5\n - trigger: state\n id: garage\n entity_id: binary_sensor.garage_door\n to: 'on'\n from: 'off'\n for:\n minutes: 2\n - trigger: state\n entity_id: switch.garage_furnace\n to: 'off'\n for: 5\n - trigger: state\n id: freeze\n entity_id: input_boolean.garage_freeze_protection\n to: 'off'\n - trigger: state\n id: thermostat\n entity_id: climate.garage\n to: heat\n conditions:\n - condition: state\n entity_id: climate.garage\n state: heat\n - condition: template\n value_template: \"{{ iif(trigger.id == 'thermostat',\\n is_state('binary_sensor.garage_door',\\\n \\ 'on'), true) }}\\n\"\n actions:\n - action: climate.turn_off\n target:\n entity_id: climate.garage\n continue_on_error: true\n - if: '{{ trigger.id in [''garage'', ''thermostat''] }}'\n then:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: The garage heat has been turned off because the garage door is\n open.\n continue_on_error: true\n - wait_template: '{{ is_state(''binary_sensor.garage_door'', ''off'') }}'\n timeout:\n minutes: 15\n continue_on_timeout: false\n - condition: template\n value_template: '{{ is_state(''binary_sensor.garage_occupied'', ''on'') }}'\n - action: climate.turn_on\n target:\n entity_id: climate.garage\n continue_on_error: true\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'The garage heat has been turned back on.\n\n The thermostat is set to {{ state_attr(''climate.garage'', ''temperature'')\n }} degrees.\n\n The current garage temperature is {{ states(''sensor.garage_sensor_air_temperature'')\n }} degrees.\n\n '\n media_player: media_player.office_speaker", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "garage sensor air temperature", "room": "garage", "type": "sensor", "id": { "entity_id": "sensor.garage_sensor_air_temperature", "device_id": null } }, { "name": "garage climate", "room": "garage", "type": "climate", "id": { "entity_id": "climate.garage", "device_id": null } }, { "name": "garage door binary sensor", "room": "garage", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_door", "device_id": null } }, { "name": "garage freeze protection input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_freeze_protection", "device_id": null } }, { "name": "garage furnace switch", "room": "garage", "type": "switch", "id": { "entity_id": "switch.garage_furnace", "device_id": null } }, { "name": "garage high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.garage_high_temperature", "device_id": null } }, { "name": "garage occupied binary sensor", "room": "garage", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_occupied", "device_id": null } }, { "name": "office speaker media player", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_speaker", "device_id": null } } ] }, { "id": "turn_garage_furnace_filter_on", "automation": "- id: turn_garage_furnace_filter_on\n alias: Turn Garage Furnace Filter On\n description: Turn on reminder active boolean.\n triggers:\n - trigger: template\n value_template: \"{% if is_state('input_boolean.garage_furnace_filter_enabled',\\\n \\ 'on') %}\\n {% set time = states('sensor.time') %}\\n {% set shift = state_attr('sensor.work_status',\\\n \\ 'shift') %}\\n {% set last_run = states('button.garage_furnace_filter_done')\\\n \\ %}\\n {% set filter_hours = states('sensor.garage_furnace_filter_hours') |\\\n \\ int(-1) %}\\n {% set limit = states('input_number.garage_furnace_filter_hours')\\\n \\ | int(-1) %}\\n {{ filter_hours >= limit\\n and ((shift == 'Days' and\\\n \\ time == states('input_datetime.garage_furnace_filter_days')[0:5])\\n \\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.garage_furnace_filter_afternoons')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.garage_furnace_filter_weekends')[0:5]))\\\n \\ }}\\n{% endif %}\\n\"\n action:\n - if: '{{ is_state(''input_boolean.garage_furnace_filter_active'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.garage_furnace_filter_active\n - if: '{{ is_state(''input_boolean.garage_furnace_filter_paused'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.garage_furnace_filter_paused\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.garage_furnace_filter_paused\n - if: '{{ is_state(''input_boolean.garage_furnace_filter_skipped'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.garage_furnace_filter_skipped\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.garage_furnace_filter_active", "config": [ { "name": "work status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_status", "device_id": null } }, { "name": "garage furnace filter enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_enabled", "device_id": null } }, { "name": "garage furnace filter hours sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.garage_furnace_filter_hours", "device_id": null } }, { "name": "garage furnace filter hours input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.garage_furnace_filter_hours", "device_id": null } }, { "name": "garage furnace filter days input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.garage_furnace_filter_days", "device_id": null } }, { "name": "garage furnace filter afternoons input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.garage_furnace_filter_afternoons", "device_id": null } }, { "name": "garage furnace filter weekends input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.garage_furnace_filter_weekends", "device_id": null } }, { "name": "garage furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_active", "device_id": null } }, { "name": "garage furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_paused", "device_id": null } }, { "name": "garage furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_skipped", "device_id": null } }, { "name": "garage furnace filter done button", "room": null, "type": "button", "id": { "entity_id": "button.garage_furnace_filter_done", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } } ] }, { "id": "garage_furnace_filter_done", "automation": "- id: garage_furnace_filter_done\n alias: Garage Furnace Filter Done\n description: Mark reminder completed.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: garage_furnace_filter_done\n condition:\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_active\n state: 'on'\n action:\n - action: button.press\n target:\n entity_id: button.garage_furnace_filter_done", "config": [ { "name": "garage furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_active", "device_id": null } }, { "name": "garage furnace filter done button", "room": null, "type": "button", "id": { "entity_id": "button.garage_furnace_filter_done", "device_id": null } } ] }, { "id": "skip_garage_furnace_filter", "automation": "- id: skip_garage_furnace_filter\n alias: Skip Garage Furnace Filter\n description: Skip reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: skip_garage_furnace_filter\n action:\n - action: button.press\n target:\n entity_id: button.skip_garage_furnace_filter", "config": [ { "name": "skip garage furnace filter button", "room": null, "type": "button", "id": { "entity_id": "button.skip_garage_furnace_filter", "device_id": null } } ] }, { "id": "pause_garage_furnace_filter", "automation": "- id: pause_garage_furnace_filter\n alias: Pause Garage Furnace Filter\n description: Pause reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: pause_garage_furnace_filter\n action:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.garage_furnace_filter_paused", "config": [ { "name": "garage furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_paused", "device_id": null } } ] }, { "id": "reset_pause_garage_furnace_filter", "automation": "- id: reset_pause_garage_furnace_filter\n alias: Reset Pause Garage Furnace Filter\n description: Reset reminder paused boolean.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.garage_furnace_filter_skipped\n to: 'on'\n - trigger: state\n entity_id: input_boolean.garage_furnace_filter_paused\n to: 'on'\n for:\n hours: 24\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'on'\n for:\n minutes: 15\n condition:\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_paused\n state: 'on'\n action:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.garage_furnace_filter_paused", "config": [ { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "garage furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_paused", "device_id": null } }, { "name": "garage furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_skipped", "device_id": null } } ] }, { "id": "reset_garage_furnace_filter_booleans", "automation": "- id: reset_garage_furnace_filter_booleans\n alias: Reset Garage Furnace Filter Booleans\n description: Reset reminder booleans if reminder disabled, completed, or not active.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: enabled\n entity_id: input_boolean.garage_furnace_filter_enabled\n to: 'off'\n - trigger: state\n id: done\n entity_id: input_boolean.garage_furnace_filter_active\n to: 'off'\n - trigger: state\n id: entity\n entity_id: &id004\n - input_boolean.garage_furnace_filter_active\n - input_boolean.garage_furnace_filter_paused\n - input_boolean.garage_furnace_filter_skipped\n to: 'on'\n condition:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_enabled\n state: 'off'\n - condition: template\n alias: Pause boolean turned on when reminder is skipped or isn't active\n value_template: \"{{ trigger.entity_id == 'input_boolean.garage_furnace_filter_paused'\\n\\\n \\ and (is_state('input_boolean.garage_furnace_filter_active', 'off')\\n\\\n \\ or is_state('input_boolean.garage_furnace_filter_skipped', 'on')) }}\\n\"\n - condition: template\n alias: Reminder completed\n value_template: '{{ trigger.id == ''done'' }}'\n action:\n - if: '{{ trigger.id == ''entity'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: *id004", "config": [ { "name": "garage furnace filter enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_enabled", "device_id": null } }, { "name": "garage furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_active", "device_id": null } }, { "name": "garage furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_paused", "device_id": null } }, { "name": "garage furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_skipped", "device_id": null } } ] }, { "id": "garage_furnace_filter_notification", "automation": "- id: garage_furnace_filter_notification\n alias: Garage Furnace Filter Notification\n description: Send notification until reminder is off.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_boolean.garage_furnace_filter_active\n to: 'on'\n - trigger: state\n entity_id: input_boolean.garage_furnace_filter_paused\n to: 'off'\n condition:\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_paused\n state: 'off'\n action:\n - repeat:\n sequence:\n - if: '{{ not is_state(''input_select.occupancy_mode'', ''Night'') }}'\n then:\n - action: notify.jason\n data:\n message: 'Change the Garage Furnace Filter. Hours: {{ ''%0.01f'' | format(states(''sensor.furnace_filter_hours'')\n | float(-1)) }}\n\n '\n data:\n tag: garage_furnace_filter_reminder\n group: Reminder\n visibility: public\n persistent: true\n notification_icon: mdi:air-filter\n icon_url: secret AIR_FILTER_ICON\n actions:\n - title: Pause\n action: pause_garage_furnace_filter\n - title: Skip\n action: skip_garage_furnace_filter\n - title: Done\n action: garage_furnace_filter_done\n - wait_template: \"{{ is_state('input_boolean.garage_furnace_filter_active',\\\n \\ 'off')\\n or is_state('input_boolean.garage_furnace_filter_paused',\\\n \\ 'on') }}\\n\"\n timeout:\n minutes: 2\n - if:\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_paused\n state: 'off'\n then:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: Hey J The furnace filter needs to be changed\n quiet_play: true\n - wait_template: \"{{ is_state('input_boolean.garage_furnace_filter_active',\\\n \\ 'off')\\n or is_state('input_boolean.garage_furnace_filter_paused',\\\n \\ 'on') }}\\n\"\n timeout:\n minutes: '{{ states(''input_number.garage_furnace_filter_notification_interval'')\n | int }}'\n until:\n - or:\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_active\n state: 'off'\n - condition: state\n entity_id: input_boolean.garage_furnace_filter_paused\n state: 'on'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "furnace filter hours sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.furnace_filter_hours", "device_id": null } }, { "name": "garage furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_active", "device_id": null } }, { "name": "garage furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_paused", "device_id": null } }, { "name": "garage furnace filter notification interval input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.garage_furnace_filter_notification_interval", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "clear_garage_furnace_filter_notification", "automation": "- id: clear_garage_furnace_filter_notification\n alias: Clear Garage Furnace Filter Notification\n description: Clear reminder notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.garage_furnace_filter_active\n to: 'off'\n - trigger: state\n entity_id:\n - input_boolean.garage_furnace_filter_paused\n - input_boolean.garage_furnace_filter_skipped\n to: 'on'\n action:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: garage_furnace_filter_reminder", "config": [ { "name": "garage furnace filter active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_active", "device_id": null } }, { "name": "garage furnace filter paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_paused", "device_id": null } }, { "name": "garage furnace filter skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_furnace_filter_skipped", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "turn_garage_lights_on", "automation": "- id: turn_garage_lights_on\n alias: Turn Garage Lights On\n description: Turn on light.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: garage\n entity_id: binary_sensor.garage_occupied\n to: 'on'\n from: 'off'\n - trigger: state\n id: lock\n entity_id: lock.garage_side_door_lock\n to: unlocked\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n actions:\n - action: script.turn_light_on\n data:\n entity_id: light.garage_lights\n activate_timer: false", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "garage occupied binary sensor", "room": "garage", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_occupied", "device_id": null } }, { "name": "garage lights light", "room": "garage", "type": "light", "id": { "entity_id": "light.garage_lights", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "garage light", "room": "garage", "type": "light", "id": { "entity_id": "light.garage_light", "device_id": null } }, { "name": "garage side door lock", "room": "garage", "type": "lock", "id": { "entity_id": "lock.garage_side_door_lock", "device_id": null } } ] }, { "id": "turn_garage_light_off", "automation": "- id: turn_garage_light_off\n alias: Turn Garage Light Off\n description: Turn off light.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: garage\n entity_id: binary_sensor.garage_occupied\n to: 'off'\n from: 'on'\n for:\n minutes: 15\n - trigger: state\n id: lock\n entity_id: lock.garage_side_door_lock\n to: locked\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.garage_occupied\n state: 'off'\n actions:\n - action: light.turn_off\n target:\n entity_id:\n - light.garage_light\n - light.workbench_light", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "garage occupied binary sensor", "room": "garage", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_occupied", "device_id": null } }, { "name": "garage light", "room": "garage", "type": "light", "id": { "entity_id": "light.garage_light", "device_id": null } }, { "name": "workbench light", "room": "garage", "type": "light", "id": { "entity_id": "light.workbench_light", "device_id": null } }, { "name": "garage side door lock", "room": "garage", "type": "lock", "id": { "entity_id": "lock.garage_side_door_lock", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } } ] }, { "id": "guest_home_alert", "automation": "- id: guest_home_alert\n alias: Guest Home Alert\n description: Sent notification if guest home when owners leave.\n triggers:\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'off'\n from: 'on'\n for:\n minutes: 5\n conditions:\n - condition: state\n entity_id:\n - input_boolean.occupancy_notifications\n - binary_sensor.guest_home\n state: 'on'\n actions:\n - action: notify.jason\n data:\n title: Guest Home\n message: 'Mode: {{ states(''input_select.occupancy_mode'') }}\n\n Alarm: {{ states(''sensor.alarm_status'') }}\n\n '\n data:\n tag: guest_alert\n notification_icon: '{{ state_attr(''binary_sensor.guest_home'', ''icon'')\n }}'\n icon_url: secret GUEST_ICON\n actions:\n - title: Away\n action: set_away_mode", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "guest home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.guest_home", "device_id": null } }, { "name": "occupancy notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_notifications", "device_id": null } }, { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "alarm status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_status", "device_id": null } } ] }, { "id": "hass_alert_notification", "automation": "- id: hass_alert_notification\n alias: HASS Alert Notification\n description: Send or clear HASS alert notifications.\n mode: parallel\n variables:\n tag: '{{ states[trigger.entity_id].object_id }}'\n group: group.{{ states[trigger.entity_id].object_id }}\n triggers:\n - trigger: state\n entity_id:\n - group.available_updates\n - group.offline_integrations\n - group.unavailable_entities\n - group.unknown_browsers\n attribute: entity_id\n to: null\n for: 60\n - trigger: state\n entity_id:\n - alert.available_updates\n - alert.offline_integrations\n - alert.unavailable_entities\n - alert.unknown_browsers\n conditions: '{{ is_state(''input_boolean.'' ~ state_attr(''alert.'' ~ tag, ''category'')\n ~ ''_alerts'', ''on'') }}'\n actions:\n - delay: 1\n - if: '{{ is_state(''alert.'' ~ tag, ''on'') }}'\n then:\n - if: '{{ state_attr(group, ''entity_id'') | count > 0 }}'\n then:\n - action: notify.jason\n data:\n title: '{{ tag | replace(''_'', '' '') | title }}'\n message: \"{{- expand(state_attr(group, 'entity_id'))\\n | map(attribute='name')\\\n \\ | sort | join('\\\\n') | truncate(500) -}}\\n\"\n data:\n tag: '{{ tag }}'\n group: System\n channel: Alert\n visibility: public\n notification_icon: mdi:alert-circle\n icon_url: secret HASS_ICON\n ledColor: secret WARNING_COLOR\n color: secret WARNING_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-hass/hass\n actions:\n - title: Pause\n action: pause_alert_{{ tag }}\n else:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: '{{ tag }}'", "config": [ { "name": "offline integrations group", "room": null, "type": "group", "id": { "entity_id": "group.offline_integrations", "device_id": null } }, { "name": "available updates group", "room": null, "type": "group", "id": { "entity_id": "group.available_updates", "device_id": null } }, { "name": "unavailable entities group", "room": null, "type": "group", "id": { "entity_id": "group.unavailable_entities", "device_id": null } }, { "name": "unknown browsers group", "room": null, "type": "group", "id": { "entity_id": "group.unknown_browsers", "device_id": null } }, { "name": "available updates alert", "room": null, "type": "alert", "id": { "entity_id": "alert.available_updates", "device_id": null } }, { "name": "offline integrations alert", "room": null, "type": "alert", "id": { "entity_id": "alert.offline_integrations", "device_id": null } }, { "name": "unavailable entities alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unavailable_entities", "device_id": null } }, { "name": "unknown browsers alert", "room": null, "type": "alert", "id": { "entity_id": "alert.unknown_browsers", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "hass_notification_actions", "automation": "- id: hass_notification_actions\n alias: HASS Notification Actions\n description: HASS alert notification actions.\n max_exceeded: silent\n triggers:\n - trigger: event\n id: restart\n event_type: mobile_app_notification_action\n event_data:\n action: restart_hass\n - trigger: event\n id: reboot\n event_type: mobile_app_notification_action\n event_data:\n action: reboot_server\n - trigger: event\n id: shutdown\n event_type: mobile_app_notification_action\n event_data:\n action: shutdown_server\n actions:\n - choose:\n - conditions:\n - condition: trigger\n id: restart\n sequence:\n - action: homeassistant.restart\n - conditions:\n - condition: trigger\n id: reboot\n sequence:\n - action: hassio.host_reboot\n - conditions:\n - condition: trigger\n id: shutdown\n sequence:\n - action: hassio.host_shutdown", "config": [] }, { "id": "hass_startup", "automation": "- id: hass_startup\n alias: HASS Startup\n description: Turn off boolean when devices loaded, send restart notifications.\n triggers:\n - trigger: homeassistant\n event: start\n actions:\n - action: system_log.write\n data:\n logger: '{{ this.entity_id }}'\n level: critical\n message: '**** HOME ASSISTANT START ****'\n - delay: 60\n - wait_template: \"{{ is_state('input_boolean.startup_pending', 'off')\\n or (is_state('binary_sensor.wan',\\\n \\ 'on')\\n and states('sensor.offline_integrations') | int(-1) == 0\\n \\\n \\ and states('sensor.offline_zwave_devices') | int(-1) == 0)\\n and states('sensor.unavailable_entities')\\\n \\ | int(-1) == 0 }}\\n\"\n timeout:\n minutes: 2\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.startup_pending\n - action: persistent_notification.create\n data:\n title: HASS Restarted\n message: Restarted at {{ now().strftime('%-I:%M %p') }}.\n notification_id: hass_restart\n - if:\n - condition: state\n entity_id: input_boolean.hass_alerts\n state: 'on'\n then:\n - action: notify.jason\n data:\n title: HASS Restarted\n message: Restarted at {{ now().strftime('%-I:%M %p') }}.\n data:\n tag: hass_restart\n group: System\n visibility: public\n icon_url: secret HASS_ICON\n clickAction: /ui-mobile/home\n - if:\n - condition: state\n entity_id: sensor.jlaptop_chrome_external_browser_user\n state: Jason\n then:\n - action: notify.html5\n data:\n title: HASS Restarted\n message: Restarted at {{ now().strftime('%-I:%M %p') }}.\n target: jlaptop_external\n data:\n tag: hass_restart\n timestamp: '{{ now().timestamp() }}'\n renotify: true\n silent: true\n requireInteraction: false\n url: /lovelace\n icon: secret HASS_ICON\n badge: secret HASS_BADGE\n actions:\n - title: Dismiss\n action: dismiss_hass_restart\n - action: system_log.write\n data:\n logger: '{{ this.entity_id }}'\n level: critical\n message: '**** HOME ASSISTANT STARTUP COMPLETE ****'\n - action: browser_mod.refresh", "config": [ { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "hass alerts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.hass_alerts", "device_id": null } }, { "name": "jlaptop chrome external browser user sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jlaptop_chrome_external_browser_user", "device_id": null } }, { "name": "html5 notify", "room": null, "type": null, "id": { "entity_id": "notify.html5", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "system log write service", "room": null, "type": "service", "id": { "entity_id": "system_log.write", "device_id": null } }, { "name": "wan binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wan", "device_id": null } }, { "name": "offline zwave devices sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.offline_zwave_devices", "device_id": null } }, { "name": "unavailable entities sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.unavailable_entities", "device_id": null } }, { "name": "JLaptop External", "room": null, "type": null, "id": { "entity_id": "jlaptop_external", "device_id": null } }, { "name": "Offline Integrations Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.offline_integrations", "device_id": null } } ] }, { "id": "hass_shutdown", "automation": "- id: hass_shutdown\n alias: HASS Shutdown\n description: Actions to perform on HA shutdown.\n triggers:\n - trigger: homeassistant\n event: shutdown\n actions:\n - action: system_log.write\n data:\n logger: '{{ this.entity_id }}'\n level: critical\n message: '**** HOME ASSISTANT STOP ****'", "config": [ { "name": "system log write service", "room": null, "type": "service", "id": { "entity_id": "system_log.write", "device_id": null } } ] }, { "id": "clear_hass_restart_notification", "automation": "- id: clear_hass_restart_notification\n alias: Clear HASS Restart Notification\n description: Clear HASS restart notification.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: html5_notification.closed\n event_data:\n tag: hass_restart\n - trigger: event\n event_type: html5_notification.clicked\n event_data:\n action: dismiss_hass_restart\n - trigger: event\n event_type: mobile_app_notification_cleared\n event_data:\n tag: hass_restart\n actions:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: hass_restart\n - action: html5.dismiss\n data:\n data:\n tag: hass_restart\n - action: persistent_notification.dismiss\n data:\n notification_id: hass_restart\n - delay:\n seconds: 60", "config": [ { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "turn_hot_tub_scene_off", "automation": "- id: turn_hot_tub_scene_off\n alias: Turn Hot Tub Scene Off\n description: Turn off hot_tub scene.\n max_exceeded: silent\n trigger:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.hot_tub_scene\n action:\n - action: switch.turn_off\n target:\n entity_id: switch.hot_tub_scene", "config": [ { "name": "hot tub scene timer", "room": null, "type": "timer", "id": { "entity_id": "timer.hot_tub_scene", "device_id": null } }, { "name": "hot tub scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.hot_tub_scene", "device_id": null } } ] }, { "id": "illuminance_lighting", "automation": "- id: illuminance_lighting\n alias: Illuminance Lighting\n description: Turn lights on based on outdoor illuminance.\n mode: restart\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: state\n id: day_lux\n entity_id: binary_sensor.daytime_illuminance\n to: 'off'\n from: 'on'\n for:\n minutes: 15\n - trigger: state\n id: day_lux\n entity_id: binary_sensor.daytime_illuminance\n to: 'on'\n from: 'off'\n - trigger: state\n id: night_lux\n entity_id: binary_sensor.nighttime_illuminance\n to: 'off'\n from: 'on'\n for:\n minutes: 15\n - trigger: state\n id: night_lux\n entity_id: binary_sensor.nighttime_illuminance\n to: 'on'\n from: 'off'\n - trigger: state\n id: home\n entity_id: input_select.occupancy_mode\n to:\n - Home\n - Guest\n from:\n - Night\n - Away\n - Vacation\n for: 5\n - trigger: state\n id: away\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for:\n minutes: 2\n - trigger: state\n id: night\n entity_id: input_select.occupancy_mode\n to: Night\n for: 5\n - trigger: state\n id: wake\n entity_id: script.waketime\n to: 'off'\n conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_triggered\n - script.waketime\n state: 'off'\n actions:\n - if:\n - condition: trigger\n id: startup\n then:\n - wait_template: '{{ has_value(''group.lights'') }}'\n timeout: 300\n - delay: 5\n - variables:\n day_lux_lights: '{{ state_attr(''group.day_lux_lights'', ''entity_id'') }}'\n night_lux_lights: '{{ state_attr(''group.night_lux_lights'', ''entity_id'')\n }}'\n night_lights: '{{ state_attr(''group.night_lights'', ''entity_id'') }}'\n away_lights: '{{ state_attr(''group.away_lights'', ''entity_id'') }}'\n night_away_lights: '{{ state_attr(''group.night_away_lights'', ''entity_id'')\n }}'\n timed_lights: '{{ state_attr(''group.timed_lights'', ''entity_id'') }}'\n - if:\n - condition: trigger\n id: day_lux\n then:\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'off'\n - if:\n - condition: state\n entity_id: binary_sensor.daytime_illuminance\n state: 'on'\n then:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - action: script.turn_light_on\n data:\n entity_id: '{{ day_lux_lights }}'\n activate_timer: false\n else:\n - action: script.turn_light_off\n data:\n entity_id: '{{ day_lux_lights }}'\n reset: false\n else:\n - if:\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'on'\n then:\n - choose:\n - conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n match: any\n state:\n - Away\n - Vacation\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: '{{ iif(is_state(''binary_sensor.night_time'', ''on''), night_away_lights,\n away_lights) }}'\n activate_timer: false\n reset: true\n - action: script.turn_light_off\n data:\n entity_id: \"{{ expand('group.lights')\\n | rejectattr('entity_id',\\\n \\ 'in',\\n iif(is_state('binary_sensor.night_time', 'on'), night_away_lights,\\\n \\ away_lights))\\n | selectattr('state', 'eq', 'on')\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n - conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: '{{ night_lights }}'\n activate_timer: false\n reset: '{{ trigger.id not in [''day_lux'', ''night_lux''] }}'\n - action: script.turn_light_off\n data:\n entity_id: \"{% set arrive = state_attr('scene.arrive_home', 'entity_id')\\n\\\n \\ if trigger.id == 'night' and trigger.from_state.state == 'Away'\\\n \\ else '' %}\\n{{ expand('group.lights')\\n | rejectattr('entity_id',\\\n \\ 'in', night_lights)\\n | rejectattr('entity_id', 'in', timed_lights)\\n\\\n \\ | rejectattr('entity_id', 'in', arrive)\\n | selectattr('state',\\\n \\ 'eq', 'on')\\n | map(attribute='entity_id') | list }}\\n\"\n reset: '{{ trigger.id not in [''day_lux'', ''night_lux''] }}'\n default:\n - if:\n - condition: state\n entity_id: binary_sensor.morning_hours\n state: 'on'\n then:\n - action: script.light_scene_on\n data:\n scene: morning\n else:\n - action: script.turn_light_on\n data:\n entity_id: '{{ night_lux_lights }}'\n activate_timer: false\n else:\n - if:\n - condition: state\n entity_id: binary_sensor.daytime_illuminance\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n match: any\n state:\n - Home\n - Guest\n then:\n - action: script.turn_light_on\n data:\n entity_id: '{{ day_lux_lights }}'\n activate_timer: false\n - if: '{{ trigger.id in [''night_lux'', ''wake''] }}'\n then:\n - action: script.turn_light_off\n data:\n entity_id: \"{{ expand('group.lights')\\n | rejectattr('entity_id',\\\n \\ 'in', day_lux_lights)\\n | rejectattr('entity_id', 'in', timed_lights)\\n\\\n \\ | selectattr('state', 'eq', 'on')\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n else:\n - action: script.turn_light_off\n data:\n reset: \"{{ trigger.id not in ['day_lux', 'night_lux']\\n and is_state('input_select.occupancy_mode',\\\n \\ ['Night', 'Away', 'Vacation']) }}\\n\"", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "waketime script", "room": null, "type": "script", "id": { "entity_id": "script.waketime", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "lights group", "room": null, "type": "group", "id": { "entity_id": "group.lights", "device_id": null } }, { "name": "turn light off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_off", "device_id": null } }, { "name": "daytime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.daytime_illuminance", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "day lux lights group", "room": null, "type": "group", "id": { "entity_id": "group.day_lux_lights", "device_id": null } }, { "name": "night lux lights group", "room": null, "type": "group", "id": { "entity_id": "group.night_lux_lights", "device_id": null } }, { "name": "night lights group", "room": null, "type": "group", "id": { "entity_id": "group.night_lights", "device_id": null } }, { "name": "away lights group", "room": null, "type": "group", "id": { "entity_id": "group.away_lights", "device_id": null } }, { "name": "night away lights group", "room": null, "type": "group", "id": { "entity_id": "group.night_away_lights", "device_id": null } }, { "name": "timed lights group", "room": null, "type": "group", "id": { "entity_id": "group.timed_lights", "device_id": null } }, { "name": "morning hours binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.morning_hours", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "Night Time Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.night_time", "device_id": null } } ] }, { "id": "increase_alarm_clock_volume", "automation": "- id: increase_alarm_clock_volume\n alias: Increase Alarm Clock Volume\n description: Turn up alarm clock volume at specified interval.\n mode: restart\n variables:\n alarm_type: '{{ states(''input_select.alarm_clock_type'') }}'\n media_player: '{{ states(''sensor.alarm_clock_active_media_player'') }}'\n volume: '{{ states(''input_number.alarm_clock_volume_'' ~ alarm_type) | float/100\n }}'\n triggers:\n - trigger: state\n entity_id: binary_sensor.alarm_clock\n to: 'on'\n for:\n minutes: 2\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_clock_increase_volume\n state: 'on'\n actions:\n - repeat:\n sequence:\n - if: '{{ is_state(''switch.alarm_clock_snooze'', ''on'') }}'\n then:\n - action: media_player.volume_set\n target:\n entity_id: '{{ media_player }}'\n data:\n volume_level: '{{ volume }}'\n - wait_template: '{{ is_state(''switch.alarm_clock_snooze'', ''off'') }}'\n timeout:\n minutes: 60\n continue_on_timeout: false\n - action: media_player.volume_up\n target:\n entity_id: '{{ media_player }}'\n - wait_template: '{{ is_state(''binary_sensor.alarm_clock'', ''off'') }}'\n timeout:\n minutes: 2\n until:\n - or:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'off'\n - condition: template\n value_template: '{{ state_attr(media_player, ''volume_level'') | float(1)\n > 0.9 }}'", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock type", "room": null, "type": "input_select", "id": { "entity_id": "input_select.alarm_clock_type", "device_id": null } }, { "name": "alarm clock active media player", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_active_media_player", "device_id": null } }, { "name": "alarm clock snooze", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_snooze", "device_id": null } }, { "name": "alarm clock increase volume input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_increase_volume", "device_id": null } }, { "name": "Alarm Clock Volume Input Number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.alarm_clock_volume_", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "indoor_temperature_alert", "automation": "- id: indoor_temperature_alert\n alias: Indoor Temperature Alert\n description: Turn thermostat to heat/cool when indoor temp alert is active.\n initial_state: true\n triggers:\n - trigger: state\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: 'on'\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.climate_manual_mode\n - action: climate.set_hvac_mode\n target:\n entity_id: climate.house\n data:\n hvac_mode: '{{ iif(is_state(''alert.indoor_low_temperature'', ''on''), ''heat'',\n ''cool'') }}'\n continue_on_error: true\n - delay: 5\n - action: climate.set_temperature\n target:\n entity_id: climate.house\n data:\n temperature: \"{{ iif(is_state('alert.indoor_low_temperature', 'on'),\\n states('input_number.low_temperature_threshold')\\\n \\ | int,\\n states('input_number.high_temperature_threshold') | int) }}\\n\"\n continue_on_error: true\n - action: notify.jason\n data:\n title: Emergency HVAC\n message: 'The HVAC system has been turned on because an indoor temperature alert\n is active.\n\n HVAC Mode: {{ states(''climate.house'') }}\n\n HVAC State: {{ state_attr(''climate.house'', ''hvac_action'') }}\n\n Temperature: {{ states(''sensor.indoor_temperature'', with_unit=true) }}\n\n Target: {{ states(''sensor.indoor_temperature_target'', with_unit=true) }}\n\n '\n data:\n tag: emergency_heat\n group: Alert\n channel: Urgent\n notification_icon: mdi:thermostat\n icon_url: secret LOW_TEMP_ICON\n ledColor: secret WARNING_COLOR\n color: secret WARNING_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/climate\n actions:\n - title: Climate Off\n action: turn_thermostat_off\n continue_on_error: true\n - wait_for_trigger:\n - trigger: state\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: idle\n timeout:\n hours: 4\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.climate_manual_mode", "config": [ { "name": "climate manual mode input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_manual_mode", "device_id": null } }, { "name": "climate house climate", "room": null, "type": "climate", "id": { "entity_id": "climate.house", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } }, { "name": "low temperature threshold input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.low_temperature_threshold", "device_id": null } }, { "name": "high temperature threshold input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.high_temperature_threshold", "device_id": null } }, { "name": "indoor temperature sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.indoor_temperature", "device_id": null } }, { "name": "indoor temperature target sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.indoor_temperature_target", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "intruder_warning", "automation": "- id: intruder_warning\n alias: Intruder Warning\n description: Play warning for intruder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: intruder_warning\n actions:\n - action: script.tts_play\n data:\n message: Hey you ugly schmuck! Get the fuck outta my house!\n media_player: media_player.broadcast_speakers\n provider: HASS\n language: English (USA)\n voice: Brandon\n min_volume: 100\n alert: true\n save_message: false", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "broadcast speakers", "room": null, "type": "media_player", "id": { "entity_id": "media_player.broadcast_speakers", "device_id": null } } ] }, { "id": "iqvia_update", "automation": "- id: iqvia_update\n alias: IQVIA Update\n description: Poll IQVIA for updates.\n triggers:\n - trigger: time_pattern\n minutes: 35\n conditions:\n - condition: state\n entity_id: binary_sensor.wan\n state: 'on'\n actions:\n - action: homeassistant.update_entity\n target:\n entity_id:\n - sensor.allergy_index_forecasted_average\n - sensor.allergy_index_today\n - sensor.allergy_index_tomorrow\n - sensor.asthma_index_forecasted_average\n - sensor.asthma_index_today\n - sensor.asthma_index_tomorrow\n - sensor.cold_flu_index_today\n - sensor.cold_flu_forecasted_average", "config": [ { "name": "wan binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wan", "device_id": null } }, { "name": "homeassistant update entity service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.update_entity", "device_id": null } }, { "name": "Allergy Index Forecasted Average Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.allergy_index_forecasted_average", "device_id": null } }, { "name": "Allergy Index Today Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.allergy_index_today", "device_id": null } }, { "name": "Allergy Index Tomorrow Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.allergy_index_tomorrow", "device_id": null } }, { "name": "Asthma Index Forecasted Average Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.asthma_index_forecasted_average", "device_id": null } }, { "name": "Asthma Index Today Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.asthma_index_today", "device_id": null } }, { "name": "Asthma Index Tomorrow Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.asthma_index_tomorrow", "device_id": null } }, { "name": "Cold Flu Forecasted Average Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.cold_flu_forecasted_average", "device_id": null } }, { "name": "Cold Flu Index Today Sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.cold_flu_index_today", "device_id": null } } ] }, { "id": "turn_jason_medication_on", "automation": "- id: turn_jason_medication_on\n alias: Turn Jason Medication On\n description: Turn on reminder active boolean.\n triggers:\n - trigger: template\n value_template: \"{% if is_state('input_boolean.jason_medication_enabled', 'on')\\\n \\ %}\\n {% set time = states('sensor.time') %}\\n {% set shift = state_attr('sensor.work_status',\\\n \\ 'shift') %}\\n {% set last_run = states('button.jason_medication_done') %}\\n\\\n \\ {{ ((shift == 'Days' and time == states('input_datetime.jason_medication_days')[0:5])\\n\\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.jason_medication_afternoons')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.jason_medication_weekends')[0:5]))\\\n \\ }}\\n{% endif %}\\n\"\n conditions:\n - condition: template\n alias: Not done within last 4 hours\n value_template: '{% set done = as_datetime(states(''button.charlie_mealtime_done''),\n now()) %} {{ now() - done > timedelta(hours=4) }}\n\n '\n actions:\n - if: '{{ is_state(''input_boolean.jason_medication_active'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.jason_medication_active\n - if: '{{ is_state(''input_boolean.jason_medication_paused'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.jason_medication_paused\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.jason_medication_paused\n - if: '{{ is_state(''input_boolean.jason_medication_skipped'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.jason_medication_skipped\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.jason_medication_active", "config": [ { "name": "work status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_status", "device_id": null } }, { "name": "charlie mealtime done button", "room": null, "type": "button", "id": { "entity_id": "button.charlie_mealtime_done", "device_id": null } }, { "name": "jason medication enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_enabled", "device_id": null } }, { "name": "jason medication days input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.jason_medication_days", "device_id": null } }, { "name": "jason medication afternoons input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.jason_medication_afternoons", "device_id": null } }, { "name": "jason medication weekends input datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.jason_medication_weekends", "device_id": null } }, { "name": "jason medication active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_active", "device_id": null } }, { "name": "jason medication paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_paused", "device_id": null } }, { "name": "jason medication skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_skipped", "device_id": null } }, { "name": "jason medication done button", "room": null, "type": "button", "id": { "entity_id": "button.jason_medication_done", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } } ] }, { "id": "jason_medication_done", "automation": "- id: jason_medication_done\n alias: Jason Medication Done\n description: Mark reminder completed.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n actions: jason_medication_done\n conditions:\n - condition: state\n entity_id: input_boolean.jason_medication_active\n state: 'on'\n actions:\n - action: button.press\n target:\n entity_id: button.jason_medication_done", "config": [ { "name": "jason medication active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_active", "device_id": null } }, { "name": "jason medication done button", "room": null, "type": "button", "id": { "entity_id": "button.jason_medication_done", "device_id": null } } ] }, { "id": "skip_jason_medication", "automation": "- id: skip_jason_medication\n alias: Skip Jason Medication\n description: Skip reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n actions: skip_jason_medication\n actions:\n - action: button.press\n target:\n entity_id: button.skip_jason_medication", "config": [ { "name": "skip jason medication button", "room": null, "type": "button", "id": { "entity_id": "button.skip_jason_medication", "device_id": null } } ] }, { "id": "pause_jason_medication", "automation": "- id: pause_jason_medication\n alias: Pause Jason Medication\n description: Pause reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n actions: pause_jason_medication\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.jason_medication_paused", "config": [ { "name": "jason medication paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_paused", "device_id": null } } ] }, { "id": "reset_pause_jason_medication", "automation": "- id: reset_pause_jason_medication\n alias: Reset Pause Jason Medication\n description: Reset reminder paused boolean.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.jason_medication_skipped\n to: 'on'\n - trigger: state\n entity_id: input_boolean.jason_medication_paused\n to: 'on'\n for:\n hours: 2\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'on'\n for:\n minutes: 15\n conditions:\n - condition: state\n entity_id: input_boolean.jason_medication_paused\n state: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.jason_medication_paused", "config": [ { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "jason medication paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_paused", "device_id": null } }, { "name": "jason medication skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_skipped", "device_id": null } } ] }, { "id": "reset_jason_medication_booleans", "automation": "- id: reset_jason_medication_booleans\n alias: Reset Jason Medication Booleans\n description: Reset reminder booleans if reminder disabled, completed, or not active.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: enabled\n entity_id: input_boolean.jason_medication_enabled\n to: 'off'\n - trigger: state\n id: done\n entity_id: input_boolean.jason_medication_active\n to: 'off'\n - trigger: state\n id: entity\n entity_id: &id005\n - input_boolean.jason_medication_active\n - input_boolean.jason_medication_paused\n - input_boolean.jason_medication_skipped\n to: 'on'\n conditions:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.jason_medication_enabled\n state: 'off'\n - condition: template\n alias: Pause boolean turned on when reminder is skipped or isn't active\n value_template: \"{{ trigger.entity_id == 'input_boolean.jason_medication_paused'\\n\\\n \\ and (is_state('input_boolean.jason_medication_active', 'off')\\n \\\n \\ or is_state('input_boolean.jason_medication_skipped', 'on')) }}\\n\"\n - condition: template\n alias: Reminder completed\n value_template: '{{ trigger.id == ''done'' }}'\n actions:\n - if: '{{ trigger.id == ''entity'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: *id005", "config": [ { "name": "jason medication enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_enabled", "device_id": null } }, { "name": "jason medication active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_active", "device_id": null } }, { "name": "jason medication paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_paused", "device_id": null } }, { "name": "jason medication skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_skipped", "device_id": null } } ] }, { "id": "jason_medication_notification", "automation": "- id: jason_medication_notification\n alias: Jason Medication Notification\n description: Send notification until reminder is off.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_boolean.jason_medication_active\n to: 'on'\n - trigger: state\n entity_id: input_boolean.jason_medication_paused\n to: 'off'\n conditions:\n - condition: state\n entity_id: input_boolean.jason_medication_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.jason_medication_paused\n state: 'off'\n actions:\n - repeat:\n sequence:\n - if: '{{ not is_state(''input_select.occupancy_mode'', ''Night'') }}'\n then:\n - action: notify.jason\n data:\n message: Time to take your medication\n data:\n tag: jason_medication_reminder\n group: Reminder\n visibility: public\n persistent: true\n notification_icon: mdi:pill-multiple\n icon_url: secret PILL_ICON\n actions:\n - title: Pause\n actions: pause_jason_medication\n - title: Skip\n actions: skip_jason_medication\n - title: Done\n actions: jason_medication_done\n - wait_template: \"{{ is_state('input_boolean.jason_medication_active', 'off')\\n\\\n \\ or is_state('input_boolean.jason_medication_paused', 'on') }}\\n\"\n timeout:\n minutes: 2\n - if:\n - condition: state\n entity_id: input_boolean.jason_medication_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.jason_medication_paused\n state: 'off'\n then:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: Hey J It's time to do some drugs Take your medicine like\n a man.\n provider: HASS\n language: English (USA)\n voice: Guy:sad\n quiet_play: true\n - wait_template: \"{{ is_state('input_boolean.jason_medication_active', 'off')\\n\\\n \\ or is_state('input_boolean.jason_medication_paused', 'on') }}\\n\"\n timeout:\n minutes: '{{ states(''input_number.jason_medication_notification_interval'')\n | int }}'\n until:\n - or:\n - condition: state\n entity_id: input_boolean.jason_medication_active\n state: 'off'\n - condition: state\n entity_id: input_boolean.jason_medication_paused\n state: 'on'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason medication active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_active", "device_id": null } }, { "name": "jason medication paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_paused", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "jason notification interval", "room": null, "type": "input_number", "id": { "entity_id": "input_number.jason_medication_notification_interval", "device_id": null } } ] }, { "id": "clear_jason_medication_notification", "automation": "- id: clear_jason_medication_notification\n alias: Clear Jason Medication Notification\n description: Clear reminder notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.jason_medication_active\n to: 'off'\n - trigger: state\n entity_id:\n - input_boolean.jason_medication_paused\n - input_boolean.jason_medication_skipped\n to: 'on'\n actions:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: jason_medication_reminder", "config": [ { "name": "jason medication active input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_active", "device_id": null } }, { "name": "jason medication paused input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_paused", "device_id": null } }, { "name": "jason medication skipped input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_medication_skipped", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "jason_phone_alarm_triggered_volume_control", "automation": "- id: jason_phone_alarm_triggered_volume_control\n alias: Jason Phone Alarm Triggered Volume Control\n description: Set DND and alarm volume when alarm triggered.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_triggered\n to:\n - 'on'\n - 'off'\n actions:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n then:\n - action: select.select_option\n target:\n entity_id: select.jason_phone_dnd\n data:\n option: 'off'\n - action: number.set_value\n target:\n entity_id: number.jason_phone_alarm_volume\n data:\n value: 7\n - wait_template: '{{ not is_state(''alarm_control_panel.house'', ''triggered'')\n }}'\n timeout:\n minutes: 10\n - action: script.silence_mobile_alarm\n else:\n - condition: state\n entity_id: input_boolean.jason_phone_volume_control\n state: 'on'\n - action: number.set_value\n target:\n entity_id: number.jason_phone_alarm_volume\n data:\n value: '{{ states(''input_number.mobile_waketime_volume_jason'') | int(7)\n }}'\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n then:\n - action: select.select_option\n target:\n entity_id: select.jason_phone_dnd\n data:\n option: priority_only", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "jason phone dnd select", "room": null, "type": "select", "id": { "entity_id": "select.jason_phone_dnd", "device_id": null } }, { "name": "jason phone alarm volume number", "room": null, "type": "number", "id": { "entity_id": "number.jason_phone_alarm_volume", "device_id": null } }, { "name": "silence mobile alarm script", "room": null, "type": "script", "id": { "entity_id": "script.silence_mobile_alarm", "device_id": null } }, { "name": "jason phone volume control", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_phone_volume_control", "device_id": null } }, { "name": "mobile waketime volume jason", "room": null, "type": "input_number", "id": { "entity_id": "input_number.mobile_waketime_volume_jason", "device_id": null } } ] }, { "id": "jason_phone_alert_announcements", "automation": "- id: jason_phone_alert_announcements\n alias: Jason Phone Alert Announcements\n description: Play alert tts announcement.\n mode: parallel\n variables:\n message: '{%- set t = trigger.entity_id %}\n\n {%- if t == ''alert.jason_phone_wifi_off'' %}\n\n Jason, your phone wifi is off.\n\n {%- elif t == ''alert.jason_phone_wifi_disconnected'' %}\n\n Jason, your phone wifi has not connected to the home network.\n\n {%- elif t == ''alert.jason_phone_ringer_off'' %}\n\n Jason, your phone ringer is off.\n\n {%- elif t == ''alert.jason_phone_offline'' %}\n\n Jason, your mobile phone went offline at {{ as_local(states.binary_sensor.jason_phone_connected.last_changed).strftime(''%-I:%M\n %p'') }}\n\n {%- elif t == ''alert.jason_phone_bluetooth_off'' %}\n\n Jason, your phone bluetooth is off.\n\n {%- elif t == ''alert.jason_phone_bluetooth_disconnected'' %}\n\n Jason your mobile phone bluetooth is not connected to Home Assistant.\n\n {%- elif t == ''alert.jason_phone_bluetooth_device'' %}\n\n Heads up Jason, your mobile phone is still connected to a bluetooth device!\n\n {%- elif t == ''alert.jason_phone_battery_low'' %}\n\n Heads up Jason! You''ve let your phone battery get down to {{ states(''sensor.jphone_battery_level'',\n with_unit=true) }}. Plug the friggin thing in!\n\n {%- elif t == ''alert.jason_phone_high_accuracy'' %}\n\n Jason, your phone high accuracy mode is on.\n\n {%- else %} ERROR FIX ME JASON!\n\n {%- endif -%}\n\n '\n triggers:\n - trigger: state\n entity_id:\n - alert.jason_phone_bluetooth_device\n - alert.jason_phone_battery_low\n - alert.jason_phone_high_accuracy\n to: 'on'\n - trigger: state\n entity_id:\n - alert.jason_phone_wifi_off\n - alert.jason_phone_wifi_disconnected\n - alert.jason_phone_ringer_off\n - alert.jason_phone_offline\n - alert.jason_phone_bluetooth_off\n - alert.jason_phone_bluetooth_disconnected\n to: 'on'\n for:\n minutes: 5\n conditions:\n - condition: state\n entity_id: binary_sensor.jason_home\n state: 'on'\n actions:\n - repeat:\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: '{{ message }}'\n provider: HASS\n language: English (USA)\n voice: Sara:shouting\n quiet_play: true\n continue_on_error: true\n - wait_template: '{{ not is_state(trigger.entity_id, ''on'') }}'\n timeout:\n minutes: '{{ 10 if trigger.entity_id == ''alert.jason_phone_battery_low''\n else 30 }}'\n until:\n - condition: template\n value_template: '{{ not is_state(trigger.entity_id, ''on'') }}'", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "jason phone wifi off alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_wifi_off", "device_id": null } }, { "name": "jason phone wifi disconnected alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_wifi_disconnected", "device_id": null } }, { "name": "jason phone ringer off alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_ringer_off", "device_id": null } }, { "name": "jason phone offline alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_offline", "device_id": null } }, { "name": "jason phone connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_phone_connected", "device_id": null } }, { "name": "jason phone bluetooth off alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_bluetooth_off", "device_id": null } }, { "name": "jason phone bluetooth disconnected alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_bluetooth_disconnected", "device_id": null } }, { "name": "jason phone bluetooth device alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_bluetooth_device", "device_id": null } }, { "name": "jason phone battery low alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_battery_low", "device_id": null } }, { "name": "jphone battery level sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jphone_battery_level", "device_id": null } }, { "name": "jason phone high accuracy alert", "room": null, "type": "alert", "id": { "entity_id": "alert.jason_phone_high_accuracy", "device_id": null } } ] }, { "id": "turn_jason_phone_high_accuracy_on", "automation": "- id: turn_jason_phone_high_accuracy_on\n alias: Turn Jason Phone High Accuracy On\n description: Turn on mobile location high accuracy mode.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: person.jason\n to:\n - not_home\n - Near Home\n - Almost Home\n - trigger: state\n entity_id: sensor.jphone_detected_activity\n to: in_vehicle\n - trigger: state\n entity_id: binary_sensor.jason_home\n to: 'off'\n from: 'on'\n conditions:\n - alias: Not out of town\n condition: template\n value_template: '{{ states(''sensor.home_jason_distance'') | int(-1) <= 20 }}'\n actions:\n - action: notify.mobile_app_jphone\n data:\n message: command_high_accuracy_mode\n data:\n command: force_on\n - action: notify.mobile_app_jphone\n data:\n message: command_high_accuracy_mode\n data:\n command: high_accuracy_set_update_interval\n high_accuracy_update_interval: 15", "config": [ { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "jason phone", "room": null, "type": null, "id": { "entity_id": null, "device_id": "mobile_app_jphone" } }, { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "jphone detected activity sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jphone_detected_activity", "device_id": null } }, { "name": "home jason distance sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.home_jason_distance", "device_id": null } }, { "name": "mobile app jphone notify", "room": null, "type": "notify", "id": { "entity_id": "notify.mobile_app_jphone", "device_id": null } } ] }, { "id": "turn_jason_phone_high_accuracy_off", "automation": "- id: turn_jason_phone_high_accuracy_off\n alias: Turn Jason Phone High Accuracy Off\n description: Turn off mobile high accuracy location mode.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: state\n entity_id:\n - switch.jason_phone_high_accuracy\n - binary_sensor.jphone_high_accuracy_mode\n to: 'on'\n from: 'off'\n for:\n minutes: 60\n - trigger: event\n id: notification\n event_type: mobile_app_notification_action\n event_data:\n action: turn_off_jason_phone_high_accuracy\n - trigger: state\n id: person\n entity_id: person.jason\n from:\n - not_home\n - Near Home\n - Almost Home\n for: 60\n not_to:\n - not_home\n - Near Home\n - Almost Home\n - trigger: numeric_state\n entity_id: sensor.home_jason_distance\n above: 20\n - trigger: state\n id: activity\n entity_id: sensor.jphone_detected_activity\n from: in_vehicle\n for:\n minutes: 10\n - trigger: state\n id: home\n entity_id: binary_sensor.jason_home\n to: 'on'\n from: 'off'\n conditions:\n - condition: template\n alias: Do not turn off during commute times\n value_template: \"{{ iif(trigger.entity_id == 'sensor.jphone_detected_activity',\\n\\\n \\ is_state('binary_sensor.commute_active', 'off'), true) }}\\n\"\n actions:\n - action: notify.mobile_app_jphone\n data:\n message: command_high_accuracy_mode\n data:\n command: high_accuracy_set_update_interval\n high_accuracy_update_interval: 60\n - action: notify.mobile_app_jphone\n data:\n message: command_high_accuracy_mode\n data:\n command: force_off", "config": [ { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "jason phone", "room": null, "type": null, "id": { "entity_id": null, "device_id": "mobile_app_jphone" } }, { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "jphone detected activity sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jphone_detected_activity", "device_id": null } }, { "name": "home jason distance sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.home_jason_distance", "device_id": null } }, { "name": "mobile app jphone notify", "room": null, "type": "notify", "id": { "entity_id": "notify.mobile_app_jphone", "device_id": null } }, { "name": "jason phone high accuracy switch", "room": null, "type": "switch", "id": { "entity_id": "switch.jason_phone_high_accuracy", "device_id": null } }, { "name": "jphone high accuracy mode binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jphone_high_accuracy_mode", "device_id": null } }, { "name": "commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.commute_active", "device_id": null } } ] }, { "id": "jason_phone_night_mode", "automation": "- id: jason_phone_night_mode\n alias: Jason Phone Night Mode\n description: Turn DND on at night, off during day.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to: Night\n for: 1\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n from: Night\n for: 1\n - trigger: state\n id: occupancy\n entity_id: binary_sensor.jason_home\n to: 'on'\n from: 'off'\n - trigger: state\n entity_id: binary_sensor.waketime_active\n to: 'on'\n from: 'off'\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.jason_home\n - input_boolean.jason_phone_volume_control\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: state\n entity_id: binary_sensor.waketime_active\n state: 'off'\n then:\n - action: select.select_option\n target:\n entity_id: select.jason_phone_dnd\n data:\n option: priority_only\n - action: number.set_value\n target:\n entity_id: number.jason_phone_alarm_volume\n data:\n value: '{{ states(''input_number.mobile_waketime_volume_jason'') }}'\n else:\n - action: select.select_option\n target:\n entity_id: select.jason_phone_dnd\n data:\n option: 'off'\n - action: select.select_option\n target:\n entity_id: select.jason_phone_ringer_mode\n data:\n option: normal\n - if:\n - condition: numeric_state\n entity_id: sensor.jphone_volume_level_alarm\n below: input_number.mobile_waketime_volume_jason\n then:\n - action: number.set_value\n target:\n entity_id: number.jason_phone_alarm_volume\n data:\n value: '{{ states(''input_number.mobile_waketime_volume_jason'') }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "waketime active", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.waketime_active", "device_id": null } }, { "name": "jason phone dnd select", "room": null, "type": "select", "id": { "entity_id": "select.jason_phone_dnd", "device_id": null } }, { "name": "jason phone alarm volume number", "room": null, "type": "number", "id": { "entity_id": "number.jason_phone_alarm_volume", "device_id": null } }, { "name": "jason phone volume control", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_phone_volume_control", "device_id": null } }, { "name": "mobile waketime volume jason", "room": null, "type": "input_number", "id": { "entity_id": "input_number.mobile_waketime_volume_jason", "device_id": null } }, { "name": "jason phone ringer mode select", "room": null, "type": "select", "id": { "entity_id": "select.jason_phone_ringer_mode", "device_id": null } }, { "name": "jphone volume level alarm sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jphone_volume_level_alarm", "device_id": null } } ] }, { "id": "jason_phone_quiet_time", "automation": "- id: jason_phone_quiet_time\n alias: Jason Phone Quiet Time\n description: Adjust mobile volumes durning quiet times.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: binary_sensor.quiet_time\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.jason_home\n - input_boolean.jason_phone_volume_control\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.quiet_time\n state: 'on'\n then:\n - action: number.set_value\n target:\n entity_id: number.jason_phone_media_volume\n data:\n value: 10\n - action: number.set_value\n target:\n entity_id: number.jason_phone_ringer_volume\n data:\n value: 4\n else:\n - action: number.set_value\n target:\n entity_id: number.jason_phone_media_volume\n data:\n value: 15\n - action: number.set_value\n target:\n entity_id: number.jason_phone_ringer_volume\n data:\n value: 5", "config": [ { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "jason phone volume control", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_phone_volume_control", "device_id": null } }, { "name": "quiet time binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.quiet_time", "device_id": null } }, { "name": "jason phone media volume number", "room": null, "type": "number", "id": { "entity_id": "number.jason_phone_media_volume", "device_id": null } }, { "name": "jason phone ringer volume number", "room": null, "type": "number", "id": { "entity_id": "number.jason_phone_ringer_volume", "device_id": null } } ] }, { "id": "jason_phone_update_location", "automation": "- id: jason_phone_update_location\n alias: Jason Phone Update Location\n description: Update Jason phone location.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: update_jason_location\n - trigger: state\n entity_id: device_tracker.jphone\n from: home\n - trigger: state\n entity_id: binary_sensor.jason_phone_wifi_connected\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n condition: \"{{ true if this.attributes.last_triggered == none\\n else now() - this.attributes.last_triggered\\\n \\ > timedelta(seconds=30) }}\\n\"\n actions:\n - action: button.press\n target:\n entity_id: button.jason_phone_update_location", "config": [ { "name": "jphone device tracker", "room": null, "type": "device_tracker", "id": { "entity_id": "device_tracker.jphone", "device_id": null } }, { "name": "jason phone wifi connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_phone_wifi_connected", "device_id": null } }, { "name": "jason phone update location button", "room": null, "type": "button", "id": { "entity_id": "button.jason_phone_update_location", "device_id": null } } ] }, { "id": "kiosk_alarm_display", "automation": "- id: kiosk_alarm_display\n alias: Kiosk Alarm Display\n description: Display alarm trigger camera or danger message on kiosk.\n variables:\n trigger_entity: \"{{ expand(state_attr('alarm_control_panel.house', 'open_sensors'))\\n\\\n \\ | map(attribute='entity_id') | join }}\\n\"\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_pending\n to:\n - 'on'\n - 'off'\n - trigger: state\n entity_id: input_boolean.alarm_triggered\n to:\n - 'on'\n - 'off'\n for: 1\n conditions:\n - condition: state\n entity_id:\n - input_boolean.alarm_enabled\n - binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: binary_sensor.danger_alarm\n state: 'off'\n actions:\n - choose:\n - conditions:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_pending\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n sequence:\n - action: browser_mod.navigate\n data:\n path: alarm\n browser_id: kiosk\n continue_on_error: true\n - delay: 15\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_pending\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'on'\n - choose:\n - conditions: '{{ trigger_entity in state_attr(''group.south_side_house_sensors'',\n ''entity_id'') }}'\n sequence:\n - action: browser_mod.navigate\n data:\n path: side-door-camera\n browser_id: kiosk\n continue_on_error: true\n - conditions: '{{ trigger_entity in state_attr(''group.front_house_sensors'',\n ''entity_id'') }}'\n sequence:\n - action: browser_mod.navigate\n data:\n path: front-door-camera\n browser_id: kiosk\n continue_on_error: true\n - conditions: '{{ trigger_entity in state_attr(''group.front_north_side_house_sensors'',\n ''entity_id'') }}'\n sequence:\n - action: browser_mod.navigate\n data:\n path: side-gate-front-camera\n browser_id: kiosk\n continue_on_error: true\n - conditions: '{{ trigger_entity in state_attr(''group.back_north_side_house_sensors'',\n ''entity_id'') }}\n\n '\n sequence:\n - action: browser_mod.navigate\n data:\n path: side-gate-back-camera\n browser_id: kiosk\n continue_on_error: true\n - conditions: '{{ trigger_entity in state_attr(''group.back_house_sensors'',\n ''entity_id'') }}'\n sequence:\n - action: browser_mod.navigate\n data:\n path: back-door-camera\n browser_id: kiosk\n continue_on_error: true\n - conditions: '{{ trigger_entity in state_attr(''group.garage_sensors'', ''entity_id'')\n }}'\n sequence:\n - action: browser_mod.navigate\n data:\n path: side-door-camera\n browser_id: kiosk\n continue_on_error: true\n default:\n - action: browser_mod.navigate\n data:\n path: home\n browser_id: kiosk\n continue_on_error: true", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "danger alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.danger_alarm", "device_id": null } }, { "name": "browser mod navigate service", "room": null, "type": "service", "id": { "entity_id": "browser_mod.navigate", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "group front house sensors", "room": "front", "type": "group", "id": { "entity_id": "group.front_house_sensors", "device_id": null } }, { "name": "group front north side house sensors", "room": "front north side", "type": "group", "id": { "entity_id": "group.front_north_side_house_sensors", "device_id": null } }, { "name": "group back north side house sensors", "room": "back north side", "type": "group", "id": { "entity_id": "group.back_north_side_house_sensors", "device_id": null } }, { "name": "group back house sensors", "room": "back", "type": "group", "id": { "entity_id": "group.back_house_sensors", "device_id": null } }, { "name": "group garage sensors", "room": "garage", "type": "group", "id": { "entity_id": "group.garage_sensors", "device_id": null } } ] }, { "id": "kiosk_reset_dashboard", "automation": "- id: kiosk_reset_dashboard\n alias: Kiosk Reset Dashboard\n description: Reset dashboard to home page.\n mode: queued\n triggers:\n - trigger: state\n id: page\n entity_id: sensor.kiosk_tablet_current_page\n from: http://192.168.1.100:8123/ui-kiosk/home\n for: 300\n - trigger: state\n id: app\n entity_id: sensor.kiosk_tablet_foreground_app\n from: de.ozerov.fully\n for: 300\n conditions:\n - condition: state\n entity_id: binary_sensor.fully_kiosk_connected\n state: 'on'\n actions:\n - wait_template: \"{{ is_state('binary_sensor.kiosk_motion', 'off')\\n and is_state('input_boolean.alarm_triggered',\\\n \\ 'off') }}\\n\"\n timeout: 300\n - if: '{{ states(''sensor.kiosk_tablet_foreground_app'') != ''de.ozerov.fully''\n }}'\n then:\n - action: button.press\n target:\n entity_id: button.kiosk_tablet_bring_to_foreground\n - if: '{{ states(''sensor.kiosk_tablet_current_page'') | contains(''http://192.168.1.100:8123'')\n }}'\n then:\n - action: browser_mod.navigate\n data:\n path: /ui-kiosk/home\n browser_id: kiosk", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "browser mod navigate service", "room": null, "type": "service", "id": { "entity_id": "browser_mod.navigate", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "kiosk tablet current page sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.kiosk_tablet_current_page", "device_id": null } }, { "name": "kiosk tablet foreground app sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.kiosk_tablet_foreground_app", "device_id": null } }, { "name": "fully kiosk connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.fully_kiosk_connected", "device_id": null } }, { "name": "kiosk motion binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.kiosk_motion", "device_id": null } }, { "name": "kiosk tablet bring to foreground button", "room": null, "type": "button", "id": { "entity_id": "button.kiosk_tablet_bring_to_foreground", "device_id": null } } ] }, { "id": "kiosk_restart", "automation": "- id: kiosk_restart\n alias: Kiosk Restart\n description: Restart kiosk browser.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: state\n id: kiosk\n entity_id: binary_sensor.kiosk_offline_alert\n to: 'on'\n from: 'off'\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: restart_kiosk\n actions:\n - if: '{{ trigger.id == ''startup'' }}'\n then:\n - delay: 60\n - if: '{{ not has_value(''sensor.kiosk_browser_user'') }}'\n then:\n - action: button.press\n target:\n entity_id: button.kiosk_tablet_restart_browser", "config": [ { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "kiosk offline alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.kiosk_offline_alert", "device_id": null } }, { "name": "kiosk tablet restart browser button", "room": null, "type": "button", "id": { "entity_id": "button.kiosk_tablet_restart_browser", "device_id": null } } ] }, { "id": "reset_kiosk_motion", "automation": "- id: reset_kiosk_motion\n alias: Reset Kiosk Motion\n description: Restart kiosk motion when unknown.\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: binary_sensor.kiosk_motion\n to: unknown\n for: 10\n actions:\n - action: mqtt.publish\n data:\n topic: fully/event/onMotion/6c1f5c36-4b34530\n payload: '{\"type\": \"visual\", \"deviceId\": \"6c1f5c36-4b34530\", \"event\": \"onMotion\"}'", "config": [ { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "kiosk motion binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.kiosk_motion", "device_id": null } }, { "name": "mqtt publish service", "room": null, "type": "service", "id": { "entity_id": "mqtt.publish", "device_id": null } } ] }, { "id": "kiosk_screen_on", "automation": "- id: kiosk_screen_on\n alias: Kiosk Screen On\n description: Turn kiosk screen on.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: motion\n entity_id:\n - binary_sensor.kiosk_motion\n - binary_sensor.fully_kiosk_connected\n to: 'on'\n - trigger: state\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n to: 'on'\n conditions:\n - condition: state\n entity_id: binary_sensor.fully_kiosk_connected\n state: 'on'\n - condition: state\n entity_id: switch.kiosk_tablet_screen\n state: 'off'\n actions:\n - action: switch.turn_on\n target:\n entity_id: switch.kiosk_tablet_screen", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "fully kiosk connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.fully_kiosk_connected", "device_id": null } }, { "name": "kiosk motion binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.kiosk_motion", "device_id": null } }, { "name": "kiosk tablet screen switch", "room": null, "type": "switch", "id": { "entity_id": "switch.kiosk_tablet_screen", "device_id": null } } ] }, { "id": "kiosk_screen_off", "automation": "- id: kiosk_screen_off\n alias: Kiosk Screen Off\n description: Kiosk screen off.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: motion\n entity_id: binary_sensor.kiosk_motion\n to: 'off'\n for:\n minutes: 5\n - trigger: state\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n to: 'off'\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.fully_kiosk_connected\n - switch.kiosk_tablet_screen\n state: 'on'\n - condition: state\n entity_id:\n - input_boolean.alarm_pending\n - input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.kiosk_motion\n state: 'off'\n for:\n minutes: 5\n - condition: state\n entity_id: input_select.occupancy_mode\n state:\n - Night\n - Away\n - Vacation\n actions:\n - action: switch.turn_off\n target:\n entity_id: switch.kiosk_tablet_screen", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "alarm pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_pending", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "fully kiosk connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.fully_kiosk_connected", "device_id": null } }, { "name": "kiosk motion binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.kiosk_motion", "device_id": null } }, { "name": "kiosk tablet screen switch", "room": null, "type": "switch", "id": { "entity_id": "switch.kiosk_tablet_screen", "device_id": null } } ] }, { "id": "kiosk_screen_brightness", "automation": "- id: kiosk_screen_brightness\n alias: Kiosk Screen Brightness\n description: Adjust kiosk screen brightness.\n max_exceeded: silent\n variables:\n brightness: '{% if is_state(''input_select.occupancy_mode'', ''Night'') %} 50\n {% elif is_state(''binary_sensor.quiet_time'', ''on'') %} 125 {% else %} 200\n {% endif %}\n\n '\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Home\n - Guest\n for: 1\n - trigger: state\n entity_id: binary_sensor.quiet_time\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n condition: \"{{ states('number.kiosk_tablet_screen_brightness') | int(0) != brightness\\n\\\n \\ if has_value('number.kiosk_tablet_screen_brightness') else false }}\\n\"\n actions:\n - action: number.set_value\n target:\n entity_id: number.kiosk_tablet_screen_brightness\n data:\n value: '{{ brightness }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "quiet time binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.quiet_time", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "kiosk tablet screen brightness number", "room": null, "type": "number", "id": { "entity_id": "number.kiosk_tablet_screen_brightness", "device_id": null } } ] }, { "id": "turn_light_timer_off", "automation": "- id: turn_light_timer_off\n alias: Turn Light Timer Off\n description: Turn in use timer off when light turns off.\n mode: parallel\n max: 25\n variables:\n timer: '{% from ''light.jinja'' import light_timer %} {{ light_timer(trigger.entity_id)\n }}\n\n '\n triggers:\n - trigger: state\n entity_id:\n - light.bathroom_vanity_light_rgb\n - light.bathroom_shower_light\n - light.back_house_potlights\n - light.back_yard_tree_lights\n - light.bedroom_fan_light\n - light.bedroom_potlights\n - light.dining_room_light_rgb\n - light.dining_room_potlights\n - light.front_house_potlights\n - light.front_porch_light\n - light.hallway_potlights\n - light.kitchen_sink_light\n - light.kitchen_potlights\n - light.living_room_cove_light\n - light.living_room_fan_light\n - light.living_room_potlights\n - light.master_bedroom_light\n - light.office_fan_light\n - light.office_potlights\n - light.outside_garage_lights\n - light.side_entrance_light\n to: 'off'\n conditions: '{{ has_value(timer) }}'\n actions:\n - action: timer.cancel\n target:\n entity_id: '{{ timer }}'", "config": [ { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "bedroom fan light", "room": "bedroom", "type": "light", "id": { "entity_id": "light.bedroom_fan_light", "device_id": null } }, { "name": "bedroom potlights", "room": "bedroom", "type": "light", "id": { "entity_id": "light.bedroom_potlights", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "kitchen potlights", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_potlights", "device_id": null } }, { "name": "dining room potlights", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_potlights", "device_id": null } }, { "name": "hallway potlights", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway_potlights", "device_id": null } }, { "name": "bathroom shower light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_shower_light", "device_id": null } }, { "name": "bathroom vanity light rgb", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light_rgb", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "back house potlights", "room": "back", "type": "light", "id": { "entity_id": "light.back_house_potlights", "device_id": null } }, { "name": "back yard tree lights", "room": "back yard", "type": "light", "id": { "entity_id": "light.back_yard_tree_lights", "device_id": null } }, { "name": "bathroom vanity light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } }, { "name": "front house potlights", "room": "front", "type": "light", "id": { "entity_id": "light.front_house_potlights", "device_id": null } }, { "name": "front porch light", "room": "front porch", "type": "light", "id": { "entity_id": "light.front_porch_light", "device_id": null } }, { "name": "kitchen sink light", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_sink_light", "device_id": null } }, { "name": "living room cove light", "room": "living room", "type": "light", "id": { "entity_id": "light.living_room_cove_light", "device_id": null } }, { "name": "living room fan light", "room": "living room", "type": "light", "id": { "entity_id": "light.living_room_fan_light", "device_id": null } }, { "name": "living room potlights", "room": "living room", "type": "light", "id": { "entity_id": "light.living_room_potlights", "device_id": null } }, { "name": "master bedroom light", "room": "master bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_light", "device_id": null } }, { "name": "office fan light", "room": "office", "type": "light", "id": { "entity_id": "light.office_fan_light", "device_id": null } }, { "name": "office potlights", "room": "office", "type": "light", "id": { "entity_id": "light.office_potlights", "device_id": null } }, { "name": "outside garage lights", "room": "outside", "type": "light", "id": { "entity_id": "light.outside_garage_lights", "device_id": null } } ] }, { "id": "turn_living_room_ceiling_fan_on", "automation": "- id: turn_living_room_ceiling_fan_on\n alias: Turn On Living Room Ceiling Fan On\n description: Turn on living_room ceiling fan.\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.climate_fan\n - binary_sensor.schedule_fan\n - binary_sensor.living_room_temperature_fan\n to: 'on'\n from: 'off'\n - trigger: state\n id: alert\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: 'on'\n conditions:\n - condition: state\n entity_id: fan.living_room_fan\n state: 'off'\n actions:\n - action: script.turn_fan_on\n data:\n entity_id: fan.living_room_fan\n speed: 50\n override: '{{ trigger.id == ''alert'' }}'", "config": [ { "name": "turn fan on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_on", "device_id": null } }, { "name": "climate fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_fan", "device_id": null } }, { "name": "schedule fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.schedule_fan", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "living room fan", "room": "living room", "type": "fan", "id": { "entity_id": "fan.living_room_fan", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } }, { "name": "living room temperature fan binary sensor", "room": "living room", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.living_room_temperature_fan", "device_id": null } } ] }, { "id": "turn_living_room_ceiling_fan_off", "automation": "- id: turn_living_room_ceiling_fan_off\n alias: Turn Living Room Ceiling Fan Off\n description: Turn off living_room ceiling fan.\n mode: queued\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for:\n minutes: 1\n - trigger: state\n entity_id:\n - binary_sensor.climate_fan\n - binary_sensor.schedule_fan\n - binary_sensor.living_room_temperature_fan\n to: 'off'\n from: 'on'\n - trigger: state\n id: alert\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: idle\n conditions:\n - condition: state\n entity_id: fan.living_room_fan\n state: 'on'\n - condition: state\n entity_id:\n - binary_sensor.schedule_fan\n - binary_sensor.living_room_temperature_fan\n state: 'off'\n - condition: state\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n state: idle\n - condition: template\n alias: HVAC fan is off if trigger is schedule fan\n value_template: \"{{ is_state('binary_sensor.climate_fan', 'off')\\n if trigger.entity_id\\\n \\ == 'binary_sensor.schedule_fan' else true }}\\n\"\n actions:\n - action: script.turn_fan_off\n data:\n entity_id: fan.living_room_fan\n override: '{{ trigger.id == ''occupancy'' }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "turn fan off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_off", "device_id": null } }, { "name": "climate fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_fan", "device_id": null } }, { "name": "schedule fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.schedule_fan", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "living room fan", "room": "living room", "type": "fan", "id": { "entity_id": "fan.living_room_fan", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } }, { "name": "living room temperature fan binary sensor", "room": "living room", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.living_room_temperature_fan", "device_id": null } } ] }, { "id": "wake_living_room_tv_on", "automation": "- id: wake_living_room_tv_on\n alias: Wake Living Room TV On\n description: Wake On Lan for WebOS TV.\n triggers:\n - trigger: webostv.turn_on\n entity_id: media_player.living_room_tv\n actions:\n - action: wake_on_lan.send_magic_packet\n data:\n mac: secret LIVINGROOM_TV_MAC", "config": [ { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "webostv turn on trigger", "room": null, "type": "trigger", "id": { "entity_id": "webostv.turn_on", "device_id": null } }, { "name": "wake on lan send magic packet service", "room": null, "type": "service", "id": { "entity_id": "wake_on_lan.send_magic_packet", "device_id": null } } ] }, { "id": "turn_living_room_tv_on", "automation": "- id: turn_living_room_tv_on\n alias: Turn Living Room TV On\n description: Turn TV on, select chromecast input.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: media_player.living_room_chromecast\n to:\n - playing\n - buffering\n - paused\n from:\n - 'off'\n - idle\n - unknown\n - unavailable\n - trigger: state\n entity_id: media_player.living_room_chromecast\n to: playing\n from: paused\n conditions:\n - or:\n - condition: state\n entity_id: media_player.living_room_tv\n state: 'off'\n - not:\n - condition: state\n entity_id: media_player.living_room_tv\n attribute: source\n state: HDMI 2\n actions:\n - if:\n - condition: state\n entity_id: media_player.living_room_tv\n state: 'off'\n then:\n - action: media_player.turn_on\n target:\n entity_id: media_player.living_room_tv\n - wait_template: '{{ is_state(''media_player.living_room_tv'', ''on'') }}'\n timeout: 30\n continue_on_timeout: false\n - wait_template: '{{ state_attr(''media_player.living_room_tv'', ''source'') = none\n }}'\n timeout: 30\n continue_on_timeout: false\n - if:\n - not:\n - condition: state\n entity_id: media_player.living_room_tv\n attribute: source\n state: HDMI 2\n then:\n - action: media_player.select_source\n target:\n entity_id: media_player.living_room_tv\n data:\n source: HDMI 2", "config": [ { "name": "living room chromecast", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_chromecast", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "media player turn on service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_on", "device_id": null } }, { "name": "media player select source service", "room": null, "type": "service", "id": { "entity_id": "media_player.select_source", "device_id": null } } ] }, { "id": "turn_living_room_tv_off", "automation": "- id: turn_living_room_tv_off\n alias: Turn Living Room TV Off\n description: Turn off TV if still on Chromecast input.\n triggers:\n - trigger: state\n entity_id: media_player.living_room_chromecast\n to: 'off'\n conditions:\n - condition: state\n entity_id: media_player.living_room_tv\n attribute: source\n state: HDMI 2\n actions:\n - action: media_player.turn_off\n target:\n entity_id: media_player.living_room_tv", "config": [ { "name": "living room chromecast", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_chromecast", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "media player turn off service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_off", "device_id": null } } ] }, { "id": "turn_living_room_chromecast_on", "automation": "- id: turn_living_room_chromecast_on\n alias: Turn Living Room Chromecast On\n description: Turn on chromecast if TV source is turned to HDMI 2.\n triggers:\n - platform: state\n entity_id: media_player.living_room_tv\n attribute: source\n to: HDMI 2\n for: 5\n conditions:\n - condition: state\n entity_id: media_player.living_room_chromecast\n state:\n - 'off'\n - unknown\n - unavailable\n actions:\n - action: media_player.turn_on\n target:\n entity_id: media_player.living_room_chromecast", "config": [ { "name": "living room chromecast", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_chromecast", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "media player turn on service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_on", "device_id": null } } ] }, { "id": "turn_living_room_chromecast_off", "automation": "- id: turn_living_room_chromecast_off\n alias: Turn Living Room Chromecast Off\n description: Turn off chromecast if TV is turned off.\n triggers:\n - trigger: state\n entity_id: media_player.living_room_tv\n to: 'off'\n conditions:\n - condition: not\n conditions:\n - condition: state\n entity_id: media_player.living_room_chromecast\n state:\n - 'off'\n - unknown\n - unavailable\n actions:\n - action: media_player.turn_off\n target:\n entity_id: media_player.living_room_chromecast", "config": [ { "name": "living room chromecast", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_chromecast", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "media player turn off service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_off", "device_id": null } } ] }, { "id": "lock_door_locks", "automation": "- id: lock_door_locks\n alias: Lock Door Locks\n description: Lock door locks.\n mode: queued\n triggers:\n - trigger: state\n id: alarm\n entity_id: alarm_control_panel.house\n to:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: state\n id: unlocked\n entity_id:\n - lock.back_door_lock\n - lock.front_door_lock\n - lock.side_door_lock\n - lock.garage_side_door_lock\n to: unlocked\n for:\n minutes: 10\n - trigger: state\n id: lock_keypad\n entity_id:\n - sensor.back_door_lock_status\n - sensor.front_door_lock_status\n - sensor.side_door_lock_status\n - sensor.garage_side_door_lock_status\n to:\n - Locked (Keypad)\n - Locked (Guest)\n - Locked (Jason)\n not_from:\n - unknown\n - unavailable\n for:\n minutes: 1\n conditions:\n - condition: template\n alias: Alarm enabled if alarm trigger\n value_template: '{{ is_state(''input_boolean.alarm_enabled'', ''on'') if trigger.id\n == ''alarm'' else true }}'\n - condition: template\n alias: Alarm is not disarmed if trigger is unlocked, else one or more locks are\n unlocked\n value_template: \"{{ not is_state('alarm_control_panel.house', 'disarmed')\\n \\\n \\ if trigger.id == 'unlocked' else is_state('group.door_locks', 'unlocked')\\\n \\ }}\\n\"\n actions:\n - action: script.lock_door_locks\n data:\n entity_id: '{{ state_attr(''group.door_locks'', ''entity_id'') }}'\n - delay: 60", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "back door lock status", "room": "back", "type": "sensor", "id": { "entity_id": "sensor.back_door_lock_status", "device_id": null } }, { "name": "front door lock status", "room": "front", "type": "sensor", "id": { "entity_id": "sensor.front_door_lock_status", "device_id": null } }, { "name": "side door lock status", "room": "side", "type": "sensor", "id": { "entity_id": "sensor.side_door_lock_status", "device_id": null } }, { "name": "garage side door lock status", "room": "garage", "type": "sensor", "id": { "entity_id": "sensor.garage_side_door_lock_status", "device_id": null } }, { "name": "side door lock", "room": "side", "type": "lock", "id": { "entity_id": "lock.side_door_lock", "device_id": null } }, { "name": "back door lock", "room": "back", "type": "lock", "id": { "entity_id": "lock.back_door_lock", "device_id": null } }, { "name": "front door lock", "room": "front", "type": "lock", "id": { "entity_id": "lock.front_door_lock", "device_id": null } }, { "name": "garage side door lock", "room": "garage", "type": "lock", "id": { "entity_id": "lock.garage_side_door_lock", "device_id": null } }, { "name": "door locks group", "room": null, "type": "group", "id": { "entity_id": "group.door_locks", "device_id": null } }, { "name": "lock door locks script", "room": null, "type": "script", "id": { "entity_id": "script.lock_door_locks", "device_id": null } } ] }, { "id": "lock_status_update", "automation": "- id: lock_status_update\n alias: Lock Status Update\n description: Update lock status sensor when lock zwave events are detected.\n mode: parallel\n variables:\n node_id: '{{ trigger.event.data[''node_id''] | int(-1) }}'\n entity_id: \"{{ expand('group.door_locks')\\n | selectattr('attributes.node_id',\\\n \\ 'eq', node_id)\\n | map(attribute='entity_id') | join }}\\n\"\n user: \"{%- from 'lock.jinja' import lock_user %} {% if trigger.event.data.parameters\\\n \\ is defined %}\\n {% if trigger.event.data.parameters['userId'] is defined\\\n \\ %}\\n {% set userID = trigger.event.data.parameters['userId'] | int(-1)\\\n \\ %}\\n {% endif %}\\n{% endif %} {{ lock_user(userID | default(0)) }}\\n\"\n event_label: '{{ trigger.event.data[''event_label''] }}'\n triggers:\n - trigger: event\n event_type: zwave_js_notification\n conditions: '{{ event_label.endswith(''lock operation'') and node_id > 0 and entity_id\n != '''' }}'\n actions:\n - action: input_text.set_value\n target:\n entity_id: input_text.{{ states[entity_id].object_id }}_status\n data:\n value: '{% if event_label == ''Manual unlock operation'' %} Unlocked (Manual)\n {% elif event_label == ''Manual lock operation'' %} Locked (Manual) {% elif\n event_label == ''RF unlock operation'' %} Unlocked (Hassio) {% elif event_label\n == ''RF lock operation'' %} Locked (Hassio) {% elif event_label == ''Keypad\n unlock operation'' %} Unlocked ({{ user }}) {% elif event_label == ''Keypad\n lock operation'' %} Locked ({{ user }}) {% else %} ERROR {% endif %}\n\n '", "config": [ { "name": "door locks group", "room": null, "type": "group", "id": { "entity_id": "group.door_locks", "device_id": null } }, { "name": "zwave js notification event", "room": null, "type": "event", "id": { "entity_id": "zwave_js_notification", "device_id": null } }, { "name": "input text set value service", "room": null, "type": "service", "id": { "entity_id": "input_text.set_value", "device_id": null } } ] }, { "id": "log_error_notification", "automation": "- id: log_error_notification\n alias: Log Error Notification\n description: Notify on HA log errors.\n mode: single\n variables:\n log_error: \"{% set message = '' %} {% set exception = '' %} {% if trigger.event.data.message[0]\\\n \\ is defined %}\\n {% set message = trigger.event.data.message[0] %}\\n{% endif\\\n \\ %} {% if trigger.event.data.exception is defined %}\\n {% set exception =\\\n \\ trigger.event.data.exception %}\\n{% endif %} {% if 'Missing device owner or\\\n \\ root rights to reboot the device' in exception %}\\n Fully Kiosk Error - Missing\\\n \\ device owner or root rights to reboot the device.\\n{% else %} {{ none }} {%\\\n \\ endif %}\\n\"\n triggers:\n - trigger: event\n event_type: system_log_event\n event_data:\n level: ERROR\n conditions:\n - condition: template\n value_template: '{{ log_error != none }}'\n actions:\n - action: browser_mod.notification\n data:\n duration: 10000\n message: '{{ log_error }}'\n - action: persistent_notification.create\n data:\n title: HASS Log Error\n message: '{{ log_error }}'\n notification_id: log_error\n - if:\n - condition: state\n entity_id:\n - input_boolean.tts_enabled\n - input_boolean.kiosk_tts_enabled\n state: 'on'\n then:\n - action: notify.kiosk_tts\n data:\n message: '{{ log_error }}'", "config": [ { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "system log event event", "room": null, "type": "event", "id": { "entity_id": "system_log_event", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "kiosk tts notify", "room": null, "type": "notify", "id": { "entity_id": "notify.kiosk_tts", "device_id": null } }, { "name": "tts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.tts", "device_id": null } }, { "name": "tts enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.tts_enabled", "device_id": null } }, { "name": "Kiosk TTS Enabled Input Boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.kiosk_tts_enabled", "device_id": null } } ] }, { "id": "log_level_selection", "automation": "- id: log_level_selection\n alias: Log Level Selection\n description: Change HA log level to set value.\n variables:\n level: '{{ states(''input_select.log_level'') }}'\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_select.log_level\n to: null\n actions:\n - action: logger.set_default_level\n data:\n level: '{{ level }}'\n - action: system_log.write\n data:\n logger: '{{ this.entity_id }}'\n level: critical\n message: '***** HA LOG LEVEL SET TO : {{ level }} *****'", "config": [ { "name": "log level input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.log_level", "device_id": null } }, { "name": "logger set default level service", "room": null, "type": "service", "id": { "entity_id": "logger.set_default_level", "device_id": null } }, { "name": "system log write service", "room": null, "type": "service", "id": { "entity_id": "system_log.write", "device_id": null } } ] }, { "id": "turn_master_bathroom_vent_fan_off", "automation": "- id: turn_master_bathroom_vent_fan_off\n alias: Turn Master Bathroom Vent Fan Off\n description: Turn off master bathroom vent fan.\n mode: queued\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for:\n minutes: 1\n - trigger: state\n id: alert\n entity_id: alert.indoor_high_temperature\n to: idle\n conditions:\n - condition: state\n entity_id: fan.master_bathroom_fan\n state: 'on'\n - condition: state\n entity_id: alert.indoor_high_temperature\n state: idle\n actions:\n - action: script.turn_fan_off\n data:\n entity_id: fan.master_bathroom_fan\n override: '{{ trigger.id == ''occupancy'' }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "turn fan off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_off", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "master bathroom fan", "room": "master bathroom", "type": "fan", "id": { "entity_id": "fan.master_bathroom_fan", "device_id": null } } ] }, { "id": "media_launcher_control", "automation": "- id: media_launcher_control\n alias: Media Launcher Control\n description: Control media launcher display.\n mode: restart\n triggers:\n - trigger: state\n id: preset\n entity_id:\n - input_boolean.media_launcher_preset_jason\n - input_boolean.media_launcher_preset_charlie\n - input_boolean.media_launcher_preset_guest\n - input_boolean.media_launcher_preset_wake\n - input_boolean.media_launcher_preset_morning\n - input_boolean.media_launcher_preset_sleep\n - input_boolean.media_launcher_preset_chill\n - input_boolean.media_launcher_preset_company\n - input_boolean.media_launcher_preset_shower\n - trigger: state\n id: other\n entity_id:\n - input_boolean.media_launcher_play_media\n - input_boolean.media_launcher_tv\n - input_boolean.media_launcher_alarm_clock\n - input_boolean.media_launcher_tts\n - input_boolean.media_launcher_volume\n actions:\n - action: automation.turn_off\n target:\n entity_id: '{{ this.entity_id }}'\n data:\n stop_actions: false\n - action: input_boolean.turn_off\n target:\n entity_id: \"{{ expand('group.media_launchers') | rejectattr('entity_id', 'eq',\\\n \\ trigger.entity_id)\\n | map(attribute='entity_id') | list }}\\n\"\n continue_on_error: true\n - action: automation.turn_on\n target:\n entity_id: '{{ this.entity_id }}'\n - delay: 120\n - wait_template: '{{ is_state(''input_boolean.media_launcher_lock'', ''off'') }}'\n timeout: 900\n - action: automation.turn_off\n target:\n entity_id: '{{ this.entity_id }}'\n data:\n stop_actions: false\n - action: input_boolean.turn_off\n target:\n entity_id:\n - input_boolean.media_launcher_lock\n - group.media_launchers\n continue_on_error: true\n - action: automation.turn_on\n target:\n entity_id: '{{ this.entity_id }}'", "config": [ { "name": "media launcher alarm clock", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_alarm_clock", "device_id": null } }, { "name": "media launcher preset jason", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_jason", "device_id": null } }, { "name": "media launcher preset charlie", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_charlie", "device_id": null } }, { "name": "media launcher preset guest", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_guest", "device_id": null } }, { "name": "media launcher preset wake", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_wake", "device_id": null } }, { "name": "media launcher preset morning", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_morning", "device_id": null } }, { "name": "media launcher preset sleep", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_sleep", "device_id": null } }, { "name": "media launcher preset chill", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_chill", "device_id": null } }, { "name": "media launcher preset company", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_company", "device_id": null } }, { "name": "media launcher preset shower", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_shower", "device_id": null } }, { "name": "media launcher play media", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_play_media", "device_id": null } }, { "name": "media launcher tv", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_tv", "device_id": null } }, { "name": "media launcher tts", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_tts", "device_id": null } }, { "name": "media launcher volume", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_volume", "device_id": null } }, { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "media launchers group", "room": null, "type": "group", "id": { "entity_id": "group.media_launchers", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } }, { "name": "media launcher lock", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_lock", "device_id": null } } ] }, { "id": "media_player_dnd_mode", "automation": "- id: media_player_dnd_mode\n alias: Media Player DND Mode\n description: Set media players Do Not Disturb mode.\n mode: queued\n variables:\n switches: \"{{ states.switch | selectattr('entity_id', 'in', integration_entities('google_home'))\\n\\\n \\ | selectattr('entity_id', 'contains', '_do_not_disturb')\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n to: Night\n for: 1\n - trigger: state\n entity_id: input_select.occupancy_mode\n from: Night\n for: 1\n actions:\n - action: switch.turn_{{ 'on' if is_state('input_select.occupancy_mode', 'Night')\n else 'off' }}\n target:\n entity_id: '{{ switches }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } } ] }, { "id": "turn_media_player_mute_off", "automation": "- id: turn_media_player_mute_off\n alias: Turn Media Player Mute Off\n description: Turn media mute off.\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.timed_mute_duration\n actions:\n - action: switch.turn_off\n target:\n entity_id: switch.media_mute", "config": [ { "name": "timed mute duration timer", "room": null, "type": "timer", "id": { "entity_id": "timer.timed_mute_duration", "device_id": null } }, { "name": "media mute switch", "room": null, "type": "switch", "id": { "entity_id": "switch.media_mute", "device_id": null } } ] }, { "id": "toggle_media_player_mute", "automation": "- id: toggle_media_player_mute\n alias: Toggle Media Player Mute\n description: Toggle media mute.\n triggers:\n - trigger: event\n event_type: shelly.click\n event_data:\n device: shellybutton1-E8DB84AA2E96\n click_type: triple\n actions:\n - action: switch.toggle\n target:\n entity_id: switch.media_mute", "config": [ { "name": "media mute switch", "room": null, "type": "switch", "id": { "entity_id": "switch.media_mute", "device_id": null } }, { "name": "shelly click event", "room": null, "type": "event", "id": { "entity_id": "shelly.click", "device_id": null } }, { "name": "shelly button device", "room": "bedroom", "type": "device", "id": { "entity_id": null, "device_id": "shellybutton1-E8DB84AA2E96" } } ] }, { "id": "mute_media_players", "automation": "- id: mute_media_players\n alias: Mute Media Players\n description: Mute media players.\n mode: queued\n variables:\n entity_id: \"{{ expand(state_attr('group.speaker_media_players', 'entity_id'))\\n\\\n \\ | rejectattr('attributes.type', 'eq', 'group')\\n | rejectattr('attributes.is_volume_muted',\\\n \\ 'eq', true)\\n | map(attribute='entity_id') | list }}\\n\"\n triggers:\n - trigger: state\n entity_id: binary_sensor.mobile_phone_in_use\n attribute: speaker_on\n to: true\n actions:\n - if:\n - condition: state\n entity_id: input_boolean.tts\n state: 'on'\n then:\n - wait_template: '{{ is_state(''input_boolean.tts'', ''off'') }}'\n - action: script.media_players_mute\n data:\n entity_id: '{{ entity_id }}'\n mute: true\n - wait_template: '{{ not is_state_attr(''binary_sensor.mobile_phone_in_use'', ''speaker_on'',\n true) }}'\n - alias: Media Mute switch is off\n condition: state\n entity_id: switch.media_mute\n state: 'off'\n - action: script.media_players_mute\n data:\n entity_id: '{{ entity_id }}'\n mute: false", "config": [ { "name": "media mute switch", "room": null, "type": "switch", "id": { "entity_id": "switch.media_mute", "device_id": null } }, { "name": "mobile phone in use binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.mobile_phone_in_use", "device_id": null } }, { "name": "tts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.tts", "device_id": null } }, { "name": "media players mute script", "room": null, "type": "script", "id": { "entity_id": "script.media_players_mute", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } }, { "name": "speaker media players group", "room": null, "type": "group", "id": { "entity_id": "group.speaker_media_players", "device_id": null } } ] }, { "id": "media_play_error", "automation": "- id: media_play_error\n alias: Media Play Error\n description: Notify on media play error.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: system_log_event\n event_data:\n name: homeassistant.components.script.media_play\n level: ERROR\n actions:\n - action: script.tts_play\n data:\n message: The selected media has failed to play. Is Music Assistant offline?\n quiet_play: true\n continue_on_error: true\n - action: script.media_player_reset_volumes\n data:\n force_reset: true\n continue_on_error: true\n - delay: 1\n - event: media_play_error", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "system log event event", "room": null, "type": "event", "id": { "entity_id": "system_log_event", "device_id": null } }, { "name": "media play error event", "room": null, "type": "event", "id": { "entity_id": "media_play_error", "device_id": null } }, { "name": "media player reset volumes script", "room": null, "type": "script", "id": { "entity_id": "script.media_player_reset_volumes", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } } ] }, { "id": "reset_media_preset_option_view", "automation": "- id: reset_media_preset_option_view\n alias: Reset Media Preset Option View\n description: Reset media preset option view.\n triggers:\n - trigger: state\n entity_id: input_boolean.media_preset_options\n to: 'on'\n for:\n minutes: 5\n - trigger: state\n entity_id:\n - input_boolean.media_launcher_preset_charlie\n - input_boolean.media_launcher_preset_chill\n - input_boolean.media_launcher_preset_company\n - input_boolean.media_launcher_preset_guest\n - input_boolean.media_launcher_preset_jason\n - input_boolean.media_launcher_preset_morning\n - input_boolean.media_launcher_preset_shower\n - input_boolean.media_launcher_preset_sleep\n - input_boolean.media_launcher_preset_wake\n to: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.media_preset_options", "config": [ { "name": "media launcher preset jason", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_jason", "device_id": null } }, { "name": "media launcher preset charlie", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_charlie", "device_id": null } }, { "name": "media launcher preset guest", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_guest", "device_id": null } }, { "name": "media launcher preset wake", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_wake", "device_id": null } }, { "name": "media launcher preset morning", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_morning", "device_id": null } }, { "name": "media launcher preset sleep", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_sleep", "device_id": null } }, { "name": "media launcher preset chill", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_chill", "device_id": null } }, { "name": "media launcher preset company", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_company", "device_id": null } }, { "name": "media launcher preset shower", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_launcher_preset_shower", "device_id": null } }, { "name": "media preset options", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_preset_options", "device_id": null } } ] }, { "id": "morning_before_waketime", "automation": "- id: morning_before_waketime\n alias: Morning Before Waketime\n description: Override HVAC mode before wakeup to preheat house.\n triggers:\n - trigger: state\n entity_id: binary_sensor.waketime_active\n to: 'on'\n from: 'off'\n conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: state\n entity_id: input_boolean.climate_manual_mode\n state: 'off'\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.climate_presence_override", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "waketime active", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.waketime_active", "device_id": null } }, { "name": "climate manual mode input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_manual_mode", "device_id": null } }, { "name": "climate presence override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_presence_override", "device_id": null } } ] }, { "id": "turn_movie_scene_off", "automation": "- id: turn_movie_scene_off\n alias: Turn Movie Scene Off\n description: Turn off movie scene.\n max_exceeded: silent\n trigger:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.movie_scene\n action:\n - action: switch.turn_off\n target:\n entity_id: switch.movie_scene", "config": [ { "name": "movie scene timer", "room": null, "type": "timer", "id": { "entity_id": "timer.movie_scene", "device_id": null } }, { "name": "movie scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.movie_scene", "device_id": null } } ] }, { "id": "nap_alarm_clock_timer_control", "automation": "- id: nap_alarm_clock_timer_control\n alias: Nap Alarm Clock Timer Control\n description: Start or cancel alarm clock nap timer.\n triggers:\n - trigger: state\n entity_id: input_boolean.alarm_clock_nap\n to: null\n actions:\n - if:\n - condition: state\n entity_id: input_boolean.alarm_clock_nap\n state: 'on'\n then:\n - action: timer.start\n target:\n entity_id: timer.alarm_clock_nap\n data:\n duration:\n minutes: '{{ states(''input_number.alarm_clock_nap_time'') | int(0) }}'\n else:\n - action: timer.cancel\n target:\n entity_id: timer.alarm_clock_nap", "config": [ { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "alarm clock nap input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap time input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.alarm_clock_nap_time", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } } ] }, { "id": "nap_alarm_clock_timer_duration_changed", "automation": "- id: nap_alarm_clock_timer_duration_changed\n alias: Nap Alarm Clock Timer Duration Changed\n description: Restart nap timer when duration setting changes.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_number.alarm_clock_nap_time\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_clock_nap\n state: 'on'\n - condition: state\n entity_id: switch.alarm_clock_nap\n state: 'off'\n actions:\n - action: timer.start\n target:\n entity_id: timer.alarm_clock_nap\n data:\n duration:\n minutes: '{{ states(''input_number.alarm_clock_nap_time'') | int(0) }}'", "config": [ { "name": "alarm clock nap input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap time input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.alarm_clock_nap_time", "device_id": null } }, { "name": "alarm clock nap switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_nap", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "nap_alarm_clock_timer_turned_off", "automation": "- id: nap_alarm_clock_timer_turned_off\n alias: Nap Alarm Clock Timer Turned Off\n description: Reset nap alarm clock if timer turned off.\n triggers:\n - trigger: state\n entity_id: timer.alarm_clock_nap\n to:\n - idle\n - paused\n for: 15\n conditions:\n condition: state\n entity_id: input_boolean.alarm_clock_nap\n state: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.alarm_clock_nap", "config": [ { "name": "alarm clock nap input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } } ] }, { "id": "nest_protect_reload", "automation": "- id: nest_protect_reload\n alias: Nest Protect Reload\n description: Reload nest protect when WAN status changes.\n mode: restart\n triggers:\n - trigger: state\n entity_id: alert.wan_offline\n to:\n - idle\n - 'on'\n actions:\n - action: homeassistant.reload_config_entry\n target:\n entity_id: binary_sensor.nest_protect_upstairs_smoke_status", "config": [ { "name": "wan offline alert", "room": null, "type": "alert", "id": { "entity_id": "alert.wan_offline", "device_id": null } }, { "name": "nest protect upstairs smoke status", "room": "upstairs", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nest_protect_upstairs_smoke_status", "device_id": null } }, { "name": "homeassistant reload config entry service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.reload_config_entry", "device_id": null } } ] }, { "id": "notification_led", "automation": "- id: notification_led\n alias: Notification LED\n description: Set LED notification.\n mode: parallel\n max: 20\n variables:\n type: '{{ states[trigger.entity_id].object_id | replace(''_led_alert'', '''')\n }}'\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.alarm_clock_led_alert\n - binary_sensor.alarm_led_alert\n - binary_sensor.commute_led_alert\n - binary_sensor.garage_led_alert\n - binary_sensor.media_led_alert\n - binary_sensor.presence_led_alert\n - binary_sensor.reminder_led_alert\n - binary_sensor.scene_led_alert\n - binary_sensor.shower_led_alert\n - binary_sensor.weather_led_alert\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n actions:\n - wait_template: '{{ state_attr(''group.'' ~ type ~''_led'', ''entity_id'') != none\n }}'\n timeout: 300\n continue_on_timeout: false\n - action: script.{{ type }}_led", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock_led_alert", "device_id": null } }, { "name": "alarm led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_led_alert", "device_id": null } }, { "name": "commute led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.commute_led_alert", "device_id": null } }, { "name": "garage led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.garage_led_alert", "device_id": null } }, { "name": "media led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.media_led_alert", "device_id": null } }, { "name": "presence led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.presence_led_alert", "device_id": null } }, { "name": "reminder led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.reminder_led_alert", "device_id": null } }, { "name": "scene led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.scene_led_alert", "device_id": null } }, { "name": "shower led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.shower_led_alert", "device_id": null } }, { "name": "weather led alert binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.weather_led_alert", "device_id": null } } ] }, { "id": "notification_led_reset", "automation": "- id: notification_led_reset\n alias: Notification LED Reset\n description: Reset LED notification.\n mode: parallel\n max: 50\n triggers:\n - trigger: state\n entity_id:\n - light.back_house_potlights\n - light.back_yard_garden_lights\n - light.back_yard_tree_lights\n - light.bathroom_shower_light\n - light.bathroom_vanity_light\n - light.bedroom_fan_light\n - light.bedroom_potlights\n - light.dining_room_light\n - light.dining_room_potlights\n - light.front_house_potlights\n - light.front_porch_light\n - light.hallway_potlights\n - light.kitchen_potlights\n - light.kitchen_sink_light\n - light.living_room_cove_light\n - light.living_room_fan_light\n - light.living_room_potlights\n - light.master_bedroom_light\n - light.office_fan_light\n - light.office_potlights\n - light.outside_garage_lights\n - light.side_entrance_light\n from:\n - unknown\n - unavailable\n actions:\n - action: script.led_reset\n data:\n entities: '{{ trigger.entity_id }}'", "config": [ { "name": "bedroom fan light", "room": "bedroom", "type": "light", "id": { "entity_id": "light.bedroom_fan_light", "device_id": null } }, { "name": "bedroom potlights", "room": "bedroom", "type": "light", "id": { "entity_id": "light.bedroom_potlights", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "kitchen potlights", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_potlights", "device_id": null } }, { "name": "dining room potlights", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_potlights", "device_id": null } }, { "name": "hallway potlights", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway_potlights", "device_id": null } }, { "name": "bathroom shower light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_shower_light", "device_id": null } }, { "name": "back house potlights", "room": "back", "type": "light", "id": { "entity_id": "light.back_house_potlights", "device_id": null } }, { "name": "back yard garden lights", "room": "back yard", "type": "light", "id": { "entity_id": "light.back_yard_garden_lights", "device_id": null } }, { "name": "back yard tree lights", "room": "back yard", "type": "light", "id": { "entity_id": "light.back_yard_tree_lights", "device_id": null } }, { "name": "bathroom vanity light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } }, { "name": "front house potlights", "room": "front", "type": "light", "id": { "entity_id": "light.front_house_potlights", "device_id": null } }, { "name": "front porch light", "room": "front porch", "type": "light", "id": { "entity_id": "light.front_porch_light", "device_id": null } }, { "name": "kitchen sink light", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_sink_light", "device_id": null } }, { "name": "living room cove light", "room": "living room", "type": "light", "id": { "entity_id": "light.living_room_cove_light", "device_id": null } }, { "name": "living room fan light", "room": "living room", "type": "light", "id": { "entity_id": "light.living_room_fan_light", "device_id": null } }, { "name": "living room potlights", "room": "living room", "type": "light", "id": { "entity_id": "light.living_room_potlights", "device_id": null } }, { "name": "master bedroom light", "room": "master bedroom", "type": "light", "id": { "entity_id": "light.master_bedroom_light", "device_id": null } }, { "name": "office fan light", "room": "office", "type": "light", "id": { "entity_id": "light.office_fan_light", "device_id": null } }, { "name": "office potlights", "room": "office", "type": "light", "id": { "entity_id": "light.office_potlights", "device_id": null } }, { "name": "outside garage lights", "room": "outside", "type": "light", "id": { "entity_id": "light.outside_garage_lights", "device_id": null } }, { "name": "led reset script", "room": null, "type": "script", "id": { "entity_id": "script.led_reset", "device_id": null } } ] }, { "id": "set_occupancy_mode", "automation": "- id: set_occupancy_mode\n alias: Set Occupancy Mode\n description: Set occupancy mode.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n - trigger: state\n id: arrive\n entity_id:\n - binary_sensor.someone_home\n - binary_sensor.owner_home\n to: 'on'\n from: 'off'\n - trigger: state\n id: leave\n entity_id:\n - binary_sensor.someone_home\n - binary_sensor.owner_home\n to: 'off'\n from: 'on'\n for: 60\n - trigger: state\n id: night\n entity_id: alarm_control_panel.house\n to: armed_night\n - trigger: event\n id: home\n event_type: mobile_app_notification_action\n event_data:\n action: set_home_mode\n - trigger: event\n id: away\n event_type: mobile_app_notification_action\n event_data:\n action: set_away_mode\n conditions:\n - condition: state\n entity_id: input_boolean.startup_pending\n state: 'off'\n - condition: template\n value_template: \"{{ is_state('input_boolean.alarm_auto_arming', 'on')\\n if\\\n \\ trigger.id == 'night' else is_state('input_boolean.occupancy_mode_automation',\\\n \\ 'on') }}\\n\"\n actions:\n - action: input_select.select_option\n target:\n entity_id: input_select.occupancy_mode\n data:\n option: '{% from ''presence.jinja'' import occupancy_mode %} {{ iif(trigger.id\n in [''startup'', ''arrive'', ''leave''], occupancy_mode(), trigger.id | title)\n }}\n\n '", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm auto arming", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_auto_arming", "device_id": null } }, { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "occupancy mode automation", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_mode_automation", "device_id": null } } ] }, { "id": "occupancy_mode_changed", "automation": "- id: occupancy_mode_changed\n alias: Occupancy Mode Changed\n description: Set occupancy mode options, validate occupancy mode change.\n mode: queued\n variables:\n prev_mode: '{{ trigger.from_state.state }}'\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n to: null\n conditions:\n - condition: state\n entity_id: input_boolean.occupancy_mode_automation\n state: 'on'\n actions:\n - choose:\n - conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Home\n sequence:\n - variables:\n overrides: \"{{ expand('group.presence_override_controls')\\n | selectattr('state',\\\n \\ 'eq', 'on')\\n | map(attribute='entity_id') | list }}\\n\"\n - if: '{{ overrides | count > 0 }}'\n then:\n - repeat:\n count: '{{ overrides | count > 0 }}'\n sequence:\n - variables:\n person: '{{ states[overrides[repeat.index-1]].object_id | replace(''_presence_override'',\n '''') }}'\n - if: '{{ is_state(''person.'' ~ person, ''home'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.{{ person }}_presence_override\n - delay: 1\n - if:\n - condition: state\n entity_id: binary_sensor.owner_home\n state: 'off'\n then:\n - action: automation.turn_off\n target:\n entity_id: '{{ state_attr(''group.occupancy_automations'', ''entity_id'')\n }}'\n data:\n stop_actions: false\n - action: input_select.select_option\n target:\n entity_id: input_select.occupancy_mode\n data:\n option: '{{ ''Guest'' if is_state(''binary_sensor.guest_home'', ''on'')\n else prev_mode }}'\n - action: automation.turn_on\n target:\n entity_id: '{{ state_attr(''group.occupancy_automations'', ''entity_id'')\n }}'\n - conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n sequence:\n - if:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'off'\n then:\n - action: automation.turn_off\n target:\n entity_id: '{{ state_attr(''group.occupancy_automations'', ''entity_id'')\n }}'\n data:\n stop_actions: false\n - action: input_select.select_option\n target:\n entity_id: input_select.occupancy_mode\n data:\n option: '{{ prev_mode }}'\n - action: automation.turn_on\n target:\n entity_id: '{{ state_attr(''group.occupancy_automations'', ''entity_id'')\n }}'\n else:\n - action: automation.turn_off\n target:\n entity_id: automation.someone_arrives_home\n data:\n stop_actions: true\n - action: automation.turn_on\n target:\n entity_id: automation.someone_arrives_home\n - conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state:\n - Away\n - Vacation\n sequence:\n - if: null\n then:\n - action: script.turn_presence_override_on\n data:\n people: '{{ state_attr(''binary_sensor.someone_home'', ''home'') }}'\n home: turn_off\n - action: automation.turn_off\n target:\n entity_id: automation.someone_arrives_home\n data:\n stop_actions: true\n - action: automation.turn_on\n target:\n entity_id: automation.someone_arrives_home\n - conditions:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Guest\n sequence:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.guest_home\n - if:\n - condition: state\n entity_id: binary_sensor.owner_home\n state: 'on'\n then:\n - action: automation.turn_off\n target:\n entity_id: '{{ state_attr(''group.occupancy_automations'', ''entity_id'')\n }}'\n data:\n stop_actions: false\n - action: input_select.select_option\n target:\n entity_id: input_select.occupancy_mode\n data:\n option: '{{ ''Night'' if prev_mode == ''Night'' else ''Home'' }}'\n - action: automation.turn_on\n target:\n entity_id: '{{ state_attr(''group.occupancy_automations'', ''entity_id'')\n }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "guest home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.guest_home", "device_id": null } }, { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } }, { "name": "occupancy mode automation", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_mode_automation", "device_id": null } }, { "name": "presence override controls group", "room": null, "type": "group", "id": { "entity_id": "group.presence_override_controls", "device_id": null } }, { "name": "turn presence override on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_presence_override_on", "device_id": null } }, { "name": "occupancy automations group", "room": null, "type": "group", "id": { "entity_id": "group.occupancy_automations", "device_id": null } }, { "name": "someone arrives home automation", "room": null, "type": "automation", "id": { "entity_id": "automation.someone_arrives_home", "device_id": null } }, { "name": "guest home input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.guest_home", "device_id": null } } ] }, { "id": "occupancy_mode_alert", "automation": "- id: occupancy_mode_alert\n alias: Occupancy Mode Alert\n description: Send occupancy mode alert notification.\n triggers:\n - trigger: state\n entity_id: alert.occupancy_mode\n to: 'on'\n for:\n minutes: 5\n conditions:\n - condition: state\n entity_id: input_boolean.occupancy_notifications\n state: 'on'\n actions:\n - repeat:\n sequence:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'Hey you!\n\n Pay attention and get it together dumbass!\n\n {%- from ''presence.jinja'' import occupancy_alert %}\n\n {{ occupancy_alert() }}\n\n '\n provider: HASS\n language: English (Nigeria)\n voice: Abeo\n always_play: true\n - wait_template: '{{ not is_state(''alert.occupancy_mode'', ''on'') }}'\n timeout:\n minutes: 15\n until:\n - not:\n - condition: state\n entity_id: alert.occupancy_mode\n state: 'on'", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "occupancy notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_notifications", "device_id": null } }, { "name": "occupancy mode alert entity", "room": null, "type": "alert", "id": { "entity_id": "alert.occupancy_mode", "device_id": null } } ] }, { "id": "turn_occupancy_notifications_off", "automation": "- id: turn_occupancy_notifications_off\n alias: Turn Occupancy Notifications Off\n description: Turn off occupancy notifications boolean.\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_off_occupancy_notifications\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.occupancy_notifications\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: occupancy_notification", "config": [ { "name": "occupancy notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_notifications", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } } ] }, { "id": "occupancy_mode_notification", "automation": "- id: occupancy_mode_notification\n alias: Occupancy Mode Notification\n description: Send notification when occupancy mode or alarm state has changed.\n mode: single\n max_exceeded: silent\n variables:\n run_delay: 10\n occupancy_changed: \"{{ is_state('input_boolean.occupancy_announcements', 'on')\\n\\\n \\ and now() - states.input_select.occupancy_mode.last_changed\\n < timedelta(seconds=run_delay)\\\n \\ }}\\n\"\n alarm_changed: \"{{ is_state('input_boolean.alarm_announcements', 'on')\\n and\\\n \\ now() - states.alarm_control_panel.house.last_changed\\n < timedelta(seconds=run_delay)\\\n \\ }}\\n\"\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Home\n - Guest\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: state\n id: armed\n entity_id: alarm_control_panel.house\n to:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n - trigger: state\n id: disarmed\n entity_id: alarm_control_panel.house\n to: disarmed\n from:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n - pending\n - triggered\n conditions:\n - condition: template\n alias: Alarm enabled if alarm trigger\n value_template: '{{ iif(trigger.id in [''armed'', ''disarmed''], is_state(''input_boolean.alarm_enabled'',\n ''on''), true) }}'\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state: &id006\n - triggered\n - pending\n - arming\n actions:\n - delay: '{{ run_delay }}'\n - not:\n - condition: state\n entity_id: alarm_control_panel.house\n state: *id006\n - parallel:\n - sequence:\n - if:\n - '{{ is_state(''input_boolean.occupancy_announcements'', ''on'') if trigger.id\n == ''occupancy'' else true }}'\n - '{{ is_state(''input_boolean.alarm_announcements'', ''on'') if trigger.id\n in [''armed'', ''disarmed''] else true }}'\n then:\n - action: script.tts_play\n data:\n message: \"{%- if occupancy_changed -%}\\nThe house is now in {{ states('input_select.occupancy_mode')\\\n \\ }} mode\\n{%- endif %}\\n{%- if occupancy_changed and alarm_changed\\\n \\ %}, and the\\n {%- elif occupancy_changed %}.\\n {%- elif alarm_changed\\\n \\ %} The\\n {%- endif %}\\n{%- if alarm_changed %} alarm is {{ states('sensor.alarm_status')\\\n \\ }}.\\n{%- endif %}\\n{{ 'Personalized occupant automations are disabled.'\\\n \\ if states('input_select.occupancy_mode') == 'Guest' }}\\n\"\n ignore_away: true\n continue_on_error: true\n - wait_template: '{{ is_state(''input_boolean.tts'', ''off'') }}'\n - event: occupancy_notification_done\n - sequence:\n - if:\n - condition: state\n entity_id: input_boolean.occupancy_notifications\n state: 'on'\n then:\n - action: notify.jason\n data:\n title: '{{ iif(is_state(''input_boolean.alarm_triggered'', ''on''), ''Alarm\n Triggered'', ''House Mode'') }}'\n message: 'Mode: {{ states(''input_select.occupancy_mode'') }}\n\n Alarm: {{ states(''sensor.alarm_status'') }}\n\n {%- if is_state(''input_boolean.alarm_triggered'', ''on'') %}\n\n Trigger: {{ states(''input_text.current_alarm'')\n }}\n\n {{ iif(is_state(''alarm_control_panel.house'', ''disarmed''), ''Disarmed'',\n ''Armed'') }} by: {{ state_attr(''alarm_control_panel.house'', ''changed_by'')\n }}\n\n {%- endif %}\n\n Home: \n\n {%- set people = [] %}\n\n {%- from ''speech_helpers.jinja'' import array_to_clist %}\n\n {%- set people = state_attr(''binary_sensor.someone_home'', ''home'')\n %}\n\n {%- set people = people + [''Charlie''] if is_state(''binary_sensor.charlie_home'',\n ''on'') else people %}\n\n {%- set people = [''Nobody''] if people | count == 0 else people -%}\n\n {{- array_to_clist(people, true) }}\n\n '\n data:\n subject: 'Occupancy Mode: {{ states(''input_select.occupancy_mode'')\n }}'\n tag: occupancy_notification\n notification_icon: '{{ state_attr(''input_select.occupancy_mode'', ''icon'')\n }}'\n icon_url: /local/images/notification/{{ states('input_select.occupancy_mode')\n | lower }}_icon.png\n clickAction: /ui-mobile/presence\n actions:\n - title: Home\n action: set_home_mode\n - title: Away\n action: set_away_mode\n continue_on_error: true", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "alarm enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_enabled", "device_id": null } }, { "name": "alarm announcements", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_announcements", "device_id": null } }, { "name": "current alarm", "room": null, "type": "input_text", "id": { "entity_id": "input_text.current_alarm", "device_id": null } }, { "name": "occupancy announcements", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_announcements", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "occupancy notifications", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_notifications", "device_id": null } }, { "name": "charlie home binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.charlie_home", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "tts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.tts", "device_id": null } }, { "name": "alarm status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_status", "device_id": null } } ] }, { "id": "turn_office_ceiling_fan_on", "automation": "- id: turn_office_ceiling_fan_on\n alias: Turn Office Ceiling Fan On\n description: Turn on office ceiling fan.\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.climate_fan\n - binary_sensor.schedule_fan\n to: 'on'\n from: 'off'\n - trigger: state\n id: alert\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: 'on'\n conditions:\n - condition: state\n entity_id: fan.office_fan\n state: 'off'\n actions:\n - action: script.turn_fan_on\n data:\n entity_id: fan.office_fan\n speed: 50\n override: '{{ trigger.id == ''alert'' }}'", "config": [ { "name": "turn fan on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_on", "device_id": null } }, { "name": "climate fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_fan", "device_id": null } }, { "name": "schedule fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.schedule_fan", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "office fan", "room": "office", "type": "fan", "id": { "entity_id": "fan.office_fan", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } } ] }, { "id": "turn_office_ceiling_fan_off", "automation": "- id: turn_office_ceiling_fan_off\n alias: Turn Office Ceiling Fan Off\n description: Turn off office ceiling fan.\n mode: queued\n triggers:\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for:\n minutes: 1\n - trigger: state\n entity_id:\n - binary_sensor.climate_fan\n - binary_sensor.schedule_fan\n to: 'off'\n from: 'on'\n - trigger: state\n id: alert\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n to: idle\n conditions:\n - condition: state\n entity_id: fan.office_fan\n state: 'on'\n - condition: state\n alias: Fan schedule is not on\n entity_id: binary_sensor.schedule_fan\n state: 'off'\n - condition: state\n entity_id:\n - alert.indoor_low_temperature\n - alert.indoor_high_temperature\n state: idle\n actions:\n - action: script.turn_fan_off\n data:\n entity_id: fan.office_fan\n override: '{{ trigger.id == ''occupancy'' }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "turn fan off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_fan_off", "device_id": null } }, { "name": "climate fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_fan", "device_id": null } }, { "name": "schedule fan", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.schedule_fan", "device_id": null } }, { "name": "indoor high temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_high_temperature", "device_id": null } }, { "name": "office fan", "room": "office", "type": "fan", "id": { "entity_id": "fan.office_fan", "device_id": null } }, { "name": "indoor low temperature alert", "room": null, "type": "alert", "id": { "entity_id": "alert.indoor_low_temperature", "device_id": null } } ] }, { "id": "turn_office_tv_on", "automation": "- id: turn_office_tv_on\n alias: Turn Office TV On\n description: Turn TV on, select chromecast input.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: media_player.office_chromecast\n to:\n - idle\n - playing\n - buffering\n - paused\n from:\n - 'off'\n - idle\n - unknown\n - unavailable\n - trigger: state\n entity_id: media_player.office_chromecast\n to: playing\n from: paused\n conditions:\n - or:\n - condition: state\n entity_id: media_player.office_tv\n state:\n - 'off'\n - standby\n - not:\n - condition: state\n entity_id: media_player.office_tv\n attribute: source\n state: Chromecast\n actions:\n - if:\n - condition: state\n entity_id: media_player.office_tv\n state:\n - 'off'\n - standby\n then:\n - action: media_player.turn_on\n target:\n entity_id: media_player.office_tv\n - wait_template: '{{ is_state(''media_player.office_tv'', ''on'') }}'\n timeout: 30\n continue_on_timeout: false\n - wait_template: '{{ state_attr(''media_player.office_tv'', ''source'') != none\n }}'\n timeout: 30\n continue_on_timeout: false\n - if:\n - not:\n - condition: state\n entity_id: media_player.office_tv\n attribute: source\n state: Chromecast\n then:\n - action: media_player.select_source\n target:\n entity_id: media_player.office_tv\n data:\n source: Chromecast", "config": [ { "name": "office tv", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_tv", "device_id": null } }, { "name": "media player turn on service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_on", "device_id": null } }, { "name": "media player select source service", "room": null, "type": "service", "id": { "entity_id": "media_player.select_source", "device_id": null } }, { "name": "office chromecast", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_chromecast", "device_id": null } } ] }, { "id": "turn_office_tv_off", "automation": "- id: turn_office_tv_off\n alias: Turn Office TV Off\n description: Turn off TV if still on Chromecast input.\n triggers:\n - trigger: state\n entity_id: media_player.office_chromecast\n to: 'off'\n conditions:\n - condition: state\n entity_id: media_player.office_tv\n attribute: source\n state: Chromecast\n actions:\n - action: media_player.turn_off\n target:\n entity_id: media_player.office_tv", "config": [ { "name": "office tv", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_tv", "device_id": null } }, { "name": "media player turn off service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_off", "device_id": null } }, { "name": "office chromecast", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_chromecast", "device_id": null } } ] }, { "id": "turn_office_chromecast_on", "automation": "- id: turn_office_chromecast_on\n alias: Turn Office Chromecast On\n description: Turn on chromecast if TV source is turned to HDMI 2.\n triggers:\n - platform: state\n entity_id: media_player.office_tv\n attribute: source\n to: Chromecast\n for: 5\n conditions:\n - condition: state\n entity_id: media_player.office_chromecast\n state:\n - 'off'\n - unknown\n - unavailable\n actions:\n - action: media_player.turn_on\n target:\n entity_id: media_player.office_chromecast", "config": [ { "name": "office tv", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_tv", "device_id": null } }, { "name": "media player turn on service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_on", "device_id": null } }, { "name": "office chromecast", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_chromecast", "device_id": null } } ] }, { "id": "turn_office_chromecast_off", "automation": "- id: turn_office_chromecast_off\n alias: Turn Office Chromecast Off\n description: Turn off chromecast if TV is turned off.\n triggers:\n - trigger: state\n entity_id: media_player.office_tv\n to: 'off'\n conditions:\n - condition: not\n conditions:\n - condition: state\n entity_id: media_player.office_chromecast\n state:\n - 'off'\n - unknown\n - unavailable\n actions:\n - action: media_player.turn_off\n target:\n entity_id: media_player.office_chromecast", "config": [ { "name": "office tv", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_tv", "device_id": null } }, { "name": "media player turn off service", "room": null, "type": "service", "id": { "entity_id": "media_player.turn_off", "device_id": null } }, { "name": "office chromecast", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_chromecast", "device_id": null } } ] }, { "id": "turn_office_fan_light_on", "automation": "- id: turn_office_fan_light_on\n alias: Turn Office Fan Light On\n description: Turn on light.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: motion\n entity_id: binary_sensor.office_motion\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.office_illuminance\n state: 'on'\n actions:\n - action: script.turn_light_on\n data:\n entity_id: light.office_fan_light\n activate_timer: false\n reset: true", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "office fan light", "room": "office", "type": "light", "id": { "entity_id": "light.office_fan_light", "device_id": null } }, { "name": "office motion binary sensor", "room": "office", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.office_motion", "device_id": null } }, { "name": "office illuminance binary sensor", "room": "office", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.office_illuminance", "device_id": null } } ] }, { "id": "turn_office_fan_light_off", "automation": "- id: turn_office_fan_light_off\n alias: Turn Office Fan Light Off\n description: Turn off light.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n id: motion\n entity_id: binary_sensor.office_motion\n to: 'off'\n for:\n minutes: 10\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.office_fan_light\n conditions:\n - condition: state\n entity_id: light.office_fan_light\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.office_motion\n state: 'off'\n for:\n minutes: 10\n - condition: state\n entity_id: timer.office_fan_light\n state: idle\n actions:\n - action: light.turn_off\n target:\n entity_id: light.office_fan_light", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "office fan light", "room": "office", "type": "light", "id": { "entity_id": "light.office_fan_light", "device_id": null } }, { "name": "office motion binary sensor", "room": "office", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.office_motion", "device_id": null } }, { "name": "office fan light timer", "room": "office", "type": "timer", "id": { "entity_id": "timer.office_fan_light", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } } ] }, { "id": "turn_office_potlights_on", "automation": "- id: turn_office_potlights_on\n alias: Turn Office Potlights On\n description: Turn on light.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: motion\n entity_id: binary_sensor.office_motion\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'off'\n actions:\n - action: script.turn_light_on\n data:\n entity_id: light.office_potlights\n activate_timer: false\n reset: true", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "office potlights", "room": "office", "type": "light", "id": { "entity_id": "light.office_potlights", "device_id": null } }, { "name": "office motion binary sensor", "room": "office", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.office_motion", "device_id": null } } ] }, { "id": "turn_office_potlights_off", "automation": "- id: turn_office_potlights_off\n alias: Turn Office Potlights Off\n description: Turn off light.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n id: motion\n entity_id: binary_sensor.office_motion\n to: 'off'\n for:\n minutes: 10\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.office_potlights\n conditions:\n - condition: state\n entity_id: light.office_potlights\n state: 'on'\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.office_motion\n state: 'off'\n for:\n minutes: 10\n - condition: state\n entity_id: timer.office_potlights\n state: idle\n actions:\n - action: light.turn_off\n target:\n entity_id: light.office_potlights", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "office potlights", "room": "office", "type": "light", "id": { "entity_id": "light.office_potlights", "device_id": null } }, { "name": "office motion binary sensor", "room": "office", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.office_motion", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } }, { "name": "office potlights timer", "room": "office", "type": "timer", "id": { "entity_id": "timer.office_potlights", "device_id": null } } ] }, { "id": "update_openuv", "automation": "- id: update_openuv\n alias: Update OpenUV\n description: Update OpenUV sensors during sunlight hours.\n triggers:\n - trigger: time_pattern\n minutes: 10\n conditions:\n - condition: state\n entity_id: binary_sensor.wan\n state: 'on'\n - condition: sun\n after: sunrise\n - condition: sun\n before: sunset\n actions:\n - action: homeassistant.update_entity\n target:\n entity_id: sensor.current_uv_index", "config": [ { "name": "wan binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wan", "device_id": null } }, { "name": "current uv index sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.current_uv_index", "device_id": null } }, { "name": "homeassistant update entity service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.update_entity", "device_id": null } } ] }, { "id": "open_garage_door", "automation": "- id: open_garage_door\n alias: Open Garage Door\n description: Open the garage door.\n max_exceeded: silent\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: event\n id: arriving\n event_type: mobile_app_notification_action\n event_data:\n action: arriving_home_garage_jason\n actions:\n - if: '{{ trigger.id == ''arriving'' }}'\n then:\n - wait_template: '{{ is_state(''alarm_control_panel.house'',''disarmed'') }}'\n timeout: 600\n continue_on_timeout: false\n - action: script.garage_door\n data:\n action: open\n person: '{{ person }}'", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "garage door script", "room": null, "type": "script", "id": { "entity_id": "script.garage_door", "device_id": null } } ] }, { "id": "garage_door_opened", "automation": "- id: garage_door_opened\n alias: Garage Door Opened\n description: Announcement when door is open.\n triggers:\n - trigger: state\n entity_id: cover.garage_door\n attribute: current_position\n to: 100\n not_from: None\n conditions:\n - condition: state\n entity_id: input_boolean.garage_door_announcements\n state: 'on'\n actions:\n - action: script.tts_play\n data:\n message: The garage door is open.\n provider: HASS\n language: English (USA)\n voice: Guy:newscast\n ignore_away: true", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "garage door cover", "room": "garage", "type": "cover", "id": { "entity_id": "cover.garage_door", "device_id": null } }, { "name": "garage door announcements input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garage_door_announcements", "device_id": null } } ] }, { "id": "phone_in_use", "automation": "- id: phone_in_use\n alias: Phone In Use\n description: Adjust media players volume when phone in use.\n mode: queued\n triggers:\n - trigger: state\n entity_id: binary_sensor.mobile_phone_in_use\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.mobile_phone_in_use\n state: 'on'\n then:\n - action: script.media_player_set_volumes\n data:\n source: phone_all\n else:\n - wait_template: '{{ is_state_attr(''automation.mute_media_players'', ''current'',\n 0) }}'\n - action: script.media_player_set_volumes\n data:\n source: phone_off", "config": [ { "name": "mute media players", "room": null, "type": "automation", "id": { "entity_id": "automation.mute_media_players", "device_id": null } }, { "name": "mobile phone in use binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.mobile_phone_in_use", "device_id": null } }, { "name": "media player set volumes script", "room": null, "type": "script", "id": { "entity_id": "script.media_player_set_volumes", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } } ] }, { "id": "ping_dead_zwave_node", "automation": "- id: ping_dead_zwave_node\n alias: Ping Dead ZWave Node\n description: Ping dead zwave nodes.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: sensor.offline_zwave_devices\n to: null\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: ping_offline_zwave_devices\n conditions:\n - condition: template\n value_template: \"{{ true if this.attributes.last_triggered == none\\n else now()\\\n \\ - this.attributes.last_triggered > timedelta(seconds=60) }}\\n\"\n - condition: numeric_state\n entity_id: sensor.offline_zwave_devices\n above: 0\n actions:\n - repeat:\n sequence:\n - action: button.press\n target:\n entity_id: '{{ state_attr(''sensor.offline_zwave_devices'', ''ping_buttons'')\n }}'\n - wait_template: '{{ states(''sensor.offline_zwave_devices'') | int(-1) == 0\n }}'\n timeout: 300\n until: '{{ repeat.index == 5 or states(''sensor.offline_zwave_devices'') | int(-1)\n == 0 }}'", "config": [ { "name": "offline zwave devices sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.offline_zwave_devices", "device_id": null } } ] }, { "id": "precipitation_alert", "automation": "- id: precipitation_alert\n alias: Precipitation Alert\n description: Precipitation alert notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: alert\n entity_id: alert.precipitation\n to: null\n - trigger: state\n id: change\n entity_id: binary_sensor.precipitation_type_change_alert\n to: 'on'\n from: 'off'\n - trigger: template\n id: days\n value_template: \"{{ (is_state('binary_sensor.precipitation_likely_next_24_hours',\\\n \\ 'on')\\n or is_state('binary_sensor.precipitation_likely_soon', 'on'))\\n\\\n \\ and is_state('binary_sensor.work_today', 'on')\\n and is_state('sensor.scheduled_shift_today',\\\n \\ 'Days')\\n and states('sensor.time') == '15:50' }}\\n\"\n - trigger: template\n id: afternoons\n value_template: \"{{ (is_state('binary_sensor.precipitation_likely_next_24_hours',\\\n \\ 'on')\\n or is_state('binary_sensor.precipitation_likely_soon', 'on'))\\n\\\n \\ and ((is_state('binary_sensor.work_today', 'on')\\n and is_state('sensor.scheduled_shift_today',\\\n \\ 'Afternoons'))\\n or is_state('binary_sensor.work_today', 'off'))\\n \\\n \\ and states('sensor.time') == '10:45' }}\\n\"\n conditions:\n - condition: or\n conditions:\n - condition: state\n entity_id: alert.precipitation\n state:\n - idle\n - 'off'\n - condition: and\n conditions:\n - condition: or\n conditions:\n - condition: state\n entity_id: alert.precipitation\n state: 'on'\n - condition: state\n entity_id: binary_sensor.precipitation_type_change_alert\n state: 'on'\n - condition: template\n value_template: '{{ trigger.id in [''days'', ''afternoons''] }}'\n - condition: time\n alias: Prevent notifications at night\n after: 08:00:00\n before: '22:00:00'\n - condition: template\n alias: Only once every 2 hours\n value_template: \"{{ trigger.id == 'change' or (true if this.attributes.last_triggered\\\n \\ == none\\n else now() - this.attributes.last_triggered > timedelta(hours=2))\\\n \\ }}\\n\"\n actions:\n - if:\n - condition: state\n entity_id: alert.precipitation\n state:\n - idle\n - 'off'\n - condition: state\n entity_id: binary_sensor.precipitation_type_change_alert\n state: 'off'\n - condition: template\n value_template: '{{ not trigger.id in [''days'', ''afternoons''] }}'\n then:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: windsor_radar\n else:\n - variables:\n file: '{%- from ''camera.jinja''import snapshot_filename -%} weather_snapshots/{{-\n snapshot_filename(''windsor_radar'') -}}\n\n '\n - action: camera.snapshot\n target:\n entity_id: camera.windsor_radar\n data:\n filename: /config/www/{{ file }}\n continue_on_error: true\n - action: notify.jason\n data:\n message: '{%- from ''weather.jinja'' import precipitation_text -%}\n\n {{- precipitation_text() -}}\n\n '\n data:\n tag: windsor_radar\n group: Weather\n visibility: public\n notification_icon: mdi:weather-rainy\n icon_url: secret STORM_ICON\n image: /local/{{ file }}\n ledColor: secret MINOR_COLOR\n color: secret MINOR_COLOR\n vibrationPattern: secret ALERT_VIBRATION\n clickAction: /ui-mobile/storm-radar\n actions:\n - title: Pause\n action: pause_alert_precipitation", "config": [ { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } }, { "name": "scheduled shift today sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.scheduled_shift_today", "device_id": null } }, { "name": "Precipitation Alert", "room": null, "type": "alert", "id": { "entity_id": "alert.precipitation", "device_id": null } }, { "name": "Precipitation Likely Next 24 Hours Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.precipitation_likely_next_24_hours", "device_id": null } }, { "name": "Precipitation Likely Soon Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.precipitation_likely_soon", "device_id": null } }, { "name": "Precipitation Type Change Alert Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.precipitation_type_change_alert", "device_id": null } }, { "name": "Work Today Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_today", "device_id": null } }, { "name": "Windsor Radar Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.windsor_radar", "device_id": null } } ] }, { "id": "turn_presence_override_on", "automation": "- id: turn_presence_override_on\n alias: Turn Presence Override On\n description: Override person presence.\n mode: parallel\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: state\n id: phone\n entity_id: binary_sensor.jason_phone_connected\n to: 'off'\n from: 'on'\n - trigger: state\n id: unlocked\n entity_id:\n - sensor.side_door_lock_status\n - sensor.front_door_lock_status\n - sensor.back_door_lock_status\n - sensor.garage_side_door_lock_status\n to:\n - Unlocked (Jason)\n - Unlocked (Guest)\n not_from:\n - unknown\n - unavailable\n - trigger: state\n id: locked\n entity_id:\n - sensor.side_door_lock_status\n - sensor.front_door_lock_status\n - sensor.back_door_lock_status\n to:\n - Locked (Jason)\n - Locked (Guest)\n not_from:\n - unknown\n - unavailable\n conditions:\n - condition: template\n alias: Person is home it trigger is their phone\n value_template: \"{{ is_state('person.' ~ person, 'home')\\n if trigger.id == 'phone'\\\n \\ else true }}\\n\"\n - condition: template\n alias: Person is not home it trigger is unlock\n value_template: \"{{ not is_state('person.' ~ person, 'home')\\n if trigger.id\\\n \\ == 'unlocked' else true }}\\n\"\n actions:\n - action: script.turn_presence_override_on\n data:\n people: '{{ person }}'\n home: '{{ iif(trigger.id in [''phone'', ''unlocked''], ''turn_on'', ''turn_off'')\n }}'", "config": [ { "name": "back door lock status", "room": "back", "type": "sensor", "id": { "entity_id": "sensor.back_door_lock_status", "device_id": null } }, { "name": "front door lock status", "room": "front", "type": "sensor", "id": { "entity_id": "sensor.front_door_lock_status", "device_id": null } }, { "name": "side door lock status", "room": "side", "type": "sensor", "id": { "entity_id": "sensor.side_door_lock_status", "device_id": null } }, { "name": "garage side door lock status", "room": "garage", "type": "sensor", "id": { "entity_id": "sensor.garage_side_door_lock_status", "device_id": null } }, { "name": "jason phone connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_phone_connected", "device_id": null } }, { "name": "turn presence override on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_presence_override_on", "device_id": null } } ] }, { "id": "turn_presence_override_off", "automation": "- id: turn_presence_override_off\n alias: Turn Presence Override Off\n description: Turn off override boolean when tracker state to/from home.\n mode: parallel\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: state\n id: home\n entity_id: person.jason\n to: home\n for:\n minutes: 5\n - trigger: state\n id: away\n entity_id: person.jason\n from: home\n for:\n minutes: 5\n - trigger: event\n id: action\n event_type: mobile_app_notification_action\n event_data:\n action: turn_off_presence_override_jason\n - trigger: state\n id: sensor\n entity_id: binary_sensor.jason_phone_connected\n to: 'on'\n from: 'off'\n conditions:\n - condition: template\n alias: Occupany trigger or person's presence override is on.\n value_template: \"{{ trigger.id == 'occupancy'\\n or is_state('input_boolean.'\\\n \\ ~ person ~ '_presence_override', 'on') }}\\n\"\n actions:\n - variables:\n home: '{{ states.person | selectattr(''state'', ''eq'', ''home'') | map(attribute=''object_id'')\n | list }}'\n - action: script.turn_presence_override_off\n data:\n people: '{{ iif(trigger.id == ''occupancy'', home, person) }}'", "config": [ { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "jason phone connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_phone_connected", "device_id": null } } ] }, { "id": "purge_alarm_snapshots", "automation": "- id: purge_alarm_snapshots\n alias: Purge Alarm Snapshots\n description: Purge alarm snapshot images.\n triggers:\n - trigger: time\n at: 02:00:00\n actions:\n - action: shell_command.alarm_snapshots_purge_old", "config": [] }, { "id": "reboot_router", "automation": "- id: reboot_router\n alias: Reboot Router\n description: Reboot router.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: reboot_router\n actions:\n - action: button.press\n target:\n entity_id: button.rt_ax58u_reboot", "config": [ { "name": "RT AX58U Reboot Button", "room": null, "type": "button", "id": { "entity_id": "button.rt_ax58u_reboot", "device_id": null } } ] }, { "id": "reload_google_home", "automation": "- id: reload_google_home\n alias: Reload Google Home\n description: Reload google home integration when device unavailable.\n mode: parallel\n variables:\n device_id: '{{ device_id(''sensor.office_speaker_device'') }}'\n triggers:\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n - trigger: state\n id: sensor\n entity_id:\n - sensor.bathroom_speaker_device\n - sensor.kitchen_hub_device\n - sensor.bedroom_chromecast_device\n - sensor.dining_room_hub_device\n - sensor.bedroom_hub_device\n - sensor.office_speaker_device\n - sensor.laundry_room_speaker_device\n - sensor.living_room_chromecast_device\n - sensor.living_room_speaker_device\n - sensor.office_chromecast_device\n to:\n - unknown\n - unavailable\n for: 120\n - trigger: state\n id: switch\n entity_id:\n - switch.bathroom_speaker_do_not_disturb\n - switch.kitchen_hub_do_not_disturb\n - switch.dining_room_hub_do_not_disturb\n - switch.bedroom_hub_do_not_disturb\n - switch.office_speaker_do_not_disturb\n - switch.laundry_room_speaker_do_not_disturb\n - switch.living_room_speaker_do_not_disturb\n to:\n - unknown\n - unavailable\n for: 120\n - trigger: state\n id: player\n entity_id: &id007\n - media_player.bathroom_speaker\n - media_player.bedroom_hub\n - media_player.dining_room_hub\n - media_player.kitchen_hub\n - media_player.laundry_room_speaker\n - media_player.living_room_speaker\n - media_player.living_room_tv\n - media_player.office_speaker\n to:\n - unknown\n - unavailable\n for: 120\n - trigger: state\n id: player\n entity_id: *id007\n from:\n - unknown\n - unavailable\n for: 120\n conditions:\n - condition: state\n entity_id: input_boolean.startup_pending\n state: 'off'\n actions:\n - if:\n - condition: trigger\n id: startup\n then:\n - wait_template: '{{ is_state(''binary_sensor.unavailable_speaker_players'', ''off'')\n }}'\n timeout:\n minutes: 5\n continue_on_timeout: true\n - condition: state\n entity_id:\n - sensor.bathroom_speaker_device\n - sensor.kitchen_hub_device\n - sensor.bedroom_chromecast_device\n - sensor.dining_room_hub_device\n - sensor.bedroom_hub_device\n - sensor.office_speaker_device\n - sensor.laundry_room_speaker_device\n - sensor.living_room_chromecast_device\n - sensor.living_room_speaker_device\n - sensor.office_chromecast_device\n - switch.bathroom_speaker_do_not_disturb\n - switch.kitchen_hub_do_not_disturb\n - switch.dining_room_hub_do_not_disturb\n - switch.bedroom_hub_do_not_disturb\n - switch.office_speaker_do_not_disturb\n - switch.laundry_room_speaker_do_not_disturb\n - switch.living_room_speaker_do_not_disturb\n match: any\n state:\n - unknown\n - unavailable\n - action: homeassistant.reload_config_entry\n target:\n device_id: '{{ device_id }}'\n continue_on_error: true\n else:\n - variables:\n media_player: \"{% if trigger.id == 'sensor' %}\\n media_player.{{ states[trigger.entity_id].object_id\\\n \\ | replace('_device', '') }}\\n{% elif trigger.id == 'switch' %}\\n media_player.{{\\\n \\ states[trigger.entity_id].object_id | replace('_do_not_disturb', '') }}\\n\\\n {% elif trigger.id == 'player' %}\\n {{ trigger.entity_id }}\\n{% endif %}\\n\"\n sensor: sensor.{{ states[media_player].object_id }}_device\n switch: switch.{{ states[media_player].object_id }}_do_not_disturb\n - wait_template: '{{ not is_state(media_player, [''unknown'', ''unavailable''])\n }}'\n timeout:\n hours: 24\n continue_on_timeout: false\n - delay: 30\n - condition: template\n alias: Google home entity still unknown or unavailable\n value_template: \"{{ states(sensor) in ['unknown', 'unavailable']\\n or states(switch)\\\n \\ in ['unknown', 'unavailable'] }}\\n\"\n - action: homeassistant.reload_config_entry\n target:\n device_id: '{{ device_id }}'\n continue_on_error: true\n - action: persistent_notification.create\n data:\n title: Google Home\n message: 'The Google Home integration was reloaded!\n\n Trigger - {{ trigger.entity_id if trigger.entity_id is defined else trigger.id\n }}\n\n '\n enabled: true", "config": [ { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "kitchen hub", "room": "kitchen", "type": "media_player", "id": { "entity_id": "media_player.kitchen_hub", "device_id": null } }, { "name": "bedroom hub", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_hub", "device_id": null } }, { "name": "office speaker media player", "room": "office", "type": "media_player", "id": { "entity_id": "media_player.office_speaker", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "homeassistant reload config entry service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.reload_config_entry", "device_id": null } }, { "name": "Unavailable Speaker Players Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.unavailable_speaker_players", "device_id": null } }, { "name": "Bathroom Speaker Media Player", "room": "Bathroom", "type": "media_player", "id": { "entity_id": "media_player.bathroom_speaker", "device_id": null } }, { "name": "Laundry Room Speaker Media Player", "room": "Laundry Room", "type": "media_player", "id": { "entity_id": "media_player.laundry_room_speaker", "device_id": null } }, { "name": "Living Room Speaker Media Player", "room": "Living Room", "type": "media_player", "id": { "entity_id": "media_player.living_room_speaker", "device_id": null } }, { "name": "Bathroom Speaker Device Sensor", "room": "Bathroom", "type": "sensor", "id": { "entity_id": "sensor.bathroom_speaker_device", "device_id": null } }, { "name": "Bedroom Chromecast Device Sensor", "room": "Bedroom", "type": "sensor", "id": { "entity_id": "sensor.bedroom_chromecast_device", "device_id": null } }, { "name": "Bedroom Hub Device Sensor", "room": "Bedroom", "type": "sensor", "id": { "entity_id": "sensor.bedroom_hub_device", "device_id": null } }, { "name": "Dining Room Hub Device Sensor", "room": "Dining Room", "type": "sensor", "id": { "entity_id": "sensor.dining_room_hub_device", "device_id": null } }, { "name": "Kitchen Hub Device Sensor", "room": "Kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_hub_device", "device_id": null } }, { "name": "Laundry Room Speaker Device Sensor", "room": "Laundry Room", "type": "sensor", "id": { "entity_id": "sensor.laundry_room_speaker_device", "device_id": null } }, { "name": "Living Room Chromecast Device Sensor", "room": "Living Room", "type": "sensor", "id": { "entity_id": "sensor.living_room_chromecast_device", "device_id": null } }, { "name": "Living Room Speaker Device Sensor", "room": "Living Room", "type": "sensor", "id": { "entity_id": "sensor.living_room_speaker_device", "device_id": null } }, { "name": "Office Chromecast Device Sensor", "room": "Office", "type": "sensor", "id": { "entity_id": "sensor.office_chromecast_device", "device_id": null } }, { "name": "Office Speaker Device Sensor", "room": "Office", "type": "sensor", "id": { "entity_id": "sensor.office_speaker_device", "device_id": null } }, { "name": "Bathroom Speaker Do Not Disturb Switch", "room": "Bathroom", "type": "switch", "id": { "entity_id": "switch.bathroom_speaker_do_not_disturb", "device_id": null } }, { "name": "Bedroom Hub Do Not Disturb Switch", "room": "Bedroom", "type": "switch", "id": { "entity_id": "switch.bedroom_hub_do_not_disturb", "device_id": null } }, { "name": "Dining Room Hub Do Not Disturb Switch", "room": "Dining Room", "type": "switch", "id": { "entity_id": "switch.dining_room_hub_do_not_disturb", "device_id": null } }, { "name": "Kitchen Hub Do Not Disturb Switch", "room": "Kitchen", "type": "switch", "id": { "entity_id": "switch.kitchen_hub_do_not_disturb", "device_id": null } }, { "name": "Laundry Room Speaker Do Not Disturb Switch", "room": "Laundry Room", "type": "switch", "id": { "entity_id": "switch.laundry_room_speaker_do_not_disturb", "device_id": null } }, { "name": "Living Room Speaker Do Not Disturb Switch", "room": "Living Room", "type": "switch", "id": { "entity_id": "switch.living_room_speaker_do_not_disturb", "device_id": null } }, { "name": "Office Speaker Do Not Disturb Switch", "room": "Office", "type": "switch", "id": { "entity_id": "switch.office_speaker_do_not_disturb", "device_id": null } } ] }, { "id": "reload_music_assistant", "automation": "- id: reload_music_assistant\n alias: Reload Music Assistant\n description: Reload music assistant integration when mass players become unavailable.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: include /config/include/media_player_entities_mass.yaml\n to:\n - unknown\n - unavailable\n for: 120\n conditions:\n - alias: Home Assistant media player is available\n condition: template\n value_template: '{{ states(trigger.entity_id) | replace(''_mass'', '''') not in\n [''unknown'', ''unavailable''] }}'\n actions:\n - action: homeassistant.reload_config_entry\n target:\n device_id: 123cf9306dd25382e7398c7b319505c5\n continue_on_error: true\n - action: persistent_notification.create\n data:\n title: Music Assistant\n message: 'The Music Assistant integration was reloaded\n\n Trigger - {{ trigger.entity_id }}\n\n '\n enabled: true", "config": [ { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "homeassistant reload config entry service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.reload_config_entry", "device_id": null } }, { "name": "Device 123cf9306dd25382e7398c7b319505c5", "room": null, "type": null, "id": { "entity_id": "123cf9306dd25382e7398c7b319505c5", "device_id": null } } ] }, { "id": "reset_door_locks", "automation": "- id: reset_door_locks\n alias: Reset Door Locks\n description: Reset lock alert sensors.\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: reset_intrusion_locks\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: reset_jammed_locks\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: reset_failed_locks\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: reset_keypad_disabled_locks\n actions:\n - action: script.reset_door_locks", "config": [ { "name": "reset door locks script", "room": null, "type": "script", "id": { "entity_id": "script.reset_door_locks", "device_id": null } } ] }, { "id": "reset_media_preset_enqueue_options", "automation": "- id: reset_media_preset_enqueue_options\n alias: Reset Media Preset Enqueue Options\n description: Reset media preset enqueue options.\n variables:\n preset: '{{ trigger.entity_id | replace(''input_select.media_type_'', '''') }}'\n triggers:\n - trigger: state\n id: video\n entity_id: &id008\n - input_select.media_type_play\n - input_select.media_type_charlie\n - input_select.media_type_chill\n - input_select.media_type_company\n - input_select.media_type_guest\n - input_select.media_type_jason\n - input_select.media_type_morning\n - input_select.media_type_shower\n - input_select.media_type_sleep\n - input_select.media_type_wake\n to: Video\n - trigger: state\n id: mass\n entity_id: *id008\n from: Video\n actions:\n - if: '{{ trigger.id == ''video'' and states(''input_select.enqueue_mode_'' ~ preset)\n == ''Replace Next'' }}'\n then:\n - action: input_select.select_option\n target:\n entity_id: input_select.enqueue_mode_{{ preset }}\n data:\n option: Play\n - action: input_select.set_options\n target:\n entity_id: input_select.enqueue_mode_{{ preset }}\n data:\n options: \"{% if states(trigger.entity_id) == 'Video' %}\\n {{ ['Play', 'Replace',\\\n \\ 'Next', 'Add'] }}\\n{% else %}\\n {{ ['Play', 'Replace', 'Next', 'Replace\\\n \\ Next', 'Add'] }}\\n{% endif %}\"", "config": [ { "name": "media type charlie input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_charlie", "device_id": null } }, { "name": "media type play input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_play", "device_id": null } }, { "name": "input select set options service", "room": null, "type": "service", "id": { "entity_id": "input_select.set_options", "device_id": null } }, { "name": "Enqueue Mode Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.enqueue_mode_", "device_id": null } }, { "name": "Media Type Chill Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_chill", "device_id": null } }, { "name": "Media Type Company Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_company", "device_id": null } }, { "name": "Media Type Guest Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_guest", "device_id": null } }, { "name": "Media Type Jason Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_jason", "device_id": null } }, { "name": "Media Type Morning Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_morning", "device_id": null } }, { "name": "Media Type Shower Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_shower", "device_id": null } }, { "name": "Media Type Sleep Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_sleep", "device_id": null } }, { "name": "Media Type Wake Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.media_type_wake", "device_id": null } } ] }, { "id": "reset_media_player_volumes", "automation": "- id: reset_media_player_volumes\n alias: Reset Media Player Volumes\n description: Reset media player volumes.\n mode: restart\n triggers:\n - trigger: state\n id: player\n entity_id: include /config/include/media_player_entities_single.yaml\n to:\n - idle\n - 'off'\n for: 60\n not_from:\n - unknown\n - unavailable\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n - trigger: state\n id: quiet\n entity_id: binary_sensor.quiet_time\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n - trigger: time\n id: time\n at: input_datetime.day_reset\n actions:\n - if: '{{ trigger.id in [''startup'', ''quiet''] }}'\n then:\n - wait_template: '{{ is_state(''input_boolean.tts'', ''off'') }}'\n timeout: 120\n - if: '{{ trigger.id == ''player'' }}'\n then:\n - action: script.media_player_set_volumes\n alias: Set new volumes for inactive players\n data:\n entity_id: '{{ trigger.entity_id }}'\n source: reset\n continue_on_error: true\n else:\n - action: script.media_player_reset_volumes\n data:\n force_reset: '{{ trigger.id in [''startup'',''time''] }}'\n continue_on_error: true", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "quiet time binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.quiet_time", "device_id": null } }, { "name": "tts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.tts", "device_id": null } }, { "name": "media player reset volumes script", "room": null, "type": "script", "id": { "entity_id": "script.media_player_reset_volumes", "device_id": null } }, { "name": "media player set volumes script", "room": null, "type": "script", "id": { "entity_id": "script.media_player_set_volumes", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } } ] }, { "id": "restart_zwave", "automation": "- id: restart_zwave\n alias: ZWave Restart\n description: Restart zwave addon, reload integration.\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: restart_zwave_network\n actions:\n - action: hassio.addon_restart\n data:\n addon: core_zwave_js\n - wait_template: '{{ is_state(''binary_sensor.z_wave_js_running'', ''on'') }}'\n timeout: 300\n continue_on_timeout: false\n - action: homeassistant.reload_config_entry\n target:\n device_id: 8d81bd72be4f34f5d639ad396db18747", "config": [ { "name": "homeassistant reload config entry service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.reload_config_entry", "device_id": null } }, { "name": "hassio addon restart service", "room": null, "type": "service", "id": { "entity_id": "hassio.addon_restart", "device_id": null } }, { "name": "z wave js running binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.z_wave_js_running", "device_id": null } }, { "name": "Device 8d81bd72be4f34f5d639ad396db18747", "room": null, "type": null, "id": { "entity_id": "8d81bd72be4f34f5d639ad396db18747", "device_id": null } } ] }, { "id": "rgb_light_media_color_sync", "automation": "- id: rgb_light_media_color_sync\n alias: RGB Light Media Color Sync\n description: Sync RGB Light to media player picture entity color.\n mode: queued\n triggers:\n - trigger: state\n id: player\n entity_id:\n - media_player.living_room_chromecast\n - media_player.living_room_tv\n attribute: entity_picture\n - trigger: state\n id: light\n entity_id: light.dining_room_light_rgb\n to: 'on'\n conditions:\n - condition: state\n entity_id:\n - input_boolean.media_color_light_sync\n - light.dining_room_light_rgb\n state: 'on'\n - condition: template\n value_template: '{{ state_attr(trigger.entity_id, ''entity_picture'') != none\n }}'\n - condition: template\n alias: Media player is not an active tts player\n value_template: '{% from ''tts.jinja'' import tts_player %} {{ not tts_player(''media_player.dining_room_hub'')\n }}\n\n '\n actions:\n - action: color_extractor.turn_on\n target:\n entity_id: light.dining_room_light_rgb\n data:\n color_extract_url: \"{{ state_attr('media_player.living_room_' ~\\n iif(is_state('media_player.living_room_chromecast',\\\n \\ 'off'), 'tv', 'chromecast'), 'entity_picture') }}\\n\"\n brightness_pct: 80\n transition: 5", "config": [ { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "living room chromecast", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_chromecast", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "dining room hub", "room": "dining room", "type": "media_player", "id": { "entity_id": "media_player.dining_room_hub", "device_id": null } }, { "name": "media color light sync input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_color_light_sync", "device_id": null } }, { "name": "color extractor service", "room": null, "type": null, "id": { "entity_id": "color_extractor.turn_on", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } } ] }, { "id": "save_media_player_volume", "automation": "- id: save_media_player_volume\n alias: Save Media Player Volume\n description: Save media volume when media player volume changes.\n mode: queued\n max: 20\n max_exceeded: error\n variables:\n volume_level: '{{ ''%0.2f'' | format(state_attr(trigger.entity_id, ''volume_level'')\n | float(-1)) | float }}'\n triggers:\n - trigger: state\n entity_id: include /config/include/media_player_entities_single.yaml\n attribute: volume_level\n to: null\n for: 5\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: template\n alias: Valid volume level\n value_template: '{{ volume_level >= 0 }}'\n - condition: template\n alias: Media player is not an active tts or alarm_clock player\n value_template: \"{% from 'alarm_clock.jinja' import alarm_clock_player %} {% from\\\n \\ 'tts.jinja' import tts_player %} {{ not bool(alarm_clock_player(trigger.entity_id))\\n\\\n \\ and not bool(tts_player(trigger.entity_id)) }}\\n\"\n actions:\n - action: input_number.set_value\n target:\n entity_id: input_number.{{ states[trigger.entity_id].object_id }}_current_volume\n data:\n value: '{{ volume_level }}'", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "input number set value service", "room": null, "type": "service", "id": { "entity_id": "input_number.set_value", "device_id": null } } ] }, { "id": "play_saved_tts_messages", "automation": "- id: play_saved_tts_messages\n alias: Play Saved TTS Messages\n description: Play saved TTS messages.\n max_exceeded: silent\n trigger:\n - trigger: state\n entity_id: binary_sensor.someone_home\n to: 'on'\n from: 'off'\n for:\n minutes: 5\n - trigger: state\n entity_id: input_select.occupancy_mode\n to:\n - Home\n - Guest\n from: Night\n for:\n minutes: 5\n - trigger: state\n entity_id:\n - input_boolean.alarm_triggered\n - switch.media_mute\n - binary_sensor.scene_active\n - binary_sensor.mobile_phone_in_use\n - binary_sensor.quiet_time\n to: 'off'\n from: 'on'\n for:\n minutes: 1\n condition:\n - condition: numeric_state\n entity_id: sensor.saved_tts_messages\n above: 0\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id:\n - binary_sensor.mobile_phone_in_use\n - binary_sensor.scene_active\n - switch.media_mute\n state: 'off'\n - condition: state\n entity_id: input_select.occupancy_mode\n match: any\n state:\n - Home\n - Guest\n action:\n - action: script.play_saved_tts_messages\n data:\n skip_none: true", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "scene active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.scene_active", "device_id": null } }, { "name": "quiet time binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.quiet_time", "device_id": null } }, { "name": "media mute switch", "room": null, "type": "switch", "id": { "entity_id": "switch.media_mute", "device_id": null } }, { "name": "mobile phone in use binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.mobile_phone_in_use", "device_id": null } }, { "name": "saved tts messages sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.saved_tts_messages", "device_id": null } }, { "name": "play saved tts messages script", "room": null, "type": "script", "id": { "entity_id": "script.play_saved_tts_messages", "device_id": null } }, { "name": "play saved tts messages script", "room": null, "type": "script", "id": { "entity_id": "script.play_saved_tts_messages", "device_id": null } } ] }, { "id": "scene_lighting", "automation": "- id: scene_lighting\n alias: Scene Lighting\n description: Turn lights on/off based on scene state.\n mode: queued\n variables:\n scene: '{{ state_attr(''binary_sensor.scene_active'', ''active_scene'') }}'\n scene_lights: \"{{ expand(state_attr('scene.' ~ scene, 'entity_id'))\\n | selectattr('domain',\\\n \\ 'eq', 'light')\\n | map(attribute='entity_id') | list }}\\n\"\n night_lights: '{{ intersect(state_attr(''group.night_lux_lights'', ''entity_id''),\n scene_lights) }}'\n rgb_lights: '{{ intersect(state_attr(''group.rgb_lights'', ''entity_id''), scene_lights)\n }}'\n adaptive_lights: \"{% set main = expand(states.switch.adaptive_lighting_main_lights.attributes.configuration['lights'])\\n\\\n \\ | map(attribute='entity_id') | list %}\\n{% set rgb = expand(states.switch.adaptive_lighting_rgb_lights.attributes.configuration['lights'])\\n\\\n \\ | map(attribute='entity_id') | list %}\\n{{ intersect(union(main,rgb),scene_lights)\\\n \\ }}\\n\"\n triggers:\n - trigger: state\n id: scene_on\n entity_id:\n - switch.chill_scene\n - switch.company_scene\n - switch.movie_scene\n to: 'on'\n from: 'off'\n for: 2\n - trigger: state\n id: scene_off\n entity_id:\n - switch.chill_scene\n - switch.company_scene\n - switch.movie_scene\n to: 'off'\n from: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: input_select.occupancy_mode\n match: any\n state:\n - Home\n - Guest\n actions:\n - if:\n - condition: trigger\n id: scene_on\n then:\n - action: adaptive_lighting.set_manual_control\n data:\n entity_id: switch.adaptive_lighting_main_lights\n lights: '{{ adaptive_lights }}'\n manual_control: true\n - action: script.light_scene_on\n data:\n scene: '{{ scene }}'\n else:\n - wait_template: '{{ is_state(''binary_sensor.scene_active'', ''off'') }}'\n timeout: 15\n continue_on_timeout: false\n - action: script.reset_rgb_lights\n data:\n entity_id: '{{ rgb_lights }}'\n - if:\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'on'\n then:\n - if:\n - condition: state\n entity_id: binary_sensor.waketime_active\n state: 'on'\n then:\n - action: script.light_scene_on\n data:\n scene: morning\n else:\n - action: script.turn_light_on\n data:\n entity_id: '{{ night_lights }}'\n activate_timer: false\n override: true\n reset: true\n - action: script.turn_light_off\n data:\n entity_id: '{{ symmetric_difference(scene_lights, night_lights) }}'\n reset: false\n else:\n - action: script.turn_light_off\n data:\n entity_id: '{{ scene_lights }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "adaptive lighting", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "turn light off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_off", "device_id": null } }, { "name": "waketime active", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.waketime_active", "device_id": null } }, { "name": "scene active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.scene_active", "device_id": null } }, { "name": "chill scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.chill_scene", "device_id": null } }, { "name": "company scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.company_scene", "device_id": null } }, { "name": "reset rgb lights script", "room": null, "type": "script", "id": { "entity_id": "script.reset_rgb_lights", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "night lux lights group", "room": null, "type": "group", "id": { "entity_id": "group.night_lux_lights", "device_id": null } }, { "name": "rgb lights group", "room": null, "type": "group", "id": { "entity_id": "group.rgb_lights", "device_id": null } }, { "name": "adaptive lighting main lights switch", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_main_lights", "device_id": null } }, { "name": "adaptive lighting rgb lights switch", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_rgb_lights", "device_id": null } }, { "name": "adaptive lighting set manual control service", "room": null, "type": "service", "id": { "entity_id": "adaptive_lighting.set_manual_control", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "movie scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.movie_scene", "device_id": null } } ] }, { "id": "scene_light_color", "automation": "- id: scene_light_color\n alias: Scene Light Color\n mode: restart\n variables:\n scene: \"{{ states[trigger.entity_id].object_id | replace('rgb_', '')\\n if trigger.id\\\n \\ =='sensor' else states[trigger.entity_id].object_id }}\\n\"\n triggers:\n - trigger: state\n id: sensor\n entity_id:\n - sensor.rgb_company_scene\n - sensor.rgb_chill_scene\n - sensor.rgb_movie_scene\n not_to:\n - unknown\n - unavailable\n for: 5\n - trigger: state\n id: scene\n entity_id:\n - switch.chill_scene\n - switch.company_scene\n - switch.movie_scene\n to: 'on'\n from: 'off'\n for: 5\n conditions:\n - condition: template\n alias: Scene rgb color sensor is valid\n value_template: '{{ has_value(''sensor.rgb_'' ~ scene) }}'\n - condition: template\n alias: Scene switch is on\n value_template: '{{ is_state(''switch.'' ~ scene , ''on'') }}'\n actions:\n - action: script.turn_light_on\n data:\n entity_id: light.dining_room_light_rgb\n rgb_color: '{{ state_attr(''sensor.rgb_'' ~ scene, ''rgb_color'') }}'\n transition: 5\n activate_timer: false\n override: true\n continue_on_error: true", "config": [ { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "chill scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.chill_scene", "device_id": null } }, { "name": "company scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.company_scene", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } }, { "name": "rgb company scene sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.rgb_company_scene", "device_id": null } }, { "name": "rgb chill scene sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.rgb_chill_scene", "device_id": null } }, { "name": "rgb movie scene sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.rgb_movie_scene", "device_id": null } }, { "name": "movie scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.movie_scene", "device_id": null } } ] }, { "id": "security_lighting", "automation": "- id: security_lighting\n alias: Security Lighting\n description: Turn on lights when person dectected.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: motion_on\n entity_id: group.security_occupancy_sensors\n to: 'on'\n from: 'off'\n for: 5\n conditions:\n - condition: state\n entity_id: group.security_occupancy_sensors\n state: 'off'\n - condition: state\n entity_id: alarm_control_panel.house\n state:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n - condition: state\n entity_id: binary_sensor.nighttime_illuminance\n state: 'on'\n actions:\n - action: scene.create\n data:\n scene_id: security_lights_restore\n snapshot_entities:\n - light.back_house_potlights\n - light.outside_garage_lights\n - light.front_house_potlights\n - light.front_porch_light\n - light.side_entrance_light\n - light.kitchen_sink_light\n - switch.adaptive_lighting_outside_lights\n - action: script.turn_light_on\n data:\n entity_id:\n - light.back_house_potlights\n - light.outside_garage_lights\n - light.front_house_potlights\n - light.front_porch_light\n - light.side_entrance_light\n - light.kitchen_sink_light\n profile: default_max\n override: true\n activate_timer: false\n - delay:\n minutes: 2\n - wait_template: '{{ is_state(''group.security_occupancy_sensors'', ''off'') }}'\n - action: script.light_scene_on\n data:\n scene: security_lights_restore", "config": [ { "name": "adaptive lighting", "room": null, "type": "switch", "id": { "entity_id": "switch.adaptive_lighting", "device_id": null } }, { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "nighttime illuminance", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.nighttime_illuminance", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "back house potlights", "room": "back", "type": "light", "id": { "entity_id": "light.back_house_potlights", "device_id": null } }, { "name": "front house potlights", "room": "front", "type": "light", "id": { "entity_id": "light.front_house_potlights", "device_id": null } }, { "name": "front porch light", "room": "front porch", "type": "light", "id": { "entity_id": "light.front_porch_light", "device_id": null } }, { "name": "kitchen sink light", "room": "kitchen", "type": "light", "id": { "entity_id": "light.kitchen_sink_light", "device_id": null } }, { "name": "outside garage lights", "room": "outside", "type": "light", "id": { "entity_id": "light.outside_garage_lights", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "scene create service", "room": null, "type": "service", "id": { "entity_id": "scene.create", "device_id": null } }, { "name": "security occupancy sensors group", "room": null, "type": "group", "id": { "entity_id": "group.security_occupancy_sensors", "device_id": null } }, { "name": "adaptive lighting outside lights switch", "room": "outside", "type": "switch", "id": { "entity_id": "switch.adaptive_lighting_outside_lights", "device_id": null } } ] }, { "id": "select_other_alarm_clock", "automation": "- id: select_other_alarm_clock\n alias: Select Other Alarm Clock\n description: Select next other alarm clock display for ui.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: sensor.alarm_clock_other\n attribute: source\n to: null\n - trigger: state\n entity_id: input_boolean.alarm_clock_launcher_other\n to: 'on'\n actions:\n - action: input_select.select_option\n target:\n entity_id: input_select.alarm_clock_selection\n data:\n option: '{% set next = state_attr(''sensor.alarm_clock_other'', ''source'')\n %} {{ ''Jason Phone'' if next == none else next }}\n\n '", "config": [ { "name": "alarm clock launcher other", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_launcher_other", "device_id": null } }, { "name": "alarm clock selection", "room": null, "type": "input_select", "id": { "entity_id": "input_select.alarm_clock_selection", "device_id": null } }, { "name": "alarm clock other sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_other", "device_id": null } } ] }, { "id": "lock_set_vacation_mode", "automation": "- id: lock_set_vacation_mode\n alias: Set Lock Vacation Mode\n description: Set door locks vacation mode.\n mode: queued\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to: armed_vacation\n for: 300\n - trigger: state\n entity_id: alarm_control_panel.house\n from: armed_vacation\n actions:\n - action: select.select_option\n target:\n entity_id:\n - select.back_door_lock_vacation_mode\n - select.front_door_lock_vacation_mode\n - select.garage_side_door_lock_vacation_mode\n - select.side_door_lock_vacation_mode\n data:\n option: '{{ iif(trigger.to_state.state == ''armed_vacation'', ''Enable'', ''Disable'')\n }}'", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "back door lock vacation mode select", "room": "back", "type": "select", "id": { "entity_id": "select.back_door_lock_vacation_mode", "device_id": null } }, { "name": "front door lock vacation mode select", "room": "front", "type": "select", "id": { "entity_id": "select.front_door_lock_vacation_mode", "device_id": null } }, { "name": "garage side door lock vacation mode select", "room": "garage", "type": "select", "id": { "entity_id": "select.garage_side_door_lock_vacation_mode", "device_id": null } }, { "name": "side door lock vacation mode select", "room": "side", "type": "select", "id": { "entity_id": "select.side_door_lock_vacation_mode", "device_id": null } } ] }, { "id": "set_lock_alarm_mode", "automation": "- id: set_lock_alarm_mode\n alias: Set Lock Alarm Mode\n description: Set door locks alarm mode.\n mode: queued\n triggers:\n - trigger: state\n entity_id: alarm_control_panel.house\n to:\n - armed_home\n - armed_night\n - armed_away\n - armed_vacation\n - disarmed\n actions:\n - choose:\n - conditions: '{{ is_state(''alarm_control_panel.house'', ''disarmed'') }}'\n sequence:\n - action: select.select_option\n target:\n entity_id: &id009\n - select.back_door_lock_alarm_mode\n - select.front_door_lock_alarm_mode\n - select.garage_side_door_lock_alarm_mode\n - select.side_door_lock_alarm_mode\n data:\n option: Alarm off\n - conditions: '{{ is_state(''alarm_control_panel.house'', ''armed_home'') }}'\n sequence:\n - action: select.select_option\n target:\n entity_id: *id009\n data:\n option: Alert\n - action: select.select_option\n target:\n entity_id:\n - select.back_door_lock_alarm_alert_sensitivity\n - select.front_door_lock_alarm_alert_sensitivity\n - select.garage_side_door_lock_alarm_alert_sensitivity\n - select.side_door_lock_alarm_alert_sensitivity\n data:\n option: Less sensitive\n - conditions: '{{ is_state(''alarm_control_panel.house'', ''armed_night'') }}'\n sequence:\n - action: select.select_option\n target:\n entity_id: *id009\n data:\n option: Forced entry\n - action: select.select_option\n target:\n entity_id: &id010\n - select.back_door_lock_alarm_kick_sensitivity\n - select.front_door_lock_alarm_kick_sensitivity\n - select.garage_side_door_lock_alarm_kick_sensitivity\n - select.side_door_lock_alarm_kick_sensitivity\n data:\n option: Most sensitive\n - conditions: '{{ states(''alarm_control_panel.house'') == ''armed_away'' }}'\n sequence:\n - action: select.select_option\n target:\n entity_id: *id009\n data:\n option: Forced entry\n - action: select.select_option\n target:\n entity_id: *id010\n data:\n option: Most sensitive\n - conditions: '{{ states(''alarm_control_panel.house'') == ''armed_vacation''\n }}'\n sequence:\n - action: select.select_option\n target:\n entity_id: *id009\n data:\n option: Forced entry\n - action: select.select_option\n target:\n entity_id: *id010\n data:\n option: Most sensitive", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "back door lock alarm mode select", "room": "back", "type": "select", "id": { "entity_id": "select.back_door_lock_alarm_mode", "device_id": null } }, { "name": "front door lock alarm mode select", "room": "front", "type": "select", "id": { "entity_id": "select.front_door_lock_alarm_mode", "device_id": null } }, { "name": "garage side door lock alarm mode select", "room": "garage", "type": "select", "id": { "entity_id": "select.garage_side_door_lock_alarm_mode", "device_id": null } }, { "name": "side door lock alarm mode select", "room": "side", "type": "select", "id": { "entity_id": "select.side_door_lock_alarm_mode", "device_id": null } }, { "name": "back door lock alarm alert sensitivity select", "room": "back", "type": "select", "id": { "entity_id": "select.back_door_lock_alarm_alert_sensitivity", "device_id": null } }, { "name": "front door lock alarm alert sensitivity select", "room": "front", "type": "select", "id": { "entity_id": "select.front_door_lock_alarm_alert_sensitivity", "device_id": null } }, { "name": "garage side door lock alarm alert sensitivity select", "room": "garage", "type": "select", "id": { "entity_id": "select.garage_side_door_lock_alarm_alert_sensitivity", "device_id": null } }, { "name": "side door lock alarm alert sensitivity select", "room": "side", "type": "select", "id": { "entity_id": "select.side_door_lock_alarm_alert_sensitivity", "device_id": null } }, { "name": "back door lock alarm kick sensitivity select", "room": "back", "type": "select", "id": { "entity_id": "select.back_door_lock_alarm_kick_sensitivity", "device_id": null } }, { "name": "front door lock alarm kick sensitivity select", "room": "front", "type": "select", "id": { "entity_id": "select.front_door_lock_alarm_kick_sensitivity", "device_id": null } }, { "name": "garage side door lock alarm kick sensitivity select", "room": "garage", "type": "select", "id": { "entity_id": "select.garage_side_door_lock_alarm_kick_sensitivity", "device_id": null } }, { "name": "side door lock alarm kick sensitivity select", "room": "side", "type": "select", "id": { "entity_id": "select.side_door_lock_alarm_kick_sensitivity", "device_id": null } } ] }, { "id": "set_thermostat", "automation": "- id: set_thermostat\n alias: Set Thermostat\n description: Set thermostat temperatures.\n mode: restart\n triggers:\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n - trigger: state\n id: occupancy\n entity_id: input_select.occupancy_mode\n to: null\n for: 15\n - trigger: state\n id: override\n entity_id: input_boolean.climate_presence_override\n to: null\n - trigger: state\n id: manual\n entity_id: input_boolean.climate_manual_mode\n to: 'off'\n - trigger: state\n id: home\n entity_id:\n - input_number.home_heat_temperature\n - input_number.home_cool_temperature\n to: null\n for: 5\n - trigger: state\n id: night\n entity_id:\n - input_number.night_heat_temperature\n - input_number.night_cool_temperature\n to: null\n for: 5\n - trigger: state\n id: guest\n entity_id:\n - input_number.guest_heat_temperature\n - input_number.guest_cool_temperature\n to: null\n for: 5\n - trigger: state\n entity_id: input_select.climate_mode\n to: null\n - trigger: state\n id: boost\n entity_id: sensor.climate_temperature_boost\n to: null\n not_from:\n - unknown\n - unavailable\n conditions:\n - condition: state\n entity_id: input_boolean.climate_manual_mode\n state: 'off'\n - condition: or\n conditions:\n - not:\n - condition: state\n entity_id: climate.house\n state: 'off'\n - condition: state\n entity_id: alert.climate_window_door_open\n state: 'on'\n - condition: template\n value_template: '{{ trigger.id == ''startup'' }}'\n - condition: template\n alias: HVAC boost is a valid number if trigger is boost\n value_template: '{% if trigger.id == ''boost'' %} {{ is_number(states(trigger.entity_id))\n }} {% else %} {{ true }} {% endif %}\n\n '\n - condition: template\n alias: Current occupancy mode corresponds to trigger preset\n value_template: '{% if trigger.id == ''home'' %} {{ is_state(''input_select.occupancy_mode'',\n ''Home'') }} {% elif trigger.id == ''night'' %} {{ is_state(''input_select.occupancy_mode'',\n ''Night'') }} {% elif trigger.id == ''guest'' %} {{ is_state(''input_select.occupancy_mode'',\n ''Guest'') }} {% else %} true {% endif %}\n\n '\n actions:\n - delay: 60\n - action: script.set_thermostat", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "climate manual mode input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_manual_mode", "device_id": null } }, { "name": "climate presence override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_presence_override", "device_id": null } }, { "name": "climate window door open alert", "room": null, "type": "alert", "id": { "entity_id": "alert.climate_window_door_open", "device_id": null } }, { "name": "climate house climate", "room": null, "type": "climate", "id": { "entity_id": "climate.house", "device_id": null } }, { "name": "climate mode input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.climate_mode", "device_id": null } }, { "name": "home heat temperature input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.home_heat_temperature", "device_id": null } }, { "name": "home cool temperature input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.home_cool_temperature", "device_id": null } }, { "name": "night heat temperature input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.night_heat_temperature", "device_id": null } }, { "name": "night cool temperature input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.night_cool_temperature", "device_id": null } }, { "name": "guest heat temperature input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.guest_heat_temperature", "device_id": null } }, { "name": "guest cool temperature input number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.guest_cool_temperature", "device_id": null } }, { "name": "climate temperature boost sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.climate_temperature_boost", "device_id": null } }, { "name": "set thermostat script", "room": null, "type": "script", "id": { "entity_id": "script.set_thermostat", "device_id": null } } ] }, { "id": "set_utility_peak_period", "automation": "- id: set_utility_peak_period\n alias: Set Utility Peak Period\n description: Set utility meter tariff.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: sensor.enwin_utilities_ltd_residential_electricity_rate\n attribute: active_peak\n conditions: '{{ state_attr(''sensor.enwin_utilities_ltd_residential_electricity_rate'',\n ''active_peak'') != none }}'\n actions:\n - action: select.select_option\n target:\n entity_id:\n - select.daily_energy_consumption\n - select.monthly_energy_consumption\n data:\n option: '{{ state_attr(''sensor.enwin_utilities_ltd_residential_electricity_rate'',\n ''active_peak'') }}'", "config": [ { "name": "enwin utilities ltd residential electricity rate sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.enwin_utilities_ltd_residential_electricity_rate", "device_id": null } }, { "name": "daily energy consumption select", "room": null, "type": "select", "id": { "entity_id": "select.daily_energy_consumption", "device_id": null } }, { "name": "monthly energy consumption select", "room": null, "type": "select", "id": { "entity_id": "select.monthly_energy_consumption", "device_id": null } } ] }, { "id": "turn_shower_scene_off", "automation": "- id: turn_shower_scene_off\n alias: Turn Shower Scene Off\n description: Turn off shower scene.\n max_exceeded: silent\n trigger:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.shower_scene\n action:\n - action: switch.turn_off\n target:\n entity_id: switch.shower_scene", "config": [ { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "shower scene timer", "room": null, "type": "timer", "id": { "entity_id": "timer.shower_scene", "device_id": null } } ] }, { "id": "turn_side_entrance_light_on", "automation": "- id: turn_side_entrance_light_on\n alias: Turn Side Entrance Light On\n description: Turn on light.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: unlock\n entity_id: lock.side_door_lock\n to: unlocked\n - trigger: state\n id: motion\n entity_id: binary_sensor.side_entrance_motion\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.side_entrance_illuminance\n state: 'on'\n actions:\n - action: script.turn_light_on\n data:\n entity_id: light.side_entrance_light\n activate_timer: false\n reset: true", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "side door lock", "room": "side", "type": "lock", "id": { "entity_id": "lock.side_door_lock", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "side entrance motion binary sensor", "room": "side entrance", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.side_entrance_motion", "device_id": null } }, { "name": "side entrance illuminance binary sensor", "room": "side entrance", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.side_entrance_illuminance", "device_id": null } } ] }, { "id": "turn_side_entrance_light_off", "automation": "- id: turn_side_entrance_light_off\n alias: Turn Side Entrance Light Off\n description: Turn off light.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n id: motion\n entity_id: binary_sensor.side_entrance_motion\n to: 'off'\n for:\n minutes: 10\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.side_entrance_light\n conditions:\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: state\n entity_id: binary_sensor.side_entrance_motion\n state: 'off'\n for:\n minutes: 10\n - condition: state\n entity_id: timer.side_entrance_light\n state: idle\n actions:\n - action: light.turn_off\n target:\n entity_id: light.side_entrance_light", "config": [ { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } }, { "name": "side entrance motion binary sensor", "room": "side entrance", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.side_entrance_motion", "device_id": null } }, { "name": "side entrance light timer", "room": "side entrance", "type": "timer", "id": { "entity_id": "timer.side_entrance_light", "device_id": null } } ] }, { "id": "play_sleep_media_preset", "automation": "- id: play_sleep_media_preset\n alias: Play Sleep Media Preset\n description: Play Sleep media preset.\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n to: Night\n from:\n - Home\n - Guest\n for: 60\n conditions:\n - condition: state\n entity_id: input_boolean.media_enabled_sleep\n state: 'on'\n - condition: template\n alias: Within an hour of bedtime\n value_template: \"{% if has_value('sensor.bedtime_today') %}\\n {% set bedtime\\\n \\ = states('sensor.bedtime_today') | as_datetime %}\\n {{ now() > bedtime -\\\n \\ timedelta(hours=1) and now() - bedtime < timedelta(hours=1) }}\\n{% endif %}\\n\"\n actions:\n - action: script.media_play\n data:\n preset: sleep", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "media enabled sleep input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_enabled_sleep", "device_id": null } }, { "name": "bedtime today sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.bedtime_today", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } }, { "name": "Media Enabled Input Boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_enabled_", "device_id": null } } ] }, { "id": "stop_sleep_media_preset", "automation": "- id: stop_sleep_media_preset\n alias: Stop Sleep Media Preset\n description: Stop Sleep media preset.\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.media_sleep\n actions:\n - action: script.turn_media_player_off\n data:\n entity_id: \"{{ expand('group.media_players')\\n | selectattr('name', 'eq',\\\n \\ states('select.media_speaker_sleep'))\\n | map(attribute='entity_id')\\\n \\ | join }}\\n\"", "config": [ { "name": "media players group", "room": null, "type": "group", "id": { "entity_id": "group.media_players", "device_id": null } }, { "name": "turn media player off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_media_player_off", "device_id": null } }, { "name": "media sleep timer", "room": null, "type": "timer", "id": { "entity_id": "timer.media_sleep", "device_id": null } }, { "name": "media speaker sleep select", "room": null, "type": "select", "id": { "entity_id": "select.media_speaker_sleep", "device_id": null } }, { "name": "media sleep timer", "room": null, "type": "timer", "id": { "entity_id": "timer.media_sleep", "device_id": null } } ] }, { "id": "sleep_media_preset_restart_timer", "automation": "- id: sleep_media_preset_restart_timer\n alias: Sleep Media Preset Restart Timer\n description: Restart sleep media preset timer when time adjusted.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_number.media_sleep_time\n to: null\n conditions:\n - condition: state\n entity_id: timer.media_sleep\n state:\n - active\n - paused\n actions:\n - action: timer.start\n target:\n entity_id: timer.media_sleep\n data:\n duration:\n minutes: '{{ states(''input_number.media_sleep_time'') | int(0) }}'", "config": [ { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } }, { "name": "media sleep timer", "room": null, "type": "timer", "id": { "entity_id": "timer.media_sleep", "device_id": null } }, { "name": "media sleep timer", "room": null, "type": "timer", "id": { "entity_id": "timer.media_sleep", "device_id": null } }, { "name": "media sleep time input", "room": null, "type": "input_number", "id": { "entity_id": "input_number.media_sleep_time", "device_id": null } } ] }, { "id": "sleep_media_preset_cancel_timer", "automation": "- id: sleep_media_preset_cancel_timer\n alias: Sleep Media Preset Cancel Timer\n description: Cancel sleep preset timer if preset player turned off.\n triggers:\n - trigger: template\n id: sleep\n value_template: \"{% set sleep_player = expand('group.media_players')\\n | selectattr('name',\\\n \\ 'eq', states('select.media_speaker_sleep'))\\n | map(attribute='entity_id')\\\n \\ | join %}\\n{{ not is_state(sleep_player, ['playing', 'paused', 'buffering',\\\n \\ 'on'])\\n and is_state('timer.media_sleep', ['active', 'paused']) }}\\n\"\n for: 5\n conditions:\n - condition: state\n entity_id: timer.media_sleep\n state:\n - active\n - paused\n actions:\n - action: timer.cancel\n data:\n entity_id: timer.media_sleep", "config": [ { "name": "media players group", "room": null, "type": "group", "id": { "entity_id": "group.media_players", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "media sleep timer", "room": null, "type": "timer", "id": { "entity_id": "timer.media_sleep", "device_id": null } }, { "name": "media speaker sleep select", "room": null, "type": "select", "id": { "entity_id": "select.media_speaker_sleep", "device_id": null } }, { "name": "media sleep timer", "room": null, "type": "timer", "id": { "entity_id": "timer.media_sleep", "device_id": null } } ] }, { "id": "someone_arrives_home", "automation": "- id: someone_arrives_home\n alias: Someone Arrives Home\n description: Determine who arrived home and run arrive home script.\n mode: parallel\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n first_home: '{{ state_attr(''binary_sensor.someone_home'', ''home'') | count ==\n 1 }}'\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.jason_home\n - binary_sensor.guest_home\n to: 'on'\n from: 'off'\n for: 5\n actions:\n - action: input_select.select_option\n target:\n entity_id: input_select.last_person_to_arrive\n data:\n option: '{{ person | title }}'\n - event: set_variable\n event_data:\n key: last_to_arrive\n value: '{{ now() }}'\n set_timestamp: false\n - event: set_variable\n event_data:\n key: last_arrived_{{ person }}\n value: '{{ now() }}'\n set_timestamp: false\n - if:\n - condition: state\n entity_id: input_boolean.occupancy_announcements\n state: 'on'\n then:\n - action: script.tts_play\n data:\n message: '{{ ''A guest has arrived.'' if person == ''guest'' else person |\n title ~ '' is home'' }}'\n provider: HASS\n language: English (USA)\n voice: Aria:friendly\n save_message: false\n continue_on_error: true\n - if:\n - condition: template\n alias: Person is Jason\n value_template: '{{ person == ''jason'' }}'\n then:\n - wait_template: '{{ is_state(''binary_sensor.side_entrance_motion'', ''on'')\n }}'\n timeout: 300\n - delay: 60\n - if:\n - condition: template\n alias: Person is still home\n value_template: '{{ is_state(''binary_sensor.'' ~ person ~ ''_home'', ''on'')\n }}'\n then:\n - if:\n - condition: state\n entity_id: input_boolean.occupancy_announcements\n state: 'on'\n then:\n - action: google_generative_ai_conversation.generate_content\n data:\n prompt: \"{% if person == 'jason' %}\\n You are a female and will welcome\\\n \\ the male person Jason home using a cute pet version of his name\\n in\\\n \\ an explicit and flirty manner using innuendos in 30 words or less and\\\n \\ no emoticons.\\n{% elif person == 'guest' %}\\n Act surprised when noticing\\\n \\ a new guest and welcome them to our home in a rude and\\n disappointed\\\n \\ but very funny manner in 30 words or less and no emoticons.\\n{% endif\\\n \\ %}\\n\"\n response_variable: response\n - delay: 1\n - action: script.tts_play\n data:\n message: '{{ response[''text''] }}'\n provider: HASS\n language: English (USA)\n voice: '{{ ''Aria:whispering'' if person == ''jason'' else ''Jane:unfriendly''\n }}'\n save_message: false\n continue_on_error: true\n - if: '{{ first_home }}'\n then:\n - if:\n - condition: numeric_state\n entity_id: sensor.saved_tts_messages\n above: 0\n then:\n - action: script.play_saved_tts_messages\n continue_on_error: true\n - wait_template: '{{ is_state(''script.play_saved_tts_messages'', ''off'')\n }}'\n timeout:\n minutes: 5\n - if: '{{ is_state(''input_boolean.media_enabled_'' ~ person, ''on'') }}'\n then:\n - action: script.media_play\n data:\n preset: '{{ person }}'", "config": [ { "name": "occupancy announcements", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.occupancy_announcements", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "guest home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.guest_home", "device_id": null } }, { "name": "saved tts messages sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.saved_tts_messages", "device_id": null } }, { "name": "play saved tts messages script", "room": null, "type": "script", "id": { "entity_id": "script.play_saved_tts_messages", "device_id": null } }, { "name": "side entrance motion binary sensor", "room": "side entrance", "type": "binary_sensor", "id": { "entity_id": "binary_sensor.side_entrance_motion", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } }, { "name": "last person to arrive select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.last_person_to_arrive", "device_id": null } }, { "name": "play saved tts messages script", "room": null, "type": "script", "id": { "entity_id": "script.play_saved_tts_messages", "device_id": null } }, { "name": "Media Enabled Input Boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.media_enabled_", "device_id": null } } ] }, { "id": "someone_leaves_home", "automation": "- id: someone_leaves_home\n alias: Someone Leaves Home\n description: Run leave home script when someone leaves home.\n mode: parallel\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger) }}\n\n '\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.jason_home\n - binary_sensor.guest_home\n to: 'off'\n from: 'on'\n for: 1\n actions:\n - if:\n - condition: template\n alias: Person just arrived within last 2 minutes\n value_template: '{{ now() - states.input_select.last_person_to_arrive.last_changed\n < timedelta(minutes=2) }}'\n then:\n - wait_template: '{{ is_state(trigger.entity_id, ''on'') }}'\n timeout:\n minutes: 1\n - condition: template\n alias: Person is still not home\n value_template: '{{ is_state(trigger.entity_id, ''off'') }}'\n - action: input_select.select_option\n target:\n entity_id: input_select.last_person_to_leave\n data:\n option: '{{ person | title }}'\n - event: set_variable\n event_data:\n key: last_to_leave\n value: '{{ now() }}'\n set_timestamp: false\n - event: set_variable\n event_data:\n key: last_left_{{ person }}\n value: '{{ now() }}'\n set_timestamp: false", "config": [ { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "guest home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.guest_home", "device_id": null } }, { "name": "last person to arrive select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.last_person_to_arrive", "device_id": null } }, { "name": "Last Person To Leave Input Select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.last_person_to_leave", "device_id": null } } ] }, { "id": "turn_spa_maintenance_on", "automation": "- id: turn_spa_maintenance_on\n alias: Turn Spa Maintenance On\n description: Turn on reminder active boolean.\n triggers:\n - trigger: template\n value_template: \"{% if is_state('input_boolean.spa_maintenance_enabled', 'on')\\n\\\n \\ and not is_state('input_select.occupancy_mode','Vacation') %}\\n {% set\\\n \\ time = states('sensor.time') %}\\n {% set shift = state_attr('sensor.work_status',\\\n \\ 'shift') %}\\n {% set last_run = states('button.spa_maintenance_done') %}\\n\\\n \\ {{ ((shift == 'Days' and time == states('input_datetime.spa_maintenance_days')[0:5])\\n\\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.spa_maintenance_afternoons')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.spa_maintenance_weekends')[0:5]))\\n\\\n \\ and (last_run == 'unknown' or (now().date()- (last_run | as_datetime).date()).days\\n\\\n \\ >= states('input_number.spa_maintenance_day_interval') | int) }}\\n\\\n {% endif %}\\n\"\n action:\n - if: '{{ is_state(''input_boolean.spa_maintenance_active'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_maintenance_active\n - if: '{{ is_state(''input_boolean.spa_maintenance_paused'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_maintenance_paused\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_maintenance_paused\n - if: '{{ is_state(''input_boolean.spa_maintenance_skipped'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_maintenance_skipped\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.spa_maintenance_active", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "work status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_status", "device_id": null } }, { "name": "spa maintenance enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_enabled", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } }, { "name": "spa maintenance done button", "room": "spa", "type": "button", "id": { "entity_id": "button.spa_maintenance_done", "device_id": null } }, { "name": "spa maintenance days datetime", "room": "spa", "type": "input_datetime", "id": { "entity_id": "input_datetime.spa_maintenance_days", "device_id": null } }, { "name": "spa maintenance afternoons datetime", "room": "spa", "type": "input_datetime", "id": { "entity_id": "input_datetime.spa_maintenance_afternoons", "device_id": null } }, { "name": "spa maintenance weekends datetime", "room": "spa", "type": "input_datetime", "id": { "entity_id": "input_datetime.spa_maintenance_weekends", "device_id": null } }, { "name": "spa maintenance day interval", "room": "spa", "type": "input_number", "id": { "entity_id": "input_number.spa_maintenance_day_interval", "device_id": null } }, { "name": "spa maintenance active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_active", "device_id": null } }, { "name": "spa maintenance paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_paused", "device_id": null } }, { "name": "spa maintenance skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_skipped", "device_id": null } } ] }, { "id": "spa_maintenance_done", "automation": "- id: spa_maintenance_done\n alias: Spa Maintenance Done\n description: Mark reminder completed.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: spa_maintenance_done\n condition:\n - condition: state\n entity_id: input_boolean.spa_maintenance_active\n state: 'on'\n action:\n - action: button.press\n target:\n entity_id: button.spa_maintenance_done", "config": [ { "name": "spa maintenance done button", "room": "spa", "type": "button", "id": { "entity_id": "button.spa_maintenance_done", "device_id": null } }, { "name": "spa maintenance active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_active", "device_id": null } } ] }, { "id": "skip_spa_maintenance", "automation": "- id: skip_spa_maintenance\n alias: Skip Spa Maintenance\n description: Skip reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: skip_spa_maintenance\n action:\n - action: button.press\n target:\n entity_id: button.skip_spa_maintenance", "config": [ { "name": "skip spa maintenance button", "room": "spa", "type": "button", "id": { "entity_id": "button.skip_spa_maintenance", "device_id": null } } ] }, { "id": "pause_spa_maintenance", "automation": "- id: pause_spa_maintenance\n alias: Pause Spa Maintenance\n description: Pause reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: pause_spa_maintenance\n action:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.spa_maintenance_paused", "config": [ { "name": "spa maintenance paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_paused", "device_id": null } } ] }, { "id": "reset_pause_spa_maintenance", "automation": "- id: reset_pause_spa_maintenance\n alias: Reset Pause Spa Maintenance\n description: Reset reminder paused boolean.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.spa_maintenance_skipped\n to: 'on'\n - trigger: state\n entity_id: input_boolean.spa_maintenance_paused\n to: 'on'\n for:\n hours: 24\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'on'\n for:\n minutes: 15\n condition:\n - condition: state\n entity_id: input_boolean.spa_maintenance_paused\n state: 'on'\n action:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_maintenance_paused", "config": [ { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "spa maintenance paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_paused", "device_id": null } }, { "name": "spa maintenance skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_skipped", "device_id": null } } ] }, { "id": "reset_spa_maintenance_booleans", "automation": "- id: reset_spa_maintenance_booleans\n alias: Reset Spa Maintenance Booleans\n description: Reset reminder booleans if reminder disabled, completed, or not active.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: enabled\n entity_id: input_boolean.spa_maintenance_enabled\n to: 'off'\n - trigger: state\n id: done\n entity_id: input_boolean.spa_maintenance_active\n to: 'off'\n - trigger: state\n id: entity\n entity_id: &id011\n - input_boolean.spa_maintenance_active\n - input_boolean.spa_maintenance_paused\n - input_boolean.spa_maintenance_skipped\n to: 'on'\n condition:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.spa_maintenance_enabled\n state: 'off'\n - condition: template\n alias: Pause boolean turned on when reminder is skipped or isn't active\n value_template: \"{{ trigger.entity_id == 'input_boolean.spa_maintenance_paused'\\n\\\n \\ and (is_state('input_boolean.spa_maintenance_active', 'off')\\n or\\\n \\ is_state('input_boolean.spa_maintenance_skipped', 'on')) }}\\n\"\n - condition: template\n alias: Reminder completed\n value_template: '{{ trigger.id == ''done'' }}'\n action:\n - if: '{{ trigger.id == ''entity'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: *id011", "config": [ { "name": "spa maintenance enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_enabled", "device_id": null } }, { "name": "spa maintenance active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_active", "device_id": null } }, { "name": "spa maintenance paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_paused", "device_id": null } }, { "name": "spa maintenance skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_skipped", "device_id": null } } ] }, { "id": "spa_maintenance_notification", "automation": "- id: spa_maintenance_notification\n alias: Spa Maintenance Notification\n description: Send notification until reminder is off.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_boolean.spa_maintenance_active\n to: 'on'\n - trigger: state\n entity_id: input_boolean.spa_maintenance_paused\n to: 'off'\n condition:\n - condition: state\n entity_id: input_boolean.spa_maintenance_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.spa_maintenance_paused\n state: 'off'\n action:\n - repeat:\n sequence:\n - if: '{{ not is_state(''input_select.occupancy_mode'', ''Night'') }}'\n then:\n - action: notify.jason\n data:\n message: Time to check the Spa\n data:\n tag: spa_maintenance_reminder\n group: Reminder\n visibility: public\n persistent: true\n notification_icon: mdi:hot-tub\n icon_url: secret SPA_ICON\n actions:\n - title: Pause\n action: pause_spa_maintenance\n - title: Skip\n action: skip_spa_maintenance\n - title: Done\n action: spa_maintenance_done\n - wait_template: \"{{ is_state('input_boolean.spa_maintenance_active', 'off')\\n\\\n \\ or is_state('input_boolean.spa_maintenance_paused', 'on') }}\\n\"\n timeout:\n minutes: 2\n - if:\n - condition: state\n entity_id: input_boolean.spa_maintenance_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.spa_maintenance_paused\n state: 'off'\n then:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: Hey mister Quit lounging around It's time to check up on\n the hot tub\n provider: HASS\n language: English (USA)\n voice: Tony:friendly\n quiet_play: true\n - wait_template: \"{{ is_state('input_boolean.spa_maintenance_active', 'off')\\n\\\n \\ or is_state('input_boolean.spa_maintenance_paused', 'on') }}\\n\"\n timeout:\n minutes: '{{ states(''input_number.spa_maintenance_notification_interval'')\n | int }}'\n until:\n - or:\n - condition: state\n entity_id: input_boolean.spa_maintenance_active\n state: 'off'\n - condition: state\n entity_id: input_boolean.spa_maintenance_paused\n state: 'on'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "spa maintenance active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_active", "device_id": null } }, { "name": "spa maintenance paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_paused", "device_id": null } }, { "name": "spa maintenance notification interval", "room": "spa", "type": "input_number", "id": { "entity_id": "input_number.spa_maintenance_notification_interval", "device_id": null } } ] }, { "id": "clear_spa_maintenance_notification", "automation": "- id: clear_spa_maintenance_notification\n alias: Clear Spa Maintenance Notification\n description: Clear reminder notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.spa_maintenance_active\n to: 'off'\n - trigger: state\n entity_id:\n - input_boolean.spa_maintenance_paused\n - input_boolean.spa_maintenance_skipped\n to: 'on'\n action:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: spa_maintenance_reminder", "config": [ { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "spa maintenance active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_active", "device_id": null } }, { "name": "spa maintenance paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_paused", "device_id": null } }, { "name": "spa maintenance skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_maintenance_skipped", "device_id": null } } ] }, { "id": "spa_temperature_selection", "automation": "- id: spa_temperature_selection\n alias: Spa Temperature Selection\n description: Select spa temperature range.\n mode: restart\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n from: Vacation\n for: 1\n - trigger: state\n entity_id: input_select.occupancy_mode\n to: Vacation\n for: 1\n actions:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Vacation\n then:\n - repeat:\n sequence:\n - action: select.select_option\n target:\n entity_id: select.spa_temperature_range\n data:\n option: low\n - wait_template: '{{ is_state(''select.spa_temperature_range'', ''Low'') }}'\n timeout:\n minutes: 30\n until:\n - condition: state\n entity_id: select.spa_temperature_range\n state: low\n else:\n - repeat:\n sequence:\n - action: select.select_option\n target:\n entity_id: select.spa_temperature_range\n data:\n option: high\n - wait_template: '{{ is_state(''select.spa_temperature_range'', ''High'')\n }}'\n timeout:\n minutes: 30\n until:\n - condition: state\n entity_id: select.spa_temperature_range\n state: high", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "spa temperature range select", "room": "spa", "type": "select", "id": { "entity_id": "select.spa_temperature_range", "device_id": null } } ] }, { "id": "turn_spa_water_on", "automation": "- id: turn_spa_water_on\n alias: Turn Spa Water On\n description: Turn on reminder active boolean.\n triggers:\n - trigger: template\n value_template: \"{% if is_state('input_boolean.spa_water_enabled', 'on') %}\\n\\\n \\ {% set time = states('sensor.time') %}\\n {% set shift = state_attr('sensor.work_status',\\\n \\ 'shift') %}\\n {% set last_run = states('button.spa_water_done') | as_datetime(now())\\\n \\ %}\\n {% set day_limit = states('input_number.spa_water_day_interval') | int(-1)\\\n \\ %}\\n {{ now() - last_run > timedelta(days=day_limit)\\n and ((shift\\\n \\ == 'Days' and time == states('input_datetime.spa_water_days')[0:5])\\n \\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.spa_water_afternoons')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.spa_water_weekends')[0:5]))\\\n \\ }}\\n{% endif %}\\n\"\n action:\n - if: '{{ is_state(''input_boolean.spa_water_active'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_water_active\n - if: '{{ is_state(''input_boolean.spa_water_paused'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_water_paused\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_water_paused\n - if: '{{ is_state(''input_boolean.spa_water_skipped'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_water_skipped\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.spa_water_active", "config": [ { "name": "work status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_status", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } }, { "name": "spa water enabled", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_enabled", "device_id": null } }, { "name": "spa water done button", "room": "spa", "type": "button", "id": { "entity_id": "button.spa_water_done", "device_id": null } }, { "name": "spa water day interval", "room": "spa", "type": "input_number", "id": { "entity_id": "input_number.spa_water_day_interval", "device_id": null } }, { "name": "spa water days datetime", "room": "spa", "type": "input_datetime", "id": { "entity_id": "input_datetime.spa_water_days", "device_id": null } }, { "name": "spa water afternoons datetime", "room": "spa", "type": "input_datetime", "id": { "entity_id": "input_datetime.spa_water_afternoons", "device_id": null } }, { "name": "spa water weekends datetime", "room": "spa", "type": "input_datetime", "id": { "entity_id": "input_datetime.spa_water_weekends", "device_id": null } }, { "name": "spa water active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_active", "device_id": null } }, { "name": "spa water paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_paused", "device_id": null } }, { "name": "spa water skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_skipped", "device_id": null } } ] }, { "id": "spa_water_done", "automation": "- id: spa_water_done\n alias: Spa Water Done\n description: Mark reminder completed.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: spa_water_done\n condition:\n - condition: state\n entity_id: input_boolean.spa_water_active\n state: 'on'\n action:\n - action: button.press\n target:\n entity_id: button.spa_water_done", "config": [ { "name": "spa water done button", "room": "spa", "type": "button", "id": { "entity_id": "button.spa_water_done", "device_id": null } }, { "name": "spa water active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_active", "device_id": null } } ] }, { "id": "skip_spa_water", "automation": "- id: skip_spa_water\n alias: Skip Spa Water\n description: Skip reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: skip_spa_water\n action:\n - action: button.press\n target:\n entity_id: button.skip_spa_water", "config": [ { "name": "skip spa water button", "room": "spa", "type": "button", "id": { "entity_id": "button.skip_spa_water", "device_id": null } } ] }, { "id": "pause_spa_water", "automation": "- id: pause_spa_water\n alias: Pause Spa Water\n description: Pause reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: pause_spa_water\n action:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.spa_water_paused", "config": [ { "name": "spa water paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_paused", "device_id": null } } ] }, { "id": "reset_pause_spa_water", "automation": "- id: reset_pause_spa_water\n alias: Reset Pause Spa Water\n description: Reset reminder paused boolean.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.spa_water_skipped\n to: 'on'\n - trigger: state\n entity_id: input_boolean.spa_water_paused\n to: 'on'\n for:\n hours: 24\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'on'\n for:\n minutes: 15\n condition:\n - condition: state\n entity_id: input_boolean.spa_water_paused\n state: 'on'\n action:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.spa_water_paused", "config": [ { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "spa water paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_paused", "device_id": null } }, { "name": "spa water skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_skipped", "device_id": null } } ] }, { "id": "reset_spa_water_booleans", "automation": "- id: reset_spa_water_booleans\n alias: Reset Spa Water Booleans\n description: Reset reminder booleans if reminder disabled, completed, or not active.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: enabled\n entity_id: input_boolean.spa_water_enabled\n to: 'off'\n - trigger: state\n id: done\n entity_id: input_boolean.spa_water_active\n to: 'off'\n - trigger: state\n id: entity\n entity_id: &id012\n - input_boolean.spa_water_active\n - input_boolean.spa_water_paused\n - input_boolean.spa_water_skipped\n to: 'on'\n condition:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.spa_water_enabled\n state: 'off'\n - condition: template\n alias: Pause boolean turned on when reminder is skipped or isn't active\n value_template: \"{{ trigger.entity_id == 'input_boolean.spa_water_paused'\\n\\\n \\ and (is_state('input_boolean.spa_water_active', 'off')\\n or is_state('input_boolean.spa_water_skipped',\\\n \\ 'on')) }}\\n\"\n - condition: template\n alias: Reminder completed\n value_template: '{{ trigger.id == ''done'' }}'\n action:\n - if: '{{ trigger.id == ''entity'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: *id012", "config": [ { "name": "spa water enabled", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_enabled", "device_id": null } }, { "name": "spa water active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_active", "device_id": null } }, { "name": "spa water paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_paused", "device_id": null } }, { "name": "spa water skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_skipped", "device_id": null } } ] }, { "id": "spa_water_notification", "automation": "- id: spa_water_notification\n alias: Spa Water Notification\n description: Send notification until reminder is off.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_boolean.spa_water_active\n to: 'on'\n - trigger: state\n entity_id: input_boolean.spa_water_paused\n to: 'off'\n condition:\n - condition: state\n entity_id: input_boolean.spa_water_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.spa_water_paused\n state: 'off'\n action:\n - repeat:\n sequence:\n - if: '{{ not is_state(''input_select.occupancy_mode'', ''Night'') }}'\n then:\n - action: notify.jason\n data:\n message: 'Time to change the spa water. It was last changed {{ time_since(as_datetime(states(''button.spa_water_done''),\n none)) }} ago.\n\n '\n data:\n tag: spa_water_reminder\n group: Reminder\n visibility: public\n persistent: true\n notification_icon: mdi:spa\n icon_url: secret SPA_ICON\n actions:\n - title: Pause\n action: pause_spa_water\n - title: Skip\n action: skip_spa_water\n - title: Done\n action: spa_water_done\n - wait_template: \"{{ is_state('input_boolean.spa_water_active', 'off')\\n \\\n \\ or is_state('input_boolean.spa_water_paused', 'on') }}\\n\"\n timeout:\n minutes: 2\n - if:\n - condition: state\n entity_id: input_boolean.spa_water_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.spa_water_paused\n state: 'off'\n then:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: Hey Jason, it's time to change the spa water\n quiet_play: true\n - wait_template: \"{{ is_state('input_boolean.spa_water_active', 'off')\\n \\\n \\ or is_state('input_boolean.spa_water_paused', 'on') }}\\n\"\n timeout:\n minutes: '{{ states(''input_number.spa_water_notification_interval'') |\n int }}'\n until:\n - or:\n - condition: state\n entity_id: input_boolean.spa_water_active\n state: 'off'\n - condition: state\n entity_id: input_boolean.spa_water_paused\n state: 'on'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "spa water done button", "room": "spa", "type": "button", "id": { "entity_id": "button.spa_water_done", "device_id": null } }, { "name": "spa water active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_active", "device_id": null } }, { "name": "spa water paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_paused", "device_id": null } }, { "name": "spa water notification interval", "room": "spa", "type": "input_number", "id": { "entity_id": "input_number.spa_water_notification_interval", "device_id": null } } ] }, { "id": "clear_spa_water_notification", "automation": "- id: clear_spa_water_notification\n alias: Clear Spa Water Notification\n description: Clear reminder notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.spa_water_active\n to: 'off'\n - trigger: state\n entity_id:\n - input_boolean.spa_water_paused\n - input_boolean.spa_water_skipped\n to: 'on'\n action:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: spa_water_reminder", "config": [ { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "spa water active", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_active", "device_id": null } }, { "name": "spa water paused", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_paused", "device_id": null } }, { "name": "spa water skipped", "room": "spa", "type": "input_boolean", "id": { "entity_id": "input_boolean.spa_water_skipped", "device_id": null } } ] }, { "id": "start_car_reminder", "automation": "- id: start_car_reminder\n alias: Start Car Reminder\n description: Play announcement if cold enough to start car before work.\n max_exceeded: silent\n triggers:\n - trigger: time\n at: sensor.car_start_time\n conditions:\n - condition: numeric_state\n entity_id: sensor.outdoor_temperature\n below: 5\n actions:\n - action: script.tts_play\n data:\n message: 'It''s only {{ states(''sensor.outdoor_temperature'') | int(0) }} degrees\n outside right now.\n\n Start the car if you don''t want to freeze your nuts off on the way to work!\n\n '\n media_player: media_player.inside_speakers\n provider: HASS\n language: English (USA)\n voice: Luna\n min_volume: 60\n quiet_play: true", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "inside speakers media player", "room": null, "type": "media_player", "id": { "entity_id": "media_player.inside_speakers", "device_id": null } }, { "name": "car start time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.car_start_time", "device_id": null } }, { "name": "outdoor temperature sensor", "room": "outside", "type": "sensor", "id": { "entity_id": "sensor.outdoor_temperature", "device_id": null } } ] }, { "id": "turn_indoor_sump_on", "automation": "- id: turn_indoor_sump_on\n alias: Turn Indoor Sump On\n description: Turn indoor sump pump on.\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_indoor_sump_on\n actions:\n - wait_template: '{{ has_value(''switch.indoor_sump'') }}'\n timeout:\n minutes: 10\n - if: '{{ wait.completed }}'\n then:\n - action: switch.turn_on\n target:\n entity_id: switch.indoor_sump\n else:\n - action: script.sump_error_notification\n data:\n sump: indoor", "config": [ { "name": "indoor sump switch", "room": "indoor", "type": "switch", "id": { "entity_id": "switch.indoor_sump", "device_id": null } }, { "name": "sump error notification script", "room": null, "type": "script", "id": { "entity_id": "script.sump_error_notification", "device_id": null } } ] }, { "id": "turn_outdoor_sump_on", "automation": "- id: turn_outdoor_sump_on\n alias: Turn Outdoor Sump On\n description: Turn outdoor sump pump on.\n triggers:\n - trigger: numeric_state\n entity_id: sensor.outdoor_temperature\n above: 1\n for:\n days: 1\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_outdoor_sump_on\n actions:\n - wait_template: '{{ has_value(''switch.outdoor_sump'') }}'\n timeout:\n minutes: 10\n - if: '{{ wait.completed }}'\n then:\n - action: switch.turn_on\n target:\n entity_id: switch.outdoor_sump\n else:\n - action: script.sump_error_notification\n data:\n sump: outdoor", "config": [ { "name": "outdoor temperature sensor", "room": "outside", "type": "sensor", "id": { "entity_id": "sensor.outdoor_temperature", "device_id": null } }, { "name": "sump error notification script", "room": null, "type": "script", "id": { "entity_id": "script.sump_error_notification", "device_id": null } }, { "name": "outdoor sump switch", "room": "outside", "type": "switch", "id": { "entity_id": "switch.outdoor_sump", "device_id": null } } ] }, { "id": "turn_outodoor_sump_off", "automation": "- id: turn_outodoor_sump_off\n alias: Turn Outdoor Sump Off\n description: Turn outdoor sump pump off.\n triggers:\n - trigger: numeric_state\n entity_id: sensor.outdoor_temperature\n below: 1\n for:\n hours: 12\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_outdoor_sump_off\n actions:\n - wait_template: '{{ has_value(''switch.outdoor_sump'') }}'\n timeout:\n minutes: 10\n - if: '{{ wait.completed }}'\n then:\n - action: switch.turn_off\n target:\n entity_id: switch.outdoor_sump\n else:\n - action: script.sump_error_notification\n data:\n sump: outdoor", "config": [ { "name": "outdoor temperature sensor", "room": "outside", "type": "sensor", "id": { "entity_id": "sensor.outdoor_temperature", "device_id": null } }, { "name": "sump error notification script", "room": null, "type": "script", "id": { "entity_id": "script.sump_error_notification", "device_id": null } }, { "name": "outdoor sump switch", "room": "outside", "type": "switch", "id": { "entity_id": "switch.outdoor_sump", "device_id": null } } ] }, { "id": "outdoor_sump_restart", "automation": "- id: outdoor_sump_restart\n alias: Outdoor Sump Restart\n description: Determine outdoor sump state when sump comes online and system restart.\n triggers:\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n - trigger: state\n entity_id: switch.outdoor_sump\n to: null\n from:\n - unknown\n - unavailable\n condition:\n - condition: state\n entity_id: input_boolean.startup_pending\n state: 'off'\n actions:\n - wait_template: \"{{ has_value('switch.outdoor_sump')\\n and is_number(states('sensor.outdoor_temperature'))\\\n \\ }}\\n\"\n timeout:\n minutes: 10\n - if: '{{ wait.completed }}'\n then:\n - if:\n - condition: numeric_state\n entity_id: sensor.outdoor_temperature\n below: 1\n then:\n - action: switch.turn_off\n target:\n entity_id: switch.outdoor_sump\n else:\n - action: switch.turn_on\n target:\n entity_id: switch.outdoor_sump\n else:\n - action: script.sump_error_notification\n data:\n sump: outdoor", "config": [ { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "outdoor temperature sensor", "room": "outside", "type": "sensor", "id": { "entity_id": "sensor.outdoor_temperature", "device_id": null } }, { "name": "sump error notification script", "room": null, "type": "script", "id": { "entity_id": "script.sump_error_notification", "device_id": null } }, { "name": "outdoor sump switch", "room": "outside", "type": "switch", "id": { "entity_id": "switch.outdoor_sump", "device_id": null } } ] }, { "id": "sync_home_away", "automation": "- id: sync_home_away\n alias: Sync Home Away\n description: Keep occupancy booleans in sync with person state.\n mode: parallel\n variables:\n people: '{{ [''jason''] }}'\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: state\n entity_id: person.jason\n to: home\n - trigger: state\n entity_id: person.jason\n from: home\n - trigger: state\n entity_id: input_boolean.jason_home\n to:\n - 'on'\n - 'off'\n - trigger: state\n entity_id: input_boolean.jason_presence_override\n to: 'off'\n conditions:\n - condition: template\n alias: Person's home override is not on\n value_template: '{{ is_state(''input_boolean.'' ~ person ~ ''_presence_override'',\n ''off'') }}'\n actions:\n - action: automation.turn_off\n target:\n entity_id: '{{ this.entity_id }}'\n data:\n stop_actions: false\n - action: input_boolean.turn_{{ 'on' if is_state('person.' ~ person, 'home') else\n 'off' }}\n target:\n entity_id: input_boolean.{{ person }}_home\n continue_on_error: true\n - action: automation.turn_on\n target:\n entity_id: '{{ this.entity_id }}'", "config": [ { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "automation turn off service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_off", "device_id": null } }, { "name": "automation turn on service", "room": null, "type": "service", "id": { "entity_id": "automation.turn_on", "device_id": null } }, { "name": "jason presence override", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_presence_override", "device_id": null } }, { "name": "jason home input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_home", "device_id": null } } ] }, { "id": "thermostat_mode_changed", "automation": "- id: thermostat_mode_changed\n alias: Thermostat Mode Changed\n description: Update stored climate mode.\n mode: restart\n triggers:\n - trigger: state\n entity_id: climate.house\n to:\n - heat\n - cool\n - heat_cool\n - fan_only\n - 'off'\n conditions:\n - condition: state\n entity_id: script.set_thermostat\n state: 'off'\n - condition: state\n alias: HVAC Window Door Open alert is not active\n entity_id: alert.climate_window_door_open\n state: idle\n actions:\n - action: input_select.select_option\n target:\n entity_id: input_select.climate_mode\n data:\n option: '{{ states(''climate.house'') }}'", "config": [ { "name": "climate window door open alert", "room": null, "type": "alert", "id": { "entity_id": "alert.climate_window_door_open", "device_id": null } }, { "name": "climate house climate", "room": null, "type": "climate", "id": { "entity_id": "climate.house", "device_id": null } }, { "name": "climate mode input select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.climate_mode", "device_id": null } }, { "name": "set thermostat script", "room": null, "type": "script", "id": { "entity_id": "script.set_thermostat", "device_id": null } } ] }, { "id": "tts_queue_finished", "automation": "- id: tts_queue_finished\n alias: TTS Queue Finished\n description: Reset tts queue.\n triggers:\n - trigger: state\n id: finished\n entity_id: script.tts_play\n to: 'off'\n from: 'on'\n for: 1\n - trigger: state\n id: reset\n entity_id: input_boolean.tts\n to: 'on'\n for:\n minutes: 2\n conditions:\n - condition: state\n entity_id: input_boolean.tts_enabled\n state: 'on'\n actions:\n - action: script.turn_on\n target:\n entity_id: script.tts_finished\n data:\n variables:\n reset: '{{ trigger.id == ''reset'' }}'", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "tts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.tts", "device_id": null } }, { "name": "tts enabled input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.tts_enabled", "device_id": null } }, { "name": "tts finished script", "room": null, "type": "script", "id": { "entity_id": "script.tts_finished", "device_id": null } } ] }, { "id": "turn_alarm_clock_off", "automation": "- id: turn_alarm_clock_off\n alias: Turn Alarm Clock Off\n description: Turn off alarm clock.\n max_exceeded: silent\n variables:\n alarm_type: '{{ states(''input_select.alarm_clock_type'') }}'\n triggers:\n - trigger: event\n event_type: shelly.click\n event_data:\n device: shellybutton1-E8DB84AA2E96\n click_type: long\n - trigger: event\n event_type: timer.cancelled\n event_data:\n entity_id: timer.alarm_clock_nap\n - trigger: event\n event_type: timer.paused\n event_data:\n entity_id: timer.alarm_clock_nap\n - trigger: event\n event_type: timer.cancelled\n event_data:\n entity_id: timer.alarm_clock_snooze\n - trigger: event\n event_type: timer.paused\n event_data:\n entity_id: timer.alarm_clock_snooze\n - trigger: event\n id: action\n event_type: mobile_app_notification_action\n event_data:\n action: turn_off_alarm_clock\n - trigger: state\n entity_id: binary_sensor.alarm_clock\n to: 'on'\n for:\n minutes: 60\n conditions:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'on'\n - condition: template\n alias: Alarm clock is active\n value_template: '{{ alarm_type != ''off'' }}'\n actions:\n - action: switch.turn_off\n target:\n entity_id: switch.alarm_clock_{{ alarm_type }}\n - if: '{{ is_state(''input_boolean.alarm_clock_failed'', ''on'') }}'\n then:\n - action: script.silence_mobile_alarm", "config": [ { "name": "alarm clock failed", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_failed", "device_id": null } }, { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock type", "room": null, "type": "input_select", "id": { "entity_id": "input_select.alarm_clock_type", "device_id": null } }, { "name": "alarm clock snooze timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_snooze", "device_id": null } }, { "name": "silence mobile alarm script", "room": null, "type": "script", "id": { "entity_id": "script.silence_mobile_alarm", "device_id": null } }, { "name": "timer cancel service", "room": null, "type": "service", "id": { "entity_id": "timer.cancel", "device_id": null } }, { "name": "shelly click event", "room": null, "type": "event", "id": { "entity_id": "shelly.click", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "shelly button device", "room": "bedroom", "type": "device", "id": { "entity_id": null, "device_id": "shellybutton1-E8DB84AA2E96" } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock snooze timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_snooze", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "reset_alarm_clock_switch", "automation": "- id: reset_alarm_clock_switch\n alias: Reset Alarm Clock Switch\n description: Turn off alarm clock switch if another one is already on.\n mode: parallel\n triggers:\n - trigger: state\n entity_id:\n - switch.alarm_clock_daily\n - switch.alarm_clock_manual\n - switch.alarm_clock_nap\n to: 'on'\n from: 'off'\n conditions:\n - condition: state\n entity_id: binary_sensor.alarm_clock\n state: 'on'\n actions:\n - action: switch.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'", "config": [ { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock daily", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_daily", "device_id": null } }, { "name": "alarm clock nap switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock daily switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_daily", "device_id": null } }, { "name": "alarm clock manual switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_manual", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "turn_alarm_clock_on", "automation": "- id: turn_alarm_clock_on\n alias: Turn Alarm Clock On\n description: Turn on alarm clock.\n max_exceeded: silent\n triggers:\n - trigger: time\n id: daily\n at: sensor.alarm_clock_daily_next_alarm\n - trigger: time\n id: manual\n at: sensor.alarm_clock_manual_next_alarm\n - trigger: event\n id: nap\n event_type: timer.finished\n event_data:\n entity_id: timer.alarm_clock_nap\n conditions:\n - condition: template\n alias: Alarm is not already on\n value_template: '{{ is_state(''switch.alarm_clock_'' ~ trigger.id, ''off'') }}'\n - condition: template\n alias: Nap alarm is set if trigger is nap timer\n value_template: '{{ iif(trigger.id == ''nap'', is_state(''input_boolean.alarm_clock_nap'',\n ''on''), true) }}\n\n '\n actions:\n - if: '{{ is_state(''input_boolean.alarm_clock_skip_next'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.alarm_clock_skip_next\n - if: '{{ trigger.id == ''manual'' and is_state(''input_boolean.alarm_clock_manual_repeat'',\n ''off'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.alarm_clock_manual\n else:\n - if:\n - condition: state\n entity_id: input_select.occupancy_mode\n state:\n - Home\n - Guest\n - Night\n then:\n - if:\n - condition: template\n value_template: \"{{ iif(trigger.id == 'daily',\\n is_state('input_select.occupancy_mode',\\\n \\ 'Night'), true) }}\\n\"\n then:\n - action: switch.turn_on\n target:\n entity_id: switch.alarm_clock_{{ trigger.id }}\n else:\n - action: notify.jason\n data:\n title: Alarm Clock\n message: 'Daily alarm clock was scheduled for {{ state_attr(''sensor.waketime_today'',\n ''12hour'') }} but the house is already awake\n\n '\n data:\n tag: alarm_clock_failed\n visibility: public\n persistent: true\n channel: Night\n group: Alarm Clock\n notification_icon: '{{ state_attr(''binary_sensor.alarm_clock'', ''icon'')\n }}'\n icon_url: secret ALARM_CLOCK_ICON\n clickAction: /ui-mobile/schedule\n actions:\n - title: Play Alarm\n action: play_daily_alarm\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: upcoming_alarm_clock\n else:\n - action: notify.jason\n data:\n title: Alarm Clock\n message: Alarm clock was scheduled but nobody is home\n data:\n visibility: public\n persistent: true\n channel: Urgent\n group: Alarm Clock\n notification_icon: '{{ state_attr(''binary_sensor.alarm_clock'', ''icon'')\n }}'\n icon_url: secret ALARM_CLOCK_ICON\n clickAction: /ui-mobile/schedule\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: upcoming_alarm_clock", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm clock", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.alarm_clock", "device_id": null } }, { "name": "alarm clock skip next", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_skip_next", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "alarm clock nap input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock nap timer", "room": null, "type": "timer", "id": { "entity_id": "timer.alarm_clock_nap", "device_id": null } }, { "name": "alarm clock daily next alarm", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_daily_next_alarm", "device_id": null } }, { "name": "alarm clock manual next alarm", "room": null, "type": "sensor", "id": { "entity_id": "sensor.alarm_clock_manual_next_alarm", "device_id": null } }, { "name": "alarm clock manual repeat", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_manual_repeat", "device_id": null } }, { "name": "Alarm Clock Manual Input Boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_clock_manual", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "play_daily_alarm_clock", "automation": "- id: play_daily_alarm_clock\n alias: Play Daily Alarm Clock\n description: Turn on alarm clock.\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: play_daily_alarm\n actions:\n - action: switch.turn_on\n target:\n entity_id: switch.alarm_clock_daily", "config": [ { "name": "alarm clock daily", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_daily", "device_id": null } }, { "name": "alarm clock daily switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_daily", "device_id": null } }, { "name": "Alarm Clock Switch", "room": null, "type": "switch", "id": { "entity_id": "switch.alarm_clock_", "device_id": null } } ] }, { "id": "turn_climate_presence_override_on", "automation": "- id: turn_climate_presence_override_on\n alias: Turn Climate Presence Override On\n description: Turn on climate presence override.\n max_exceeded: silent\n max: 5\n triggers:\n - trigger: zone\n id: work\n entity_id: person.jason\n zone: zone.work\n event: leave\n - trigger: state\n id: commute\n entity_id: binary_sensor.home_commute_active\n to: 'on'\n for: 1\n - trigger: state\n id: home\n entity_id:\n - binary_sensor.jason_almost_home\n - binary_sensor.jason_heading_home\n to: 'on'\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.someone_home\n - input_boolean.climate_manual_mode\n state: 'off'\n - condition: template\n alias: At work for at least 15 minutes\n value_template: \"{{ iif(trigger.id == 'work',\\n now() - trigger.from_state.last_changed\\\n \\ > timedelta(minutes=15), true) }}\\n\"\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.climate_presence_override", "config": [ { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "jason almost home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_almost_home", "device_id": null } }, { "name": "home commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.home_commute_active", "device_id": null } }, { "name": "climate manual mode input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_manual_mode", "device_id": null } }, { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "climate presence override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_presence_override", "device_id": null } }, { "name": "work zone", "room": "work", "type": "zone", "id": { "entity_id": "zone.work", "device_id": null } }, { "name": "jason heading home binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_heading_home", "device_id": null } } ] }, { "id": "turn_climate_presence_override_off", "automation": "- id: turn_climate_presence_override_off\n alias: Turn Climate Presence Override Off\n description: Turn off climate presence override.\n triggers:\n - trigger: state\n entity_id: binary_sensor.someone_home\n to: 'on'\n - trigger: state\n entity_id: input_boolean.climate_manual_mode\n to: 'on'\n - trigger: state\n entity_id: input_select.occupancy_mode\n to:\n - Home\n - Guest\n from:\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: state\n entity_id: input_boolean.climate_presence_override\n to: 'on'\n for:\n minutes: 60\n conditions:\n - condition: state\n entity_id: input_boolean.climate_presence_override\n state: 'on'\n - condition: state\n entity_id: input_boolean.climate_manual_mode\n state: 'off'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.climate_presence_override", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "climate manual mode input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_manual_mode", "device_id": null } }, { "name": "climate presence override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.climate_presence_override", "device_id": null } } ] }, { "id": "turn_jason_phone_ringer_on", "automation": "- id: turn_jason_phone_ringer_on\n alias: Turn Jason Phone ringer On\n description: Turn Jason phone ringer on.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_jason_phone_ringer_on\n actions:\n - action: select.select_option\n target:\n entity_id: select.jason_phone_ringer_mode\n data:\n option: normal", "config": [ { "name": "jason phone ringer mode select", "room": null, "type": "select", "id": { "entity_id": "select.jason_phone_ringer_mode", "device_id": null } } ] }, { "id": "turn_media_player_off", "automation": "- id: turn_media_player_off\n alias: Turn Media Player Off\n description: Automatically stop and turn off media players.\n mode: restart\n triggers:\n - trigger: state\n id: night\n entity_id: input_select.occupancy_mode\n to: Night\n for: 1\n - trigger: state\n id: away\n entity_id: input_select.occupancy_mode\n to:\n - Away\n - Vacation\n for: 1\n - trigger: state\n id: alarm\n entity_id: input_boolean.alarm_triggered\n to: 'on'\n - trigger: state\n id: mute\n entity_id: switch.media_mute\n to: 'on'\n from: 'off'\n for:\n minutes: 15\n actions:\n - choose:\n - conditions:\n - condition: trigger\n id: night\n sequence:\n - action: script.turn_media_player_off\n data:\n entity_id: '{{ state_attr(''group.speaker_media_players'', ''entity_id'')\n }}'\n - wait_template: \"{{ not is_state('input_select.occupancy_mode', 'Night')\\n\\\n \\ or is_state('group.tv_media_players', 'off') }}\\n\"\n timeout:\n minutes: 60\n - if: \"{{ is_state('input_select.occupancy_mode', 'Night')\\n and is_state('group.tv_media_players',\\\n \\ 'on') }}\\n\"\n then:\n - action: script.turn_media_player_off\n data:\n entity_id: '{{ state_attr(''group.tv_media_players'', ''entity_id'') }}'\n - conditions: '{{ trigger.id in [''mute'', ''alarm''] }}'\n sequence:\n - action: script.turn_media_player_off\n data:\n entity_id: '{{ state_attr(''group.speaker_media_players'', ''entity_id'')\n }}'\n default:\n - action: script.turn_media_player_off", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "turn media player off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_media_player_off", "device_id": null } }, { "name": "media mute switch", "room": null, "type": "switch", "id": { "entity_id": "switch.media_mute", "device_id": null } }, { "name": "speaker media players group", "room": null, "type": "group", "id": { "entity_id": "group.speaker_media_players", "device_id": null } }, { "name": "tv media players group", "room": null, "type": "group", "id": { "entity_id": "group.tv_media_players", "device_id": null } } ] }, { "id": "turn_room_off", "automation": "- id: turn_room_off\n alias: Turn Room Off\n description: Turn room off.\n triggers:\n - trigger: event\n id: bedroom\n event_type: shelly.click\n event_data:\n device: shellybutton1-E8DB84AA2E96\n click_type: double\n actions:\n - action: script.turn_room_off\n data:\n room: '{{ trigger.id }}'", "config": [ { "name": "shelly click event", "room": null, "type": "event", "id": { "entity_id": "shelly.click", "device_id": null } }, { "name": "shelly button device", "room": "bedroom", "type": "device", "id": { "entity_id": null, "device_id": "shellybutton1-E8DB84AA2E96" } }, { "name": "turn room off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_room_off", "device_id": null } } ] }, { "id": "turn_scene_off", "automation": "- id: turn_scene_off\n alias: Turn Scene Off\n description: Turn scene off.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: state\n id: alarm\n entity_id: input_boolean.alarm_triggered\n to: 'on'\n actions:\n - action: switch.turn_off\n target:\n entity_id: group.scene_switches", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "scene switches group", "room": null, "type": "group", "id": { "entity_id": "group.scene_switches", "device_id": null } } ] }, { "id": "turn_schedule_routine_off", "automation": "- id: turn_schedule_routine_off\n alias: Turn Schedule Routine Off\n description: Turn off schedule routine.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_select.occupancy_mode\n to:\n - Night\n - Away\n - Vacation\n for: 1\n - trigger: state\n entity_id:\n - switch.chill_scene\n - switch.company_scene\n - switch.movie_scene\n to: 'on'\n from: 'off'\n actions:\n - action: script.turn_off\n target:\n entity_id:\n - script.waketime\n - script.bedtime", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "waketime script", "room": null, "type": "script", "id": { "entity_id": "script.waketime", "device_id": null } }, { "name": "bedtime script", "room": null, "type": "script", "id": { "entity_id": "script.bedtime", "device_id": null } }, { "name": "chill scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.chill_scene", "device_id": null } }, { "name": "company scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.company_scene", "device_id": null } }, { "name": "movie scene switch", "room": null, "type": "switch", "id": { "entity_id": "switch.movie_scene", "device_id": null } }, { "name": "turn off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_off", "device_id": null } } ] }, { "id": "turn_thermostat_off", "automation": "- id: turn_thermostat_off\n alias: Turn Thermostat Off\n description: Turn off thermostat\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: turn_thermostat_off\n conditions:\n - not:\n - condition: state\n entity_id: climate.house\n state: 'off'\n actions:\n - action: climate.turn_off\n target:\n entity_id: climate.house", "config": [ { "name": "climate house climate", "room": null, "type": "climate", "id": { "entity_id": "climate.house", "device_id": null } } ] }, { "id": "tv_picture_mode", "automation": "- id: tv_picture_mode\n alias: TV Picture Mode\n description: Set TV picture mode.\n mode: parallel\n triggers:\n - trigger: state\n entity_id:\n - media_player.bedroom_tv\n - media_player.deck_tv\n - media_player.living_room_tv\n to: 'on'\n for: 5\n conditions:\n - condition: template\n alias: TV is not off or unavailable\n value_template: '{{ not is_state(trigger.entity_id, [''off'', ''standby'', ''unknown'',\n ''unavailable'']) }}'\n actions:\n - action: script.tv_picture_mode\n data:\n entity_id: '{{ trigger.entity_id }}'\n picture_mode: '{{ iif(is_state(''input_select.occupancy_mode'', ''Night''),\n ''expert2'', ''cinema'') }}'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "deck tv media player", "room": "deck", "type": "media_player", "id": { "entity_id": "media_player.deck_tv", "device_id": null } }, { "name": "tv picture mode script", "room": null, "type": "script", "id": { "entity_id": "script.tv_picture_mode", "device_id": null } } ] }, { "id": "tv_sound_mode", "automation": "- id: tv_sound_mode\n alias: TV Sound Mode\n description: Set TV sound mode.\n mode: parallel\n triggers:\n - trigger: state\n id: music\n entity_id: &id014\n - media_player.bedroom_tv\n - media_player.deck_tv\n - media_player.living_room_tv\n attribute: source\n to: &id013\n - HDMI 2\n - Spotify - Music and Podcasts\n not_from: *id013\n - trigger: state\n id: aiSoundPlus\n entity_id: *id014\n attribute: source\n from: *id013\n not_to: *id013\n conditions:\n - condition: template\n alias: TV is not off or unavailable\n value_template: '{{ not is_state(trigger.entity_id, [''off'', ''standby'', ''unknown'',\n ''unavailable'']) }}'\n actions:\n - action: script.tv_sound_mode\n data:\n entity_id: '{{ trigger.entity_id }}'\n sound_mode: '{{ trigger.id }}'", "config": [ { "name": "living room tv", "room": "living room", "type": "media_player", "id": { "entity_id": "media_player.living_room_tv", "device_id": null } }, { "name": "bedroom tv", "room": "bedroom", "type": "media_player", "id": { "entity_id": "media_player.bedroom_tv", "device_id": null } }, { "name": "deck tv media player", "room": "deck", "type": "media_player", "id": { "entity_id": "media_player.deck_tv", "device_id": null } }, { "name": "tv sound mode script", "room": null, "type": "script", "id": { "entity_id": "script.tv_sound_mode", "device_id": null } } ] }, { "id": "update_unavailable_entities_group", "automation": "- id: update_unavailable_entities_group\n alias: Update Unavailable Entities Group\n description: Update unavailable entities group.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time_pattern\n minutes: /1\n actions:\n - action: group.set\n data:\n object_id: unavailable_entities\n entities: \"{% set ignore_seconds = 60 %} {% set ignore_label = 'ignored' %}\\\n \\ {% set ignored_domains = ['button', 'conversation', 'event', 'group', 'image',\\n\\\n \\ 'input_button', 'input_text', 'remote', 'tts', 'scene', 'stt', 'update']\\\n \\ %}\\n{% set ignore_ts = (now().timestamp() - ignore_seconds)|as_datetime\\\n \\ %} {% set disabled_device_entities = state_attr('sensor.disabled_device_entities',\\\n \\ 'entities')\\n | regex_replace(find='\\\\[|\\\\]|\\\\{|\\\\}|\\\\'entity_id\\\\':',\\\n \\ replace='') %}\\n{% set ignored_devices = label_devices(ignore_label | lower)\\\n \\ %} {% set ignored_device_entities = namespace(value=[]) %} {% for device\\\n \\ in ignored_devices %}\\n {% set ignored_device_entities.value = ignored_device_entities.value\\\n \\ + device_entities(device) %}\\n{% endfor %} {{ states\\n | rejectattr('domain',\\\n \\ 'in', ignored_domains)\\n | rejectattr('entity_id', 'in', disabled_device_entities)\\n\\\n \\ | rejectattr('entity_id', 'in', state_attr('group.ignored_entities',\\\n \\ 'entity_id'))\\n | rejectattr('entity_id', 'in', ['group.unavailable_entities',\\\n \\ 'group.ignored_entities'])\\n | rejectattr('entity_id', 'in', ignored_device_entities.value)\\n\\\n \\ | rejectattr('entity_id', 'in', label_entities(ignore_label | lower))\\n\\\n \\ | rejectattr('last_changed', 'ge', ignore_ts)\\n | selectattr('state',\\\n \\ 'in', ['unknown', 'unavailable'])\\n | map(attribute='entity_id') | list\\\n \\ | sort }}\\n\"", "config": [ { "name": "unavailable entities group", "room": null, "type": "group", "id": { "entity_id": "group.unavailable_entities", "device_id": null } } ] }, { "id": "unavailable_entities_notification", "automation": "- id: unavailable_entities_notification\n alias: Unavailable Entities Notification\n description: Create persistent notification if unavailable entities, dismiss if\n none.\n mode: restart\n triggers:\n - trigger: state\n entity_id: group.unavailable_entities\n attribute: entity_id\n to: null\n for: 5\n conditions:\n - condition: template\n alias: Sensor state is a valid numerical value\n value_template: '{{ is_number(states(''sensor.unavailable_entities'')) }}'\n actions:\n - if:\n - condition: numeric_state\n entity_id: sensor.unavailable_entities\n below: 1\n then:\n - action: persistent_notification.dismiss\n data:\n notification_id: unavailable_entities\n else:\n - action: persistent_notification.create\n data:\n notification_id: unavailable_entities\n title: Unavailable Entities\n message: '{{ state_attr(''group.unavailable_entities'', ''entity_id'') | join(''\n\n '') }}'", "config": [ { "name": "unavailable entities group", "room": null, "type": "group", "id": { "entity_id": "group.unavailable_entities", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "unavailable entities sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.unavailable_entities", "device_id": null } } ] }, { "id": "unlock_door_locks", "automation": "- id: unlock_door_locks\n alias: Unlock Door Locks\n description: Unlock entry door locks.\n mode: queued\n variables:\n locks: \"{% if trigger.id == 'doorbell' %}\\n {% set locks = 'lock.front_door_lock'\\\n \\ %}\\n{% elif trigger.id == 'arriving' %}\\n {% set locks = ['lock.back_door_lock',\\\n \\ 'lock.side_door_lock'] %}\\n{% else %}\\n {% set locks = state_attr('group.door_locks',\\\n \\ 'entity_id') %}\\n{% endif %} {{ expand(locks) | selectattr('state', 'eq',\\\n \\ 'locked')\\n | map(attribute='entity_id') | sort }}\\n\"\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: event\n id: arriving\n event_type: mobile_app_notification_action\n event_data:\n action: arriving_home_jason\n - trigger: event\n id: arriving\n event_type: mobile_app_notification_action\n event_data:\n action: arriving_home_garage_jason\n - trigger: event\n id: doorbell\n event_type: mobile_app_notification_action\n event_data:\n action: doorbell_unlock_door\n - trigger: state\n id: danger\n entity_id: binary_sensor.danger_alarm\n to: 'on'\n conditions:\n - '{{ locks | count > 0 }}'\n actions:\n - if: '{{ trigger.id == ''arriving'' }}'\n then:\n - wait_template: '{{ is_state(''alarm_control_panel.house'',''disarmed'') }}'\n timeout: 60\n continue_on_timeout: false\n - if: '{{ person == ''jason'' }}'\n then:\n - action: script.unlock_door_locks\n target:\n entity_id: '{{ locks }}'\n data:\n code: secret LOCK_JASON\n else:\n - action: script.unlock_door_locks\n target:\n entity_id: '{{ locks }}'\n data:\n code: secret LOCK_HASS", "config": [ { "name": "house alarm", "room": null, "type": "alarm_control_panel", "id": { "entity_id": "alarm_control_panel.house", "device_id": null } }, { "name": "danger alarm", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.danger_alarm", "device_id": null } }, { "name": "side door lock", "room": "side", "type": "lock", "id": { "entity_id": "lock.side_door_lock", "device_id": null } }, { "name": "back door lock", "room": "back", "type": "lock", "id": { "entity_id": "lock.back_door_lock", "device_id": null } }, { "name": "front door lock", "room": "front", "type": "lock", "id": { "entity_id": "lock.front_door_lock", "device_id": null } }, { "name": "door locks group", "room": null, "type": "group", "id": { "entity_id": "group.door_locks", "device_id": null } }, { "name": "unlock door locks script", "room": null, "type": "script", "id": { "entity_id": "script.unlock_door_locks", "device_id": null } } ] }, { "id": "update_alarm_group_entities", "automation": "- id: update_alarm_group_entities\n alias: Update Alarm Group Entities\n description: Update alarm entity groups.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - action: group.set\n data:\n object_id: entry_doors\n entities: \"{{ states.binary_sensor\\n | selectattr('attributes.device_class',\\\n \\ 'defined')\\n | selectattr('attributes.device_class', 'eq', 'door')\\n\\\n \\ | selectattr('attributes.type', 'defined')\\n | selectattr('attributes.type',\\\n \\ 'eq', 'entry')\\n | rejectattr('entity_id', 'contains', 'open_alert')\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: door_alert_sensors\n entities: \"{{ states.binary_sensor\\n | selectattr('entity_id', 'contains',\\\n \\ '_door_open_alert')\\n | rejectattr('entity_id', 'eq', 'binary_sensor.climate_window_door_open_alert')\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: windows\n entities: \"{{ states.binary_sensor\\n | selectattr('attributes.device_class',\\\n \\ 'defined')\\n | selectattr('attributes.device_class', 'eq', 'window')\\n\\\n \\ | rejectattr('entity_id', 'contains', '_open_alert')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: window_alert_sensors\n entities: \"{{ states.binary_sensor\\n | selectattr('entity_id', 'contains',\\\n \\ '_window_open_alert')\\n | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: motion_sensors\n entities: \"{{ states.binary_sensor\\n | selectattr('attributes.device_class',\\\n \\ 'defined')\\n | selectattr('attributes.device_class', 'eq', 'motion')\\n\\\n \\ | rejectattr('entity_id', 'search', '(jphone|jlaptop|jtablet|jwork)')\\n\\\n \\ | rejectattr('entity_id', 'contains', 'object_detected')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: door_locks\n entities: \"{{ states.lock\\n | selectattr('attributes.type', 'defined')\\n\\\n \\ | selectattr('attributes.type', 'eq', 'door')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: leak_sensors\n entities: \"{{ states.binary_sensor\\n | selectattr('attributes.type', 'defined')\\n\\\n \\ | selectattr('attributes.type', 'eq', 'leak')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "climate window door open alert", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.climate_window_door_open_alert", "device_id": null } } ] }, { "id": "update_camera_group_entities", "automation": "- id: update_camera_group_entities\n alias: Update Camera Group Entities\n description: Update camera entities.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: state\n entity_id: &id015\n - camera.side_driveway\n - camera.side_door\n - camera.front_driveway\n - camera.front_door\n - camera.front_yard\n - camera.side_gate_front\n - camera.side_gate_back\n - camera.back_yard\n - camera.back_door\n - camera.patio_door\n - camera.back_house\n - camera.garage_inside\n - camera.charlie_cam\n - camera.living_room\n to:\n - unknown\n - unavailable\n - trigger: state\n entity_id: *id015\n from:\n - unknown\n - unavailable\n actions:\n - action: group.set\n data:\n object_id: indoor_cameras\n entities: \"{{ states.camera\\n | selectattr('attributes.location', 'defined')\\n\\\n \\ | selectattr('attributes.location', 'eq', 'indoor')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: outdoor_cameras\n entities: \"{{ states.camera\\n | selectattr('attributes.location', 'defined')\\n\\\n \\ | selectattr('attributes.location', 'eq', 'outdoor')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: wyze_cameras\n entities: \"{{ states.camera\\n | selectattr('attributes.source', 'defined')\\n\\\n \\ | selectattr('attributes.source', 'eq', 'wyze')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: frigate_cameras\n entities: \"{{ states.camera\\n | selectattr('attributes.frigate', 'defined')\\n\\\n \\ | selectattr('attributes.frigate', 'eq', true)\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: frigate_all_count_sensors\n entities: \"{{ expand(integration_entities('frigate'))\\n | selectattr('entity_id',\\\n \\ 'contains', '_all_count')\\n | map(attribute='entity_id') | select('has_value')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: camera_detection_switches\n entities: \"{{ expand(integration_entities('frigate'))\\n | selectattr('domain',\\\n \\ 'eq', 'switch')\\n | selectattr('entity_id', 'contains', '_detect')\\n\\\n \\ | map(attribute='entity_id') | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: camera_recording_switches\n entities: \"{{ expand(integration_entities('frigate'))\\n | selectattr('domain',\\\n \\ 'eq', 'switch')\\n | selectattr('entity_id', 'contains', '_recordings')\\n\\\n \\ | map(attribute='entity_id') | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: camera_motion_switches\n entities: \"{{ expand(integration_entities('frigate'))\\n | selectattr('domain',\\\n \\ 'eq', 'switch')\\n | selectattr('entity_id', 'contains', '_motion')\\n\\\n \\ | map(attribute='entity_id') | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: camera_snapshot_switches\n entities: \"{{ expand(integration_entities('frigate'))\\n | selectattr('domain',\\\n \\ 'eq', 'switch')\\n | selectattr('entity_id', 'contains', '_snapshots')\\n\\\n \\ | map(attribute='entity_id') | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: camera_motion_switches\n entities: \"{{ expand(integration_entities('frigate'))\\n | selectattr('domain',\\\n \\ 'eq', 'switch')\\n | selectattr('entity_id', 'contains', '_motion')\\n\\\n \\ | map(attribute='entity_id') | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: security_occupancy_sensors\n entities:\n - binary_sensor.back_door_person_occupancy\n - binary_sensor.back_house_person_occupancy\n - binary_sensor.back_yard_person_occupancy\n - binary_sensor.front_door_person_occupancy\n - binary_sensor.front_yard_person_occupancy\n - binary_sensor.patio_door_person_occupancy\n - binary_sensor.side_driveway_person_occupancy\n - binary_sensor.side_gate_back_person_occupancy\n - binary_sensor.side_gate_front_person_occupancy\n - action: group.set\n data:\n object_id: offline_cameras\n entities: \"{% from 'hass.jinja' import ignored_device_entities %} {% set indoor\\\n \\ = state_attr('group.indoor_cameras', 'entity_id') | list\\n if is_state('binary_sensor.someone_home',\\\n \\ 'off')\\n and state_attr('group.indoor_cameras', 'entity_id') != none\\\n \\ else [] %}\\n{% set outdoor = state_attr('group.outdoor_cameras', 'entity_id')\\\n \\ | list\\n if state_attr('group.outdoor_cameras', 'entity_id') != none\\\n \\ else [] %}\\n{{ expand(union(indoor, outdoor))\\n | rejectattr('entity_id',\\\n \\ 'in', ignored_device_entities())\\n | rejectattr('entity_id', 'in', label_entities('ignored'))\\n\\\n \\ | map(attribute='entity_id') | reject('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: indoor_camera_power_switches\n entities: \"{{ expand('group.wyze_cameras')\\n | select('in', expand('group.indoor_cameras'))\\n\\\n \\ | map(attribute='entity_id') | list\\n | map('regex_replace', find='camera.(.*)',\\n\\\n \\ replace='switch.\\\\\\\\1_camera_power', ignorecase=False) | sort }}\\n\"\n - action: group.set\n data:\n object_id: indoor_camera_stream_switches\n entities: \"{{ expand('group.wyze_cameras')\\n | select('in', expand('group.indoor_cameras'))\\n\\\n \\ | map(attribute='entity_id') | list\\n | map('regex_replace', find='camera.(.*)',\\n\\\n \\ replace='switch.\\\\\\\\1_camera_stream', ignorecase=False) | sort }}\\n\"\n - action: group.set\n data:\n object_id: last_detected_object_sensors\n entities: \"{{ expand(integration_entities('frigate'))\\n | selectattr('domain',\\\n \\ 'eq', 'image')\\n | map(attribute='entity_id') | list }}\\n\"\n - delay: 1", "config": [ { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "indoor cameras group", "room": null, "type": "group", "id": { "entity_id": "group.indoor_cameras", "device_id": null } }, { "name": "front door camera", "room": "front", "type": "camera", "id": { "entity_id": "camera.front_door", "device_id": null } }, { "name": "Back Door Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.back_door", "device_id": null } }, { "name": "Back House Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.back_house", "device_id": null } }, { "name": "Back Yard Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.back_yard", "device_id": null } }, { "name": "Charlie Cam", "room": null, "type": "camera", "id": { "entity_id": "camera.charlie_cam", "device_id": null } }, { "name": "Front Driveway Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.front_driveway", "device_id": null } }, { "name": "Front Yard Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.front_yard", "device_id": null } }, { "name": "Garage Inside Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.garage_inside", "device_id": null } }, { "name": "Living Room Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.living_room", "device_id": null } }, { "name": "Patio Door Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.patio_door", "device_id": null } }, { "name": "Side Door Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.side_door", "device_id": null } }, { "name": "Side Driveway Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.side_driveway", "device_id": null } }, { "name": "Side Gate Back Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.side_gate_back", "device_id": null } }, { "name": "Side Gate Front Camera", "room": null, "type": "camera", "id": { "entity_id": "camera.side_gate_front", "device_id": null } } ] }, { "id": "update_energy_groups", "automation": "- id: update_energy_groups\n alias: Update Energy Groups\n description: Create and update groups.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - if: '{{ trigger.id == ''startup'' }}'\n then:\n - wait_template: \"{{ expand(integration_entities('shelly'))\\n | map(attribute='entity_id')\\n\\\n \\ | select('has_value') | list | count > 0 }}\\n\"\n timeout: 300\n - if: '{{ not wait.completed }}'\n then:\n - action: notify.persistent_notification\n data:\n title: Startup Error\n message: 'Power and energy groups did not load.\n\n Try reloading groups using Developer Tools.'\n - stop: Integration did not load.\n - action: group.set\n data:\n object_id: overpowering_sensors\n entities: \"{{ expand(integration_entities('shelly'))\\n | selectattr('entity_id',\\\n \\ 'contains', '_overpowering')\\n | map(attribute='entity_id') | sort }}\\n\"", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } } ] }, { "id": "update_fan_groups", "automation": "- id: update_fan_groups\n alias: Update Fan Groups\n description: Create and update groups.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - action: group.set\n data:\n object_id: fans\n entities: \"{{ states.fan\\n | selectattr('attributes.type', 'defined')\\n \\\n \\ | selectattr('attributes.type', 'in', ['ceiling', 'vent'])\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: ceiling_fans\n entities: \"{{ states.fan\\n | selectattr('attributes.type', 'defined')\\n \\\n \\ | selectattr('attributes.type', 'eq', 'ceiling')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: vent_fans\n entities: \"{{ states.fan\\n | selectattr('attributes.type', 'defined')\\n \\\n \\ | selectattr('attributes.type', 'eq', 'vent')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: fan_timers\n entities: \"{{ states.timer\\n | selectattr('attributes.type', 'defined')\\n\\\n \\ | selectattr('attributes.type', 'eq', 'fan')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } } ] }, { "id": "update_hass_groups", "automation": "- id: update_hass_groups\n alias: Update HASS Groups\n description: Create and update groups.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time_pattern\n minutes: /1\n actions:\n - action: group.set\n data:\n object_id: unknown_browsers\n entities: \"{{ expand('group.connected_browsers')\\n | rejectattr('entity_id',\\\n \\ 'in', label_entities('Authorized Browser'))\\n | map(attribute='entity_id')\\n\\\n \\ | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: offline_integrations\n entities: \"{{ expand('group.integration_connected_sensors') | selectattr('state',\\\n \\ 'in', ['off', 'unknown', 'unavailable'])\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: hass_alerts\n entities: \"{{ states.alert\\n | selectattr('attributes.category', 'in',\\n\\\n \\ ['hass', 'network', 'system', 'zwave', 'bluetooth'])\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: low_batteries\n entities: \"{% set low_batteries = namespace(value=[]) %} {% set batteries =\\\n \\ expand(integration_entities('battery_notes'))\\n | selectattr('domain',\\\n \\ 'eq', 'sensor')\\n | selectattr('attributes.device_class', 'eq', 'battery')\\n\\\n \\ | map(attribute='entity_id') | sort %}\\n{% for item in batteries %}\\n\\\n \\ {% if states(item) == 'on' or (states(item) | int(-1) != -1 and states(item)\\\n \\ | int(0)\\n < states('input_number.battery_alert_threshold') | int)\\\n \\ %}\\n {% set low_batteries.value = low_batteries.value + [item] %}\\n \\\n \\ {% endif %}\\n{% endfor %} {{ low_batteries.value }}\\n\"\n - action: group.set\n data:\n object_id: available_updates\n entities: \"{{ states.update\\n | selectattr('state', 'eq', 'on')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: connected_browsers\n entities: \"{{ states.sensor\\n | selectattr('entity_id', 'contains', '_browser_user')\\n\\\n \\ | rejectattr('entity_id', 'contains', '_browser_useragent')\\n | map(attribute='entity_id')\\\n \\ | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: integration_connected_sensors\n entities: \"{{ states.binary_sensor\\n | rejectattr('entity_id', 'in', label_entities('ignored'))\\n\\\n \\ | selectattr('entity_id', 'contains', '_integration_connected')\\n \\\n \\ | map(attribute='entity_id')\\n | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: add_on_memory_sensors\n entities: \"{{ expand(integration_entities('hassio'))\\n | selectattr('entity_id',\\\n \\ 'contains', '_memory_percent')\\n | rejectattr('entity_id', 'in', ['sensor.home_assistant_core_memory_percent',\\n\\\n \\ 'sensor.home_assistant_supervisor_memory_percent'])\\n | map(attribute='entity_id')\\n\\\n \\ | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: add_on_cpu_sensors\n entities: \"{{ expand(integration_entities('hassio'))\\n | selectattr('entity_id',\\\n \\ 'contains', '_cpu_percent')\\n | rejectattr('entity_id', 'in', ['sensor.home_assistant_core_cpu_percent',\\n\\\n \\ 'sensor.home_assistant_supervisor_cpu_percent'])\\n | map(attribute='entity_id')\\n\\\n \\ | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: google_home_timers\n entities: \"{{ states.sensor | selectattr('attributes.integration', 'eq', 'google_home')\\n\\\n \\ | selectattr('entity_id', 'contains', 'timer')\\n | map(attribute='entity_id')\\\n \\ | list\\n | select('has_value') | sort }}\\n\"\n - action: group.set\n data:\n object_id: occupancy_automations\n entities: \"{{ states.automation\\n | selectattr('entity_id', 'in', label_entities('Occupancy'))\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: presence_sensors\n entities:\n - binary_sensor.jason_home\n - binary_sensor.guest_home\n - action: group.set\n data:\n object_id: scene_switches\n entities: \"{{ states.switch | selectattr('attributes.type', 'eq', 'scene')\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: presence_override_controls\n entities:\n - input_boolean.jason_presence_override\n - action: group.set\n data:\n object_id: indoor_humidity_sensors\n entities:\n - sensor.thermostat_humidity\n - sensor.bathroom_sensor_humidity\n - sensor.living_room_sensor_humidity\n - sensor.bedroom_sensor_humidity\n - action: group.set\n data:\n object_id: indoor_temperature_sensors\n entities:\n - sensor.thermostat_temperature\n - sensor.living_room_sensor_temperature\n - sensor.bedroom_sensor_temperature", "config": [ { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "guest home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.guest_home", "device_id": null } }, { "name": "living room sensor temperature sensor", "room": "living room", "type": "sensor", "id": { "entity_id": "sensor.living_room_sensor_temperature", "device_id": null } }, { "name": "jason presence override", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_presence_override", "device_id": null } }, { "name": "Battery Alert Threshold Input Number", "room": null, "type": "input_number", "id": { "entity_id": "input_number.battery_alert_threshold", "device_id": null } } ] }, { "id": "update_notification_led_groups", "automation": "- id: update_notification_led_groups\n alias: Update Notification LED Groups\n description: Update LED notification groups.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - if:\n - condition: trigger\n id: startup\n then:\n - delay: 60\n - action: group.set\n data:\n object_id: notify_led\n entities: \"{{ states | selectattr('domain', 'in', ['light', 'switch'])\\n \\\n \\ | selectattr('attributes.notify_led', 'defined')\\n | selectattr('attributes.notify_led',\\\n \\ 'eq', true) | map(attribute='entity_id') | list }}\\n\"\n - delay: 1\n - condition: template\n value_template: '{{ state_attr(''group.notify_led'', ''entity_id'') != none }}'\n - action: group.set\n data:\n object_id: dimmer_led\n entities: \"{{ expand('group.notify_led') | selectattr('domain', 'eq', 'light')\\n\\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: switch_led\n entities: \"{{ expand('group.notify_led') | selectattr('domain', 'eq', 'switch')\\n\\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: alarm_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.alarm_led',\\\n \\ 'defined')\\n | selectattr('attributes.alarm_led', 'eq', true)\\n |\\\n \\ map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: presence_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.presence_led',\\\n \\ 'defined')\\n | selectattr('attributes.presence_led', 'eq', true)\\n \\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: scene_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.scene_led',\\\n \\ 'defined')\\n | selectattr('attributes.scene_led', 'eq', true)\\n |\\\n \\ map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: reminder_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.reminder_led',\\\n \\ 'defined')\\n | selectattr('attributes.reminder_led', 'eq', true)\\n \\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: garage_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.garage_led',\\\n \\ 'defined')\\n | selectattr('attributes.garage_led', 'eq', true)\\n |\\\n \\ map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: alarm_clock_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.alarm_clock_led',\\\n \\ 'defined')\\n | selectattr('attributes.alarm_clock_led', 'eq', true)\\n\\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: hass_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.hass_led',\\\n \\ 'defined')\\n | selectattr('attributes.hass_led', 'eq', true)\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n - action: group.set\n data:\n object_id: shower_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.shower_led',\\\n \\ 'defined')\\n | selectattr('attributes.shower_led', 'eq', true)\\n |\\\n \\ map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: media_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.media_led',\\\n \\ 'defined')\\n | selectattr('attributes.media_led', 'eq', true)\\n |\\\n \\ map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: weather_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.weather_led',\\\n \\ 'defined')\\n | selectattr('attributes.weather_led', 'eq', true)\\n \\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: commute_led\n entities: \"{{ expand('group.notify_led') | selectattr('attributes.commute_led',\\\n \\ 'defined')\\n | selectattr('attributes.commute_led', 'eq', true)\\n \\\n \\ | map(attribute='entity_id') | list }}\"", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } } ] }, { "id": "update_light_groups", "automation": "- id: update_light_groups\n alias: Update Light Groups\n description: Create and update groups.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - action: group.set\n data:\n object_id: lights\n entities: \"{{ states.light\\n | selectattr('attributes.type', 'defined')\\n\\\n \\ | selectattr('attributes.type', 'in', ['dimmer', 'switch', 'group'])\\n\\\n \\ | rejectattr('attributes.master', 'eq', true)\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: rgb_lights\n entities: \"{{ states.light\\n | selectattr('attributes.rgb', 'eq', true)\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: day_lux_lights\n entities: \"{{ states.light\\n | selectattr('attributes.day_lux', 'defined')\\n\\\n \\ | selectattr('attributes.day_lux', 'eq', true)\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n - action: group.set\n data:\n object_id: night_lux_lights\n entities: \"{{ states.light\\n | selectattr('attributes.night_lux', 'defined')\\n\\\n \\ | selectattr('attributes.night_lux', 'eq', true)\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n - action: group.set\n data:\n object_id: night_lights\n entities: \"{{ states.light\\n | selectattr('attributes.night', 'defined')\\n\\\n \\ | selectattr('attributes.night', 'eq', true)\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n - action: group.set\n data:\n object_id: away_lights\n entities: \"{{ states.light\\n | selectattr('attributes.away', 'eq', true)\\n\\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: night_away_lights\n entities: \"{{ states.light\\n | selectattr('attributes.night', 'defined')\\n\\\n \\ | selectattr('attributes.away', 'eq', true)\\n | selectattr('attributes.night',\\\n \\ 'eq', true)\\n | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: timed_lights\n entities: \"{{ states.light\\n | selectattr('attributes.timed', 'eq', true)\\n\\\n \\ | map(attribute='entity_id') | list }}\\n\"\n - action: group.set\n data:\n object_id: light_timers\n entities: \"{{ states.timer\\n | selectattr('attributes.type', 'defined')\\n\\\n \\ | selectattr('attributes.type', 'eq', 'light')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } } ] }, { "id": "update_media_groups", "automation": "- id: update_media_groups\n alias: Update Media Groups\n description: Create and update groups.\n mode: single\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - action: group.set\n data:\n object_id: media_launchers\n entities: \"{{ states.input_boolean\\n | selectattr('entity_id', 'contains',\\\n \\ 'input_boolean.media_launcher_')\\n | map(attribute='entity_id') | sort\\\n \\ }}\\n\"\n - action: group.set\n data:\n object_id: alarm_clock_launchers\n entities: \"{{ states.input_boolean\\n | selectattr('entity_id', 'contains',\\\n \\ 'input_boolean.alarm_clock_launcher_')\\n | map(attribute='entity_id')\\\n \\ | sort }}\\n\"\n - action: group.set\n data:\n object_id: alarm_clock_other_alarms\n entities:\n - sensor.bathroom_speaker_next_alarm\n - sensor.bedroom_hub_next_alarm\n - sensor.dining_room_hub_next_alarm\n - sensor.jason_phone_next_alarm\n - sensor.kitchen_hub_next_alarm\n - sensor.laundry_room_speaker_next_alarm\n - sensor.living_room_speaker_next_alarm\n - sensor.office_speaker_next_alarm", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } } ] }, { "id": "update_sprinkler_groups", "automation": "- id: update_sprinkler_groups\n alias: Update Sprinkler Groups\n description: Create and update groups.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - if: '{{ trigger.id == ''startup'' }}'\n then:\n - wait_template: \"{{ expand(integration_entities('hydrawise'))\\n | map(attribute='entity_id')\\n\\\n \\ | select('has_value') | list | count > 0 }}\\n\"\n timeout: 300\n - if: '{{ not wait.completed }}'\n then:\n - action: notify.persistent_notification\n data:\n title: Startup Error\n message: 'Sprinkler groups did not load.\n\n Try reloading groups using Developer Tools.'\n - action: group.set\n data:\n object_id: sprinkler_next_cycle\n entities: \"{{ expand(integration_entities('hydrawise'))\\n | selectattr('domain',\\\n \\ 'eq', 'sensor')\\n | selectattr('entity_id', 'contains', '_next_cycle')\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: sprinkler_current_cycle\n entities: \"{{ expand(integration_entities('hydrawise'))\\n | selectattr('domain',\\\n \\ 'eq', 'binary_sensor')\\n | selectattr('entity_id', 'contains', '_watering')\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: sprinkler_automatic_watering\n entities: \"{{ expand(integration_entities('hydrawise'))\\n | selectattr('domain',\\\n \\ 'eq', 'switch')\\n | selectattr('entity_id', 'contains', '_automatic_watering')\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"\n - action: group.set\n data:\n object_id: sprinkler_remaining_time\n entities: \"{{ expand(integration_entities('hydrawise'))\\n | selectattr('domain',\\\n \\ 'eq', 'sensor')\\n | selectattr('entity_id', 'contains', '_remaining_watering_time')\\n\\\n \\ | map(attribute='entity_id') | sort }}\\n\"", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } } ] }, { "id": "update_time_to_home", "automation": "- id: update_time_to_home\n alias: Update Time To Home\n description: Increase update interval during commute times.\n triggers:\n - trigger: time_pattern\n minutes: /2\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.home_commute_active\n - binary_sensor.wan\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.jason_phone_connected\n state: 'on'\n - not:\n - condition: state\n entity_id: binary_sensor.jason_home\n state: 'on'\n - condition: state\n entity_id: sensor.jason_time_to_home\n state:\n - unknown\n - unavailable\n then:\n - action: homeassistant.update_entity\n target:\n entity_id: sensor.jason_time_to_home", "config": [ { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "home commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.home_commute_active", "device_id": null } }, { "name": "jason phone connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_phone_connected", "device_id": null } }, { "name": "wan binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wan", "device_id": null } }, { "name": "homeassistant update entity service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.update_entity", "device_id": null } }, { "name": "jason time to home sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jason_time_to_home", "device_id": null } } ] }, { "id": "update_time_to_home_not_commute", "automation": "- id: update_time_to_home_not_commute\n alias: Update Time To Home Not Commute\n description: Increase update interval when not home during non commute times.\n triggers:\n - trigger: time_pattern\n minutes: /5\n conditions:\n - condition: state\n entity_id: binary_sensor.commute_active\n state: 'off'\n - condition: state\n entity_id: binary_sensor.wan\n state: 'on'\n - condition: state\n entity_id: binary_sensor.jason_home\n state: 'off'\n - not:\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Vacation\n actions:\n - if:\n - not:\n - condition: state\n entity_id: binary_sensor.jason_home\n state: 'on'\n - condition: state\n entity_id: sensor.jason_time_to_home\n state:\n - unknown\n - unavailable\n - condition: state\n entity_id: person.jason\n state:\n - Work\n - home\n then:\n - action: homeassistant.update_entity\n target:\n entity_id: sensor.jason_time_to_home", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.commute_active", "device_id": null } }, { "name": "wan binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wan", "device_id": null } }, { "name": "homeassistant update entity service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.update_entity", "device_id": null } }, { "name": "jason time to home sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jason_time_to_home", "device_id": null } } ] }, { "id": "update_time_to_work", "automation": "- id: update_time_to_work\n alias: Update Commute Time To Work\n description: Increase update interval during commute times.\n triggers:\n - trigger: time_pattern\n minutes: /2\n conditions:\n - condition: state\n entity_id:\n - binary_sensor.work_commute_active\n - binary_sensor.wan\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.jason_phone_connected\n state: 'on'\n - not:\n - condition: state\n entity_id: person.jason\n state: Work\n - condition: state\n entity_id: sensor.jason_time_to_work\n state:\n - unknown\n - unavailable\n then:\n - action: homeassistant.update_entity\n target:\n entity_id: sensor.jason_time_to_work", "config": [ { "name": "jason person", "room": null, "type": "person", "id": { "entity_id": "person.jason", "device_id": null } }, { "name": "work commute active binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_commute_active", "device_id": null } }, { "name": "jason phone connected binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_phone_connected", "device_id": null } }, { "name": "wan binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wan", "device_id": null } }, { "name": "homeassistant update entity service", "room": null, "type": "service", "id": { "entity_id": "homeassistant.update_entity", "device_id": null } }, { "name": "jason time to work sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.jason_time_to_work", "device_id": null } } ] }, { "id": "update_zwave_groups", "automation": "- id: update_zwave_groups\n alias: Update ZWave Groups\n description: Create and update groups.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n id: startup\n event: start\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time\n at: input_datetime.day_reset\n actions:\n - action: group.set\n data:\n object_id: zwave_node_sensors\n entities: \"{{ expand(integration_entities('zwave_js'))\\n | selectattr('entity_id',\\\n \\ 'contains', 'node_status')\\n | map(attribute=\\\"entity_id\\\") | sort }}\\n\"\n - action: group.set\n data:\n object_id: zwave_entities\n entities: \"{{ states\\n | selectattr('attributes.node_id', 'defined')\\n \\\n \\ | map(attribute=\\\"entity_id\\\") | sort }}\"", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } } ] }, { "id": "waketime", "automation": "- id: waketime\n alias: Waketime\n description: Run wake up routine.\n triggers:\n - trigger: template\n value_template: \"{% if has_value('sensor.next_waketime') %}\\n {{ now().replace(second=0,\\\n \\ microsecond=0) == (states('sensor.next_waketime') | as_datetime)\\n -\\\n \\ timedelta(minutes=1) }}\\n{% endif %}\\n\"\n conditions:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n - condition: state\n entity_id: input_boolean.alarm_triggered\n state: 'off'\n - condition: or\n conditions:\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.work_today\n state: 'on'\n - condition: state\n entity_id: input_boolean.workday_morning\n state: 'on'\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.work_today\n state: 'off'\n - condition: state\n entity_id: input_boolean.weekend_morning\n state: 'on'\n - condition: and\n conditions:\n - condition: state\n entity_id: binary_sensor.owner_home\n state: 'off'\n - condition: state\n entity_id: input_boolean.guest_morning\n state: 'on'\n actions:\n - delay: 60\n - action: script.waketime\n data:\n alarm_delay: true", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "alarm triggered", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.alarm_triggered", "device_id": null } }, { "name": "waketime script", "room": null, "type": "script", "id": { "entity_id": "script.waketime", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "next waketime sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_waketime", "device_id": null } }, { "name": "workday morning input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.workday_morning", "device_id": null } }, { "name": "weekend morning input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.weekend_morning", "device_id": null } }, { "name": "guest morning input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.guest_morning", "device_id": null } }, { "name": "Work Today Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_today", "device_id": null } } ] }, { "id": "wan_down", "automation": "- id: wan_down\n alias: WAN Down\n description: WAN down.\n mode: queued\n triggers:\n - trigger: state\n entity_id: alert.wan_offline\n to:\n - idle\n - 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.network_alerts\n state: 'on'\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.wan\n state: 'off'\n then:\n - if:\n - condition: state\n entity_id: binary_sensor.piper_running\n state: 'off'\n then:\n - action: hassio.addon_start\n data:\n addon: core_piper\n - wait_template: '{{ is_state(''binary_sensor.piper_running'', ''on'') }}'\n timeout:\n minutes: 5\n - repeat:\n while:\n - condition: state\n entity_id: alert.wan_offline\n state: 'on'\n sequence:\n - action: script.tts_play\n data:\n message: Attention! The internet is offline!\n min_volume: 70\n quiet_play: true\n - wait_template: '{{ is_state(''alert.wan_offline'', [''idle'', ''off''])\n }}'\n timeout:\n minutes: 15\n else:\n - action: script.tts_play\n data:\n message: The internet is back online!\n provider: HASS\n language: English (USA)\n voice: Jenny:excited\n min_volume: 70\n quiet_play: true", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "wan offline alert", "room": null, "type": "alert", "id": { "entity_id": "alert.wan_offline", "device_id": null } }, { "name": "wan binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.wan", "device_id": null } }, { "name": "piper running binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.piper_running", "device_id": null } }, { "name": "Network Alerts Input Boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.network_alerts", "device_id": null } } ] }, { "id": "turn_waste_collection_on", "automation": "- id: turn_waste_collection_on\n alias: Turn Waste Collection On\n description: Turn on waste collection alert boolean.\n mode: parallel\n variables:\n waste_types: '{{ [''garbage'', ''organic_waste'', ''recycle'', ''yard_waste'']\n }}'\n active_types: \"{% set types = namespace(value = []) %} {% for type in waste_types\\\n \\ %}\\n {% if is_state_attr('sensor.next_' ~ type ~ '_day', 'display', 'Tomorrow')\\\n \\ %}\\n {% set types.value = types.value + [type] %}\\n {% endif %}\\n{% endfor\\\n \\ %} {{ types.value }}\\n\"\n triggers:\n - trigger: state\n entity_id:\n - sensor.next_garbage_day\n - sensor.next_organic_waste_day\n - sensor.next_recycle_day\n - sensor.next_yard_waste_day\n attribute: display\n to: Tomorrow\n - trigger: state\n entity_id:\n - sensor.next_garbage_day\n - sensor.next_organic_waste_day\n - sensor.next_recycle_day\n - sensor.next_yard_waste_day\n attribute: display\n from: Tomorrow\n actions:\n - repeat:\n count: '{{ waste_types | count }}'\n sequence:\n - variables:\n waste_type: '{{ waste_types[repeat.index - 1] }}'\n - if: '{{ waste_type in active_types }}'\n then:\n - action: input_boolean.turn_{{ iif(waste_type in active_types, 'on', 'off')\n }}\n target:\n entity_id: input_boolean.{{ waste_type }}_alert", "config": [ { "name": "next garbage day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_garbage_day", "device_id": null } }, { "name": "next organic waste day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_organic_waste_day", "device_id": null } }, { "name": "next recycle day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_recycle_day", "device_id": null } }, { "name": "next yard waste day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_yard_waste_day", "device_id": null } } ] }, { "id": "waste_collection_notification", "automation": "- id: waste_collection_notification\n alias: Waste Collection Notification\n description: Play TTS announcement.\n triggers:\n - trigger: time\n at: '11:00'\n - trigger: time\n at: '17:00'\n - trigger: time\n at: '21:00'\n actions:\n - variables:\n waste_types: '{{ [''garbage'', ''organic_waste'', ''recycle'', ''yard_waste'']\n }}'\n active_types: \"{% set types = namespace(value = []) %} {% for type in waste_types\\\n \\ %}\\n {% if is_state_attr('sensor.next_' ~ type ~ '_day', 'display', 'Tomorrow')\\n\\\n \\ and is_state('input_boolean.' ~ type ~ 'alert', 'on') %}\\n {% set\\\n \\ types.value = types.value + [type] %}\\n {% endif %}\\n{% endfor %} {{ types.value\\\n \\ }}\\n\"\n - if: '{{ active_types | count > 0 }}'\n then:\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: '{% from ''speech_helpers.jinja'' import array_to_clist %} Hey\n Jason, don''t forget to take out the {{ array_to_clist(active_types) |\n replace(''_'', '' '') }} today\n\n '\n provider: HASS\n language: English (USA)\n voice: Jenny:angry\n quiet_play: true\n save_message: true\n continue_on_error: true\n - condition: state\n entity_id: input_boolean.schedule_alerts\n state: 'on'\n - repeat:\n count: '{{ active_types | count }}'\n sequence:\n - variables:\n waste_type: '{{ active_types[repeat.index - 1] }}'\n - if:\n - alias: Waste alert boolean is on\n condition: template\n value_template: '{{ is_state(''input_boolean.'' ~ waste_type ~ ''_alert'',\n ''on'') }}'\n then:\n - action: notify.jason\n data:\n message: '{{ waste_type | title ~'' Day is tomorrow'' }}'\n data:\n tag: '{{ waste_type }}_collection'\n group: Reminder\n channel: General\n visibility: public\n persistent: true\n sticky: false\n timeout: 86400\n notification_icon: '{{ state_attr(''sensor.next_'' ~ waste_type ~ ''_day'',\n ''icon'') }}'\n icon_url: /local/images/notification/{{ waste_type }}_icon.png\n image: /local/images/notification/{{ waste_type }}_image.png\n clickAction: secret WASTE_SCHEDULE\n actions:\n - title: '{{ waste_type | title }} Done'\n action: '{{ waste_type }}_done'", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "schedule alerts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.schedule_alerts", "device_id": null } } ] }, { "id": "yard_waste_warning", "automation": "- id: yard_waste_warning\n alias: Yard Waste Warning\n description: Notification of yard waste day this week.\n triggers:\n - trigger: state\n entity_id: sensor.next_yard_waste_day\n attribute: warning\n to: true\n conditions:\n - condition: state\n entity_id: input_boolean.schedule_alerts\n state: 'on'\n actions:\n - action: notify.jason\n data:\n message: Yard Waste collection is this week\n data:\n tag: yard_waste_collection\n group: Reminder\n channel: General\n visibility: public\n persistent: false\n sticky: false\n timeout: 86400\n notification_icon: '{{ state_attr(''sensor.next_yard_waste_day'', ''icon'')\n }}'\n icon_url: /local/images/notification/yard_waste_icon.png\n image: /local/images/notification/yard_waste_image.png\n clickAction: secret WASTE_SCHEDULE\n actions:\n - title: Yard Waste Done\n action: yard_waste_done", "config": [ { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "next yard waste day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_yard_waste_day", "device_id": null } }, { "name": "schedule alerts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.schedule_alerts", "device_id": null } } ] }, { "id": "clear_waste_collection_notification", "automation": "- id: clear_waste_collection_notification\n alias: Clear Waste Collection Notification\n description: Turn off alert, clear notification.\n mode: parallel\n variables:\n waste_types: '{{ [''garbage'', ''organic_waste'', ''recycle'', ''yard_waste'']\n }}'\n waste_type: \"{% if trigger.id in waste_types %} {{ trigger.id }} {% elif trigger.entity_id\\\n \\ is defined %}\\n {% if 'garbage' in trigger.entity_id %} garbage\\n {% elif\\\n \\ 'organic_waste' in trigger.entity_id %} organic_waste\\n {% elif 'recycle'\\\n \\ in trigger.entity_id %} recycle\\n {% elif 'yard_waste' in trigger.entity_id\\\n \\ %} yard_waste\\n {% endif %}\\n{% endif %}\\n\"\n triggers:\n - trigger: state\n id: alert\n entity_id:\n - input_boolean.garbage_alert\n - input_boolean.organic_waste_alert\n - input_boolean.recycle_alert\n - input_boolean.yard_waste_alert\n to: 'off'\n - trigger: state\n id: sensor\n entity_id:\n - sensor.next_garbage_day\n - sensor.next_organic_waste_day\n - sensor.next_recycle_day\n - sensor.next_yard_waste_day\n attribute: display\n from: Tomorrow\n not_to:\n - unknown\n - unavailable\n - trigger: event\n id: garbage\n event_type: mobile_app_notification_action\n event_data:\n action: garbage_done\n - trigger: event\n id: organic_waste\n event_type: mobile_app_notification_action\n event_data:\n action: organic_waste_done\n - trigger: event\n id: recycle\n event_type: mobile_app_notification_action\n event_data:\n action: recycle_done\n - trigger: event\n id: yard_waste\n event_type: mobile_app_notification_action\n event_data:\n action: yard_waste_done\n conditions:\n - condition: state\n entity_id: input_boolean.schedule_alerts\n state: 'on'\n actions:\n - if: '{{ trigger.id in [''sensor'', ''alert''] or trigger.id in waste_types }}'\n then:\n - if: '{{ trigger.id = ''alert'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.{{ waste_type }}_alert\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: '{{ waste_type }}_collection'\n else:\n - repeat:\n count: '{{ waste_types | count }}'\n sequence:\n - variables:\n waste_type: '{{ waste_types[repeat.index - 1] }}'\n - if:\n - alias: Waste sensor is off\n condition: template\n value_template: '{{ not is_state_attr(''sensor.next_'' ~ waste_type ~\n ''_day'', ''display'', ''Tomorrow'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.{{ waste_type }}_alert\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: '{{ waste_type }}_collection'", "config": [ { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "next garbage day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_garbage_day", "device_id": null } }, { "name": "next organic waste day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_organic_waste_day", "device_id": null } }, { "name": "next recycle day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_recycle_day", "device_id": null } }, { "name": "next yard waste day sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.next_yard_waste_day", "device_id": null } }, { "name": "garbage alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garbage_alert", "device_id": null } }, { "name": "organic waste alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.organic_waste_alert", "device_id": null } }, { "name": "recycle alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.recycle_alert", "device_id": null } }, { "name": "yard waste alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.yard_waste_alert", "device_id": null } }, { "name": "schedule alerts input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.schedule_alerts", "device_id": null } } ] }, { "id": "turn_water_plants_on", "automation": "- id: turn_water_plants_on\n alias: Turn Water Plants On\n description: Turn on reminder active boolean.\n triggers:\n - trigger: template\n value_template: \"{% if is_state('input_boolean.water_plants_enabled', 'on')\\n\\\n \\ and not is_state('input_select.occupancy_mode','Vacation') %}\\n {% set\\\n \\ time = states('sensor.time') %}\\n {% set shift = state_attr('sensor.work_status',\\\n \\ 'shift') %}\\n {% set last_run = states('button.water_plants_done') %}\\n \\\n \\ {{ ((shift == 'Days' and time == states('input_datetime.water_plants_days')[0:5])\\n\\\n \\ or (shift == 'Afternoons' and time == states('input_datetime.water_plants_afternoons')[0:5])\\n\\\n \\ or (shift == 'Off' and time == states('input_datetime.water_plants_weekends')[0:5]))\\n\\\n \\ and (last_run == 'unknown' or (now().date()- (last_run | as_datetime).date()).days\\n\\\n \\ >= states('input_number.water_plants_day_interval') | int) }}\\n{% endif\\\n \\ %}\\n\"\n action:\n - if: '{{ is_state(''input_boolean.water_plants_active'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.water_plants_active\n - if: '{{ is_state(''input_boolean.water_plants_paused'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.water_plants_paused\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.water_plants_paused\n - if: '{{ is_state(''input_boolean.water_plants_skipped'', ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.water_plants_skipped\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.water_plants_active", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "work status sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_status", "device_id": null } }, { "name": "time sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.time", "device_id": null } }, { "name": "water plants enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_enabled", "device_id": null } }, { "name": "water plants done button", "room": null, "type": "button", "id": { "entity_id": "button.water_plants_done", "device_id": null } }, { "name": "water plants days datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.water_plants_days", "device_id": null } }, { "name": "water plants afternoons datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.water_plants_afternoons", "device_id": null } }, { "name": "water plants weekends datetime", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.water_plants_weekends", "device_id": null } }, { "name": "water plants day interval", "room": null, "type": "input_number", "id": { "entity_id": "input_number.water_plants_day_interval", "device_id": null } }, { "name": "water plants active", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_active", "device_id": null } }, { "name": "water plants paused", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_paused", "device_id": null } }, { "name": "water plants skipped", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_skipped", "device_id": null } } ] }, { "id": "water_plants_done", "automation": "- id: water_plants_done\n alias: Water Plants Done\n description: Mark reminder completed.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: water_plants_done\n condition:\n - condition: state\n entity_id: input_boolean.water_plants_active\n state: 'on'\n action:\n - action: button.press\n target:\n entity_id: button.water_plants_done", "config": [ { "name": "water plants done button", "room": null, "type": "button", "id": { "entity_id": "button.water_plants_done", "device_id": null } }, { "name": "water plants active", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_active", "device_id": null } } ] }, { "id": "skip_water_plants", "automation": "- id: skip_water_plants\n alias: Skip Water Plants\n description: Skip reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: skip_water_plants\n action:\n - action: button.press\n target:\n entity_id: button.skip_water_plants", "config": [ { "name": "skip water plants button", "room": null, "type": "button", "id": { "entity_id": "button.skip_water_plants", "device_id": null } } ] }, { "id": "pause_water_plants", "automation": "- id: pause_water_plants\n alias: Pause Water Plants\n description: Pause reminder.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: pause_water_plants\n action:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.water_plants_paused", "config": [ { "name": "water plants paused", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_paused", "device_id": null } } ] }, { "id": "reset_pause_water_plants", "automation": "- id: reset_pause_water_plants\n alias: Reset Pause Water Plants\n description: Reset reminder paused boolean.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.water_plants_skipped\n to: 'on'\n - trigger: state\n entity_id: input_boolean.water_plants_paused\n to: 'on'\n for:\n hours: 24\n - trigger: state\n entity_id: binary_sensor.owner_home\n to: 'on'\n for:\n minutes: 15\n condition:\n - condition: state\n entity_id: input_boolean.water_plants_paused\n state: 'on'\n action:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.water_plants_paused", "config": [ { "name": "owner home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.owner_home", "device_id": null } }, { "name": "water plants paused", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_paused", "device_id": null } }, { "name": "water plants skipped", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_skipped", "device_id": null } } ] }, { "id": "reset_water_plants_booleans", "automation": "- id: reset_water_plants_booleans\n alias: Reset Water Plants Booleans\n description: Reset reminder booleans if reminder disabled, completed, or not active.\n max_exceeded: silent\n triggers:\n - trigger: state\n id: enabled\n entity_id: input_boolean.water_plants_enabled\n to: 'off'\n - trigger: state\n id: done\n entity_id: input_boolean.water_plants_active\n to: 'off'\n - trigger: state\n id: entity\n entity_id: &id016\n - input_boolean.water_plants_active\n - input_boolean.water_plants_paused\n - input_boolean.water_plants_skipped\n to: 'on'\n condition:\n - condition: or\n conditions:\n - condition: state\n entity_id: input_boolean.water_plants_enabled\n state: 'off'\n - condition: template\n alias: Pause boolean turned on when reminder is skipped or isn't active\n value_template: \"{{ trigger.entity_id == 'input_boolean.water_plants_paused'\\n\\\n \\ and (is_state('input_boolean.water_plants_active', 'off')\\n or is_state('input_boolean.water_plants_skipped',\\\n \\ 'on')) }}\\n\"\n - condition: template\n alias: Reminder completed\n value_template: '{{ trigger.id == ''done'' }}'\n action:\n - if: '{{ trigger.id == ''entity'' }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n else:\n - action: input_boolean.turn_off\n target:\n entity_id: *id016", "config": [ { "name": "water plants enabled", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_enabled", "device_id": null } }, { "name": "water plants active", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_active", "device_id": null } }, { "name": "water plants paused", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_paused", "device_id": null } }, { "name": "water plants skipped", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_skipped", "device_id": null } } ] }, { "id": "water_plants_notification", "automation": "- id: water_plants_notification\n alias: Water Plants Notification\n description: Send notification until reminder is off.\n max_exceeded: silent\n triggers:\n - trigger: homeassistant\n event: start\n - trigger: state\n entity_id: input_boolean.water_plants_active\n to: 'on'\n - trigger: state\n entity_id: input_boolean.water_plants_paused\n to: 'off'\n condition:\n - condition: state\n entity_id: input_boolean.water_plants_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.water_plants_paused\n state: 'off'\n action:\n - repeat:\n sequence:\n - if: '{{ not is_state(''input_select.occupancy_mode'', ''Night'') }}'\n then:\n - action: notify.jason\n data:\n message: Water Your Plants\n data:\n tag: water_plants_reminder\n group: Reminder\n visibility: public\n persistent: true\n notification_icon: mdi:sprout\n icon_url: secret PLANT_ICON\n actions:\n - title: Pause\n action: pause_water_plants\n - title: Skip\n action: skip_water_plants\n - title: Done\n action: water_plants_done\n - wait_template: \"{{ is_state('input_boolean.water_plants_active', 'off')\\n\\\n \\ or is_state('input_boolean.water_plants_paused', 'on') }}\\n\"\n timeout:\n minutes: 2\n - if:\n - condition: state\n entity_id: input_boolean.water_plants_active\n state: 'on'\n - condition: state\n entity_id: input_boolean.water_plants_paused\n state: 'off'\n then:\n - action: script.turn_on\n continue_on_error: true\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: 'Hey Jason, your plants are a little thirsty\n\n You should think about giving them a little drink today.'\n quiet_play: true\n - wait_template: \"{{ is_state('input_boolean.water_plants_active', 'off')\\n\\\n \\ or is_state('input_boolean.water_plants_paused', 'on') }}\\n\"\n timeout:\n minutes: '{{ states(''input_number.water_plants_notification_interval'')\n | int }}'\n until:\n - or:\n - condition: state\n entity_id: input_boolean.water_plants_active\n state: 'off'\n - condition: state\n entity_id: input_boolean.water_plants_paused\n state: 'on'", "config": [ { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "water plants active", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_active", "device_id": null } }, { "name": "water plants paused", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_paused", "device_id": null } }, { "name": "water plants notification interval", "room": null, "type": "input_number", "id": { "entity_id": "input_number.water_plants_notification_interval", "device_id": null } } ] }, { "id": "clear_water_plants_notification", "automation": "- id: clear_water_plants_notification\n alias: Clear Water Plants Notification\n description: Clear reminder notification.\n max_exceeded: silent\n triggers:\n - trigger: state\n entity_id: input_boolean.water_plants_active\n to: 'off'\n - trigger: state\n entity_id:\n - input_boolean.water_plants_paused\n - input_boolean.water_plants_skipped\n to: 'on'\n action:\n - action: notify.jason\n data:\n message: clear_notification\n data:\n tag: water_plants_reminder", "config": [ { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "water plants active", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_active", "device_id": null } }, { "name": "water plants paused", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_paused", "device_id": null } }, { "name": "water plants skipped", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.water_plants_skipped", "device_id": null } } ] }, { "id": "work_commute_alert", "automation": "- id: work_commute_alert\n alias: Work Commute Alert\n description: Play announcement when alert turns on.\n mode: restart\n variables:\n person: '{% from ''presence.jinja'' import trigger_person %} {{ trigger_person(trigger)\n }}\n\n '\n triggers:\n - trigger: state\n entity_id:\n - alert.work_commute_jason\n - alert.late_for_work_jason\n to: 'on'\n conditions:\n - condition: state\n entity_id: binary_sensor.jason_home\n state: 'on'\n actions:\n - if: '{{ trigger.entity_id == ''alert.work_commute_jason'' }}'\n then:\n - action: button.press\n target:\n entity_id: button.jason_phone_open_mobile_app\n - delay: 10\n - action: browser_mod.navigate\n data:\n path: /ui-kiosk/traffic\n browser_id: kiosk\n - repeat:\n sequence:\n - if: '{{ repeat.index == 1 or is_state(''timer.dining_room_light'', ''idle'')\n }}'\n then:\n - action: script.work_commute_lights\n - action: script.turn_on\n target:\n entity_id: script.tts_play\n data:\n variables:\n message: '{%- if trigger.entity_id == ''alert.late_for_work_jason'' %}\n\n Attention! {{ person | title }}! It is now {{ now().strftime(''%-I:%M\n %p'') }}!\n\n {%- endif %}\n\n {%- from ''schedule.jinja'' import leave_home_time %}\n\n {{ leave_home_time(''jason'') }}\n\n '\n media_player: media_player.inside_speakers\n provider: HASS\n language: English (USA)\n voice: Jane:shouting\n min_volume: 60\n quiet_play: true\n continue_on_error: true\n - wait_template: '{{ not is_state(trigger.entity_id, ''on'') }}'\n timeout:\n minutes: '{{ iif(trigger.entity_id == ''alert.late_for_work_jason'', 5,\n 15) }}'\n until:\n - condition: template\n value_template: '{{ not is_state(trigger.entity_id, ''on'') }}'\n - if:\n - condition: state\n entity_id: sensor.kiosk_tablet_current_page\n state: http://192.168.1.100:8123/ui-kiosk/traffic\n then:\n - action: browser_mod.navigate\n data:\n path: /ui-kiosk/home\n browser_id: kiosk", "config": [ { "name": "tts play script", "room": null, "type": "script", "id": { "entity_id": "script.tts_play", "device_id": null } }, { "name": "jason home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.jason_home", "device_id": null } }, { "name": "work commute lights script", "room": null, "type": "script", "id": { "entity_id": "script.work_commute_lights", "device_id": null } }, { "name": "inside speakers media player", "room": null, "type": "media_player", "id": { "entity_id": "media_player.inside_speakers", "device_id": null } }, { "name": "dining room light timer", "room": "dining room", "type": "timer", "id": { "entity_id": "timer.dining_room_light", "device_id": null } }, { "name": "browser mod navigate service", "room": null, "type": "service", "id": { "entity_id": "browser_mod.navigate", "device_id": null } }, { "name": "kiosk browser id", "room": null, "type": "browser", "id": { "entity_id": null, "device_id": "kiosk" } }, { "name": "kiosk tablet current page sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.kiosk_tablet_current_page", "device_id": null } }, { "name": "work commute jason alert", "room": null, "type": "alert", "id": { "entity_id": "alert.work_commute_jason", "device_id": null } }, { "name": "late for work jason alert", "room": null, "type": "alert", "id": { "entity_id": "alert.late_for_work_jason", "device_id": null } }, { "name": "jason phone open mobile app button", "room": null, "type": "button", "id": { "entity_id": "button.jason_phone_open_mobile_app", "device_id": null } } ] }, { "id": "set_day_shift", "automation": "- id: set_day_shift\n alias: Set Day Shift\n description: Set day work shift.\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: set_day_shift\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.work_shift_override\n - action: input_select.select_option\n target:\n entity_id: input_select.current_work_shift\n data:\n option: Days", "config": [ { "name": "work shift override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_shift_override", "device_id": null } }, { "name": "current work shift select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.current_work_shift", "device_id": null } } ] }, { "id": "set_afternoon_shift", "automation": "- id: set_afternoon_shift\n alias: Set Afternoon Shift\n description: Set afternoon work shift.\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: set_aft_shift\n actions:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.work_shift_override\n - action: input_select.select_option\n target:\n entity_id: input_select.current_work_shift\n data:\n option: Afternoons", "config": [ { "name": "work shift override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_shift_override", "device_id": null } }, { "name": "current work shift select", "room": null, "type": "input_select", "id": { "entity_id": "input_select.current_work_shift", "device_id": null } } ] }, { "id": "work_schedule_changed", "automation": "- id: work_schedule_changed\n alias: Work Schedule Changed\n description: Reset work schedule settings, send notification.\n mode: restart\n triggers:\n - trigger: state\n id: startup\n entity_id: input_boolean.startup_pending\n to: 'off'\n - trigger: state\n id: schedule\n entity_id:\n - input_boolean.work_schedule\n - binary_sensor.work_holiday\n - binary_sensor.work_layoff\n - binary_sensor.work_vacation\n to:\n - 'on'\n - 'off'\n from:\n - 'on'\n - 'off'\n for: 1\n - trigger: state\n id: shift\n entity_id: sensor.work_shift_today\n to:\n - 'Off'\n - Days\n - Afternoons\n from:\n - 'Off'\n - Days\n - Afternoons\n for: 1\n conditions:\n - condition: state\n entity_id: input_boolean.startup_pending\n state: 'off'\n - or:\n - condition: state\n entity_id: input_boolean.work_schedule\n state: 'off'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n actions:\n - if:\n - or:\n - condition: trigger\n id: schedule\n - condition: state\n entity_id: input_boolean.work_schedule\n state: 'off'\n - condition: state\n entity_id:\n - binary_sensor.work_holiday\n - binary_sensor.work_layoff\n - binary_sensor.work_vacation\n match: any\n state: 'on'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id:\n - input_boolean.saturday_workday\n - input_boolean.sunday_workday\n - input_boolean.holiday_workday\n - condition: state\n entity_id: input_boolean.work_schedule\n state: 'off'\n - action: input_boolean.turn_off\n target:\n entity_id:\n - input_boolean.work_today_on\n - input_boolean.work_today_off\n - input_boolean.work_tomorrow_on\n - input_boolean.work_tomorrow_off\n - input_boolean.work_shift_override\n - input_boolean.work_schedule_lock\n - condition: template\n alias: Trigger is not startup\n value_template: '{{ trigger.id = ''startup'' }}'\n - delay: 15\n - action: notify.jason\n data:\n title: Work Schedule\n message: 'Work Schedule: {{ states(''input_boolean.work_schedule'') | title\n }}\n\n Work Today: {{ states(''binary_sensor.work_today'') | title }}\n\n Today Shift: {{ states(''sensor.scheduled_shift_today'') | title }}\n\n Work Tomorrow: {{ states(''binary_sensor.work_tomorrow'') | title }}\n\n Tomorrow Shift: {{ states(''sensor.scheduled_shift_tomorrow'') | title }}\n\n Holiday: {{ states(''binary_sensor.work_holiday'') | title }}\n\n Layoff: {{ states(''binary_sensor.work_layoff'') | title }}\n\n Vacation: {{ states(''binary_sensor.work_vacation'') | title }}\n\n '\n data:\n tag: work_schedule\n visibility: public\n timeout: 86400\n notification_icon: mdi:factory\n icon_url: secret WORK_ICON\n clickAction: /ui-mobile/work-schedule\n actions:\n - title: Set {{ iif(is_state('sensor.scheduled_shift_today', 'Afternoons'),\n 'Days', 'Afts') }}\n action: '{{ iif(is_state(''sensor.scheduled_shift_today'', ''Afternoons''),\n ''set_day_shift'', ''set_aft_shift'') }}'\n - title: Today {{ iif(is_state('binary_sensor.work_today', 'on'), 'Off', 'On')\n }}\n action: work_today_toggle", "config": [ { "name": "startup pending", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.startup_pending", "device_id": null } }, { "name": "work tomorrow", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_tomorrow", "device_id": null } }, { "name": "jason medication notification", "room": null, "type": "notify", "id": { "entity_id": "notify.jason", "device_id": null } }, { "name": "work shift override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_shift_override", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work holiday binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_holiday", "device_id": null } }, { "name": "work layoff binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_layoff", "device_id": null } }, { "name": "work vacation binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_vacation", "device_id": null } }, { "name": "work shift today sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.work_shift_today", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "saturday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.saturday_workday", "device_id": null } }, { "name": "sunday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.sunday_workday", "device_id": null } }, { "name": "holiday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.holiday_workday", "device_id": null } }, { "name": "work today on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_on", "device_id": null } }, { "name": "work today off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_off", "device_id": null } }, { "name": "work tomorrow on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_on", "device_id": null } }, { "name": "work tomorrow off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_off", "device_id": null } }, { "name": "scheduled shift today sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.scheduled_shift_today", "device_id": null } }, { "name": "scheduled shift tomorrow sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.scheduled_shift_tomorrow", "device_id": null } }, { "name": "Work Today Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_today", "device_id": null } } ] }, { "id": "work_setting_reset", "automation": "- id: work_setting_reset\n alias: Work Settings Reset\n description: Turn work setting off if work schedule off.\n mode: parallel\n triggers:\n - trigger: state\n id: toggle\n entity_id:\n - input_boolean.saturday_workday\n - input_boolean.sunday_workday\n - input_boolean.holiday_workday\n - input_boolean.work_today_on\n - input_boolean.work_today_off\n - input_boolean.work_tomorrow_on\n - input_boolean.work_tomorrow_off\n to: 'on'\n - trigger: state\n entity_id:\n - input_boolean.work_schedule_lock\n - input_boolean.work_shift_override\n to: 'on'\n conditions:\n - or:\n - condition: state\n entity_id: input_boolean.work_schedule\n state: 'off'\n - condition: state\n entity_id: binary_sensor.work_layoff\n state: 'on'\n - condition: state\n entity_id: binary_sensor.work_vacation\n state: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ trigger.entity_id }}'\n continue_on_error: true\n - action: browser_mod.notification\n data:\n duration: 10000\n message: Work setting cannot be enabled. Work schedule is not enabled or work\n layoff/vacation is on.\n continue_on_error: true", "config": [ { "name": "browser mod notification service", "room": null, "type": null, "id": { "entity_id": "browser_mod.notification", "device_id": null } }, { "name": "work shift override input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_shift_override", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work layoff binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_layoff", "device_id": null } }, { "name": "work vacation binary sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_vacation", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "saturday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.saturday_workday", "device_id": null } }, { "name": "sunday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.sunday_workday", "device_id": null } }, { "name": "holiday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.holiday_workday", "device_id": null } }, { "name": "work today on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_on", "device_id": null } }, { "name": "work today off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_off", "device_id": null } }, { "name": "work tomorrow on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_on", "device_id": null } }, { "name": "work tomorrow off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_off", "device_id": null } } ] }, { "id": "toggle_work_schedule", "automation": "- id: toggle_work_schedule\n alias: Toggle Work Schedule\n description: Toggle work schedule.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: work_schedule_toggle\n actions:\n - action: input_boolean.toggle\n target:\n entity_id: input_boolean.work_schedule", "config": [ { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } } ] }, { "id": "toggle_work_today", "automation": "- id: toggle_work_today\n alias: Toggle Work Today\n description: Toggle work today.\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: mobile_app_notification_action\n event_data:\n action: work_today_toggle\n actions:\n - if:\n - condition: state\n entity_id: binary_sensor.work_today\n state: 'on'\n then:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.work_today_off\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.work_today_on\n else:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.work_today_on\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.work_today_off", "config": [ { "name": "work today on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_on", "device_id": null } }, { "name": "work today off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_off", "device_id": null } }, { "name": "Work Today Binary Sensor", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.work_today", "device_id": null } } ] }, { "id": "reset_work_today_off", "automation": "- id: reset_work_today_off\n alias: Reset Work Today Off\n description: Turn boolean off at end of day.\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n - trigger: state\n entity_id: input_boolean.work_today_on\n to: 'on'\n conditions:\n - condition: state\n entity_id:\n - input_boolean.work_schedule\n - input_boolean.work_today_off\n state: 'on'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.work_today_off", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "work today on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_on", "device_id": null } }, { "name": "work today off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_off", "device_id": null } } ] }, { "id": "reset_work_tomorrow_off", "automation": "- id: reset_work_tomorrow_off\n alias: Reset Tomorrow Work Off\n description: Turn boolean off at end of day, turn on work today off boolean.\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n - trigger: state\n entity_id: input_boolean.work_tomorrow_on\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.work_tomorrow_off\n state: 'on'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n actions:\n - delay: 5\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.work_today_off\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.work_tomorrow_off", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "work today off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_off", "device_id": null } }, { "name": "work tomorrow on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_on", "device_id": null } }, { "name": "work tomorrow off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_off", "device_id": null } } ] }, { "id": "reset_work_today_on", "automation": "- id: reset_work_today_on\n alias: Reset Work Today On\n description: Turn boolean off at end of day.\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n - trigger: state\n entity_id: input_boolean.work_today_off\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.work_today_on\n state: 'on'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.work_today_on", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "work today on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_on", "device_id": null } }, { "name": "work today off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_off", "device_id": null } } ] }, { "id": "reset_work_tomorrow_on", "automation": "- id: reset_work_tomorrow_on\n alias: Reset Work Tomorrow On\n description: Turn boolean off at end of day, turn on work today on boolean.\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n - trigger: state\n entity_id: input_boolean.work_tomorrow_off\n to: 'on'\n conditions:\n - condition: state\n entity_id: input_boolean.work_tomorrow_on\n state: 'on'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n actions:\n - delay: 5\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.work_today_on\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.work_tomorrow_on", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "work today on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_today_on", "device_id": null } }, { "name": "work tomorrow on input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_on", "device_id": null } }, { "name": "work tomorrow off input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_tomorrow_off", "device_id": null } } ] }, { "id": "reset_saturday_workday", "automation": "- id: reset_saturday_workday\n alias: Reset Saturday Workday\n description: Turn boolean off after Saturday.\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n conditions:\n - condition: state\n entity_id: input_boolean.saturday_workday\n state: 'on'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n - condition: template\n alias: Today is Sunday\n value_template: '{{ now().weekday() == 6 }}'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.saturday_workday", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "saturday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.saturday_workday", "device_id": null } } ] }, { "id": "reset_sunday_workday", "automation": "- id: reset_sunday_workday\n alias: Reset Sunday Workday\n description: Turn boolean off after Sunday.\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n conditions:\n - condition: state\n entity_id: input_boolean.sunday_workday\n state: 'on'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n - condition: template\n alias: Today is Monday\n value_template: '{{ now().weekday() == 0 }}'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.sunday_workday", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "sunday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.sunday_workday", "device_id": null } } ] }, { "id": "reset_holiday_workday", "automation": "- id: reset_holiday_workday\n alias: Reset Holiday Workday\n description: Turn boolean off after holiday.\n triggers:\n - trigger: time\n at: input_datetime.day_reset\n conditions:\n - condition: state\n entity_id: input_boolean.holiday_workday\n state: 'on'\n - condition: state\n entity_id: input_boolean.work_schedule_lock\n state: 'off'\n - condition: state\n entity_id: calendar.work_holiday\n state: 'off'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.holiday_workday", "config": [ { "name": "day reset", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.day_reset", "device_id": null } }, { "name": "work holiday calendar", "room": null, "type": "calendar", "id": { "entity_id": "calendar.work_holiday", "device_id": null } }, { "name": "work schedule input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule", "device_id": null } }, { "name": "work schedule lock input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.work_schedule_lock", "device_id": null } }, { "name": "holiday workday input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.holiday_workday", "device_id": null } } ] }, { "id": "zwave_keypress_events", "automation": "- id: zwave_keypress_events\n alias: ZWave Keypress Events\n description: Respond to Inovelli zwave dimmer/switch keypress events.\n mode: parallel\n variables:\n entity: \"{{ expand('group.zwave_entities')\\n | selectattr('attributes.node_id',\\\n \\ 'eq', trigger.event.data['node_id'])\\n | map(attribute='entity_id') | join\\\n \\ }}\\n\"\n light: \"{% set light = entity | replace('switch.', 'light.') %} {% if is_state_attr(light,\\\n \\ 'master', true) %}\\n {% set light = expand('group.lights')\\n | selectattr('attributes.master',\\\n \\ 'eq', entity)\\n | map(attribute='entity_id') | first %}\\n{% endif %}\\\n \\ {{ state_attr(light, 'group') if state_attr(light, 'group') != none else light\\\n \\ }}\\n\"\n adaptive_switch: '{% from ''light.jinja'' import adaptive_switch %} {{ adaptive_switch(light)\n }}\n\n '\n timer: '{% from ''light.jinja'' import light_timer %} {{ light_timer(light) }}\n\n '\n key_value: '{{ trigger.event.data[''value''] }}'\n key_name: '{{ trigger.event.data[''property_key_name''] }}'\n triggers:\n - trigger: event\n event_type: zwave_js_value_notification\n event_data:\n value: KeyHeldDown\n - trigger: event\n event_type: zwave_js_value_notification\n event_data:\n value: KeyPressed\n - trigger: event\n event_type: zwave_js_value_notification\n event_data:\n value: KeyPressed1x\n - trigger: event\n event_type: zwave_js_value_notification\n event_data:\n value: KeyPressed2x\n - trigger: event\n event_type: zwave_js_value_notification\n event_data:\n value: KeyPressed3x\n - trigger: event\n event_type: zwave_js_value_notification\n event_data:\n value: KeyPressed4x\n - trigger: event\n event_type: zwave_js_value_notification\n event_data:\n value: KeyPressed5x\n actions:\n - if: '{{ entity == '''' }}'\n then:\n - stop: No valid entities.\n error: true\n - choose:\n - conditions: '{{ key_value == ''KeyHeldDown''}}'\n sequence:\n - if: '{{ has_value(timer) }}'\n then:\n - action: timer.start\n target:\n entity_id: '{{ timer }}'\n - conditions: '{{ key_value == ''KeyPressed'' and key_name == ''001'' }}'\n sequence:\n - if:\n - condition: template\n value_template: \"{{ has_value(timer) and is_state(light, 'off')\\n and\\\n \\ (now() - states[light].last_changed) > timedelta(seconds=1) }}\\n\"\n then:\n - action: timer.start\n target:\n entity_id: '{{ timer }}'\n - conditions: '{{ key_value == ''KeyPressed'' and key_name == ''002'' }}'\n sequence:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ entity == ''light.bathroom_vanity_light'' }}'\n - condition: state\n entity_id: input_select.occupancy_mode\n state: Night\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: '{{ light }}'\n profile: default\n default:\n - if: \"{{ (is_state(light, 'on')\\n and now() - states[light].last_changed\\\n \\ > timedelta(seconds=1)) }}\\n\"\n then:\n - action: script.turn_light_on\n data:\n entity_id: '{{ light }}'\n profile: default\n reset: true\n else:\n - if: '{{ timer != none }}'\n then:\n - action: timer.start\n target:\n entity_id: '{{ timer }}'\n - conditions: '{{ key_value == ''KeyPressed2x'' and key_name == ''001'' }}'\n sequence:\n - choose:\n - conditions: '{{ entity == ''light.hallway_potlights'' }}'\n sequence:\n - action: light.turn_off\n target:\n entity_id: light.upstairs_potlights\n - conditions: '{{ entity == ''light.side_entrance_light'' }}'\n sequence:\n - action: input_boolean.toggle\n target:\n entity_id: input_boolean.charlie_home\n - action: script.inovelli_led_control\n data:\n entities: light.side_entrance_light\n duration: 60\n color: '{{ iif(is_state(''input_boolean.charlie_home'', ''on''), 150,\n 50) }}'\n brightness: 10\n effect: Chase\n default:\n - action: script.turn_room_off\n data:\n room: '{{ area_name(entity) }}'\n - conditions: '{{ key_value == ''KeyPressed2x'' and key_name == ''002'' }}'\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: '{{ light }}'\n profile: default_max\n activate_timer: true\n override: true\n - conditions: '{{ key_value == ''KeyPressed3x'' and key_name == ''001'' }}'\n sequence:\n - choose:\n - conditions: '{{ entity == ''light.hallway_potlights'' }}'\n sequence:\n - action: script.light_scene_on\n data:\n scene: evening\n - conditions: '{{ entity == ''light.dining_room_potlights'' }}'\n sequence:\n - action: media_player.volume_down\n target:\n entity_id: \"{{ expand('group.speaker_media_players')\\n | selectattr('state',\\\n \\ 'in', ['playing', 'paused', 'buffering', 'on'])\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n - conditions: '{{ entity == ''light.bathroom_shower_light'' }}'\n sequence:\n - action: media_player.volume_down\n target:\n entity_id: media_player.bathroom_speaker\n - conditions:\n - condition: template\n alias: Entity is a designated garage door lock light switch\n value_template: \"{{ entity in ['light.back_house_potlights',\\n 'light.back_yard_tree_lights',\\\n \\ 'light.side_entrance_light'] }}\\n\"\n sequence:\n - action: script.unlock_door_locks\n data:\n entity_id: lock.garage_side_door_lock\n - conditions: '{{ is_state_attr(entity, ''scene_led'', true) }}'\n sequence:\n - action: script.toggle\n target:\n entity_id: script.bedtime\n - conditions: '{{ key_value == ''KeyPressed3x'' and key_name == ''002'' }}'\n sequence:\n - choose:\n - conditions: '{{ entity == ''light.hallway_potlights'' }}'\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: light.upstairs_potlights\n profile: default_low\n activate_timer: true\n - conditions: '{{ entity == ''light.dining_room_potlights'' }}'\n sequence:\n - action: media_player.volume_up\n target:\n entity_id: \"{{ expand('group.speaker_media_players')\\n | selectattr('state',\\\n \\ 'in', ['playing', 'paused', 'buffering', 'on'])\\n | map(attribute='entity_id')\\\n \\ | list }}\\n\"\n - conditions: '{{ entity == ''light.bathroom_shower_light'' }}'\n sequence:\n - action: media_player.volume_up\n target:\n entity_id: media_player.bathroom_speaker\n - conditions: '{{ is_state_attr(entity, ''garage_led'', true) }}'\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.toggle_garage_door\n - condition: template\n alias: Entity is a designated garage door lock light switch\n value_template: \"{{ entity in ['light.back_house_potlights',\\n 'light.back_yard_tree_lights',\\\n \\ 'light.side_entrance_light'] }}\\n\"\n - action: script.unlock_door_locks\n data:\n entity_id: lock.garage_side_door_lock\n - conditions: '{{ is_state_attr(entity, ''scene_led'', true) }}'\n sequence:\n - action: script.turn_on\n target:\n entity_id: script.waketime\n - conditions: '{{ key_value == ''KeyPressed4x'' and key_name == ''001'' }}'\n sequence:\n - choose:\n - conditions: '{{ entity == ''light.hallway_potlights'' }}'\n sequence:\n - action: script.light_scene_on\n data:\n scene: evening\n - conditions: '{{ entity == ''light.dining_room_light_rgb'' }}'\n sequence:\n - action: input_boolean.turn_off\n target:\n entity_id:\n - input_boolean.garbage_alert\n - input_boolean.organic_waste_alert\n - input_boolean.recycle_alert\n - input_boolean.yard_waste_alert\n - conditions: '{{ entity == ''light.dining_room_potlights'' }}'\n sequence:\n - action: script.media_players_pause\n - conditions: '{{ entity == ''light.bathroom_shower_light'' }}'\n sequence:\n - action: script.media_players_pause\n data:\n entity_id: media_player.bathroom_speaker\n - conditions: '{{ entity in [''light.back_house_potlights'', ''light.outside_garage_lights'']\n }}'\n sequence:\n - action: light.turn_off\n target:\n entity_id: &id017\n - light.outside_garage_lights\n - light.back_house_potlights\n - light.back_yard_tree_lights\n - light.back_yard_garden_lights\n - conditions: '{{ is_state_attr(entity, ''alarm_led'', true) }}'\n sequence:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - action: script.arm_alarm\n data:\n mode: night\n - conditions: '{{ key_value == ''KeyPressed4x'' and key_name == ''002'' }}'\n sequence:\n - choose:\n - conditions: '{{ entity == ''light.hallway_potlights'' }}'\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: light.upstairs_potlights\n profile: default\n activate_timer: true\n - conditions: '{{ entity == ''light.dining_room_potlights'' }}'\n sequence:\n - action: script.media_players_resume\n - conditions: '{{ entity == ''light.bathroom_shower_light'' }}'\n sequence:\n - action: script.media_players_resume\n data:\n entity_id: media_player.bathroom_speaker\n - conditions: '{{ entity in [''light.back_house_potlights'', ''light.outside_garage_lights'']\n }}'\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: *id017\n activate_timer: false\n - conditions: '{{ is_state_attr(entity, ''alarm_led'', true) }}'\n sequence:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - action: script.arm_alarm\n data:\n mode: home\n - conditions: '{{ key_value == ''KeyPressed5x'' and key_name == ''001'' }}'\n sequence:\n - choose:\n - conditions: '{{ entity == ''light.hallway_potlights'' }}'\n sequence:\n - action: script.turn_light_off\n - conditions: '{{ entity == ''light.dining_room_potlights'' }}'\n sequence:\n - action: switch.toggle\n target:\n entity_id: switch.media_mute\n - conditions: '{{ entity == ''light.bathroom_shower_light'' }}'\n sequence:\n - if:\n - condition: state\n entity_id: media_player.bathroom_speaker\n attribute: is_volume_muted\n state: true\n then:\n - action: media_player.volume_mute\n data:\n entity_id: media_player.bathroom_speaker\n is_volume_muted: false\n else:\n - action: media_player.volume_mute\n target:\n entity_id: media_player.bathroom_speaker\n data:\n is_volume_muted: true\n - conditions: '{{ is_state_attr(entity, ''alarm_led'', true) }}'\n sequence:\n - action: script.arm_alarm\n data:\n mode: away\n - if: '{{ entity == ''light.side_entrance_light'' }}'\n then:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.jason_presence_override\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.jason_home\n - conditions: '{{ is_state_attr(entity, ''alarm_clock_led'', true) }}'\n sequence:\n - action: script.alarm_clock_stop\n - conditions: '{{ key_value == ''KeyPressed5x'' and key_name == ''002'' }}'\n sequence:\n - choose:\n - conditions: '{{ entity == ''light.hallway_potlights'' }}'\n sequence:\n - action: script.turn_light_on\n data:\n entity_id: light.upstairs_potlights\n profile: default_max\n activate_timer: true\n - conditions: '{{ entity == ''light.dining_room_light_rgb'' }}'\n sequence:\n - action: script.weather_report\n - conditions: '{{ entity == ''light.bathroom_shower_light'' }}'\n sequence:\n - action: switch.toggle\n target:\n entity_id: switch.shower_scene\n - conditions: '{{ is_state_attr(entity, ''alarm_led'', true) }}'\n sequence:\n - condition: state\n entity_id: binary_sensor.someone_home\n state: 'on'\n - action: script.disarm_alarm\n data:\n zone: '{{ iif(entity in [''light.outside_garage_lights''], ''garage'',\n ''master'') }}'\n person: hassio", "config": [ { "name": "dining room light rgb", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light_rgb", "device_id": null } }, { "name": "occupancy mode", "room": null, "type": "input_select", "id": { "entity_id": "input_select.occupancy_mode", "device_id": null } }, { "name": "waketime script", "room": null, "type": "script", "id": { "entity_id": "script.waketime", "device_id": null } }, { "name": "side entrance light", "room": "side entrance", "type": "light", "id": { "entity_id": "light.side_entrance_light", "device_id": null } }, { "name": "dining room potlights", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_potlights", "device_id": null } }, { "name": "turn light on script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "arm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.arm_alarm", "device_id": null } }, { "name": "disarm alarm script", "room": null, "type": "script", "id": { "entity_id": "script.disarm_alarm", "device_id": null } }, { "name": "alarm clock stop script", "room": null, "type": "script", "id": { "entity_id": "script.alarm_clock_stop", "device_id": null } }, { "name": "someone home", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.someone_home", "device_id": null } }, { "name": "hallway potlights", "room": "hallway", "type": "light", "id": { "entity_id": "light.hallway_potlights", "device_id": null } }, { "name": "lights group", "room": null, "type": "group", "id": { "entity_id": "group.lights", "device_id": null } }, { "name": "turn light off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_off", "device_id": null } }, { "name": "bathroom shower light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_shower_light", "device_id": null } }, { "name": "shower scene", "room": null, "type": "switch", "id": { "entity_id": "switch.shower_scene", "device_id": null } }, { "name": "bedtime script", "room": null, "type": "script", "id": { "entity_id": "script.bedtime", "device_id": null } }, { "name": "charlie home input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.charlie_home", "device_id": null } }, { "name": "turn light on script 2", "room": null, "type": "script", "id": { "entity_id": "script.turn_light_on", "device_id": null } }, { "name": "garage side door lock", "room": "garage", "type": "lock", "id": { "entity_id": "lock.garage_side_door_lock", "device_id": null } }, { "name": "media mute switch", "room": null, "type": "switch", "id": { "entity_id": "switch.media_mute", "device_id": null } }, { "name": "timer start service", "room": null, "type": "service", "id": { "entity_id": "timer.start", "device_id": null } }, { "name": "back house potlights", "room": "back", "type": "light", "id": { "entity_id": "light.back_house_potlights", "device_id": null } }, { "name": "back yard garden lights", "room": "back yard", "type": "light", "id": { "entity_id": "light.back_yard_garden_lights", "device_id": null } }, { "name": "back yard tree lights", "room": "back yard", "type": "light", "id": { "entity_id": "light.back_yard_tree_lights", "device_id": null } }, { "name": "bathroom vanity light", "room": "bathroom", "type": "light", "id": { "entity_id": "light.bathroom_vanity_light", "device_id": null } }, { "name": "dining room light", "room": "dining room", "type": "light", "id": { "entity_id": "light.dining_room_light", "device_id": null } }, { "name": "outside garage lights", "room": "outside", "type": "light", "id": { "entity_id": "light.outside_garage_lights", "device_id": null } }, { "name": "jason presence override", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_presence_override", "device_id": null } }, { "name": "light turn off service", "room": null, "type": "service", "id": { "entity_id": "light.turn_off", "device_id": null } }, { "name": "light scene on script", "room": null, "type": "script", "id": { "entity_id": "script.light_scene_on", "device_id": null } }, { "name": "media play script", "room": null, "type": "script", "id": { "entity_id": "script.media_play", "device_id": null } }, { "name": "jason home input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.jason_home", "device_id": null } }, { "name": "speaker media players group", "room": null, "type": "group", "id": { "entity_id": "group.speaker_media_players", "device_id": null } }, { "name": "turn room off script", "room": null, "type": "script", "id": { "entity_id": "script.turn_room_off", "device_id": null } }, { "name": "unlock door locks script", "room": null, "type": "script", "id": { "entity_id": "script.unlock_door_locks", "device_id": null } }, { "name": "garbage alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.garbage_alert", "device_id": null } }, { "name": "organic waste alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.organic_waste_alert", "device_id": null } }, { "name": "recycle alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.recycle_alert", "device_id": null } }, { "name": "yard waste alert input boolean", "room": null, "type": "input_boolean", "id": { "entity_id": "input_boolean.yard_waste_alert", "device_id": null } }, { "name": "zwave entities group", "room": null, "type": "group", "id": { "entity_id": "group.zwave_entities", "device_id": null } }, { "name": "inovelli led control script", "room": null, "type": "script", "id": { "entity_id": "script.inovelli_led_control", "device_id": null } }, { "name": "weather report script", "room": null, "type": "script", "id": { "entity_id": "script.weather_report", "device_id": null } }, { "name": "toggle garage door script", "room": null, "type": "script", "id": { "entity_id": "script.toggle_garage_door", "device_id": null } }, { "name": "media players pause script", "room": null, "type": "script", "id": { "entity_id": "script.media_players_pause", "device_id": null } }, { "name": "media players resume script", "room": null, "type": "script", "id": { "entity_id": "script.media_players_resume", "device_id": null } }, { "name": "Upstairs Potlights Light", "room": "Upstairs", "type": "light", "id": { "entity_id": "light.upstairs_potlights", "device_id": null } }, { "name": "Bathroom Speaker Media Player", "room": "Bathroom", "type": "media_player", "id": { "entity_id": "media_player.bathroom_speaker", "device_id": null } } ] }, { "id": "zwave_operation_lock_status_update", "automation": "- id: zwave_operation_lock_status_update\n alias: ZWave Operation Lock Status Update\n description: Update lock status sensor for zwave operations.\n mode: parallel\n variables:\n lock: '{{ states[trigger.entity_id].object_id }}'\n triggers:\n - trigger: state\n entity_id:\n - lock.side_door_lock\n - lock.back_door_lock\n - lock.garage_side_door_lock\n - lock.front_door_lock\n to:\n - locked\n - unlocked\n from:\n - locked\n - unlocked\n for: 1\n actions:\n - choose:\n - conditions: \"{{ trigger.to_state.state == 'locked'\\n and ('Unlocked' in\\\n \\ states('sensor.' ~ lock ~ '_status')\\n or not has_value('sensor.' ~ lock\\\n \\ ~ '_status')) }}\\n\"\n sequence:\n - action: input_text.set_value\n target:\n entity_id: input_text.{{ lock }}_status\n data:\n value: Locked (Hassio)\n - conditions: \"{{ trigger.to_state.state == 'unlocked'\\n and ('Locked' in\\\n \\ states('sensor.' ~ lock ~ '_status')\\n or not has_value('sensor.' ~ lock\\\n \\ ~ '_status')) }}\\n\"\n sequence:\n - action: input_text.set_value\n target:\n entity_id: input_text.{{ lock }}_status\n data:\n value: Unlocked (Hassio)", "config": [ { "name": "side door lock", "room": "side", "type": "lock", "id": { "entity_id": "lock.side_door_lock", "device_id": null } }, { "name": "back door lock", "room": "back", "type": "lock", "id": { "entity_id": "lock.back_door_lock", "device_id": null } }, { "name": "front door lock", "room": "front", "type": "lock", "id": { "entity_id": "lock.front_door_lock", "device_id": null } }, { "name": "garage side door lock", "room": "garage", "type": "lock", "id": { "entity_id": "lock.garage_side_door_lock", "device_id": null } }, { "name": "input text set value service", "room": null, "type": "service", "id": { "entity_id": "input_text.set_value", "device_id": null } } ] }, { "id": "unavailable_entities_notification", "automation": "- id: unavailable_entities_notification\n alias: Unavailable Entities Notification\n description: Create persistent notification if unavailable entities, dismiss if\n none.\n mode: restart\n triggers:\n - trigger: state\n entity_id: group.unavailable_entities\n attribute: entity_id\n to: null\n for: 5\n conditions:\n - condition: template\n alias: Sensor state is a valid numerical value\n value_template: '{{ is_number(states(''sensor.unavailable_entities'')) }}'\n actions:\n - action: persistent_notification.create\n data:\n notification_id: unavailable_entities\n title: Unavailable Entities\n message: \"{% set ns = namespace(result=[]) %} {% for s in expand(state_attr('group.unavailable_entities',\\\n \\ 'entity_id')) %}\\n {% set ns.result = ns.result + [\\n device_attr(s.entity_id,\\\n \\ \\\"name\\\") ~ \\\"|\\\" ~ device_id(s.entity_id) ~ \\\"|- **\\\" ~ s.name ~ \\\"**\\\\\\\n n\\\"\\n ~ \\\" - *entity_id*: \\\" ~ s.entity_id ~ \\\"\\\\n\\\"\\n ~ \\\" -\\\n \\ *state*: \\\" ~ s.state ~ \\\"\\\\n\\\"\\n ]\\n %}\\n{% endfor %} {% set ns.result\\\n \\ = ns.result | sort %} {% set lastdev = namespace( id=\\\"\\\" ) %} {% set tarr\\\n \\ = ns.result %} {% set ns.result = [] %} {% for item in tarr %}\\n {% set\\\n \\ dev = namespace( id=\\\"\\\" ) %}\\n {% set entity = namespace( data=\\\"\\\" )\\\n \\ %}\\n {% set dev.id = item.split(\\\"|\\\")[1] %}\\n {% set entity.data = item.split(\\\"\\\n |\\\")[2] %}\\n {% if lastdev.id != dev.id %}\\n {% if dev.id != 'None' %}\\n\\\n \\ {% set ns.result = ns.result + [ \\\"**\\\" ~ device_attr(dev.id, \\\"name\\\") ~ \\\"**\\\" ] %}\\n\\\n \\ {% else %}\\n {% set ns.result = ns.result + [ \\\"**Non-Device Entities**\\\"\\\n \\ ] %}\\n {% endif %}\\n {% set lastdev.id = dev.id %}\\n {% endif %}\\n\\\n \\ {% set ns.result = ns.result + [ entity.data ] %}\\n{% endfor %} {{ ns.result\\\n \\ | join('\\\\n') }}\\n\"", "config": [ { "name": "unavailable entities group", "room": null, "type": "group", "id": { "entity_id": "group.unavailable_entities", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "unavailable entities sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.unavailable_entities", "device_id": null } } ] }, { "id": "update_unavailable_entities_group", "automation": "- id: update_unavailable_entities_group\n alias: Update Unavailable Entities Group\n description: Update unavailable entities group.\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time_pattern\n minutes: /1\n actions:\n - action: group.set\n data:\n object_id: unavailable_entities\n entities: \"{% set ignore_seconds = 60 %} {% set ignore_label = 'ignored' %}\\\n \\ {% set ignored_domains = ['button', 'conversation', 'event', 'group', 'image',\\n\\\n \\ 'input_button', 'input_text', 'remote', 'tts', 'scene', 'stt', 'update']\\\n \\ %}\\n{% set ignore_ts = (now().timestamp() - ignore_seconds)|as_datetime\\\n \\ %} {% set disabled_device_entities = state_attr('sensor.disabled_device_entities',\\\n \\ 'entities')\\n | regex_replace(find='\\\\[|\\\\]|\\\\{|\\\\}|\\\\'entity_id\\\\':',\\\n \\ replace='') %}\\n{% set ignored_devices = label_devices(ignore_label | lower)\\\n \\ %} {% set ignored_device_entities = namespace(value=[]) %} {% for device\\\n \\ in ignored_devices %}\\n {% set ignored_device_entities.value = ignored_device_entities.value\\\n \\ + device_entities(device) %}\\n{% endfor %} {{ states\\n | rejectattr('domain',\\\n \\ 'in', ignored_domains)\\n | rejectattr('entity_id', 'in', disabled_device_entities)\\n\\\n \\ | rejectattr('entity_id', 'in', state_attr('group.ignored_entities',\\\n \\ 'entity_id'))\\n | rejectattr('entity_id', 'in', ['group.unavailable_entities',\\\n \\ 'group.ignored_entities'])\\n | rejectattr('entity_id', 'in', ignored_device_entities.value)\\n\\\n \\ | rejectattr('entity_id', 'in', label_entities(ignore_label | lower))\\n\\\n \\ | rejectattr('last_changed', 'ge', ignore_ts)\\n | selectattr('state',\\\n \\ 'in', ['unknown', 'unavailable'])\\n | map(attribute='entity_id') | list\\\n \\ | sort }}\\n\"", "config": [ { "name": "unavailable entities group", "room": null, "type": "group", "id": { "entity_id": "group.unavailable_entities", "device_id": null } } ] }, { "id": "unavailable_entities_notification", "automation": "- id: unavailable_entities_notification\n alias: Unavailable Entities Notification\n description: Create persistent notification if unavailable entities, dismiss if\n none.\n mode: restart\n triggers:\n - trigger: state\n entity_id: group.unavailable_entities\n attribute: entity_id\n to: null\n for: 5\n conditions:\n - condition: template\n alias: Sensor state is a valid numerical value\n value_template: '{{ is_number(states(''sensor.unavailable_entities'')) }}'\n actions:\n - if:\n - condition: numeric_state\n entity_id: sensor.unavailable_entities\n below: 1\n then:\n - action: persistent_notification.dismiss\n data:\n notification_id: unavailable_entities\n else:\n - action: persistent_notification.create\n data:\n notification_id: unavailable_entities\n title: Unavailable Entities\n message: '{{ state_attr(''group.unavailable_entities'', ''entity_id'') | join(''\n\n '') }}'", "config": [ { "name": "unavailable entities group", "room": null, "type": "group", "id": { "entity_id": "group.unavailable_entities", "device_id": null } }, { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "unavailable entities sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.unavailable_entities", "device_id": null } } ] }, { "id": "unavailable_entities_notification", "automation": "- id: unavailable_entities_notification\n alias: Unavailable Entities Notification\n description: Create persistent notification if unavailable entities, dismiss if\n none.\n mode: restart\n trigger:\n - platform: state\n entity_id: sensor.unavailable_entities\n attribute: entity_id\n to: null\n condition:\n - condition: template\n alias: Sensor state is a valid numerical value\n value_template: \"{{ is_number(trigger.from_state.state)\\n and is_number(trigger.to_state.state)\\\n \\ }}\\n\"\n action:\n - if:\n - condition: numeric_state\n entity_id: sensor.unavailable_entities\n below: 1\n then:\n - service: persistent_notification.dismiss\n data:\n notification_id: unavailable_entities\n else:\n - service: persistent_notification.create\n data:\n notification_id: unavailable_entities\n title: Unavailable Entities\n message: '{{ state_attr(''sensor.unavailable_entities'', ''entity_id'') |\n join(''\n\n '') }}'", "config": [ { "name": "persistent notification create service", "room": null, "type": "service", "id": { "entity_id": "persistent_notification.create", "device_id": null } }, { "name": "unavailable entities sensor", "room": null, "type": "sensor", "id": { "entity_id": "sensor.unavailable_entities", "device_id": null } } ] } ]