AutomationDataset/jkfranks9/description-ready.json

6003 lines
247 KiB
JSON

[
{
"id": "'1608298913447'",
"automation": "- id: '1608298913447'\n alias: Zone Notification\n description: ''\n use_blueprint:\n path: homeassistant/notify_leaving_zone.yaml\n input:\n person_entity: person.jon\n zone_entity: zone.home\n notify_device: a9570941d9dcebbd74ecb611f829a0f2",
"config": [
{
"name": "Jon Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.jon",
"device_id": null
}
},
{
"name": "Mobile Notification Device",
"room": null,
"type": "notify",
"id": {
"entity_id": null,
"device_id": "a9570941d9dcebbd74ecb611f829a0f2"
}
}
]
},
{
"id": "'1655124375247'",
"automation": "- id: '1655124375247'\n alias: Kodi Test\n description: ''\n trigger:\n - platform: device\n device_id: 7000b71050bd8b00ed5ae05567e931c5\n domain: kodi\n entity_id: media_player.kodi\n type: turn_on\n condition: []\n action:\n - service: scene.turn_on\n target:\n entity_id: scene.lutron_dark\n metadata: {}\n mode: single",
"config": [
{
"name": "Kodi Media Player",
"room": null,
"type": "media_player",
"id": {
"entity_id": "media_player.kodi",
"device_id": "7000b71050bd8b00ed5ae05567e931c5"
}
},
{
"name": "Lutron Dark Scene",
"room": null,
"type": "scene",
"id": {
"entity_id": "scene.lutron_dark",
"device_id": null
}
}
]
},
{
"id": "'1737827992080'",
"automation": "- id: '1737827992080'\n alias: New automation\n description: ''\n triggers:\n - trigger: conversation\n command: testing\n conditions: []\n actions:\n - action: assist_satellite.announce\n metadata: {}\n data:\n message: Test is successful!\n target:\n entity_id: assist_satellite.home_assistant_voice_office_assist_satellite\n mode: single",
"config": [
{
"name": "Office Voice Assistant Satellite",
"room": "office",
"type": "assist_satellite",
"id": {
"entity_id": "assist_satellite.home_assistant_voice_office_assist_satellite",
"device_id": null
}
}
]
},
{
"id": "transition_to_sleep_mode",
"automation": "- alias: Transition To Sleep Mode\n id: transition_to_sleep_mode\n triggers:\n - trigger: time\n at: '20:00:00'\n conditions:\n - condition: state\n entity_id: sensor.harmony_hub\n state: PowerOff\n - condition: state\n entity_id: input_boolean.extended_away_mode\n state: 'off'\n - condition: state\n entity_id: binary_sensor.penthouse_occupied\n state: 'off'\n actions:\n - action: script.set_thermostat_preset\n data:\n thermostat_entity: climate.upstairs\n preset: sleep",
"config": [
{
"name": "Harmony Hub Sensor",
"room": "theater",
"type": "sensor",
"id": {
"entity_id": "sensor.harmony_hub",
"device_id": null
}
},
{
"name": "Extended Away Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_mode",
"device_id": null
}
},
{
"name": "Penthouse Occupied",
"room": "penthouse",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.penthouse_occupied",
"device_id": null
}
},
{
"name": "Upstairs Climate",
"room": "upstairs",
"type": "climate",
"id": {
"entity_id": "climate.upstairs",
"device_id": null
}
}
]
},
{
"id": "get_downstairs_thermostat_temps",
"automation": "- alias: Get Downstairs Thermostat Temps\n id: get_downstairs_thermostat_temps\n use_blueprint:\n path: climate/get_thermostat_temps.yaml\n input:\n climate_entity: climate.downstairs",
"config": [
{
"name": "Downstairs Climate",
"room": "downstairs",
"type": "climate",
"id": {
"entity_id": "climate.downstairs",
"device_id": null
}
}
]
},
{
"id": "get_upstairs_thermostat_temps",
"automation": "- alias: Get Upstairs Thermostat Temps\n id: get_upstairs_thermostat_temps\n use_blueprint:\n path: climate/get_thermostat_temps.yaml\n input:\n climate_entity: climate.upstairs",
"config": [
{
"name": "Upstairs Climate",
"room": "upstairs",
"type": "climate",
"id": {
"entity_id": "climate.upstairs",
"device_id": null
}
}
]
},
{
"id": "set_minimum_attic_temperature",
"automation": "- alias: Set Minimum Attic Temperature\n id: set_minimum_attic_temperature\n use_blueprint:\n path: climate/temp_extremes.yaml\n input:\n sensor_entity: sensor.attic_temp_min\n result_entity: input_number.min_attic_temp\n type: Min",
"config": [
{
"name": "Attic Temp Min",
"room": "attic",
"type": "sensor",
"id": {
"entity_id": "sensor.attic_temp_min",
"device_id": null
}
},
{
"name": "Min Attic Temp",
"room": "attic",
"type": "input_number",
"id": {
"entity_id": "input_number.min_attic_temp",
"device_id": null
}
}
]
},
{
"id": "set_maximum_attic_temperature",
"automation": "- alias: Set Maximum Attic Temperature\n id: set_maximum_attic_temperature\n use_blueprint:\n path: climate/temp_extremes.yaml\n input:\n sensor_entity: sensor.attic_temp_max\n result_entity: input_number.max_attic_temp\n type: Max",
"config": [
{
"name": "Attic Temp Max",
"room": "attic",
"type": "sensor",
"id": {
"entity_id": "sensor.attic_temp_max",
"device_id": null
}
},
{
"name": "Max Attic Temp",
"room": "attic",
"type": "input_number",
"id": {
"entity_id": "input_number.max_attic_temp",
"device_id": null
}
}
]
},
{
"id": "set_minimum_garage_temperature",
"automation": "- alias: Set Minimum Garage Temperature\n id: set_minimum_garage_temperature\n use_blueprint:\n path: climate/temp_extremes.yaml\n input:\n sensor_entity: sensor.garage_temp_min\n result_entity: input_number.min_garage_temp\n type: Min",
"config": [
{
"name": "Garage Temp Min",
"room": "garage",
"type": "sensor",
"id": {
"entity_id": "sensor.garage_temp_min",
"device_id": null
}
},
{
"name": "Min Garage Temp",
"room": "garage",
"type": "input_number",
"id": {
"entity_id": "input_number.min_garage_temp",
"device_id": null
}
}
]
},
{
"id": "set_maximum_garage_temperature",
"automation": "- alias: Set Maximum Garage Temperature\n id: set_maximum_garage_temperature\n use_blueprint:\n path: climate/temp_extremes.yaml\n input:\n sensor_entity: sensor.garage_temp_max\n result_entity: input_number.max_garage_temp\n type: Max",
"config": [
{
"name": "Garage Temp Max",
"room": "garage",
"type": "sensor",
"id": {
"entity_id": "sensor.garage_temp_max",
"device_id": null
}
},
{
"name": "Max Garage Temp",
"room": "garage",
"type": "input_number",
"id": {
"entity_id": "input_number.max_garage_temp",
"device_id": null
}
}
]
},
{
"id": "set_minimum_outdoor_temperature",
"automation": "- alias: Set Minimum Outdoor Temperature\n id: set_minimum_outdoor_temperature\n use_blueprint:\n path: climate/temp_extremes.yaml\n input:\n sensor_entity: sensor.porch_temp_min\n result_entity: input_number.min_outdoor_temp\n type: Min",
"config": [
{
"name": "Porch Temp Min",
"room": "porch",
"type": "sensor",
"id": {
"entity_id": "sensor.porch_temp_min",
"device_id": null
}
},
{
"name": "Min Outdoor Temp",
"room": "outdoor",
"type": "input_number",
"id": {
"entity_id": "input_number.min_outdoor_temp",
"device_id": null
}
}
]
},
{
"id": "set_maximum_outdoor_temperature",
"automation": "- alias: Set Maximum Outdoor Temperature\n id: set_maximum_outdoor_temperature\n use_blueprint:\n path: climate/temp_extremes.yaml\n input:\n sensor_entity: sensor.porch_temp_max\n result_entity: input_number.max_outdoor_temp\n type: Max",
"config": [
{
"name": "Porch Temp Max",
"room": "porch",
"type": "sensor",
"id": {
"entity_id": "sensor.porch_temp_max",
"device_id": null
}
},
{
"name": "Max Outdoor Temp",
"room": "outdoor",
"type": "input_number",
"id": {
"entity_id": "input_number.max_outdoor_temp",
"device_id": null
}
}
]
},
{
"id": "turn_off_downstairs_hvac",
"automation": "- alias: Turn Off Downstairs HVAC\n id: turn_off_downstairs_hvac\n trigger:\n - platform: state\n entity_id: binary_sensor.downstairs_doors_windows\n from: 'off'\n to: 'on'\n for: 00:02:00\n action:\n - service: climate.turn_off\n target:\n entity_id: climate.downstairs",
"config": [
{
"name": "Downstairs Climate",
"room": "downstairs",
"type": "climate",
"id": {
"entity_id": "climate.downstairs",
"device_id": null
}
},
{
"name": "Downstairs Doors Windows",
"room": "downstairs",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.downstairs_doors_windows",
"device_id": null
}
}
]
},
{
"id": "turn_on_downstairs_hvac",
"automation": "- alias: Turn On Downstairs HVAC\n id: turn_on_downstairs_hvac\n trigger:\n - platform: state\n entity_id: binary_sensor.downstairs_doors_windows\n from: 'on'\n to: 'off'\n condition:\n - condition: state\n entity_id: climate.downstairs\n state: 'off'\n action:\n - service: climate.turn_on\n target:\n entity_id: climate.downstairs",
"config": [
{
"name": "Downstairs Climate",
"room": "downstairs",
"type": "climate",
"id": {
"entity_id": "climate.downstairs",
"device_id": null
}
},
{
"name": "Downstairs Doors Windows",
"room": "downstairs",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.downstairs_doors_windows",
"device_id": null
}
}
]
},
{
"id": "calculate_astronomical_condition",
"automation": "- alias: Calculate Astronomical Condition\n id: calculate_astronomical_condition\n triggers:\n - trigger: sun\n event: sunset\n actions:\n - variables:\n first_hour: '{{ as_local(as_datetime(states(''sensor.astroweather_white_rabbit_gardens_sun_next_setting_astronomical''))).hour\n }}'\n - action: script.calculate_weather_metrics\n data:\n weather_entity: weather.astroweather_white_rabbit_gardens\n forecast_type: hourly\n first_hour: '{{ first_hour }}'\n last_hour: 23\n metrics_list:\n - - input_number.average_astro_condition\n - condition\n - 50\n - 0\n - - input_number.average_astro_cloudless_percentage\n - cloudless_percentage\n - 50\n - 0\n - - input_number.average_astro_seeing_percentage\n - seeing_percentage\n - 50\n - 0\n - - input_number.average_astro_transparency_percentage\n - transparency_percentage\n - 50\n - 0",
"config": [
{
"name": "Astro Weather Sun Next Setting",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.astroweather_white_rabbit_gardens_sun_next_setting_astronomical",
"device_id": null
}
},
{
"name": "Astro Weather",
"room": null,
"type": "weather",
"id": {
"entity_id": "weather.astroweather_white_rabbit_gardens",
"device_id": null
}
},
{
"name": "Average Astro Condition",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.average_astro_condition",
"device_id": null
}
},
{
"name": "Average Astro Cloudless Percentage",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.average_astro_cloudless_percentage",
"device_id": null
}
},
{
"name": "Average Astro Seeing Percentage",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.average_astro_seeing_percentage",
"device_id": null
}
},
{
"name": "Average Astro Transparency Percentage",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.average_astro_transparency_percentage",
"device_id": null
}
}
]
},
{
"id": "check_freezing_temperature",
"automation": "- alias: Check Freezing Temperature\n id: check_freezing_temperature\n triggers:\n - trigger: numeric_state\n entity_id:\n - sensor.openweathermap_temperature\n - sensor.porch_sensor_temperature\n below: 30\n id: awake\n - trigger: state\n entity_id: input_boolean.nighttime\n from: 'off'\n to: 'on'\n id: asleep\n conditions: '{{ is_state(''input_boolean.nighttime'', ''off'') or trigger.id ==\n ''asleep'' }}'\n actions:\n - variables:\n next_hour: '{% set curr_hour = as_local(as_datetime(now())).hour %} {% set curr_minute\n = as_local(as_datetime(now())).minute %} {{ iif(curr_minute <= 55, curr_hour\n + 1, curr_hour + 2) }}\n\n '\n last_hour: '{{ iif(trigger.id == ''awake'', 0, 12) }}'\n - action: script.calculate_weather_metrics\n data:\n weather_entity: weather.openweathermap\n forecast_type: hourly\n first_hour: '{{ next_hour }}'\n last_hour: '{{ last_hour }}'\n metrics_list:\n - - input_number.minimum_outdoor_temperature\n - temperature\n - 33\n - 120\n - if:\n - condition: numeric_state\n entity_id: input_number.minimum_outdoor_temperature\n below: 25\n then:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.freezing_temperature",
"config": [
{
"name": "Openweathermap Temperature",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.openweathermap_temperature",
"device_id": null
}
},
{
"name": "Porch Sensor Temperature",
"room": "porch",
"type": "sensor",
"id": {
"entity_id": "sensor.porch_sensor_temperature",
"device_id": null
}
},
{
"name": "Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.nighttime",
"device_id": null
}
},
{
"name": "Openweathermap Weather",
"room": null,
"type": "weather",
"id": {
"entity_id": "weather.openweathermap",
"device_id": null
}
},
{
"name": "Minimum Outdoor Temperature",
"room": "outdoor",
"type": "input_number",
"id": {
"entity_id": "input_number.minimum_outdoor_temperature",
"device_id": null
}
},
{
"name": "Freezing Temperature",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.freezing_temperature",
"device_id": null
}
}
]
},
{
"id": "reset_freezing_temperature",
"automation": "- alias: Reset Freezing Temperature\n id: reset_freezing_temperature\n triggers:\n - trigger: numeric_state\n entity_id:\n - sensor.openweathermap_temperature\n - sensor.porch_sensor_temperature\n above: 33\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.freezing_temperature",
"config": [
{
"name": "Openweathermap Temperature",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.openweathermap_temperature",
"device_id": null
}
},
{
"name": "Porch Sensor Temperature",
"room": "porch",
"type": "sensor",
"id": {
"entity_id": "sensor.porch_sensor_temperature",
"device_id": null
}
},
{
"name": "Freezing Temperature",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.freezing_temperature",
"device_id": null
}
}
]
},
{
"id": "check_salt_system_low_temperature",
"automation": "- alias: Check Salt System Low Temperature\n id: check_salt_system_low_temperature\n triggers:\n - trigger: time\n at: 06:00:00\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.salt_system_low_temperature\n - action: script.calculate_weather_metrics\n data:\n weather_entity: weather.openweathermap\n forecast_type: daily\n num_days: 3\n metrics_list:\n - - input_number.minimum_daily_temperature\n - templow\n - 60\n - 100\n - - input_number.maximum_daily_temperature\n - temperature\n - 60\n - 0\n - if:\n - condition: numeric_state\n entity_id:\n - input_number.minimum_daily_temperature\n - input_number.maximum_daily_temperature\n below: 55\n then:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.salt_system_low_temperature",
"config": [
{
"name": "Openweathermap Weather",
"room": null,
"type": "weather",
"id": {
"entity_id": "weather.openweathermap",
"device_id": null
}
},
{
"name": "Salt System Low Temperature",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.salt_system_low_temperature",
"device_id": null
}
},
{
"name": "Minimum Daily Temperature",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.minimum_daily_temperature",
"device_id": null
}
},
{
"name": "Maximum Daily Temperature",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.maximum_daily_temperature",
"device_id": null
}
}
]
},
{
"id": "handle_device_initialization_catch_22",
"automation": "- alias: Handle Device Initialization Catch 22\n id: handle_device_initialization_catch_22\n trigger:\n - platform: homeassistant\n event: start\n action:\n - service: input_boolean.turn_on\n entity_id: input_boolean.device_initialization_catch_22\n - delay: 00:01:30\n - service: input_boolean.turn_off\n entity_id: input_boolean.device_initialization_catch_22",
"config": [
{
"name": "Device Initialization Catch 22",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.device_initialization_catch_22",
"device_id": null
}
}
]
},
{
"id": "handle_power_outage",
"automation": "- alias: Handle Power Outage\n id: handle_power_outage\n trigger:\n - platform: state\n entity_id: sensor.cyber1_status_data\n to: OB DISCHRG\n for: 00:01:00\n - platform: homeassistant\n event: start\n condition:\n - condition: state\n entity_id: sensor.cyber1_status_data\n state: OB DISCHRG\n action:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - variables:\n tag: power_out\n title: 'Warning:'\n message: Power is out, shutting down PC.\n channel: critical\n tag_registry_value: '{{ {''tag'': tag, ''clear_type'': ''auto'', ''title'':\n title, ''message'': message, ''channel'': channel, ''timeout'': 0} }}'\n notification_data: '{{ {''destination'': [''mobile''], ''title'': title, ''message'':\n message, ''channel'': channel, ''timeout'': 0, ''tag'': tag} }}'\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.ups_power_out\n data_template:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - action: script.register_mobile_notification\n data: '{{ tag_registry_value }}'\n - action: script.send_notification\n data: '{{ notification_data }}'\n - action: recorder.disable\n - action: script.turn_off_pc\n - if:\n - condition: state\n entity_id: timer.vacuum\n state: idle\n then:\n - action: vacuum.stop\n entity_id: vacuum.ecovacs_deebot_none",
"config": [
{
"name": "Cyber1 Status Data",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_status_data",
"device_id": null
}
},
{
"name": "UPS Power Out Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.ups_power_out",
"device_id": null
}
},
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "Cyber1 Status",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_status",
"device_id": null
}
},
{
"name": "Vacuum Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.vacuum",
"device_id": null
}
}
]
},
{
"id": "handle_ups_critical",
"automation": "- alias: Handle UPS Critical\n id: handle_ups_critical\n trigger:\n - platform: numeric_state\n entity_id: sensor.cyber1_battery_runtime\n below: 420\n - platform: homeassistant\n event: start\n condition:\n - condition: numeric_state\n entity_id: sensor.cyber1_battery_runtime\n below: 420\n action:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - variables:\n tag: ups_battery\n title: 'Warning:'\n message: UPS battery is critical, shutting down RPi.\n channel: critical\n tag_registry_value: '{{ {''tag'': tag, ''clear_type'': ''auto'', ''title'':\n title, ''message'': message, ''channel'': channel, ''timeout'': 0} }}'\n notification_data: '{{ {''destination'': [''mobile''], ''title'': title, ''message'':\n message, ''channel'': channel, ''timeout'': 0, ''tag'': tag} }}'\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.ups_battery_critical\n data_template:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - action: script.register_mobile_notification\n data: '{{ tag_registry_value }}'\n - action: script.send_notification\n data: '{{ notification_data }}'\n - delay: 3\n - action: hassio.host_shutdown",
"config": [
{
"name": "Cyber1 Battery Runtime",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_battery_runtime",
"device_id": null
}
},
{
"name": "UPS Battery Critical Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.ups_battery_critical",
"device_id": null
}
}
]
},
{
"id": "handle_power_restoration",
"automation": "- alias: Handle Power Restoration\n id: handle_power_restoration\n trigger:\n - platform: state\n entity_id: sensor.cyber1_status_data\n to: OL CHRG\n for: 00:02:00\n - platform: homeassistant\n event: start\n condition:\n - condition: state\n entity_id: sensor.cyber1_status_data\n state: OL CHRG\n action:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - variables:\n tag: power_restored\n title: 'Attention:'\n message: \"{% set var = namespace(outage = '', critical = '') %} {% set prefix\\\n \\ = 'Power is restored, turning on the PC (' %} {% set keys = state_attr('sensor.mobile_tag_registry_keys',\\\n \\ 'tags') %} {% set var.outage = 'outage: ' ~ state_attr('input_datetime.ups_power_out',\\\n \\ 'timestamp') | timestamp_custom %} {% if 'ups_battery' in keys %}\\n {%\\\n \\ set var.critical = ', critical: ' ~ state_attr('input_datetime.ups_battery_critical',\\\n \\ 'timestamp') | timestamp_custom %}\\n{% endif %}\\n{{ prefix ~ var.outage\\\n \\ ~ var.critical ~ ')' }}\\n\"\n channel: standard\n tag_registry_value: '{{ {''tag'': tag, ''clear_type'': ''manual'', ''title'':\n title, ''message'': message, ''channel'': channel, ''timeout'': 0} }}'\n notification_data: '{{ {''destination'': [''mobile''], ''title'': title, ''message'':\n message, ''channel'': channel, ''timeout'': 0, ''tag'': tag} }}'\n - action: script.register_mobile_notification\n data: '{{ tag_registry_value }}'\n - action: script.send_notification\n data: '{{ notification_data }}'\n - action: script.remove_mobile_notification\n data:\n tag: power_out\n - action: script.remove_mobile_notification\n data:\n tag: ups_battery\n - action: wake_on_lan.send_magic_packet\n data:\n mac: 98-EE-CB-A6-80-EA\n - delay: 00:02:00\n - action: recorder.enable\n - action: vacuum.return_to_base\n entity_id: vacuum.ecovacs_deebot_none\n - action: input_boolean.turn_off\n entity_id: input_boolean.theater_open\n - action: remote.turn_off\n entity_id: remote.harmony_hub",
"config": [
{
"name": "Cyber1 Status Data",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_status_data",
"device_id": null
}
},
{
"name": "UPS Power Out Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.ups_power_out",
"device_id": null
}
},
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "UPS Battery Critical Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.ups_battery_critical",
"device_id": null
}
},
{
"name": "Cyber1 Status",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_status",
"device_id": null
}
},
{
"name": "Mobile Tag Registry Keys",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.mobile_tag_registry_keys",
"device_id": null
}
},
{
"name": "Theater Open",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.theater_open",
"device_id": null
}
},
{
"name": "Remote Harmony Hub",
"room": "theater",
"type": "remote",
"id": {
"entity_id": "remote.harmony_hub",
"device_id": null
}
}
]
},
{
"id": "reboot_nut_service",
"automation": "- alias: Reboot NUT Service\n id: reboot_nut_service\n trigger:\n - platform: state\n entity_id: sensor.cyber1_status\n to: unavailable\n - platform: homeassistant\n event: start\n condition:\n - condition: state\n entity_id: sensor.cyber1_status\n state: unavailable\n action:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - service: shell_command.reboot_nut_service",
"config": [
{
"name": "Cyber1 Status",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_status",
"device_id": null
}
}
]
},
{
"id": "open_house",
"automation": "- alias: Open House\n id: open_house\n triggers:\n - trigger: state\n entity_id: person.jon\n from: not_home\n to: home\n for: 00:00:05\n actions:\n - action: script.turn_on\n target:\n entity_id: script.open_garage_door_north\n data:\n variables:\n use_info_message: false\n - action: script.turn_off_extended_away_mode\n - if:\n - '{{ states(''sensor.downstairs_sensor_ambient_light'') | float(0) < states(''input_number.family_room_ambient_min'')\n | float(0) }}'\n then:\n - action: light.turn_on\n target:\n entity_id:\n - light.office_lamp\n - light.driveway\n - light.front_floodlight\n - if:\n - condition: state\n entity_id: input_boolean.christmas_mode\n state: 'off'\n then:\n - action: light.turn_on\n target:\n entity_id:\n - light.family_room_lamp\n - light.hallway_lamp\n else:\n - action: script.turn_on_christmas_lights\n data:\n variables:\n additional_lights: daytime\n - if:\n - condition: state\n entity_id: person.skylar\n state: home\n then:\n - action: script.operate_preferred_studio_lamps\n data:\n operation: 'on'",
"config": [
{
"name": "Jon Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.jon",
"device_id": null
}
},
{
"name": "Skylar Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.skylar",
"device_id": null
}
},
{
"name": "Christmas Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.christmas_mode",
"device_id": null
}
},
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Office Lamp",
"room": "office",
"type": "light",
"id": {
"entity_id": "light.office_lamp",
"device_id": null
}
},
{
"name": "Driveway Light",
"room": "driveway",
"type": "light",
"id": {
"entity_id": "light.driveway",
"device_id": null
}
},
{
"name": "Front Floodlight",
"room": "front",
"type": "light",
"id": {
"entity_id": "light.front_floodlight",
"device_id": null
}
},
{
"name": "Family Room Ambient Min",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_min",
"device_id": null
}
},
{
"name": "Family Room Lamp",
"room": "family_room",
"type": "light",
"id": {
"entity_id": "light.family_room_lamp",
"device_id": null
}
},
{
"name": "Hallway Lamp",
"room": "hallway",
"type": "light",
"id": {
"entity_id": "light.hallway_lamp",
"device_id": null
}
},
{
"name": "Open Garage Door North",
"room": "Garage",
"type": "script",
"id": {
"entity_id": "script.open_garage_door_north",
"device_id": null
}
},
{
"name": "Turn Off Extended Away Mode",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_off_extended_away_mode",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "close_house",
"automation": "- alias: Close House\n id: close_house\n mode: queued\n triggers:\n - trigger: state\n entity_id: person.jon\n from: home\n to: not_home\n for: 00:00:05\n id: jon_left\n - trigger: state\n entity_id: sun.sun\n from: above_horizon\n to: below_horizon\n id: sunset\n - trigger: homeassistant\n event: start\n id: start\n conditions:\n - or:\n - condition: state\n entity_id: person.jon\n state: not_home\n - condition: state\n entity_id: sun.sun\n state: below_horizon\n actions:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - action: script.turn_on\n target:\n entity_id: script.close_garage_door_north\n data:\n variables:\n use_info_message: true\n - action: script.turn_on\n target:\n entity_id: script.close_garage_door_south\n data:\n variables:\n use_info_message: true\n - if:\n - '{{ trigger.id != ''sunset'' and not is_state(''person.jon'', ''home'') }}'\n then:\n - action: script.turn_on\n entity_id: script.lock_pc\n - if:\n - '{{ is_state(''binary_sensor.adults_home'', ''off'') }}'\n then:\n - action: scene.turn_on\n target:\n entity_id:\n - scene.lights_out\n - scene.fans_off_downstairs\n - scene.fans_off_upstairs\n - action: script.turn_off_fan_lights\n data:\n light_entity: '{{ expand(state_attr(''light.ceiling_fan_lights'', ''entity_id''))\n | map(attribute = ''entity_id'') | list }}'\n - if:\n - '{{ trigger.id != ''jon_left'' and states(''sun.sun'') == ''below_horizon''\n }}'\n then:\n - action: light.turn_off\n target:\n entity_id:\n - light.storage_lights\n - light.outdoor_lights",
"config": [
{
"name": "Jon Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.jon",
"device_id": null
}
},
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
},
{
"name": "Adults Home",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.adults_home",
"device_id": null
}
},
{
"name": "Ceiling Fan Lights",
"room": null,
"type": "light",
"id": {
"entity_id": "light.ceiling_fan_lights",
"device_id": null
}
},
{
"name": "Storage Lights",
"room": "storage",
"type": "light",
"id": {
"entity_id": "light.storage_lights",
"device_id": null
}
},
{
"name": "Outdoor Lights",
"room": "outdoor",
"type": "light",
"id": {
"entity_id": "light.outdoor_lights",
"device_id": null
}
},
{
"name": "Lights Out Scene",
"room": null,
"type": "scene",
"id": {
"entity_id": "scene.lights_out",
"device_id": null
}
},
{
"name": "Fans Off Downstairs Scene",
"room": "downstairs",
"type": "scene",
"id": {
"entity_id": "scene.fans_off_downstairs",
"device_id": null
}
},
{
"name": "Fans Off Upstairs Scene",
"room": "upstairs",
"type": "scene",
"id": {
"entity_id": "scene.fans_off_upstairs",
"device_id": null
}
},
{
"name": "Close Garage Door North",
"room": "Garage",
"type": "script",
"id": {
"entity_id": "script.close_garage_door_north",
"device_id": null
}
},
{
"name": "Close Garage Door South",
"room": "Garage",
"type": "script",
"id": {
"entity_id": "script.close_garage_door_south",
"device_id": null
}
},
{
"name": "Lock PC",
"room": null,
"type": "script",
"id": {
"entity_id": "script.lock_pc",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "handle_guest_arrival_cleanup",
"automation": "- alias: Handle Guest Arrival Cleanup\n id: handle_guest_arrival_cleanup\n trigger:\n - platform: event\n event_type: timer.finished\n event_data:\n entity_id: timer.guest_arrival_cleanup\n action:\n - service: script.turn_on\n target:\n entity_id: script.close_garage_door_north\n data:\n variables:\n use_info_message: true\n - action: light.turn_off\n target:\n entity_id:\n - light.driveway\n - light.front_floodlight",
"config": [
{
"name": "Driveway Light",
"room": "driveway",
"type": "light",
"id": {
"entity_id": "light.driveway",
"device_id": null
}
},
{
"name": "Front Floodlight",
"room": "front",
"type": "light",
"id": {
"entity_id": "light.front_floodlight",
"device_id": null
}
},
{
"name": "Guest Arrival Cleanup Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.guest_arrival_cleanup",
"device_id": null
}
},
{
"name": "Close Garage Door North",
"room": "Garage",
"type": "script",
"id": {
"entity_id": "script.close_garage_door_north",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "enable_family_room_av",
"automation": "- alias: Enable Family Room AV\n id: enable_family_room_av\n triggers:\n - trigger: time\n at: 07:00:00\n id: morning\n - trigger: time\n at: '16:00:00'\n id: afternoon\n conditions:\n - or:\n - and:\n - condition: state\n entity_id: binary_sensor.children_home\n state: 'on'\n - condition: trigger\n id: morning\n - condition: trigger\n id: afternoon\n actions:\n - condition: state\n entity_id: input_boolean.extended_away_mode\n state: 'off'\n - action: script.enable_family_room_av",
"config": [
{
"name": "Extended Away Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_mode",
"device_id": null
}
},
{
"name": "Children Home",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.children_home",
"device_id": null
}
}
]
},
{
"id": "toggle_office_occupied",
"automation": "- alias: Toggle Office occupied\n id: toggle_office_occupied\n triggers:\n - trigger: state\n entity_id: binary_sensor.office_human_sensor_presence\n from: 'off'\n to: 'on'\n for: 00:02:00\n id: 'on'\n - trigger: state\n entity_id: binary_sensor.office_human_sensor_presence\n from: 'on'\n to: 'off'\n for: 00:15:00\n id: 'off'\n actions:\n - action: input_boolean.turn_{{ trigger.id }}\n target:\n entity_id: input_boolean.office_occupied",
"config": [
{
"name": "Office Human Sensor Presence",
"room": "office",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.office_human_sensor_presence",
"device_id": null
}
},
{
"name": "Office Occupied",
"room": "office",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.office_occupied",
"device_id": null
}
}
]
},
{
"id": "operate_office_fan",
"automation": "- alias: Operate Office Fan\n id: operate_office_fan\n use_blueprint:\n path: devices/operate_ceiling_fans.yaml\n input:\n sensor_entity: input_boolean.office_occupied\n sensor_off_state: 'off'\n temperature_entity: sensor.office_sensor_temperature\n fan_entity: fan.office_fan\n thresholds:\n - 80\n - 78\n - 76",
"config": [
{
"name": "Office Occupied",
"room": "office",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.office_occupied",
"device_id": null
}
},
{
"name": "Office Sensor Temperature",
"room": "office",
"type": "sensor",
"id": {
"entity_id": "sensor.office_sensor_temperature",
"device_id": null
}
},
{
"name": "Office Fan",
"room": "office",
"type": "fan",
"id": {
"entity_id": "fan.office_fan",
"device_id": null
}
}
]
},
{
"id": "operate_family_room_fan",
"automation": "- alias: Operate Family Room Fan\n id: operate_family_room_fan\n use_blueprint:\n path: devices/operate_ceiling_fans.yaml\n input:\n sensor_entity: binary_sensor.family_room_av_system\n sensor_off_state: 'off'\n temperature_entity: sensor.main_floor_temperature\n fan_entity: fan.family_room_fan\n thresholds:\n - 80\n - 78.5\n - 74",
"config": [
{
"name": "Family Room AV System",
"room": "family_room",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.family_room_av_system",
"device_id": null
}
},
{
"name": "Main Floor Temperature",
"room": "main_floor",
"type": "sensor",
"id": {
"entity_id": "sensor.main_floor_temperature",
"device_id": null
}
},
{
"name": "Family Room Fan",
"room": "family_room",
"type": "fan",
"id": {
"entity_id": "fan.family_room_fan",
"device_id": null
}
}
]
},
{
"id": "operate_theater_fan",
"automation": "- alias: Operate Theater Fan\n id: operate_theater_fan\n use_blueprint:\n path: devices/operate_ceiling_fans.yaml\n input:\n sensor_entity: sensor.harmony_hub\n sensor_off_state: PowerOff\n temperature_entity: sensor.theater_temperature\n fan_entity: fan.theater_fan\n thresholds:\n - 78\n - 76\n - 74",
"config": [
{
"name": "Harmony Hub Sensor",
"room": "theater",
"type": "sensor",
"id": {
"entity_id": "sensor.harmony_hub",
"device_id": null
}
},
{
"name": "Theater Temperature",
"room": "theater",
"type": "sensor",
"id": {
"entity_id": "sensor.theater_temperature",
"device_id": null
}
},
{
"name": "Theater Fan",
"room": "theater",
"type": "fan",
"id": {
"entity_id": "fan.theater_fan",
"device_id": null
}
}
]
},
{
"id": "turn_off_penthouse_fan",
"automation": "- alias: Turn Off Penthouse Fan\n id: turn_off_penthouse_fan\n trigger:\n - platform: state\n entity_id: switch.penthouse_fan\n from: 'off'\n to: 'on'\n for: 00:40:00\n action:\n - service: switch.turn_off\n entity_id: switch.penthouse_fan",
"config": [
{
"name": "Penthouse Fan Switch",
"room": "penthouse",
"type": "switch",
"id": {
"entity_id": "switch.penthouse_fan",
"device_id": null
}
}
]
},
{
"id": "start_treadmill",
"automation": "- alias: Start Treadmill\n id: start_treadmill\n trigger:\n - platform: numeric_state\n entity_id: sensor.treadmill_current_consumption\n above: 200\n condition:\n - condition: state\n entity_id: input_boolean.treadmill_triggered\n state: 'off'\n action:\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.treadmill_start\n data_template:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - service: input_boolean.turn_on\n target:\n entity_id: input_boolean.treadmill_triggered",
"config": [
{
"name": "Treadmill Current Consumption",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.treadmill_current_consumption",
"device_id": null
}
},
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Treadmill Start Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.treadmill_start",
"device_id": null
}
}
]
},
{
"id": "detect_treadmill_power_unavailable",
"automation": "- alias: Detect Treadmill Power Unavailable\n id: detect_treadmill_power_unavailable\n trigger:\n - platform: state\n entity_id: sensor.treadmill_current_consumption\n to: unavailable\n condition:\n - condition: state\n entity_id: input_boolean.treadmill_triggered\n state: 'on'\n action:\n - variables:\n minutes_since_start: '{% from ''utilities.jinja'' import calc_time_diff %} {{\n calc_time_diff(''input_datetime.treadmill_start'') | int(0) }}\n\n '\n default_minutes: '{{ states(''input_number.default_treadmill_minutes'') | int(0)\n }}'\n offset_minutes: 2\n - if:\n - '{{ minutes_since_start <= (default_minutes - offset_minutes) }}'\n then:\n - service: timer.start\n data:\n entity_id: timer.treadmill_power\n duration: '{{ (default_minutes - minutes_since_start) * 60 }}'\n else:\n - service: automation.trigger\n data:\n entity_id: automation.stop_treadmill\n skip_condition: false",
"config": [
{
"name": "Treadmill Current Consumption",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.treadmill_current_consumption",
"device_id": null
}
},
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Treadmill Start Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.treadmill_start",
"device_id": null
}
},
{
"name": "Default Treadmill Minutes",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.default_treadmill_minutes",
"device_id": null
}
},
{
"name": "Treadmill Power Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.treadmill_power",
"device_id": null
}
},
{
"name": "Stop Treadmill",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.stop_treadmill",
"device_id": null
}
}
]
},
{
"id": "detect_treadmill_power_available",
"automation": "- alias: Detect Treadmill Power Available\n id: detect_treadmill_power_available\n trigger:\n - platform: state\n entity_id: sensor.treadmill_current_consumption\n from: unavailable\n action:\n - if:\n - condition: state\n entity_id: input_boolean.treadmill_triggered\n state: 'on'\n then:\n - if:\n - condition: state\n entity_id: timer.treadmill_power\n state: active\n then:\n - service: timer.cancel\n entity_id: timer.treadmill_power\n else:\n - service: switch.turn_off\n target:\n entity_id: switch.treadmill",
"config": [
{
"name": "Treadmill Current Consumption",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.treadmill_current_consumption",
"device_id": null
}
},
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Treadmill Power Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.treadmill_power",
"device_id": null
}
},
{
"name": "Treadmill Switch",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.treadmill",
"device_id": null
}
}
]
},
{
"id": "handle_treadmill_power_timer",
"automation": "- alias: Handle Treadmill Power Timer\n id: handle_treadmill_power_timer\n trigger:\n - platform: event\n event_type: timer.finished\n event_data:\n entity_id: timer.treadmill_power\n action:\n - service: automation.trigger\n data:\n entity_id: automation.stop_treadmill\n skip_condition: false",
"config": [
{
"name": "Treadmill Power Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.treadmill_power",
"device_id": null
}
},
{
"name": "Stop Treadmill",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.stop_treadmill",
"device_id": null
}
}
]
},
{
"id": "stop_treadmill",
"automation": "- alias: Stop Treadmill\n id: stop_treadmill\n triggers:\n - trigger: numeric_state\n entity_id: sensor.treadmill_current_consumption\n below: 7\n conditions:\n - condition: state\n entity_id: input_boolean.treadmill_triggered\n state: 'on'\n actions:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.treadmill_triggered\n - action: switch.turn_off\n target:\n entity_id: switch.treadmill\n - action: input_number.set_value\n target:\n entity_id: input_number.treadmill_daily_time\n data:\n value: '{% set start = as_timestamp(strptime(states(''input_datetime.treadmill_start''),\n ''%Y-%m-%d %H:%M:%S'')) %} {% set num = (now().timestamp() - start) // 60\n %} {% set minutes = (num - (num % 5)) %} {{ minutes }}\n\n '\n - variables:\n daily_calories: \"{% set weight = states('sensor.smart_scale_p1_weight') | float(0)\\\n \\ %} {% set speed = states('input_number.treadmill_speed') | float(0) %}\\\n \\ {% set incline = states('input_number.treadmill_incline') | int(0) %} {%\\\n \\ set time = states('input_number.treadmill_daily_time') | int(0) / 60\\\n \\ %} {% set ctime = 1/60 %} {% set kph = speed * 1.609344 %} {% set\\\n \\ ckph = 2.0 * 1.609344 %} {% set wkg = weight * 0.45359237 %} {%\\\n \\ if states('input_number.treadmill_incline') | int(0) == 0 %}\\n {% set cooldown\\\n \\ = (((ckph**3 * 0.0215) - (ckph**2 * 0.1765) + (ckph * 0.8710) + 1.4577)\\\n \\ * wkg * ctime) | int(0) %}\\n {{ cooldown + (( (kph**3 * 0.0215) - \\\n \\ (kph**2 * 0.1765) + (kph * 0.8710) + 1.4577) * wkg * time) | int(0) }}\\n\\\n {% elif states('input_number.treadmill_incline') | int(0) == 1 %}\\n {% set\\\n \\ cooldown = (((ckph**3 * 0.0171) - (ckph**2 * 0.1062) + (ckph * 0.6080) +\\\n \\ 1.8600) * wkg * ctime) | int(0) %}\\n {{ cooldown + (( (kph**3 * 0.0171)\\\n \\ - (kph**2 * 0.1062) + (kph * 0.6080) + 1.8600) * wkg * time) | int(0)\\\n \\ }}\\n{% elif states('input_number.treadmill_incline') | int(0) == 2 %}\\n\\\n \\ {% set cooldown = (((ckph**3 * 0.0184) - (ckph**2 * 0.1134) + (ckph * 0.6566)\\\n \\ + 1.9200) * wkg * ctime) | int(0) %}\\n {{ cooldown + (( (kph**3 * 0.0184)\\\n \\ - (kph**2 * 0.1134) + (kph * 0.6566) + 1.9200) * wkg * time) | int(0)\\\n \\ }}\\n{% elif states('input_number.treadmill_incline') | int(0) == 3 %}\\n\\\n \\ {% set cooldown = (((ckph**3 * 0.0196) - (ckph**2 * 0.1205) + (ckph * 0.7053)\\\n \\ + 1.9800) * wkg * ctime) | int(0) %}\\n {{ cooldown + (( (kph**3 * 0.0196)\\\n \\ - (kph**2 * 0.1205) + (kph * 0.7053) + 1.9800) * wkg * time) | int(0)\\\n \\ }}\\n{% elif states('input_number.treadmill_incline') | int(0) == 4 %}\\n\\\n \\ {% set cooldown = (((ckph**3 * 0.0208) - (ckph**2 * 0.1277) + (ckph * 0.7539)\\\n \\ + 2.0400) * wkg * ctime) | int(0) %}\\n {{ cooldown + (( (kph**3 * 0.0208)\\\n \\ - (kph**2 * 0.1277) + (kph * 0.7539) + 2.0400) * wkg * time) | int(0)\\\n \\ }}\\n{% elif states('input_number.treadmill_incline') | int(0) == 5 %}\\n\\\n \\ {% set cooldown = (((ckph**3 * 0.0221) - (ckph**2 * 0.1349) + (ckph * 0.8025)\\\n \\ + 2.1000) * wkg * ctime) | int(0) %}\\n {{ cooldown + (( (kph**3 * 0.0221)\\\n \\ - (kph**2 * 0.1349) + (kph * 0.8025) + 2.1000) * wkg * time) | int(0)\\\n \\ }}\\n{% endif %}\\n\"\n - action: input_number.set_value\n target:\n entity_id: input_number.treadmill_daily_calories\n data:\n value: '{{ daily_calories }}'\n - action: script.register_exercise_metrics\n data:\n exercise_type: treadmill\n daily_calories: '{{ daily_calories }}'\n - action: input_number.set_value\n target:\n entity_id: input_number.treadmill_usage_minutes\n data:\n value: '{{ states(''input_number.treadmill_usage_minutes'') | int(0) + states(''input_number.treadmill_daily_time'')\n | int(0) }}'",
"config": [
{
"name": "Treadmill Current Consumption",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.treadmill_current_consumption",
"device_id": null
}
},
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Treadmill Start Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.treadmill_start",
"device_id": null
}
},
{
"name": "Treadmill Switch",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.treadmill",
"device_id": null
}
},
{
"name": "Treadmill Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_daily_time",
"device_id": null
}
},
{
"name": "Smart Scale Weight",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.smart_scale_p1_weight",
"device_id": null
}
},
{
"name": "Treadmill Speed",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_speed",
"device_id": null
}
},
{
"name": "Treadmill Incline",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_incline",
"device_id": null
}
},
{
"name": "Treadmill Daily Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_daily_calories",
"device_id": null
}
},
{
"name": "Treadmill Usage Minutes",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_usage_minutes",
"device_id": null
}
}
]
},
{
"id": "check_refrigerator_off",
"automation": "- alias: Check Refrigerator Off\n id: check_refrigerator_off\n use_blueprint:\n path: devices/monitor_device.yaml\n input:\n device_entity: switch.refrigerator\n component_name: tplink\n device_name: Refrigerator",
"config": [
{
"name": "Refrigerator Switch",
"room": "kitchen",
"type": "switch",
"id": {
"entity_id": "switch.refrigerator",
"device_id": null
}
}
]
},
{
"id": "check_microwave_off",
"automation": "- alias: Check Microwave Off\n id: check_microwave_off\n use_blueprint:\n path: devices/monitor_device.yaml\n input:\n device_entity: switch.microwave\n component_name: tplink\n device_name: Microwave",
"config": [
{
"name": "Microwave Switch",
"room": "kitchen",
"type": "switch",
"id": {
"entity_id": "switch.microwave",
"device_id": null
}
}
]
},
{
"id": "check_projector_off",
"automation": "- alias: Check Projector Off\n id: check_projector_off\n use_blueprint:\n path: devices/monitor_device.yaml\n input:\n device_entity: switch.projector\n component_name: sonoff\n device_name: Projector\n conditional_processing: '{{ states(''input_boolean.projector_plug_powered_off'')\n }}'",
"config": [
{
"name": "Projector Switch",
"room": "theater",
"type": "switch",
"id": {
"entity_id": "switch.projector",
"device_id": null
}
},
{
"name": "Projector Plug Powered Off",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_plug_powered_off",
"device_id": null
}
}
]
},
{
"id": "start_vacuum",
"automation": "- alias: Start Vacuum\n id: start_vacuum\n triggers:\n - trigger: time\n at: 03:00:00\n conditions:\n - condition: time\n weekday:\n - mon\n - condition: state\n entity_id: timer.vacuum\n state: idle\n actions:\n - if:\n - '{{ states(''vacuum.ecovacs_deebot_none'') != ''docked'' }}'\n then:\n - action: homeassistant.reload_config_entry\n target:\n entity_id: vacuum.ecovacs_deebot_none\n - wait_template: '{{ is_state(''vacuum.ecovacs_deebot_none'', ''docked'') }}'\n timeout:\n seconds: 10\n - if:\n - '{{ states(''vacuum.ecovacs_deebot_none'') != ''docked'' }}'\n then:\n - action: script.send_notification\n data:\n destination:\n - persistent\n title: Device Alert\n message: Vacuum not functioning good.\n notification_id: vacuum_nfg\n - stop: Vacuum not functioning good\n - action: input_boolean.turn_off\n entity_id:\n - input_boolean.vacuum_kicked_off\n - input_boolean.vacuum_finished\n - action: timer.start\n data:\n entity_id: timer.vacuum\n duration: 01:30:00\n - delay:\n milliseconds: 100\n - action: vacuum.start\n entity_id: vacuum.ecovacs_deebot_none",
"config": [
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "Vacuum Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.vacuum",
"device_id": null
}
},
{
"name": "Vacuum Kicked Off",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.vacuum_kicked_off",
"device_id": null
}
},
{
"name": "Vacuum Finished",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.vacuum_finished",
"device_id": null
}
}
]
},
{
"id": "stop_vacuum",
"automation": "- alias: Stop Vacuum\n id: stop_vacuum\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.vacuum\n - trigger: numeric_state\n entity_id: sensor.ecovacs_deebot_battery\n below: 20\n conditions:\n - condition: time\n weekday:\n - mon\n actions:\n - action: vacuum.return_to_base\n entity_id: vacuum.ecovacs_deebot_none",
"config": [
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "Vacuum Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.vacuum",
"device_id": null
}
},
{
"name": "Ecovacs Deebot Battery",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.ecovacs_deebot_battery",
"device_id": null
}
}
]
},
{
"id": "detect_vacuum_running",
"automation": "- alias: Detect Vacuum Running\n id: detect_vacuum_running\n triggers:\n - trigger: state\n entity_id: vacuum.ecovacs_deebot_none\n to: cleaning\n conditions:\n - condition: time\n weekday:\n - mon\n - condition: state\n entity_id: timer.vacuum\n state: active\n actions:\n - action: input_boolean.turn_on\n entity_id: input_boolean.vacuum_kicked_off",
"config": [
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "Vacuum Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.vacuum",
"device_id": null
}
},
{
"name": "Vacuum Kicked Off",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.vacuum_kicked_off",
"device_id": null
}
}
]
},
{
"id": "detect_vacuum_finished",
"automation": "- alias: Detect Vacuum Finished\n id: detect_vacuum_finished\n triggers:\n - trigger: state\n entity_id: vacuum.ecovacs_deebot_none\n to: docked\n conditions:\n - condition: time\n weekday:\n - mon\n - condition: state\n entity_id: input_boolean.vacuum_kicked_off\n state: 'on'\n actions:\n - action: input_boolean.turn_on\n entity_id: input_boolean.vacuum_finished",
"config": [
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "Vacuum Kicked Off",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.vacuum_kicked_off",
"device_id": null
}
},
{
"name": "Vacuum Finished",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.vacuum_finished",
"device_id": null
}
}
]
},
{
"id": "start_washer",
"automation": "- alias: Start Washer\n id: start_washer\n trigger:\n - platform: state\n entity_id: sensor.washer_power_state\n from:\n - stop\n - unknown\n to: fill\n action:\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.washer_start\n data_template:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - service: input_select.select_option\n target:\n entity_id: input_select.washer_load_size\n data:\n option: '*sensing*'\n - service: input_boolean.turn_on\n entity_id: input_boolean.backup_laundry_log\n - service: script.log_laundry_event\n data:\n event_type: basic\n prefix: Washer\n message: 'starting: softener {{ states(''input_boolean.washer_fabric_softener'')\n }}'",
"config": [
{
"name": "Washer Power State",
"room": "laundry_room",
"type": "sensor",
"id": {
"entity_id": "sensor.washer_power_state",
"device_id": null
}
},
{
"name": "Washer Start Datetime",
"room": "laundry_room",
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.washer_start",
"device_id": null
}
},
{
"name": "Washer Load Size Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_load_size",
"device_id": null
}
},
{
"name": "Washer Fabric Softener",
"room": "laundry_room",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.washer_fabric_softener",
"device_id": null
}
},
{
"name": "Backup Laundry Log",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.backup_laundry_log",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
}
]
},
{
"id": "set_washer_load_size",
"automation": "- alias: Set Washer Load Size\n id: set_washer_load_size\n triggers:\n - trigger: state\n entity_id: sensor.washer_power_state\n from: fill\n to: raise\n conditions:\n - condition: state\n entity_id: input_select.washer_state\n state: Wash Fill\n actions:\n - variables:\n washer_fill_seconds: '{% set start = as_timestamp(strptime(states(''input_datetime.washer_start''),\n ''%Y-%m-%d %H:%M:%S'')) %} {% set seconds = (now().timestamp() - start) |\n round(0) %} {{ seconds }}\n\n '\n - action: input_select.select_option\n target:\n entity_id: input_select.washer_load_size\n data:\n option: \"{% if washer_fill_seconds >= 180 and washer_fill_seconds < 450 %}\\n\\\n \\ Small\\n{% elif washer_fill_seconds >= 450 and washer_fill_seconds < 650\\\n \\ %}\\n Medium\\n{% elif washer_fill_seconds >= 650 %}\\n Large\\n{% else %}\\n\\\n \\ Medium\\n{% endif %}\\n\"\n - action: input_number.set_value\n target:\n entity_id: input_number.washer_fill_seconds\n data:\n value: '{{ washer_fill_seconds }}'\n - action: script.log_laundry_event\n data:\n event_type: fill_plus_load\n prefix: Washer\n message: fill time, load size\n entity_id_1: input_number.washer_fill_seconds\n entity_id_2: input_select.washer_load_size",
"config": [
{
"name": "Washer Power State",
"room": "laundry_room",
"type": "sensor",
"id": {
"entity_id": "sensor.washer_power_state",
"device_id": null
}
},
{
"name": "Washer Start Datetime",
"room": "laundry_room",
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.washer_start",
"device_id": null
}
},
{
"name": "Washer Load Size Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_load_size",
"device_id": null
}
},
{
"name": "Washer State Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_state",
"device_id": null
}
},
{
"name": "Washer Fill Seconds",
"room": "laundry_room",
"type": "input_number",
"id": {
"entity_id": "input_number.washer_fill_seconds",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
}
]
},
{
"id": "start_washer_wash_blackout_timer",
"automation": "- alias: Start Washer Wash Blackout Timer\n id: start_washer_wash_blackout_timer\n trigger:\n - platform: state\n entity_id: input_select.washer_state\n from: Wash Fill\n to: Wash\n action:\n - variables:\n duration: 00:01:00\n - service: timer.start\n data:\n entity_id: timer.washer_wash_blackout\n duration: '{{ duration }}'\n - service: script.log_laundry_event\n data:\n event_type: timer\n prefix: Washer\n message: timer started ({{ duration }})\n entity_id_1: timer.washer_wash_blackout",
"config": [
{
"name": "Washer State Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_state",
"device_id": null
}
},
{
"name": "Washer Wash Blackout Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.washer_wash_blackout",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
}
]
},
{
"id": "start_washer_rinse_fill_blackout_timer",
"automation": "- alias: Start Washer Rinse Fill Blackout Timer\n id: start_washer_rinse_fill_blackout_timer\n trigger:\n - platform: state\n entity_id: input_select.washer_state\n from: Wash Drain\n to: Rinse Fill\n condition:\n - condition: state\n entity_id: input_boolean.washer_fabric_softener\n state: 'on'\n action:\n - variables:\n duration: '{% set load_size = states(''input_select.washer_load_size'') %} {{\n iif(load_size == ''Small'', ''00:03:00'', iif(load_size == ''Large'', ''00:05:00'',\n ''00:04:00'')) }}\n\n '\n - service: timer.start\n data:\n entity_id: timer.washer_rinse_fill_blackout\n duration: '{{ duration }}'\n - service: script.log_laundry_event\n data:\n event_type: timer\n prefix: Washer\n message: timer started ({{ duration }})\n entity_id_1: timer.washer_rinse_fill_blackout",
"config": [
{
"name": "Washer Load Size Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_load_size",
"device_id": null
}
},
{
"name": "Washer Fabric Softener",
"room": "laundry_room",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.washer_fabric_softener",
"device_id": null
}
},
{
"name": "Washer State Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_state",
"device_id": null
}
},
{
"name": "Washer Rinse Fill Blackout Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.washer_rinse_fill_blackout",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
}
]
},
{
"id": "start_washer_rinse_blackout_timer",
"automation": "- alias: Start Washer Rinse Blackout Timer\n id: start_washer_rinse_blackout_timer\n trigger:\n - platform: state\n entity_id: input_select.washer_state\n from: Rinse Fill\n to: Rinse\n action:\n - variables:\n duration: 00:01:00\n - service: timer.start\n data:\n entity_id: timer.washer_rinse_blackout\n duration: '{{ duration }}'\n - service: script.log_laundry_event\n data:\n event_type: timer\n prefix: Washer\n message: timer started ({{ duration }})\n entity_id_1: timer.washer_rinse_blackout",
"config": [
{
"name": "Washer State Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_state",
"device_id": null
}
},
{
"name": "Washer Rinse Blackout Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.washer_rinse_blackout",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
}
]
},
{
"id": "set_washer_operation",
"automation": "- alias: Set Washer Operation\n id: set_washer_operation\n trace:\n stored_traces: 20\n trigger:\n - platform: state\n entity_id: sensor.washer_power_state\n condition: '{{ trigger.from_state and trigger.from_state.state != ''unavailable''\n }}'\n action:\n - delay: 00:00:01\n - variables:\n s: '{{ states(''input_select.washer_state'') }}'\n - service: input_select.select_option\n data:\n entity_id: input_select.washer_state\n option: \"{# --Set variables-- #} {% set fr = trigger.from_state.state %} {%\\\n \\ set to = trigger.to_state.state %} {% set t1 = states('timer.washer_rinse_fill_blackout')\\\n \\ %} {% set t2 = states('timer.washer_rinse_blackout') %} {% set t3 = states('timer.washer_wash_blackout')\\\n \\ %}\\n{# --Ignore everything if one of the timers is running-- #} {% if t1\\\n \\ == 'active' or t2 == 'active' or t3 == 'active' %} {{ s }}\\n{# --Transition\\\n \\ to new state based on current state and washer power state sensor change--\\\n \\ #} {% elif fr in ['stop', 'unknown'] and to == 'fill' %} \\\n \\ Wash Fill {% elif fr in ['fill', 'drop'] and to ==\\\n \\ 'raise' and s == 'Wash Fill' %} Wash {% elif fr == 'raise'\\\n \\ and to == 'drop' and s in ['Wash', 'Wash Drain'] %} Wash\\\n \\ Drain {% elif fr in ['drop', 'raise'] and to == 'fill' and s == 'Wash\\\n \\ Drain' %} Rinse Fill {% elif fr in ['fill', 'drop'] and to\\\n \\ == 'raise' and s == 'Rinse Fill' %} Rinse {% elif fr == 'raise'\\\n \\ and to == 'drop' and s == 'Rinse' %} Rinse\\\n \\ Drain \\n{# --Some washer power state sensor changes just remain in the\\\n \\ current state-- #} {% elif fr == 'drop' and to in ['fill', 'raise'] %}\\\n \\ {{ s }} {% elif fr == 'fill' and to in ['drop', 'raise'] %} {{ s }} {%\\\n \\ elif fr == 'raise' and to in ['fill', 'drop'] %} {{ s }}\\n{# --Catch-all,\\\n \\ default to Off-- #} {% else %} Off {% endif %}\\n\"\n - if:\n - '{{ s != states(''input_select.washer_state'') }}'\n then:\n - service: script.log_laundry_event\n data:\n event_type: basic\n prefix: Washer\n message: state changed from {{ s }} to {{ states('input_select.washer_state')\n }}\n - if:\n - '{{ is_state(''input_select.washer_state'', ''Off'') }}'\n then:\n - service: script.log_laundry_event\n data:\n event_type: basic\n prefix: Washer\n message: stopped\n - service: script.update_laundry_history_time_ranges\n data:\n is_washer: true\n start_time: '{{ state_attr(''input_datetime.washer_start'', ''timestamp'')\n | int(0) }}'\n stop_time: '{{ as_timestamp(now()) | round(0) }}'",
"config": [
{
"name": "Washer Power State",
"room": "laundry_room",
"type": "sensor",
"id": {
"entity_id": "sensor.washer_power_state",
"device_id": null
}
},
{
"name": "Washer Start Datetime",
"room": "laundry_room",
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.washer_start",
"device_id": null
}
},
{
"name": "Washer State Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_state",
"device_id": null
}
},
{
"name": "Washer Wash Blackout Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.washer_wash_blackout",
"device_id": null
}
},
{
"name": "Washer Rinse Fill Blackout Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.washer_rinse_fill_blackout",
"device_id": null
}
},
{
"name": "Washer Rinse Blackout Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.washer_rinse_blackout",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
},
{
"name": "Update Laundry History Time Ranges",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.update_laundry_history_time_ranges",
"device_id": null
}
}
]
},
{
"id": "turn_on_dryer_running",
"automation": "- alias: Turn On Dryer Running\n id: turn_on_dryer_running\n triggers:\n - trigger: template\n value_template: \"{{ states('sensor.dryer_sensor_temperature') not in ['unavailable',\\\n \\ 'unknown'] and states('sensor.downstairs_temperature') not in ['unavailable',\\\n \\ 'unknown'] and\\n states('sensor.dryer_sensor_temperature') | int(0) > (states('sensor.downstairs_temperature')\\\n \\ | int(0) + 30) }}\\n\"\n actions:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.dryer_start\n data_template:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'\n - action: counter.reset\n entity_id:\n - counter.dryer_temperature_count\n - counter.dryer_humidity_count\n - action: input_boolean.turn_on\n entity_id: input_boolean.dryer_running\n - action: input_boolean.turn_on\n entity_id: input_boolean.backup_laundry_log\n - action: script.log_laundry_event\n data:\n event_type: basic\n prefix: Dryer\n message: '{% set intemp = states(''sensor.downstairs_temperature'') %} {% set\n inhum = states(''sensor.downstairs_humidity'') %} {% set outtemp = states(''sensor.porch_sensor_temperature'')\n %} {% set outhum = states(''sensor.openweathermap_humidity'') %}\n\n starting: indoor ({{ intemp }}°, {{ inhum }}%); outdoor ({{ outtemp }}°, {{\n outhum }} %)\n\n '\n - action: script.log_laundry_event\n data:\n event_type: metric\n prefix: Dryer\n message: temperature detected\n entity_id_1: sensor.dryer_sensor_temperature\n - action: timer.start\n data:\n entity_id: timer.dryer_done_failsafe\n duration: 02:00:00",
"config": [
{
"name": "Porch Sensor Temperature",
"room": "porch",
"type": "sensor",
"id": {
"entity_id": "sensor.porch_sensor_temperature",
"device_id": null
}
},
{
"name": "Backup Laundry Log",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.backup_laundry_log",
"device_id": null
}
},
{
"name": "Dryer Sensor Temperature",
"room": "laundry_room",
"type": "sensor",
"id": {
"entity_id": "sensor.dryer_sensor_temperature",
"device_id": null
}
},
{
"name": "Downstairs Temperature",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_temperature",
"device_id": null
}
},
{
"name": "Dryer Start Datetime",
"room": "laundry_room",
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.dryer_start",
"device_id": null
}
},
{
"name": "Dryer Temperature Count",
"room": "laundry_room",
"type": "counter",
"id": {
"entity_id": "counter.dryer_temperature_count",
"device_id": null
}
},
{
"name": "Dryer Humidity Count",
"room": "laundry_room",
"type": "counter",
"id": {
"entity_id": "counter.dryer_humidity_count",
"device_id": null
}
},
{
"name": "Dryer Running",
"room": "laundry_room",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.dryer_running",
"device_id": null
}
},
{
"name": "Downstairs Humidity",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_humidity",
"device_id": null
}
},
{
"name": "Openweathermap Humidity",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.openweathermap_humidity",
"device_id": null
}
},
{
"name": "Dryer Done Failsafe Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.dryer_done_failsafe",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
}
]
},
{
"id": "reset_dryer_done_failsafe",
"automation": "- alias: Reset Dryer Done Failsafe\n id: reset_dryer_done_failsafe\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.dryer_done_failsafe\n actions:\n - action: counter.reset\n entity_id:\n - counter.dryer_temperature_count\n - counter.dryer_humidity_count",
"config": [
{
"name": "Dryer Temperature Count",
"room": "laundry_room",
"type": "counter",
"id": {
"entity_id": "counter.dryer_temperature_count",
"device_id": null
}
},
{
"name": "Dryer Humidity Count",
"room": "laundry_room",
"type": "counter",
"id": {
"entity_id": "counter.dryer_humidity_count",
"device_id": null
}
},
{
"name": "Dryer Done Failsafe Timer",
"room": "laundry_room",
"type": "timer",
"id": {
"entity_id": "timer.dryer_done_failsafe",
"device_id": null
}
}
]
},
{
"id": "register_dryer_event",
"automation": "- alias: Register Dryer Event\n id: register_dryer_event\n triggers:\n - trigger: template\n value_template: '{{ states(''binary_sensor.dryer_humidity_falling'') == ''on''\n and states(''sensor.dryer_sensor_humidity'') | int(0) <= 70 }}'\n id: humidity\n - trigger: state\n entity_id: binary_sensor.dryer_temperature_falling\n to: 'on'\n id: temperature\n conditions:\n - condition: state\n entity_id: input_boolean.dryer_running\n state: 'on'\n actions:\n - if:\n - '{{ trigger.id == ''temperature'' }}'\n then:\n - action: counter.increment\n entity_id: counter.dryer_temperature_count\n - action: script.log_laundry_event\n data:\n event_type: metric\n prefix: Dryer\n message: temperature falling\n entity_id_1: sensor.dryer_sensor_temperature\n else:\n - action: counter.increment\n entity_id: counter.dryer_humidity_count\n - action: script.log_laundry_event\n data:\n event_type: metric\n prefix: Dryer\n message: humidity falling\n entity_id_1: sensor.dryer_sensor_humidity",
"config": [
{
"name": "Dryer Sensor Temperature",
"room": "laundry_room",
"type": "sensor",
"id": {
"entity_id": "sensor.dryer_sensor_temperature",
"device_id": null
}
},
{
"name": "Dryer Temperature Count",
"room": "laundry_room",
"type": "counter",
"id": {
"entity_id": "counter.dryer_temperature_count",
"device_id": null
}
},
{
"name": "Dryer Humidity Count",
"room": "laundry_room",
"type": "counter",
"id": {
"entity_id": "counter.dryer_humidity_count",
"device_id": null
}
},
{
"name": "Dryer Running",
"room": "laundry_room",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.dryer_running",
"device_id": null
}
},
{
"name": "Dryer Humidity Falling",
"room": "laundry_room",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.dryer_humidity_falling",
"device_id": null
}
},
{
"name": "Dryer Sensor Humidity",
"room": "laundry_room",
"type": "sensor",
"id": {
"entity_id": "sensor.dryer_sensor_humidity",
"device_id": null
}
},
{
"name": "Dryer Temperature Falling",
"room": "laundry_room",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.dryer_temperature_falling",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
}
]
},
{
"id": "turn_off_dryer_running",
"automation": "- alias: Turn Off Dryer Running\n id: turn_off_dryer_running\n trigger:\n - platform: state\n entity_id: binary_sensor.dryer_done\n to: 'on'\n condition:\n - condition: state\n entity_id: input_boolean.dryer_running\n state: 'on'\n action:\n - service: input_boolean.turn_off\n entity_id: input_boolean.dryer_running\n - service: script.log_laundry_event\n data:\n event_type: basic\n prefix: Dryer\n message: stopped\n - service: script.update_laundry_history_time_ranges\n data:\n is_washer: false\n start_time: '{{ state_attr(''input_datetime.dryer_start'', ''timestamp'') |\n int(0) }}'\n stop_time: '{{ as_timestamp(now()) | round(0) }}'",
"config": [
{
"name": "Dryer Start Datetime",
"room": "laundry_room",
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.dryer_start",
"device_id": null
}
},
{
"name": "Dryer Running",
"room": "laundry_room",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.dryer_running",
"device_id": null
}
},
{
"name": "Dryer Done",
"room": "laundry_room",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.dryer_done",
"device_id": null
}
},
{
"name": "Log Laundry Event",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.log_laundry_event",
"device_id": null
}
},
{
"name": "Update Laundry History Time Ranges",
"room": "Laundry Room",
"type": "script",
"id": {
"entity_id": "script.update_laundry_history_time_ranges",
"device_id": null
}
}
]
},
{
"id": "turn_on_treadmill_fan",
"automation": "- alias: Turn On Treadmill Fan\n id: turn_on_treadmill_fan\n trigger:\n - platform: state\n entity_id: input_boolean.treadmill_triggered\n to: 'on'\n action:\n - choose:\n - conditions:\n - condition: numeric_state\n entity_id: climate.downstairs\n attribute: current_temperature\n below: 70.0\n sequence:\n - delay: 00:10:00\n - service: switch.turn_on\n entity_id: switch.treadmill_fan\n - conditions:\n - condition: numeric_state\n entity_id: climate.downstairs\n attribute: current_temperature\n below: 75.0\n sequence:\n - delay: 00:05:00\n - service: switch.turn_on\n entity_id: switch.treadmill_fan\n default:\n - service: switch.turn_on\n entity_id: switch.treadmill_fan",
"config": [
{
"name": "Downstairs Climate",
"room": "downstairs",
"type": "climate",
"id": {
"entity_id": "climate.downstairs",
"device_id": null
}
},
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Treadmill Switch",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.treadmill",
"device_id": null
}
},
{
"name": "Treadmill Fan Switch",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.treadmill_fan",
"device_id": null
}
}
]
},
{
"id": "turn_off_treadmill_fan",
"automation": "- alias: Turn Off Treadmill Fan\n id: turn_off_treadmill_fan\n trigger:\n - platform: state\n entity_id: input_boolean.treadmill_triggered\n to: 'off'\n action:\n - delay: 00:02:00\n - service: switch.turn_off\n entity_id: switch.treadmill_fan\n - service: script.turn_on\n entity_id: script.control_fan_for_temperature\n data:\n variables:\n fan_entity_id: fan.office_fan\n temperature_entity_id: sensor.main_floor_temperature\n thresholds:\n - 76\n - 74\n - 72\n timeout: 360",
"config": [
{
"name": "Office Fan",
"room": "office",
"type": "fan",
"id": {
"entity_id": "fan.office_fan",
"device_id": null
}
},
{
"name": "Main Floor Temperature",
"room": "main_floor",
"type": "sensor",
"id": {
"entity_id": "sensor.main_floor_temperature",
"device_id": null
}
},
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Treadmill Switch",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.treadmill",
"device_id": null
}
},
{
"name": "Treadmill Fan Switch",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.treadmill_fan",
"device_id": null
}
},
{
"name": "Control Fan For Temperature",
"room": null,
"type": "script",
"id": {
"entity_id": "script.control_fan_for_temperature",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "manage_echo_do_not_disturb",
"automation": "- alias: Manage Echo Do Not Disturb\n id: manage_echo_do_not_disturb\n triggers:\n - trigger: state\n entity_id: input_boolean.nighttime\n from: 'off'\n to: 'on'\n id: 'on'\n - trigger: state\n entity_id: input_boolean.nighttime\n from: 'on'\n to: 'off'\n id: 'off'\n actions:\n - variables:\n bedroom_echoes: '{{ [''switch.master_bedroom_echo_do_not_disturb_switch'', ''switch.studio_echo_do_not_disturb_switch'',\n ''switch.penthouse_echo_do_not_disturb_switch''] }}'\n - repeat:\n for_each: '{{ bedroom_echoes }}'\n sequence:\n - variables:\n name: '{{ repeat.item.split(''.'')[1].split(''_'')[0] }}'\n occupied_sensor: '{{ ''binary_sensor.'' ~ name ~ ''_occupied'' }}'\n - if:\n - '{{ iif(name == ''master'' or states(occupied_sensor) == ''on'') }}'\n then:\n - action: switch.turn_{{ trigger.id }}\n target:\n entity_id: '{{ repeat.item }}'",
"config": [
{
"name": "Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.nighttime",
"device_id": null
}
},
{
"name": "Master Bedroom Echo Do Not Disturb Switch",
"room": "master_bedroom",
"type": "switch",
"id": {
"entity_id": "switch.master_bedroom_echo_do_not_disturb_switch",
"device_id": null
}
},
{
"name": "Studio Echo Do Not Disturb Switch",
"room": "studio",
"type": "switch",
"id": {
"entity_id": "switch.studio_echo_do_not_disturb_switch",
"device_id": null
}
},
{
"name": "Penthouse Echo Do Not Disturb Switch",
"room": "penthouse",
"type": "switch",
"id": {
"entity_id": "switch.penthouse_echo_do_not_disturb_switch",
"device_id": null
}
}
]
},
{
"id": "update_pc_lastboot",
"automation": "- alias: Update PC Lastboot\n id: update_pc_lastboot\n trigger:\n - platform: state\n entity_id: sensor.legion_t530_lastboot\n to: null\n condition: '{{ trigger.to_state.state not in [''unknown'', ''unavailable''] }}'\n action:\n - service: input_datetime.set_datetime\n target:\n entity_id: input_datetime.pc_lastboot\n data:\n timestamp: '{{ as_timestamp(states(''sensor.legion_t530_lastboot'')) }}'",
"config": [
{
"name": "Legion T530 Lastboot",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.legion_t530_lastboot",
"device_id": null
}
},
{
"name": "PC Lastboot Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.pc_lastboot",
"device_id": null
}
}
]
},
{
"id": "save_monthly_calories",
"automation": "- alias: Save Monthly Calories\n id: save_monthly_calories\n trigger:\n - platform: state\n entity_id: sensor.total_monthly_calories\n condition:\n - '{{ now().day == 1 }}'\n - '{{ trigger.from_state and trigger.from_state.state | float(0) > 0.0 }}'\n variables:\n month: '{{ as_timestamp(trigger.from_state.last_changed) | timestamp_custom(''%b'')\n | lower() }}'\n action:\n - service: system_log.write\n data:\n message: '{{ ''calories from state last changed/month: '' ~ trigger.from_state.last_changed\n ~ '' / '' ~ month }}'\n level: debug\n - service: input_number.set_value\n target:\n entity_id: input_number.calories_curr_year_{{ month }}\n data:\n value: '{{ trigger.from_state.state | float(0) }}'\n - if:\n - '{{ month == ''dec'' }}'\n then:\n - variables:\n months:\n - jan\n - feb\n - mar\n - apr\n - may\n - jun\n - jul\n - aug\n - sep\n - oct\n - nov\n - dec\n - repeat:\n count: 12\n sequence:\n - service: input_number.set_value\n target:\n entity_id: input_number.calories_prev_year_{{ months[repeat.index-1] }}\n data:\n value: '{{ states(''input_number.calories_curr_year_'' + months[repeat.index-1])\n }}'\n - service: input_number.set_value\n target:\n entity_id: input_number.calories_curr_year_{{ months[repeat.index-1] }}\n data:\n value: 0",
"config": [
{
"name": "Total Monthly Calories",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.total_monthly_calories",
"device_id": null
}
},
{
"name": "Calories Current Year",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.calories_curr_year_",
"device_id": null
}
}
]
},
{
"id": "copy_daily_steps",
"automation": "- alias: Copy Daily Steps\n id: copy_daily_steps\n trigger:\n - platform: time\n at: '23:59:00'\n action:\n - service: input_number.set_value\n target:\n entity_id: input_number.steps_daily\n data:\n value: '{{ states(''sensor.steps_daily'') }}'",
"config": [
{
"name": "Steps Daily",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_daily",
"device_id": null
}
},
{
"name": "Steps Daily Sensor",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.steps_daily",
"device_id": null
}
}
]
},
{
"id": "process_workout_exercise",
"automation": "- alias: Process Workout Exercise\n id: process_workout_exercise\n use_blueprint:\n path: health/process_exercise.yaml\n input:\n exercise_type: workout\n units_entity: input_number.workout_daily_time",
"config": [
{
"name": "Workout Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_daily_time",
"device_id": null
}
}
]
},
{
"id": "process_yard_work_exercise",
"automation": "- alias: Process Yard Work Exercise\n id: process_yard_work_exercise\n use_blueprint:\n path: health/process_exercise.yaml\n input:\n exercise_type: yard_work\n units_entity: input_number.yard_work_daily_time",
"config": [
{
"name": "Yard Work Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.yard_work_daily_time",
"device_id": null
}
}
]
},
{
"id": "process_other_exercise",
"automation": "- alias: Process Other Exercise\n id: process_other_exercise\n use_blueprint:\n path: health/process_exercise.yaml\n input:\n exercise_type: other\n units_entity: input_number.other_daily_time",
"config": [
{
"name": "Other Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.other_daily_time",
"device_id": null
}
}
]
},
{
"id": "process_steps_exercise",
"automation": "- alias: Process Steps Exercise\n id: process_steps_exercise\n use_blueprint:\n path: health/process_exercise.yaml\n input:\n exercise_type: steps\n units_entity: input_number.steps_daily",
"config": [
{
"name": "Steps Daily",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_daily",
"device_id": null
}
}
]
},
{
"id": "perform_startup_chores",
"automation": "- alias: Perform Startup Chores\n id: perform_startup_chores\n triggers:\n - trigger: homeassistant\n event: start\n actions:\n - action: shell_command.delete_junk_log_files\n - action: input_boolean.turn_on\n data:\n entity_id: input_boolean.kodi_movie_list_restoration\n - action: pyscript.restore_input_select_options\n data:\n entity: input_select.kodi_movies\n file: /config/all_movies_backup\n - wait_template: '{{ not is_state(''input_select.kodi_movies'', ''Select'') }}'\n timeout: 00:00:10\n - action: input_select.select_option\n data:\n entity_id: input_select.kodi_movies\n option: '{{ states(''input_text.current_feature'') }}'\n - action: input_boolean.turn_off\n data:\n entity_id: input_boolean.kodi_movie_list_restoration\n - delay:\n seconds: 30\n - action: homeassistant.reload_config_entry\n target:\n entity_id: vacuum.ecovacs_deebot_none",
"config": [
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "Kodi Movie List Restoration",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.kodi_movie_list_restoration",
"device_id": null
}
},
{
"name": "Kodi Movies Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.kodi_movies",
"device_id": null
}
},
{
"name": "Current Feature Text",
"room": null,
"type": "input_text",
"id": {
"entity_id": "input_text.current_feature",
"device_id": null
}
}
]
},
{
"id": "perform_mqtt_chores",
"automation": "- alias: Perform MQTT Chores\n id: perform_mqtt_chores\n triggers:\n - trigger: mqtt\n topic: homeassistant/status\n payload: online\n actions:\n - variables:\n vtrack_entities: \"{% set var = namespace(vtrack = []) %} {% for state in states.input_boolean\\\n \\ %}\\n {% if 'Virtual' in state.name %}\\n {% set var.vtrack = var.vtrack\\\n \\ + [state.entity_id] %}\\n {% endif %}\\n{% endfor %} {% for state in states.input_boolean\\\n \\ %}\\n {% if 'NFC Tag' in state.name %}\\n {% set var.vtrack = var.vtrack\\\n \\ + [state.entity_id] %}\\n {% endif %}\\n{% endfor %}\\n{{ var.vtrack }}\\n\"\n - repeat:\n for_each: '{{ vtrack_entities }}'\n sequence:\n - variables:\n topic_suffix: '{{ repeat.item | replace(''input_boolean.'', '''') }}'\n - if:\n - '{{ states(repeat.item) == ''on'' }}'\n then:\n - action: mqtt.publish\n data:\n topic: '{{ ''homeassistant/device_tracker/'' ~ topic_suffix }}'\n payload: home\n else:\n - action: mqtt.publish\n data:\n topic: '{{ ''homeassistant/device_tracker/'' ~ topic_suffix }}'\n payload: not_home\n - variables:\n suffix: last_changed\n items:\n - '{{ ''ups_'' ~ suffix }}'\n - '{{ ''garage_door_north_'' ~ suffix }}'\n - '{{ ''garage_door_south_'' ~ suffix }}'\n - '{{ ''treadmill_'' ~ suffix }}'\n - '{{ ''washer_'' ~ suffix }}'\n - '{{ ''workout_'' ~ suffix }}'\n - repeat:\n count: '{{ items | length }}'\n sequence:\n - action: script.set_up_mqtt_automated_config\n data:\n domain: sensor\n unique_id: '{{ items[repeat.index - 1] }}'\n device_class: timestamp",
"config": []
},
{
"id": "perform_shutdown_chores",
"automation": "- alias: Perform Shutdown Chores\n id: perform_shutdown_chores\n trigger:\n - platform: homeassistant\n event: shutdown\n action:\n - service: shell_command.backup_log",
"config": []
},
{
"id": "perform_daily_chores",
"automation": "- alias: Perform Daily Chores\n id: perform_daily_chores\n triggers:\n - trigger: time\n at: 01:01:01\n actions:\n - variables:\n day_of_week: '{{ as_timestamp(now()) | timestamp_custom(''%w'') | int(0) }}'\n day_of_month: '{{ now().day }}'\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.exercise_recordable\n - action: input_number.set_value\n target:\n entity_id:\n - input_number.treadmill_daily_time\n - input_number.treadmill_daily_calories\n - input_number.workout_daily_time\n - input_number.workout_daily_calories\n - input_number.yard_work_daily_time\n - input_number.yard_work_daily_calories\n - input_number.other_daily_time\n - input_number.other_daily_calories\n - input_number.steps_daily\n - input_number.steps_daily_calories\n data:\n value: 0\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.other_date\n data:\n timestamp: '{{ now().timestamp() }}'\n - action: automation.turn_on\n entity_id:\n - automation.determine_cpap_filter_target_day\n - automation.run_studio_motion_based_light\n - automation.update_last_alexa_device\n - if:\n - condition: state\n entity_id: update.zigbee2mqtt_update\n state: 'off'\n then:\n - action: automation.turn_on\n entity_id: automation.notify_zigbee_device_unavailable\n - action: shell_command.backup_auto_scripts_log\n - action: input_boolean.turn_off\n entity_id: input_boolean.dryer_running\n - if:\n - condition: state\n entity_id: input_boolean.backup_laundry_log\n state: 'on'\n then:\n - action: shell_command.backup_laundry_log\n - action: input_boolean.turn_off\n entity_id: input_boolean.backup_laundry_log\n - if:\n - condition: state\n entity_id: input_boolean.hockey_season\n state: 'on'\n then:\n - if:\n - condition: state\n entity_id: input_boolean.hockey_canes_active\n state: 'on'\n then:\n - action: homeassistant.update_entity\n target:\n entity_id: sensor.next_canes_game\n continue_on_error: true\n - if:\n - condition: state\n entity_id: input_boolean.hockey_flyers_active\n state: 'on'\n then:\n - action: homeassistant.update_entity\n target:\n entity_id: sensor.next_flyers_game\n continue_on_error: true\n - action: input_number.set_value\n target:\n entity_id: input_number.f150_mileage\n data:\n value: '{{ states(''input_number.f150_mileage'') | int(0) + 32 }}'\n - if:\n - condition: state\n entity_id: input_boolean.theater_open\n state: 'on'\n - condition: state\n entity_id: binary_sensor.adults_home\n state: 'off'\n - condition: state\n entity_id: sensor.harmony_hub\n state: PowerOff\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.theater_open\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.salt_system_low_temperature\n - action: automation.turn_on\n entity_id: automation.control_family_room_lamp\n - action: automation.turn_off\n entity_id: automation.control_christmas_lights\n - action: watchman.report\n data:\n parse_config: false\n create_file: true\n - repeat:\n for_each:\n - david\n - mike\n - sarah\n - skylar\n sequence:\n - if:\n - '{{ not is_state(''person.'' ~ repeat.item, ''home'') }}'\n then:\n - action: input_select.select_first\n target:\n entity_id: '{{ ''input_select.'' ~ repeat.item ~ ''_guest_suite'' }}'\n - if:\n - '{{ day_of_week == 0 }}'\n then:\n - action: input_number.set_value\n target:\n entity_id:\n - input_number.treadmill_weekly_time\n - input_number.treadmill_weekly_calories\n - input_number.workout_weekly_time\n - input_number.workout_weekly_calories\n - input_number.yard_work_weekly_time\n - input_number.yard_work_weekly_calories\n - input_number.other_weekly_time\n - input_number.other_weekly_calories\n - input_number.steps_weekly\n - input_number.steps_weekly_calories\n data:\n value: 0\n - action: script.generate_periodic_lists\n data:\n type: all\n start_date: '{{ states(''sensor.date'') }}'\n - action: script.generate_weekly_free_time_days\n - action: script.generate_weekly_exercise_days\n - if:\n - '{{ day_of_month == 1 }}'\n then:\n - action: input_number.set_value\n target:\n entity_id:\n - input_number.treadmill_monthly_time\n - input_number.treadmill_monthly_calories\n - input_number.workout_monthly_time\n - input_number.workout_monthly_calories\n - input_number.yard_work_monthly_time\n - input_number.yard_work_monthly_calories\n - input_number.other_monthly_time\n - input_number.other_monthly_calories\n - input_number.steps_monthly\n - input_number.steps_monthly_calories\n data:\n value: 0\n - action: counter.reset\n target:\n entity_id:\n - counter.treadmill_days\n - counter.workout_days\n - counter.yard_work_days\n - counter.other_days\n - counter.steps_days\n - counter.exercise_recordable\n - action: shell_command.backup_exercise_log",
"config": [
{
"name": "Harmony Hub Sensor",
"room": "theater",
"type": "sensor",
"id": {
"entity_id": "sensor.harmony_hub",
"device_id": null
}
},
{
"name": "Salt System Low Temperature",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.salt_system_low_temperature",
"device_id": null
}
},
{
"name": "Adults Home",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.adults_home",
"device_id": null
}
},
{
"name": "Treadmill Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_daily_time",
"device_id": null
}
},
{
"name": "Treadmill Daily Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_daily_calories",
"device_id": null
}
},
{
"name": "Backup Laundry Log",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.backup_laundry_log",
"device_id": null
}
},
{
"name": "Dryer Running",
"room": "laundry_room",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.dryer_running",
"device_id": null
}
},
{
"name": "Steps Daily",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_daily",
"device_id": null
}
},
{
"name": "Workout Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_daily_time",
"device_id": null
}
},
{
"name": "Yard Work Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.yard_work_daily_time",
"device_id": null
}
},
{
"name": "Other Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.other_daily_time",
"device_id": null
}
},
{
"name": "Zigbee2mqtt Update",
"room": null,
"type": "update",
"id": {
"entity_id": "update.zigbee2mqtt_update",
"device_id": null
}
},
{
"name": "Hockey Season",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.hockey_season",
"device_id": null
}
},
{
"name": "Hockey Canes Active",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.hockey_canes_active",
"device_id": null
}
},
{
"name": "Next Canes Game",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.next_canes_game",
"device_id": null
}
},
{
"name": "Hockey Flyers Active",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.hockey_flyers_active",
"device_id": null
}
},
{
"name": "Next Flyers Game",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.next_flyers_game",
"device_id": null
}
},
{
"name": "F150 Mileage",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.f150_mileage",
"device_id": null
}
},
{
"name": "Theater Open",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.theater_open",
"device_id": null
}
},
{
"name": "Treadmill Weekly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_weekly_time",
"device_id": null
}
},
{
"name": "Treadmill Weekly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_weekly_calories",
"device_id": null
}
},
{
"name": "Workout Weekly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_weekly_time",
"device_id": null
}
},
{
"name": "Workout Weekly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_weekly_calories",
"device_id": null
}
},
{
"name": "Yard Work Weekly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.yard_work_weekly_time",
"device_id": null
}
},
{
"name": "Yard Work Weekly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.yard_work_weekly_calories",
"device_id": null
}
},
{
"name": "Other Weekly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.other_weekly_time",
"device_id": null
}
},
{
"name": "Other Weekly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.other_weekly_calories",
"device_id": null
}
},
{
"name": "Steps Weekly",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_weekly",
"device_id": null
}
},
{
"name": "Steps Weekly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_weekly_calories",
"device_id": null
}
},
{
"name": "Treadmill Monthly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_monthly_time",
"device_id": null
}
},
{
"name": "Treadmill Monthly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.treadmill_monthly_calories",
"device_id": null
}
},
{
"name": "Workout Monthly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_monthly_time",
"device_id": null
}
},
{
"name": "Workout Monthly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_monthly_calories",
"device_id": null
}
},
{
"name": "Yard Work Monthly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.yard_work_monthly_time",
"device_id": null
}
},
{
"name": "Yard Work Monthly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.yard_work_monthly_calories",
"device_id": null
}
},
{
"name": "Other Monthly Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.other_monthly_time",
"device_id": null
}
},
{
"name": "Other Monthly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.other_monthly_calories",
"device_id": null
}
},
{
"name": "Steps Monthly",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_monthly",
"device_id": null
}
},
{
"name": "Steps Monthly Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_monthly_calories",
"device_id": null
}
},
{
"name": "Treadmill Days",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.treadmill_days",
"device_id": null
}
},
{
"name": "Workout Days",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.workout_days",
"device_id": null
}
},
{
"name": "Yard Work Days",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.yard_work_days",
"device_id": null
}
},
{
"name": "Other Days",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.other_days",
"device_id": null
}
},
{
"name": "Steps Days",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.steps_days",
"device_id": null
}
},
{
"name": "Exercise Recordable",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.exercise_recordable",
"device_id": null
}
},
{
"name": "Date Sensor",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.date",
"device_id": null
}
},
{
"name": "Other Date Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.other_date",
"device_id": null
}
},
{
"name": "Exercise Recordable",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.exercise_recordable",
"device_id": null
}
},
{
"name": "Control Christmas Lights",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.control_christmas_lights",
"device_id": null
}
},
{
"name": "Control Family Room Lamp",
"room": "Family Room",
"type": "automation",
"id": {
"entity_id": "automation.control_family_room_lamp",
"device_id": null
}
},
{
"name": "Determine CPAP Filter Target Day",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.determine_cpap_filter_target_day",
"device_id": null
}
},
{
"name": "Notify Zigbee Device Unavailable",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.notify_zigbee_device_unavailable",
"device_id": null
}
},
{
"name": "Run Studio Motion Based Light",
"room": "Studio",
"type": "automation",
"id": {
"entity_id": "automation.run_studio_motion_based_light",
"device_id": null
}
},
{
"name": "Update Last Alexa Device",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.update_last_alexa_device",
"device_id": null
}
},
{
"name": "Other Daily Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.other_daily_calories",
"device_id": null
}
},
{
"name": "Steps Daily Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.steps_daily_calories",
"device_id": null
}
},
{
"name": "Workout Daily Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_daily_calories",
"device_id": null
}
},
{
"name": "Yard Work Daily Calories",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.yard_work_daily_calories",
"device_id": null
}
}
]
},
{
"id": "log_automations",
"automation": "- alias: Log Automations\n id: log_automations\n mode: queued\n max: 200\n trace:\n stored_traces: 20\n triggers:\n - trigger: event\n event_type: automation_triggered\n conditions:\n - condition: template\n value_template: \"{% set skip_list = [\\n 'log_automations',\\n\\\n \\ 'log_scripts',\\n 'set_maximum_attic_temperature',\\\n \\ \\n 'set_maximum_garage_temperature', \\n \\\n \\ 'set_maximum_outdoor_temperature',\\n 'set_minimum_attic_temperature',\\\n \\ \\n 'set_minimum_garage_temperature', \\n \\\n \\ 'set_minimum_outdoor_temperature',\\n 'set_washer_operation'\\n\\\n \\ ] %}\\n{{ trigger.event.data.entity_id.split('.')[1] not\\\n \\ in skip_list }}\\n\"\n actions:\n - action: notify.send_message\n target:\n entity_id: notify.automations_scripts\n data:\n message: '{{ as_timestamp(trigger.event.time_fired) | timestamp_custom(''%b\n %d: %X'') }}: (A) {{ trigger.event.data.name }}\n\n '",
"config": [
{
"name": "Automations Scripts Notify",
"room": null,
"type": "notify",
"id": {
"entity_id": "notify.automations_scripts",
"device_id": null
}
}
]
},
{
"id": "log_scripts",
"automation": "- alias: Log Scripts\n id: log_scripts\n mode: queued\n max: 200\n trace:\n stored_traces: 20\n triggers:\n - trigger: event\n event_type: script_started\n conditions:\n - condition: template\n value_template: \"{% set skip_list = [\\n 'log_laundry_event',\\n\\\n \\ 'mobile_notification_worker',\\n 'restore_lighting_on_resume',\\n\\\n \\ 'resume_cinema',\\n 'resume_worker',\\\n \\ \\n 'set_datetime_offset_days', \\n 'set_datetime_offset_months',\\\n \\ \\n 'set_datetime_offset_weeks', \\n 'set_fan_to_speed',\\\n \\ \\n 'set_theater_dark',\\n 'set_theater_dark_delay',\\n\\\n \\ 'set_theater_dim',\\n 'set_theater_idle'\\n\\\n \\ ] %}\\n{{ trigger.event.data.entity_id.split('.')[1] not\\\n \\ in skip_list }}\\n\"\n actions:\n - action: notify.send_message\n target:\n entity_id: notify.automations_scripts\n data:\n message: '{{ as_timestamp(trigger.event.time_fired) | timestamp_custom(''%b\n %d: %X'') }}: (S) {{ trigger.event.data.name }}\n\n '",
"config": [
{
"name": "Automations Scripts Notify",
"room": null,
"type": "notify",
"id": {
"entity_id": "notify.automations_scripts",
"device_id": null
}
}
]
},
{
"id": "change_yaml_log_level",
"automation": "- alias: Change YAML Log Level\n id: change_yaml_log_level\n triggers:\n - trigger: state\n entity_id: input_select.yaml_log_level\n actions:\n - action: logger.set_level\n data:\n homeassistant.components.system_log.external: '{{ trigger.to_state.state }}'",
"config": [
{
"name": "Yaml Log Level Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.yaml_log_level",
"device_id": null
}
}
]
},
{
"id": "save_notifications_on_create",
"automation": "- alias: Save Notifications On Create\n id: save_notifications_on_create\n mode: queued\n triggers:\n - trigger: persistent_notification\n update_type:\n - added\n - updated\n - current\n conditions: '{{ trigger.notification.notification_id != ''config_entry_discovered''\n }}'\n actions:\n - action: mqtt.publish\n data_template:\n topic: homeassistant/notifications/{{ trigger.notification.notification_id }}\n payload: \"{\\n 'notification_id' : \\\"{{ trigger.notification.notification_id\\\n \\ }}\\\",\\n 'title' : \\\"{{ trigger.notification.title }}\\\",\\n 'message' :\\\n \\ \\\"{{ trigger.notification.message }}\\\"\\n}\"\n retain: true",
"config": []
},
{
"id": "remove_saved_notifications_on_dismiss",
"automation": "- alias: Remove Saved Notifications On Dismiss\n id: remove_saved_notifications_on_dismiss\n mode: queued\n trigger:\n - trigger: persistent_notification\n update_type:\n - removed\n condition: '{{ trigger.notification.notification_id != ''config_entry_discovery''\n }}'\n action:\n - service: mqtt.publish\n data_template:\n topic: homeassistant/notifications/{{ trigger.notification.notification_id }}\n retain: true",
"config": []
},
{
"id": "publish_mqtt_automated_states",
"automation": "- alias: Publish MQTT Automated States\n id: publish_mqtt_automated_states\n mode: parallel\n triggers:\n - trigger: state\n entity_id: sensor.cyber1_status_data\n to: OB DISCHRG\n for: 00:01:00\n id: ups\n - trigger: state\n entity_id: cover.garage_door_north\n from: closed\n to: open\n id: garage_door_north\n - trigger: state\n entity_id: cover.garage_door_south\n from: closed\n to: open\n id: garage_door_south\n - trigger: state\n entity_id: input_select.washer_state\n from: 'Off'\n not_to:\n - Unknown\n - unknown\n - unavailable\n id: washer\n - trigger: state\n entity_id: input_boolean.treadmill_triggered\n from: 'off'\n to: 'on'\n id: treadmill\n - trigger: numeric_state\n entity_id: input_number.workout_daily_time\n above: 0\n id: workout\n variables:\n valid: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n timestamp: '{{ (datetime | default(now())).isoformat() }}\n\n '\n unique_id: '{{ trigger.id }}_last_changed\n\n '\n conditions: '{{ valid }}'\n actions:\n - action: script.publish_mqtt_automated_states\n data:\n domain: sensor\n unique_id: '{{ unique_id }}'\n state: '{{ timestamp }}'\n attributes: {}",
"config": [
{
"name": "Cyber1 Status Data",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_status_data",
"device_id": null
}
},
{
"name": "Cyber1 Status",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.cyber1_status",
"device_id": null
}
},
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Washer State Select",
"room": "laundry_room",
"type": "input_select",
"id": {
"entity_id": "input_select.washer_state",
"device_id": null
}
},
{
"name": "Workout Daily Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.workout_daily_time",
"device_id": null
}
},
{
"name": "Garage Door North Cover",
"room": "garage",
"type": "cover",
"id": {
"entity_id": "cover.garage_door_north",
"device_id": null
}
},
{
"name": "Garage Door South Cover",
"room": "garage",
"type": "cover",
"id": {
"entity_id": "cover.garage_door_south",
"device_id": null
}
}
]
},
{
"id": "toggle_zigbee_unavailable_notification",
"automation": "- alias: Toggle Zigbee Unavailable Notification\n id: toggle_zigbee_unavailable_notification\n triggers:\n - trigger: state\n entity_id: update.zigbee2mqtt_update\n from: 'off'\n to: 'on'\n id: 'off'\n - trigger: state\n entity_id: update.zigbee2mqtt_update\n from: 'on'\n to: 'off'\n id: 'on'\n actions:\n - action: automation.turn_{{ trigger.id }}\n entity_id: automation.notify_zigbee_device_unavailable",
"config": [
{
"name": "Zigbee2mqtt Update",
"room": null,
"type": "update",
"id": {
"entity_id": "update.zigbee2mqtt_update",
"device_id": null
}
},
{
"name": "Notify Zigbee Device Unavailable",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.notify_zigbee_device_unavailable",
"device_id": null
}
}
]
},
{
"id": "toggle_hockey_hobby",
"automation": "- alias: Toggle Hockey Hobby\n id: toggle_hockey_hobby\n triggers:\n - trigger: state\n entity_id: input_boolean.hockey_season\n from: 'off'\n to: 'on'\n id: 'on'\n - trigger: state\n entity_id: input_boolean.hockey_season\n from: 'on'\n to: 'off'\n id: 'off'\n actions:\n - action: automation.turn_{{ trigger.id }}\n entity_id:\n - automation.notify_next_canes_game\n - automation.notify_next_flyers_game\n - action: input_boolean.turn_{{ trigger.id }}\n entity_id:\n - input_boolean.hockey_canes_active\n - input_boolean.hockey_flyers_active",
"config": [
{
"name": "Hockey Season",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.hockey_season",
"device_id": null
}
},
{
"name": "Hockey Canes Active",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.hockey_canes_active",
"device_id": null
}
},
{
"name": "Hockey Flyers Active",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.hockey_flyers_active",
"device_id": null
}
},
{
"name": "Notify Next Canes Game",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.notify_next_canes_game",
"device_id": null
}
},
{
"name": "Notify Next Flyers Game",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.notify_next_flyers_game",
"device_id": null
}
}
]
},
{
"id": "respond_to_mobile_text",
"automation": "- alias: Respond To Mobile Text\n id: respond_to_mobile_text\n mode: queued\n triggers:\n - trigger: state\n entity_id: sensor.jon_galaxy_last_notification\n to: null\n variables:\n title: '{{ state_attr(''sensor.jon_galaxy_last_notification'', ''android.title'')\n }}'\n text: '{{ state_attr(''sensor.jon_galaxy_last_notification'', ''android.text'')\n }}'\n category: '{{ state_attr(''sensor.jon_galaxy_last_notification'', ''category'')\n }}'\n persons: \"{% set var = namespace(list = []) %} {% if 'Michael' in title or 'Michael'\\\n \\ in text %}\\n {% set var.list = var.list + ['Michael'] %}\\n{% endif %} {%\\\n \\ if 'Maryam' in title or 'Maryam' in text %}\\n {% set var.list = var.list\\\n \\ + ['Maryam'] %}\\n{% endif %} {% if 'Sarah' in title or 'Sarah' in text %}\\n\\\n \\ {% set var.list = var.list + ['Sarah'] %}\\n{% endif %} {% if 'David' in title\\\n \\ or 'David' in text %}\\n {% set var.list = var.list + ['David'] %}\\n{% endif\\\n \\ %} {% if var.list | length == 0 %}\\n {% set var.list = var.list + ['Stranger']\\\n \\ %}\\n{% endif %}\\n{{ var.list }}\\n\"\n on_treadmill: '{{ states(''input_boolean.treadmill_triggered'') == ''on'' }}'\n sleeping: '{{ states(''input_boolean.sleeptime'') == ''on'' }}'\n driving: '{{ states(''binary_sensor.jon_driving'') == ''on'' }}'\n conditions:\n - and:\n - '{{ category != ''email'' }}'\n - '{{ persons[0] != ''Stranger'' }}'\n - or:\n - '{{ on_treadmill }}'\n - '{{ sleeping }}'\n - '{{ driving }}'\n actions:\n - repeat:\n for_each: '{{ persons }}'\n sequence:\n - variables:\n timer_entity: '{{ ''timer.text_response_delay_'' ~ repeat.item | lower }}'\n - condition: '{{ states(timer_entity) == ''idle'' }}'\n - variables:\n number: \"{% if repeat.item == 'Michael' %}\\n 9199246845\\n{% elif repeat.item\\\n \\ == 'Maryam' %}\\n 9197571974\\n{% elif repeat.item == 'Sarah' %}\\n 2522302146\\n\\\n {% elif repeat.item == 'David' %}\\n 2522991689\\n{% else %}\\n 0000000000\\n\\\n {% endif %}\\n\"\n activity: \"{% if on_treadmill %}\\n on the treadmill\\n{% elif sleeping %}\\n\\\n \\ asleep, and dreaming of {{ ('sugarplums', 'aliens', 'flying', 'weasels',\\\n \\ 'being lost in an everchanging city', 'trying to find a bathroom', 'ghosts\\\n \\ messing with electricity') | random }}\\n{% elif driving %}\\n driving,\\\n \\ or at least in a vehicle\\n{% else %}\\n unavailable for some unknown\\\n \\ reason\\n{% endif %}\\n\"\n - action: notify.gmail\n data:\n title: ' '\n target: '{{ number ~ ''@vtext.com'' }}'\n message: '{{ ''Sorry, I am '' ~ activity ~ ''. I will respond when available.''\n }}'\n - action: timer.start\n data:\n entity_id: '{{ timer_entity }}'\n duration: 300",
"config": [
{
"name": "Treadmill Triggered",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.treadmill_triggered",
"device_id": null
}
},
{
"name": "Jon Galaxy Last Notification",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.jon_galaxy_last_notification",
"device_id": null
}
},
{
"name": "Jon Driving",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.jon_driving",
"device_id": null
}
},
{
"name": "Sleeptime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.sleeptime",
"device_id": null
}
}
]
},
{
"id": "create_daily_mini_todo_list",
"automation": "- alias: Create Daily Mini ToDo List\n id: create_daily_mini_todo_list\n triggers:\n - trigger: time\n at: 05:00:00\n actions:\n - variables:\n weekly_list_entities:\n - sensor.mini_todo_weekly_cleaning_list\n - sensor.mini_todo_weekly_other_list\n - sensor.mini_todo_weekly_yard_work_list\n start_date: '{% set day = now().isoweekday() %} {% set offset = iif(day <= 6,\n day, 0) %} {{ as_datetime(states(''sensor.date'')) - timedelta(days = offset)\n }}\n\n '\n - repeat:\n for_each: '{{ weekly_list_entities }}'\n sequence:\n - if:\n - '{{ states(repeat.item) in [''unknown'', ''unavailable''] }}'\n then:\n - variables:\n type: '{{ repeat.item.split(''sensor.mini_todo_weekly_'')[-1] | replace(''_list'',\n '''') }}'\n - action: script.generate_periodic_lists\n data:\n type: '{{ type }}'\n start_date: '{{ start_date }}'\n - action: script.get_weather_metrics\n - event: reset_mini_todo_items\n - wait_template: '{{ state_attr(''sensor.daily_mini_todo_list'', ''items'') | count\n == 0 }}'\n - variables:\n window_lower_bound: '{{ states(''input_datetime.mini_todo_start_time'') }}'\n window_upper_bound: '{{ states(''input_datetime.mini_todo_end_time'') }}'\n start_time: '{{ states(''sensor.date'') ~ '' '' ~ window_lower_bound }}'\n end_time: '{{ states(''sensor.date'') ~ '' '' ~ window_upper_bound }}'\n total_minutes: '{{ (((as_timestamp(end_time) - as_timestamp(start_time)) / 60)\n - states(''input_number.mini_todo_downtime_minutes'') | int(0)) }}'\n - action: input_number.set_value\n target:\n entity_id: input_number.mini_todo_available_minutes\n data:\n value: '{{ total_minutes }}'\n - action: counter.reset\n target:\n entity_id: counter.mini_todo_tasks\n - action: input_boolean.turn_off\n data:\n entity_id: input_boolean.mini_todo_major_item_added\n - action: script.add_mini_todo_calendar_items\n data:\n window_lower_bound: '{{ window_lower_bound }}'\n window_upper_bound: '{{ window_upper_bound }}'\n start_time: '{{ start_time }}'\n end_time: '{{ end_time }}'\n - if:\n - '{{ states(''input_number.mini_todo_weekly_exercise_days'') | int(0) | bitwise_and(2\n ** now().isoweekday()) > 0 }}'\n then:\n - variables:\n last_treadmill: '{{ as_timestamp(states(''sensor.treadmill_last_changed''))\n }}'\n last_workout: '{{ as_timestamp(states(''sensor.workout_last_changed'')) }}'\n exercise_type: '{{ iif(last_treadmill > last_workout, ''Workout'', ''Treadmill'')\n }}'\n current_minutes: '{{ states(''input_number.mini_todo_available_minutes'')\n | int(0) }}'\n exercise_minutes: '{{ iif(last_treadmill > last_workout, states(''input_number.variables_workout_time'')\n | int(0) + 10, states(''input_number.default_treadmill_minutes'') | int(0)\n + 10) }}'\n - service: input_number.set_value\n target:\n entity_id: input_number.mini_todo_available_minutes\n data:\n value: '{{ current_minutes - exercise_minutes }}'\n - event: add_mini_todo_item\n event_data:\n value: '{{ ''ex:'' ~ exercise_type }}'\n - action: counter.increment\n target:\n entity_id: counter.mini_todo_tasks\n - if:\n - '{{ states(''input_number.mini_todo_weekly_free_time_days'') | int(0) | bitwise_and(2\n ** now().isoweekday()) > 0 }}'\n then:\n - event: add_mini_todo_item\n event_data:\n value: ft:FREE TIME\n - action: counter.increment\n target:\n entity_id: counter.mini_todo_tasks\n - stop: Free day\n - action: counter.reset\n target:\n entity_id: counter.mini_todo_attempts\n - if:\n - '{{ state_attr(''sensor.mini_todo_weekly_cleaning_list'', ''items'') | length\n > 0 }}'\n then:\n - action: script.add_mini_todo_periodic_item\n data:\n type: cleaning\n - if:\n - '{{ state_attr(''sensor.mini_todo_weekly_yard_work_list'', ''items'') | length\n > 0 }}'\n then:\n - action: script.add_mini_todo_periodic_item\n data:\n type: yard_work\n - variables:\n task_count: '{{ 5 - states(''counter.mini_todo_tasks'') | int(0) }}'\n - repeat:\n while: '{{ states(''input_number.mini_todo_available_minutes'') | int(total_minutes)\n > 0 and states(''counter.mini_todo_tasks'') | int(0) < task_count and states(''counter.mini_todo_attempts'')\n | int(0) <= 10 }}'\n sequence:\n - variables:\n type: '{{ [''cleaning'', ''other'', ''yard_work'', ''major'', ''minor'']\n | random }}'\n - action: system_log.write\n data:\n message: '{{ ''iteration '' ~ repeat.index ~ '': type='' ~ type ~ '', avail=''\n ~ states(''input_number.mini_todo_available_minutes'') ~ '', tasks=''\n ~ states(''counter.mini_todo_tasks'') ~ '', attempts='' ~ states(''counter.mini_todo_attempts'')\n }}'\n level: debug\n - delay:\n milliseconds: 500\n - choose:\n - conditions: '{{ type in [''cleaning'', ''other'', ''yard_work''] }}'\n sequence:\n - if: '{{ range(2) | random > 0 }}'\n then:\n - action: script.add_mini_todo_periodic_item\n data:\n type: '{{ type }}'\n - conditions: '{{ type in [''major'', ''minor''] }}'\n sequence:\n - if: '{{ range(2) | random > 0 }}'\n then:\n - action: script.add_mini_todo_project_item\n data:\n type: '{{ type }}'",
"config": [
{
"name": "Default Treadmill Minutes",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.default_treadmill_minutes",
"device_id": null
}
},
{
"name": "Date Sensor",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.date",
"device_id": null
}
},
{
"name": "Mini Todo Weekly Cleaning List",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.mini_todo_weekly_cleaning_list",
"device_id": null
}
},
{
"name": "Mini Todo Weekly Other List",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.mini_todo_weekly_other_list",
"device_id": null
}
},
{
"name": "Mini Todo Weekly Yard Work List",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.mini_todo_weekly_yard_work_list",
"device_id": null
}
},
{
"name": "Daily Mini Todo List",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.daily_mini_todo_list",
"device_id": null
}
},
{
"name": "Mini Todo Start Time",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.mini_todo_start_time",
"device_id": null
}
},
{
"name": "Mini Todo End Time",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.mini_todo_end_time",
"device_id": null
}
},
{
"name": "Mini Todo Downtime Minutes",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.mini_todo_downtime_minutes",
"device_id": null
}
},
{
"name": "Mini Todo Available Minutes",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.mini_todo_available_minutes",
"device_id": null
}
},
{
"name": "Mini Todo Tasks",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.mini_todo_tasks",
"device_id": null
}
},
{
"name": "Mini Todo Major Item Added",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.mini_todo_major_item_added",
"device_id": null
}
},
{
"name": "Mini Todo Weekly Exercise Days",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.mini_todo_weekly_exercise_days",
"device_id": null
}
},
{
"name": "Treadmill Last Changed",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.treadmill_last_changed",
"device_id": null
}
},
{
"name": "Workout Last Changed",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.workout_last_changed",
"device_id": null
}
},
{
"name": "Variables Workout Time",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.variables_workout_time",
"device_id": null
}
},
{
"name": "Mini Todo Weekly Free Time Days",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.mini_todo_weekly_free_time_days",
"device_id": null
}
},
{
"name": "Mini Todo Attempts",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.mini_todo_attempts",
"device_id": null
}
}
]
},
{
"id": "reload_unifi_integration",
"automation": "- alias: Reload Unifi Integration\n id: reload_unifi_integration\n trigger:\n - platform: event\n event_type: system_log_event\n event_data:\n name: homeassistant.components.unifi\n level: WARNING\n condition: '{{ ''received 401 Unauthorized'' in trigger.event.data.message[0] }}'\n action:\n - action: counter.increment\n target:\n entity_id: counter.unifi_integration_errors\n - if:\n - condition: numeric_state\n entity_id: counter.unifi_integration_errors\n above: 5\n then:\n - action: homeassistant.reload_config_entry\n target:\n entity_id: sensor.udm_state\n - action: counter.reset\n target:\n entity_id: counter.unifi_integration_errors",
"config": [
{
"name": "Udm State Sensor",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.udm_state",
"device_id": null
}
},
{
"name": "Unifi Integration Errors",
"room": null,
"type": "counter",
"id": {
"entity_id": "counter.unifi_integration_errors",
"device_id": null
}
}
]
},
{
"id": "reload_ecovacs_integration",
"automation": "- alias: Reload Ecovacs Integration\n id: reload_ecovacs_integration\n triggers:\n - trigger: state\n entity_id:\n - vacuum.ecovacs_deebot_none\n - sensor.ecovacs_deebot_filter_lifespan\n - sensor.ecovacs_deebot_main_brush_lifespan\n - sensor.ecovacs_deebot_side_brush_lifespan\n to: unavailable\n for:\n seconds: 30\n actions:\n - action: homeassistant.reload_config_entry\n target:\n entity_id: vacuum.ecovacs_deebot_none",
"config": [
{
"name": "Vacuum",
"room": null,
"type": "vacuum",
"id": {
"entity_id": "vacuum.ecovacs_deebot_none",
"device_id": null
}
},
{
"name": "Ecovacs Deebot Filter Lifespan",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.ecovacs_deebot_filter_lifespan",
"device_id": null
}
},
{
"name": "Ecovacs Deebot Main Brush Lifespan",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.ecovacs_deebot_main_brush_lifespan",
"device_id": null
}
},
{
"name": "Ecovacs Deebot Side Brush Lifespan",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.ecovacs_deebot_side_brush_lifespan",
"device_id": null
}
}
]
},
{
"id": "toggle_control_automation",
"automation": "- alias: Toggle Control Automation\n id: toggle_control_automation\n triggers:\n - trigger: state\n entity_id: input_boolean.christmas_mode\n to: null\n actions:\n - variables:\n toggle_operation: '{{ states(''input_boolean.christmas_mode'') }}'\n - action: automation.turn_{{ toggle_operation }}\n entity_id: automation.control_family_room_light_automations\n - if:\n - '{{ is_state_attr(''sun.sun'', ''rising'', false) and is_state(''sun.sun'',\n ''above_horizon'') }}'\n then:\n - action: automation.turn_{{ iif(toggle_operation == 'on', 'off', 'on') }}\n entity_id: automation.control_family_room_lamp\n - action: automation.turn_{{ iif(toggle_operation == 'on', 'on', 'off') }}\n entity_id: automation.control_christmas_lights",
"config": [
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
},
{
"name": "Christmas Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.christmas_mode",
"device_id": null
}
},
{
"name": "Control Christmas Lights",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.control_christmas_lights",
"device_id": null
}
},
{
"name": "Control Family Room Lamp",
"room": "Family Room",
"type": "automation",
"id": {
"entity_id": "automation.control_family_room_lamp",
"device_id": null
}
},
{
"name": "Control Family Room Light Automations",
"room": "Family Room",
"type": "automation",
"id": {
"entity_id": "automation.control_family_room_light_automations",
"device_id": null
}
}
]
},
{
"id": "control_family_room_light_automations",
"automation": "- alias: Control Family Room Light Automations\n id: control_family_room_light_automations\n triggers:\n - trigger: state\n entity_id: sun.sun\n to: null\n - trigger: state\n entity_id: sun.sun\n attribute: rising\n actions:\n - if:\n - '{{ is_state_attr(''sun.sun'', ''rising'', false) and is_state(''sun.sun'',\n ''above_horizon'') }}'\n then:\n - action: automation.turn_off\n entity_id: automation.control_family_room_lamp\n - if:\n - condition: state\n entity_id: binary_sensor.all_day_christmas_lights\n state: 'off'\n then:\n - action: automation.turn_on\n entity_id: automation.control_christmas_lights\n else:\n - action: automation.turn_on\n entity_id: automation.control_family_room_lamp\n - action: automation.turn_off\n entity_id: automation.control_christmas_lights",
"config": [
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
},
{
"name": "All Day Christmas Lights",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.all_day_christmas_lights",
"device_id": null
}
},
{
"name": "Control Christmas Lights",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.control_christmas_lights",
"device_id": null
}
},
{
"name": "Control Family Room Lamp",
"room": "Family Room",
"type": "automation",
"id": {
"entity_id": "automation.control_family_room_lamp",
"device_id": null
}
}
]
},
{
"id": "control_office_lamp",
"automation": "- alias: Control Office Lamp\n id: control_office_lamp\n use_blueprint:\n path: lighting/lux_light.yaml\n input:\n lux_sensor: sensor.office_sensor_ambient_light\n light_target: light.office_lamp\n min_lux_level: input_number.office_ambient_min\n max_lux_level: input_number.office_ambient_max\n check_theater: false\n check_christmas: false",
"config": [
{
"name": "Office Lamp",
"room": "office",
"type": "light",
"id": {
"entity_id": "light.office_lamp",
"device_id": null
}
},
{
"name": "Office Sensor Ambient Light",
"room": "office",
"type": "sensor",
"id": {
"entity_id": "sensor.office_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Office Ambient Min",
"room": "office",
"type": "input_number",
"id": {
"entity_id": "input_number.office_ambient_min",
"device_id": null
}
},
{
"name": "Office Ambient Max",
"room": "office",
"type": "input_number",
"id": {
"entity_id": "input_number.office_ambient_max",
"device_id": null
}
}
]
},
{
"id": "control_hallway_lamp",
"automation": "- alias: Control Hallway Lamp\n id: control_hallway_lamp\n use_blueprint:\n path: lighting/lux_light.yaml\n input:\n lux_sensor: sensor.downstairs_sensor_ambient_light\n light_target: light.hallway_lamp\n min_lux_level: input_number.hallway_ambient_min\n max_lux_level: input_number.hallway_ambient_max\n check_theater: true\n check_christmas: false",
"config": [
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Hallway Lamp",
"room": "hallway",
"type": "light",
"id": {
"entity_id": "light.hallway_lamp",
"device_id": null
}
},
{
"name": "Hallway Ambient Min",
"room": "hallway",
"type": "input_number",
"id": {
"entity_id": "input_number.hallway_ambient_min",
"device_id": null
}
},
{
"name": "Hallway Ambient Max",
"room": "hallway",
"type": "input_number",
"id": {
"entity_id": "input_number.hallway_ambient_max",
"device_id": null
}
}
]
},
{
"id": "control_family_room_lamp",
"automation": "- alias: Control Family Room Lamp\n id: control_family_room_lamp\n use_blueprint:\n path: lighting/lux_light.yaml\n input:\n lux_sensor: sensor.downstairs_sensor_ambient_light\n light_target: light.family_room_lamp\n min_lux_level: input_number.family_room_ambient_min\n max_lux_level: input_number.family_room_ambient_max\n check_theater: true\n check_christmas: false",
"config": [
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Family Room Ambient Min",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_min",
"device_id": null
}
},
{
"name": "Family Room Lamp",
"room": "family_room",
"type": "light",
"id": {
"entity_id": "light.family_room_lamp",
"device_id": null
}
},
{
"name": "Family Room Ambient Max",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_max",
"device_id": null
}
}
]
},
{
"id": "control_christmas_lights",
"automation": "- alias: Control Christmas Lights\n id: control_christmas_lights\n use_blueprint:\n path: lighting/lux_light.yaml\n input:\n lux_sensor: sensor.downstairs_sensor_ambient_light\n light_target: light.family_room_lamp\n min_lux_level: input_number.family_room_ambient_min\n max_lux_level: input_number.family_room_ambient_max\n check_theater: true\n check_christmas: true",
"config": [
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Family Room Ambient Min",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_min",
"device_id": null
}
},
{
"name": "Family Room Lamp",
"room": "family_room",
"type": "light",
"id": {
"entity_id": "light.family_room_lamp",
"device_id": null
}
},
{
"name": "Family Room Ambient Max",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_max",
"device_id": null
}
}
]
},
{
"id": "control_voice_assistant_screens",
"automation": "- alias: Control Voice Assistant Screens\n id: control_voice_assistant_screens\n triggers:\n - trigger: numeric_state\n entity_id: sensor.downstairs_sensor_ambient_light\n below: input_number.family_room_ambient_min\n id: dim\n - trigger: numeric_state\n entity_id: sensor.downstairs_sensor_ambient_light\n above: input_number.family_room_ambient_max\n id: bright\n actions:\n - if:\n - '{{ trigger.id == ''dim'' }}'\n then:\n - action: scene.turn_on\n target:\n entity_id: scene.voice_assistants_on_dim\n else:\n - action: scene.turn_on\n target:\n entity_id: scene.voice_assistants_on_bright",
"config": [
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Family Room Ambient Min",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_min",
"device_id": null
}
},
{
"name": "Family Room Ambient Max",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_max",
"device_id": null
}
},
{
"name": "Voice Assistants On Dim Scene",
"room": null,
"type": "scene",
"id": {
"entity_id": "scene.voice_assistants_on_dim",
"device_id": null
}
},
{
"name": "Voice Assistants On Bright Scene",
"room": null,
"type": "scene",
"id": {
"entity_id": "scene.voice_assistants_on_bright",
"device_id": null
}
}
]
},
{
"id": "enable_extended_away_mode",
"automation": "- alias: Enable Extended Away Mode\n id: enable_extended_away_mode\n trigger:\n - platform: time\n at: input_datetime.extended_away_start\n action:\n - service: input_boolean.turn_on\n entity_id: input_boolean.extended_away_mode\n - service: script.set_extended_thermostat_holds\n data:\n heat_temp: '{{ states(''input_number.extended_hold_heat_temp'') }}'\n cool_temp: '{{ states(''input_number.extended_hold_cool_temp'') }}'",
"config": [
{
"name": "Extended Away Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_mode",
"device_id": null
}
},
{
"name": "Extended Away Start Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.extended_away_start",
"device_id": null
}
},
{
"name": "Extended Hold Heat Temp",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.extended_hold_heat_temp",
"device_id": null
}
},
{
"name": "Extended Hold Cool Temp",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.extended_hold_cool_temp",
"device_id": null
}
},
{
"name": "Set Extended Thermostat Holds",
"room": null,
"type": "script",
"id": {
"entity_id": "script.set_extended_thermostat_holds",
"device_id": null
}
}
]
},
{
"id": "disable_extended_away_mode",
"automation": "- alias: Disable Extended Away Mode\n id: disable_extended_away_mode\n trigger:\n - platform: time\n at: input_datetime.extended_away_end\n action:\n - service: input_boolean.turn_off\n entity_id: input_boolean.extended_away_mode\n - service: script.remove_thermostat_hold\n data:\n thermostat_entity: climate.downstairs\n extended: true\n - service: script.remove_thermostat_hold\n data:\n thermostat_entity: climate.upstairs\n extended: true",
"config": [
{
"name": "Extended Away Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_mode",
"device_id": null
}
},
{
"name": "Upstairs Climate",
"room": "upstairs",
"type": "climate",
"id": {
"entity_id": "climate.upstairs",
"device_id": null
}
},
{
"name": "Downstairs Climate",
"room": "downstairs",
"type": "climate",
"id": {
"entity_id": "climate.downstairs",
"device_id": null
}
},
{
"name": "Extended Away End Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.extended_away_end",
"device_id": null
}
},
{
"name": "Remove Thermostat Hold",
"room": null,
"type": "script",
"id": {
"entity_id": "script.remove_thermostat_hold",
"device_id": null
}
}
]
},
{
"id": "control_nighttime_during_extended_away",
"automation": "- alias: Control Nighttime During Extended Away\n id: control_nighttime_during_extended_away\n triggers:\n - trigger: time\n at: '22:00:00'\n id: 'on'\n - trigger: time\n at: 05:30:00\n id: 'off'\n conditions:\n - condition: state\n entity_id: input_boolean.extended_away_mode\n state: 'on'\n actions:\n - action: timer.start\n data:\n entity_id: timer.extended_away_nighttime\n duration:\n minutes: '{{ range(5, 90) | random }}'\n - action: input_boolean.turn_{{ trigger.id }}\n target:\n entity_id: input_boolean.extended_away_nighttime",
"config": [
{
"name": "Extended Away Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_mode",
"device_id": null
}
},
{
"name": "Extended Away Nighttime Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.extended_away_nighttime",
"device_id": null
}
},
{
"name": "Extended Away Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_nighttime",
"device_id": null
}
}
]
},
{
"id": "handle_extended_away_nighttime_timer",
"automation": "- alias: Handle Extended Away Nighttime Timer\n id: handle_extended_away_nighttime_timer\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.extended_away_nighttime\n conditions:\n - condition: state\n entity_id: input_boolean.extended_away_mode\n state: 'on'\n actions:\n - action: input_boolean.turn_{{ states('input_boolean.extended_away_nighttime')\n }}\n target:\n entity_id: input_boolean.nighttime",
"config": [
{
"name": "Extended Away Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_mode",
"device_id": null
}
},
{
"name": "Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.nighttime",
"device_id": null
}
},
{
"name": "Extended Away Nighttime Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.extended_away_nighttime",
"device_id": null
}
},
{
"name": "Extended Away Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_nighttime",
"device_id": null
}
}
]
},
{
"id": "run_extended_away_lights",
"automation": "- alias: Run Extended Away Lights\n id: run_extended_away_lights\n trigger:\n - platform: state\n entity_id: input_boolean.extended_away_mode\n to: 'on'\n - platform: state\n entity_id: input_boolean.nighttime\n to: 'off'\n - platform: state\n entity_id: sun.sun\n to: below_horizon\n - platform: homeassistant\n event: start\n condition:\n - condition: state\n entity_id: input_boolean.extended_away_mode\n state: 'on'\n - condition: state\n entity_id: input_boolean.nighttime\n state: 'off'\n - condition: state\n entity_id: sun.sun\n state: below_horizon\n action:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - variables:\n group_id: light.away_lights\n max_on: 3\n normal_lights: '{{ [''light.family_room_lamp'', ''light.office_lamp''] }}'\n group_lights_entities: '{{ expand(group_id) | map(attribute = ''entity_id'')\n | list }}'\n group_lights_filtered_entities: '{{ expand(group_id) | rejectattr(''entity_id'',\n ''in'', normal_lights) | map(attribute = ''entity_id'') | list }}'\n - service: input_boolean.turn_off\n entity_id: input_boolean.extended_away_early_return\n - repeat:\n sequence:\n - variables:\n lights_on_count: '{{ expand(group_id) | selectattr(''state'', ''eq'', ''on'')\n | list | length }}'\n lights_on_entities: '{{ expand(group_id) | selectattr(''state'', ''eq'',\n ''on'') | map(attribute = ''entity_id'') | list }}'\n toggle_entity: \"{% if lights_on_count > max_on %}\\n {{ lights_on_entities\\\n \\ | random }}\\n{% else %}\\n {{ group_lights_entities | random }}\\n{%\\\n \\ endif %}\\n\"\n - service: homeassistant.toggle\n data:\n entity_id: '{{ toggle_entity }}'\n - wait_template: '{{ is_state(''input_boolean.extended_away_mode'', ''off'')\n }}'\n timeout:\n minutes: '{{ range(10, 60) | random }}'\n - if:\n - '{{ wait.completed }}'\n then:\n - service: input_boolean.turn_on\n entity_id: input_boolean.extended_away_early_return\n until:\n - condition: template\n value_template: \"{{ is_state('input_boolean.extended_away_mode', 'off') or\\n\\\n \\ is_state('input_boolean.nighttime', 'on') or\\n states('sun.sun') ==\\\n \\ 'above_horizon' }}\\n\"\n - if:\n - condition: state\n entity_id: input_boolean.extended_away_early_return\n state: 'off'\n then:\n - service: homeassistant.turn_off\n entity_id: light.away_lights\n else:\n - service: homeassistant.turn_on\n data:\n entity_id: '{{ normal_lights }}'\n - service: homeassistant.turn_off\n data:\n entity_id: '{{ group_lights_filtered_entities }}'",
"config": [
{
"name": "Extended Away Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_mode",
"device_id": null
}
},
{
"name": "Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.nighttime",
"device_id": null
}
},
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
},
{
"name": "Office Lamp",
"room": "office",
"type": "light",
"id": {
"entity_id": "light.office_lamp",
"device_id": null
}
},
{
"name": "Family Room Lamp",
"room": "family_room",
"type": "light",
"id": {
"entity_id": "light.family_room_lamp",
"device_id": null
}
},
{
"name": "Extended Away Early Return",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.extended_away_early_return",
"device_id": null
}
},
{
"name": "Away Lights",
"room": null,
"type": "light",
"id": {
"entity_id": "light.away_lights",
"device_id": null
}
}
]
},
{
"id": "turn_off_extended_away_mode",
"automation": "- alias: Turn Off Extended Away Mode\n id: turn_off_extended_away_mode\n trigger:\n - platform: template\n value_template: '{{ states(''sensor.home_jon_distance'') | int(0) < 13000 }}'\n condition: '{{ is_state(''sensor.home_jon_direction_of_travel'', ''towards'') }}'\n action:\n - service: script.turn_off_extended_away_mode",
"config": [
{
"name": "Home Jon Distance",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.home_jon_distance",
"device_id": null
}
},
{
"name": "Home Jon Direction Of Travel",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.home_jon_direction_of_travel",
"device_id": null
}
},
{
"name": "Turn Off Extended Away Mode",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_off_extended_away_mode",
"device_id": null
}
}
]
},
{
"id": "run_studio_motion_based_light",
"automation": "- alias: Run Studio Motion Based Light\n id: run_studio_motion_based_light\n trace:\n stored_traces: 20\n use_blueprint:\n path: lighting/motion_light_with_fan.yaml\n input:\n motion_entity: binary_sensor.studio_motion_detector_occupancy\n light_entity: light.studio_bath\n fan_entity: switch.studio_fan\n no_motion_wait_fan_off: 120\n no_motion_wait_fan_on: 420\n additional_fan_wait: 300",
"config": [
{
"name": "Studio Motion Detector Occupancy",
"room": "studio",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.studio_motion_detector_occupancy",
"device_id": null
}
},
{
"name": "Studio Bath Light",
"room": "studio_bath",
"type": "light",
"id": {
"entity_id": "light.studio_bath",
"device_id": null
}
},
{
"name": "Studio Fan Switch",
"room": "studio",
"type": "switch",
"id": {
"entity_id": "switch.studio_fan",
"device_id": null
}
}
]
},
{
"id": "run_laundry_room_motion_based_light",
"automation": "- alias: Run Laundry Room Motion Based Light\n id: run_laundry_room_motion_based_light\n trace:\n stored_traces: 20\n use_blueprint:\n path: lighting/motion_light.yaml\n input:\n motion_entity: binary_sensor.laundry_room_motion_detector_occupancy\n light_target:\n entity_id: light.Laundry_room\n no_motion_wait: 180",
"config": [
{
"name": "Laundry Room Motion Detector Occupancy",
"room": "laundry_room",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.laundry_room_motion_detector_occupancy",
"device_id": null
}
},
{
"name": "Laundry Room Light",
"room": "laundry_room",
"type": "light",
"id": {
"entity_id": "light.Laundry_room",
"device_id": null
}
}
]
},
{
"id": "run_master_bath_motion_based_light",
"automation": "- alias: Run Master Bath Motion Based Light\n id: run_master_bath_motion_based_light\n trace:\n stored_traces: 20\n use_blueprint:\n path: lighting/motion_light_with_fan.yaml\n input:\n motion_entity: binary_sensor.master_bath_motion_detector_occupancy\n light_entity: light.master_vanity\n fan_entity: switch.master_bath_fan\n no_motion_wait_fan_off: 240\n no_motion_wait_fan_on: 420\n additional_fan_wait: 300\n lux_entity: sensor.downstairs_sensor_ambient_light\n min_lux_value: '{{ states(''input_number.master_suite_ambient_min'') | float(0)\n }}'",
"config": [
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Master Bath Motion Detector Occupancy",
"room": "master_bath",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.master_bath_motion_detector_occupancy",
"device_id": null
}
},
{
"name": "Master Vanity Light",
"room": "master_bath",
"type": "light",
"id": {
"entity_id": "light.master_vanity",
"device_id": null
}
},
{
"name": "Master Bath Fan Switch",
"room": "master_bath",
"type": "switch",
"id": {
"entity_id": "switch.master_bath_fan",
"device_id": null
}
},
{
"name": "Master Suite Ambient Min",
"room": "master_suite",
"type": "input_number",
"id": {
"entity_id": "input_number.master_suite_ambient_min",
"device_id": null
}
}
]
},
{
"id": "control_attic_light",
"automation": "- alias: Control Attic Light\n id: control_attic_light\n use_blueprint:\n path: lighting/sensor_light.yaml\n input:\n sensor_entity: binary_sensor.attic_door_sensor_contact\n light_target: light.attic\n close_toggle: input_boolean.attic_door_close_toggle",
"config": [
{
"name": "Attic Door Sensor Contact",
"room": "attic",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.attic_door_sensor_contact",
"device_id": null
}
},
{
"name": "Attic Light",
"room": "attic",
"type": "light",
"id": {
"entity_id": "light.attic",
"device_id": null
}
},
{
"name": "Attic Door Close Toggle",
"room": "attic",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.attic_door_close_toggle",
"device_id": null
}
}
]
},
{
"id": "control_upstairs_entry_light",
"automation": "- alias: Control Upstairs Entry Light\n id: control_upstairs_entry_light\n use_blueprint:\n path: lighting/sensor_light.yaml\n input:\n sensor_entity: binary_sensor.upstairs_entry_sensor_contact\n light_target: light.penthouse_hall\n close_toggle: input_boolean.upstairs_entry_close_toggle",
"config": [
{
"name": "Upstairs Entry Sensor Contact",
"room": "upstairs_entry",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.upstairs_entry_sensor_contact",
"device_id": null
}
},
{
"name": "Penthouse Hall Light",
"room": "penthouse_hall",
"type": "light",
"id": {
"entity_id": "light.penthouse_hall",
"device_id": null
}
},
{
"name": "Upstairs Entry Close Toggle",
"room": "upstairs_entry",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.upstairs_entry_close_toggle",
"device_id": null
}
}
]
},
{
"id": "control_master_closet_light",
"automation": "- alias: Control Master Closet Light\n id: control_master_closet_light\n use_blueprint:\n path: lighting/sensor_light.yaml\n input:\n sensor_entity: binary_sensor.master_closet_sensor_contact\n light_target: light.master_closet",
"config": [
{
"name": "Master Closet Sensor Contact",
"room": "master_closet",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.master_closet_sensor_contact",
"device_id": null
}
},
{
"name": "Master Closet Light",
"room": "master_closet",
"type": "light",
"id": {
"entity_id": "light.master_closet",
"device_id": null
}
}
]
},
{
"id": "reset_attic_door_close_toggle",
"automation": "- alias: Reset Attic Door Close Toggle\n id: reset_attic_door_close_toggle\n triggers:\n - trigger: state\n entity_id: light.attic\n from: 'on'\n to: 'off'\n actions:\n - delay: 00:00:01\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.attic_door_close_toggle",
"config": [
{
"name": "Attic Light",
"room": "attic",
"type": "light",
"id": {
"entity_id": "light.attic",
"device_id": null
}
},
{
"name": "Attic Door Close Toggle",
"room": "attic",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.attic_door_close_toggle",
"device_id": null
}
}
]
},
{
"id": "reset_upstairs_entry_close_toggle",
"automation": "- alias: Reset Upstairs Entry Close Toggle\n id: reset_upstairs_entry_close_toggle\n triggers:\n - trigger: state\n entity_id: light.penthouse_hall\n from: 'on'\n to: 'off'\n actions:\n - delay: 00:00:01\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.upstairs_entry_close_toggle",
"config": [
{
"name": "Penthouse Hall Light",
"room": "penthouse_hall",
"type": "light",
"id": {
"entity_id": "light.penthouse_hall",
"device_id": null
}
},
{
"name": "Upstairs Entry Close Toggle",
"room": "upstairs_entry",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.upstairs_entry_close_toggle",
"device_id": null
}
}
]
},
{
"id": "turn_on_guest_lights_at_dark",
"automation": "- alias: Turn On Guest Lights At Dark\n id: turn_on_guest_lights_at_dark\n triggers:\n - trigger: template\n value_template: '{{ is_state_attr(''sun.sun'', ''rising'', false) and states(''sensor.downstairs_sensor_ambient_light'')\n | float(0) < states(''input_number.studio_bedroom_ambient_min'') | float(0)\n }}'\n - trigger: homeassistant\n event: start\n conditions:\n - condition: state\n entity_id: binary_sensor.children_home\n state: 'on'\n - condition: state\n entity_id: person.jon\n state: home\n - condition: state\n entity_id: input_boolean.nighttime\n state: 'off'\n - condition: template\n value_template: '{{ is_state_attr(''sun.sun'', ''rising'', false) and states(''sensor.downstairs_sensor_ambient_light'')\n | float(0) < states(''input_number.studio_bedroom_ambient_min'') | float(0)\n }}'\n actions:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - action: script.operate_preferred_studio_lamps\n data:\n operation: 'on'",
"config": [
{
"name": "Jon Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.jon",
"device_id": null
}
},
{
"name": "Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.nighttime",
"device_id": null
}
},
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
},
{
"name": "Children Home",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.children_home",
"device_id": null
}
},
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Studio Bedroom Ambient Min",
"room": "studio_bedroom",
"type": "input_number",
"id": {
"entity_id": "input_number.studio_bedroom_ambient_min",
"device_id": null
}
}
]
},
{
"id": "turn_off_studio_night_light",
"automation": "- alias: Turn Off Studio Night Light\n id: turn_off_studio_night_light\n triggers:\n - trigger: time_pattern\n minutes: 1\n conditions:\n - or:\n - condition: state\n entity_id: input_select.studio_guests\n state: Empty\n - '{{ states(''sensor.downstairs_sensor_ambient_light'') | float(0) >= states(''input_number.studio_bedroom_ambient_max'')\n | float(0) }}'\n actions:\n - action: light.turn_on\n target:\n entity_id: light.studio_night_light\n - delay:\n milliseconds: 200\n - action: light.turn_off\n target:\n entity_id: light.studio_night_light\n - delay:\n seconds: 10\n - if:\n - condition: state\n entity_id: light.studio_night_light\n state: 'on'\n then:\n - action: script.send_notification\n data:\n destination:\n - persistent\n title: Lighting Alert\n message: Studio night light is still on. Perhaps millisecond delay is too\n short.\n notification_id: studio_night_light_on",
"config": [
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Studio Night Light",
"room": "studio",
"type": "light",
"id": {
"entity_id": "light.studio_night_light",
"device_id": null
}
},
{
"name": "Studio Bedroom Ambient Max",
"room": "studio_bedroom",
"type": "input_number",
"id": {
"entity_id": "input_number.studio_bedroom_ambient_max",
"device_id": null
}
},
{
"name": "Studio Guests Select",
"room": "studio",
"type": "input_select",
"id": {
"entity_id": "input_select.studio_guests",
"device_id": null
}
}
]
},
{
"id": "turn_on_outdoor_christmas_lights",
"automation": "- alias: Turn On Outdoor Christmas Lights\n id: turn_on_outdoor_christmas_lights\n triggers:\n - trigger: template\n value_template: '{{ states(''input_boolean.christmas_mode'') == ''on'' and states(''input_boolean.christmas_outdoor'')\n == ''on'' and states(''sun.sun'') == ''below_horizon'' }}'\n actions:\n - action: light.turn_on\n target:\n entity_id: light.christmas_outdoor",
"config": [
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
},
{
"name": "Christmas Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.christmas_mode",
"device_id": null
}
},
{
"name": "Christmas Outdoor",
"room": "outdoor",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.christmas_outdoor",
"device_id": null
}
},
{
"name": "Christmas Outdoor Light",
"room": "outdoor",
"type": "light",
"id": {
"entity_id": "light.christmas_outdoor",
"device_id": null
}
}
]
},
{
"id": "control_all_day_christmas_lights",
"automation": "- alias: Control All Day Christmas Lights\n id: control_all_day_christmas_lights\n triggers:\n - trigger: time\n at: 07:30:00\n id: morning\n - trigger: time\n at: '22:30:00'\n id: night\n - trigger: homeassistant\n event: start\n id: start\n conditions:\n - or:\n - and:\n - condition: state\n entity_id: person.jon\n state: home\n - condition: template\n value_template: '{{ trigger.id != ''night'' }}'\n - condition: time\n after: 07:30:00\n before: '22:29:59'\n - condition: state\n entity_id: binary_sensor.all_day_christmas_lights\n state: 'on'\n - and:\n - condition: template\n value_template: '{{ trigger.id != ''morning'' }}'\n - condition: time\n after: '22:30:00'\n before: 07:29:59\n - condition: state\n entity_id: binary_sensor.all_day_christmas_lights\n state: 'on'\n actions:\n - delay:\n seconds: '{{ range(2, 15) | random }}'\n - if:\n - condition: time\n after: 07:30:00\n before: '22:29:59'\n then:\n - action: automation.turn_off\n entity_id: automation.control_christmas_lights\n - action: script.turn_on_christmas_lights\n - action: light.turn_off\n target:\n entity_id: light.family_room_lamp\n else:\n - action: script.turn_off_christmas_lights\n - action: automation.turn_on\n entity_id: automation.control_christmas_lights",
"config": [
{
"name": "Jon Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.jon",
"device_id": null
}
},
{
"name": "All Day Christmas Lights",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.all_day_christmas_lights",
"device_id": null
}
},
{
"name": "Family Room Lamp",
"room": "family_room",
"type": "light",
"id": {
"entity_id": "light.family_room_lamp",
"device_id": null
}
},
{
"name": "Control Christmas Lights",
"room": null,
"type": "automation",
"id": {
"entity_id": "automation.control_christmas_lights",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "reset_christmas_plugs",
"automation": "- alias: Reset Christmas Plugs\n id: reset_christmas_plugs\n triggers:\n - trigger: state\n entity_id: input_boolean.christmas_mode\n to: 'off'\n actions:\n - variables:\n christmas_plugs: '{{ expand(state_attr(''group.christmas_plugs'', ''entity_id''))\n | map(attribute = ''entity_id'') | list }}'\n - repeat:\n for_each: '{{ christmas_plugs }}'\n sequence:\n - action: input_boolean.turn_off\n target:\n entity_id: '{{ repeat.item }}'",
"config": [
{
"name": "Christmas Mode",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.christmas_mode",
"device_id": null
}
},
{
"name": "Christmas Plugs Group",
"room": null,
"type": "group",
"id": {
"entity_id": "group.christmas_plugs",
"device_id": null
}
}
]
},
{
"id": "turn_on_office_bookcase_via_alexa",
"automation": "- alias: Turn On Office Bookcase Via Alexa\n id: turn_on_office_bookcase_via_alexa\n trigger:\n - platform: state\n entity_id: input_boolean.alexa_ha_plug\n to: 'on'\n action:\n - service: media_player.play_media\n target:\n entity_id: media_player.family_room_echo\n data:\n media_content_id: HA Office Bookcase On\n media_content_type: routine\n metadata: {}",
"config": [
{
"name": "Alexa HA Plug",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.alexa_ha_plug",
"device_id": null
}
},
{
"name": "Family Room Echo Media Player",
"room": "family_room",
"type": "media_player",
"id": {
"entity_id": "media_player.family_room_echo",
"device_id": null
}
}
]
},
{
"id": "turn_off_office_bookcase_via_alexa",
"automation": "- alias: Turn Off Office Bookcase Via Alexa\n id: turn_off_office_bookcase_via_alexa\n trigger:\n - platform: state\n entity_id: input_boolean.alexa_ha_plug\n to: 'off'\n action:\n - service: media_player.play_media\n target:\n entity_id: media_player.family_room_echo\n data:\n media_content_id: HA Office Bookcase Off\n media_content_type: routine\n metadata: {}",
"config": [
{
"name": "Alexa HA Plug",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.alexa_ha_plug",
"device_id": null
}
},
{
"name": "Family Room Echo Media Player",
"room": "family_room",
"type": "media_player",
"id": {
"entity_id": "media_player.family_room_echo",
"device_id": null
}
}
]
},
{
"id": "stop_bath_time",
"automation": "- alias: Stop Bath Time\n id: stop_bath_time\n trigger:\n - platform: event\n event_type: timer.finished\n event_data:\n entity_id: timer.bath_time\n action:\n - service: automation.turn_on\n entity_id: automation.run_studio_motion_based_light",
"config": [
{
"name": "Bath Time Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.bath_time",
"device_id": null
}
},
{
"name": "Run Studio Motion Based Light",
"room": "Studio",
"type": "automation",
"id": {
"entity_id": "automation.run_studio_motion_based_light",
"device_id": null
}
}
]
},
{
"id": "handle_guest_arrival",
"automation": "- alias: Handle Guest Arrival\n id: handle_guest_arrival\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - person.david\n - person.sarah\n - person.mike\n to: home\n id: adult\n - trigger: state\n entity_id:\n - person.skylar\n to: home\n id: child\n actions:\n - variables:\n guest: '{{ trigger.to_state.attributes.friendly_name }}'\n suite: '{{ states(''input_select.'' ~ guest | lower ~ ''_guest_suite'') }}'\n - if:\n - '{{ guest != ''Mike'' or now().hour >= 16 }}'\n then:\n - action: script.add_guest_to_suite\n data:\n guest: '{{ guest }}'\n suite: '{{ suite }}'\n - if:\n - '{{ trigger.id == ''adult'' }}'\n then:\n - action: script.turn_on\n target:\n entity_id: script.open_garage_door_north\n data:\n variables:\n use_info_message: true\n - if:\n - condition: state\n entity_id: sun.sun\n state: below_horizon\n then:\n - action: light.turn_on\n target:\n entity_id:\n - light.driveway\n - light.front_floodlight\n - action: timer.start\n data:\n entity_id: timer.guest_arrival_cleanup\n duration: 00:30:00",
"config": [
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
},
{
"name": "Skylar Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.skylar",
"device_id": null
}
},
{
"name": "Driveway Light",
"room": "driveway",
"type": "light",
"id": {
"entity_id": "light.driveway",
"device_id": null
}
},
{
"name": "Front Floodlight",
"room": "front",
"type": "light",
"id": {
"entity_id": "light.front_floodlight",
"device_id": null
}
},
{
"name": "David Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.david",
"device_id": null
}
},
{
"name": "Sarah Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.sarah",
"device_id": null
}
},
{
"name": "Mike Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.mike",
"device_id": null
}
},
{
"name": "Guest Arrival Cleanup Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.guest_arrival_cleanup",
"device_id": null
}
},
{
"name": "Open Garage Door North",
"room": "Garage",
"type": "script",
"id": {
"entity_id": "script.open_garage_door_north",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "handle_guest_departure",
"automation": "- alias: Handle Guest Departure\n id: handle_guest_departure\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - person.david\n - person.sarah\n - person.mike\n from: home\n id: adult\n - trigger: state\n entity_id:\n - person.skylar\n from: home\n id: child\n actions:\n - variables:\n guest: '{{ trigger.to_state.attributes.friendly_name }}'\n suite: '{{ iif(guest in states(''input_select.studio_guests''), ''Studio'',\n ''Penthouse'') }}'\n - action: script.remove_guest_from_suite\n data:\n guest: '{{ guest }}'\n suite: '{{ suite }}'\n - if:\n - '{{ trigger.id == ''adult'' }}'\n then:\n - action: script.turn_on\n target:\n entity_id: script.close_garage_door_north\n data:\n variables:\n use_info_message: true\n - action: light.turn_off\n target:\n entity_id: light.outdoor_lights",
"config": [
{
"name": "Skylar Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.skylar",
"device_id": null
}
},
{
"name": "Outdoor Lights",
"room": "outdoor",
"type": "light",
"id": {
"entity_id": "light.outdoor_lights",
"device_id": null
}
},
{
"name": "David Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.david",
"device_id": null
}
},
{
"name": "Sarah Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.sarah",
"device_id": null
}
},
{
"name": "Mike Person",
"room": "home",
"type": "person",
"id": {
"entity_id": "person.mike",
"device_id": null
}
},
{
"name": "Studio Guests Select",
"room": "studio",
"type": "input_select",
"id": {
"entity_id": "input_select.studio_guests",
"device_id": null
}
},
{
"name": "Close Garage Door North",
"room": "Garage",
"type": "script",
"id": {
"entity_id": "script.close_garage_door_north",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "modify_occupied_guest_suites",
"automation": "- alias: Modify Occupied Guest Suites\n id: modify_occupied_guest_suites\n mode: queued\n triggers:\n - trigger: state\n entity_id: input_select.david_guest_suite\n to: null\n id: David\n - trigger: state\n entity_id: input_select.mike_guest_suite\n to: null\n id: Mike\n - trigger: state\n entity_id: input_select.sarah_guest_suite\n to: null\n id: Sarah\n - trigger: state\n entity_id: input_select.skylar_guest_suite\n to: null\n id: Skylar\n actions:\n - condition: '{{ is_state(''person.'' ~ trigger.id | lower, ''home'') }}'\n - action: script.remove_guest_from_suite\n data:\n guest: '{{ trigger.id }}'\n suite: '{{ trigger.from_state.state }}'\n - action: script.add_guest_to_suite\n data:\n guest: '{{ trigger.id }}'\n suite: '{{ trigger.to_state.state }}'\n - if:\n - condition: state\n entity_id: input_boolean.switch_guest_suites\n state: 'on'\n then:\n - event: switch_guest_suites_complete",
"config": [
{
"name": "David Guest Suite Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.david_guest_suite",
"device_id": null
}
},
{
"name": "Sarah Guest Suite Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.sarah_guest_suite",
"device_id": null
}
},
{
"name": "Mike Guest Suite Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.mike_guest_suite",
"device_id": null
}
},
{
"name": "Skylar Guest Suite Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.skylar_guest_suite",
"device_id": null
}
},
{
"name": "Switch Guest Suites",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.switch_guest_suites",
"device_id": null
}
}
]
},
{
"id": "modify_thermostat_hold_metrics",
"automation": "- alias: Modify Thermostat Hold Metrics\n id: modify_thermostat_hold_metrics\n mode: queued\n triggers:\n - trigger: state\n entity_id: input_number.penthouse_nights_occupied\n to: null\n id: nights\n - trigger: state\n entity_id: sensor.david_temp_range\n to: null\n id: david\n - trigger: state\n entity_id: sensor.mike_temp_range\n to: null\n id: mike\n - trigger: state\n entity_id: sensor.sarah_temp_range\n to: null\n id: sarah\n - trigger: state\n entity_id: sensor.skylar_temp_range\n to: null\n id: skylar\n conditions:\n - or:\n - '{{ trigger.id == ''nights'' and is_state(''binary_sensor.penthouse_occupied'',\n ''on'') }}'\n - '{{ trigger.id != ''nights'' and trigger.id | title in states(''input_select.penthouse_guests'')\n }}'\n actions:\n - if:\n - condition: state\n entity_id: timer.thermostat_metrics_delay\n state: idle\n then:\n - action: timer.start\n data:\n entity_id: timer.thermostat_metrics_delay\n duration:\n minutes: '{{ states(''input_number.thermostat_metrics_delay_minutes'') }}'\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.thermostat_metrics_delay_timer_started",
"config": [
{
"name": "Penthouse Occupied",
"room": "penthouse",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.penthouse_occupied",
"device_id": null
}
},
{
"name": "Penthouse Nights Occupied",
"room": "penthouse",
"type": "input_number",
"id": {
"entity_id": "input_number.penthouse_nights_occupied",
"device_id": null
}
},
{
"name": "David Temp Range",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.david_temp_range",
"device_id": null
}
},
{
"name": "Mike Temp Range",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.mike_temp_range",
"device_id": null
}
},
{
"name": "Sarah Temp Range",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.sarah_temp_range",
"device_id": null
}
},
{
"name": "Skylar Temp Range",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.skylar_temp_range",
"device_id": null
}
},
{
"name": "Penthouse Guests Select",
"room": "penthouse",
"type": "input_select",
"id": {
"entity_id": "input_select.penthouse_guests",
"device_id": null
}
},
{
"name": "Thermostat Metrics Delay Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.thermostat_metrics_delay",
"device_id": null
}
},
{
"name": "Thermostat Metrics Delay Minutes",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.thermostat_metrics_delay_minutes",
"device_id": null
}
},
{
"name": "Thermostat Metrics Delay Timer Started",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.thermostat_metrics_delay_timer_started",
"device_id": null
}
}
]
},
{
"id": "handle_thermostat_metrics_delay_timer_expiration",
"automation": "- alias: Handle Thermostat Metrics Delay Timer Expiration\n id: handle_thermostat_metrics_delay_timer_expiration\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.thermostat_metrics_delay\n - trigger: homeassistant\n event: start\n conditions:\n - condition: state\n entity_id: timer.thermostat_metrics_delay\n state: idle\n - condition: state\n entity_id: input_boolean.thermostat_metrics_delay_timer_started\n state: 'on'\n actions:\n - action: script.modify_penthouse_thermostat_hold\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.thermostat_metrics_delay_timer_started",
"config": [
{
"name": "Thermostat Metrics Delay Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.thermostat_metrics_delay",
"device_id": null
}
},
{
"name": "Thermostat Metrics Delay Timer Started",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.thermostat_metrics_delay_timer_started",
"device_id": null
}
}
]
},
{
"id": "handle_thermostat_hold_delay_timer_expiration",
"automation": "- alias: Handle Thermostat Hold Delay Timer Expiration\n id: handle_thermostat_hold_delay_timer_expiration\n triggers:\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.thermostat_hold_delay\n - trigger: homeassistant\n event: start\n conditions:\n - condition: state\n entity_id: timer.thermostat_hold_delay\n state: idle\n - condition: state\n entity_id: input_boolean.thermostat_hold_delay_timer_started\n state: 'on'\n actions:\n - action: script.set_penthouse_thermostat_hold\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.thermostat_hold_delay_timer_started",
"config": [
{
"name": "Thermostat Hold Delay Timer",
"room": null,
"type": "timer",
"id": {
"entity_id": "timer.thermostat_hold_delay",
"device_id": null
}
},
{
"name": "Thermostat Hold Delay Timer Started",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.thermostat_hold_delay_timer_started",
"device_id": null
}
}
]
},
{
"id": "modify_active_studio_lamps",
"automation": "- alias: Modify Active Studio Lamps\n id: modify_active_studio_lamps\n triggers:\n - trigger: state\n entity_id: input_select.preferred_studio_lamps\n to: null\n conditions: '{{ is_state(''binary_sensor.studio_occupied'', ''on'') and states(''sensor.downstairs_sensor_ambient_light'')\n | float(0) < states(''input_number.studio_bedroom_ambient_min'') | float(0) }}'\n actions:\n - variables:\n preference: '{{ states(''input_select.preferred_studio_lamps'') }}'\n sarah_s_lamp_operation: '{{ iif(preference in [''Sarah\\''s'', ''Both''], ''on'',\n ''off'') }}\n\n '\n skylar_s_lamp_operation: '{{ iif(preference in [''Skylar\\''s'', ''Both''], ''on'',\n ''off'') }}\n\n '\n - action: light.turn_{{ sarah_s_lamp_operation }}\n target:\n entity_id: light.sarah_s_lamp\n - action: light.turn_{{ skylar_s_lamp_operation }}\n target:\n entity_id: light.skylar_s_lamp",
"config": [
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Studio Bedroom Ambient Min",
"room": "studio_bedroom",
"type": "input_number",
"id": {
"entity_id": "input_number.studio_bedroom_ambient_min",
"device_id": null
}
},
{
"name": "Preferred Studio Lamps Select",
"room": "studio",
"type": "input_select",
"id": {
"entity_id": "input_select.preferred_studio_lamps",
"device_id": null
}
},
{
"name": "Studio Occupied",
"room": "studio",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.studio_occupied",
"device_id": null
}
},
{
"name": "Sarah's Lamp",
"room": "studio",
"type": "light",
"id": {
"entity_id": "light.sarah_s_lamp",
"device_id": null
}
},
{
"name": "Skylar's Lamp",
"room": "studio",
"type": "light",
"id": {
"entity_id": "light.skylar_s_lamp",
"device_id": null
}
}
]
},
{
"id": "toggle_virtual_device_tracker",
"automation": "- alias: Toggle Virtual Device Tracker\n id: toggle_virtual_device_tracker\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - input_boolean.virtual_david\n - input_boolean.virtual_maryam\n - input_boolean.virtual_mike\n - input_boolean.virtual_sarah\n - input_boolean.virtual_skylar\n to: null\n actions:\n - variables:\n new_state: \"{% if trigger.to_state.state == 'on' %}\\n home\\n{% else %}\\n not_home\\n\\\n {% endif %}\\n\"\n topic_suffix: '{{ trigger.to_state.entity_id | replace(''input_boolean.'', '''')\n }}'\n - action: mqtt.publish\n data:\n topic: '{{ ''homeassistant/device_tracker/'' ~ topic_suffix }}'\n payload: '{{ new_state }}'",
"config": [
{
"name": "Virtual David",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.virtual_david",
"device_id": null
}
},
{
"name": "Virtual Maryam",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.virtual_maryam",
"device_id": null
}
},
{
"name": "Virtual Mike",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.virtual_mike",
"device_id": null
}
},
{
"name": "Virtual Sarah",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.virtual_sarah",
"device_id": null
}
},
{
"name": "Virtual Skylar",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.virtual_skylar",
"device_id": null
}
}
]
},
{
"id": "toggle_jon_phone_stationary_tracker",
"automation": "- alias: Toggle Jon Phone Stationary Tracker\n id: toggle_jon_phone_stationary_tracker\n use_blueprint:\n path: devices/update_phone_tracker.yaml\n input:\n wifi_entity: sensor.jon_galaxy_wifi_connection\n ssid: White Rabbit\n topic_suffix: jon_phone_stationary",
"config": [
{
"name": "Jon Galaxy Wifi Connection",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.jon_galaxy_wifi_connection",
"device_id": null
}
}
]
},
{
"id": "toggle_mike_phone_stationary_tracker",
"automation": "- alias: Toggle Mike Phone Stationary Tracker\n id: toggle_mike_phone_stationary_tracker\n use_blueprint:\n path: devices/update_phone_tracker.yaml\n input:\n wifi_entity: sensor.mike_galaxy_wifi_connection\n ssid: White Rabbit\n topic_suffix: mike_phone_stationary",
"config": [
{
"name": "Mike Galaxy Wifi Connection",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.mike_galaxy_wifi_connection",
"device_id": null
}
}
]
},
{
"id": "toggle_sarah_phone_stationary_tracker",
"automation": "- alias: Toggle Sarah Phone Stationary Tracker\n id: toggle_sarah_phone_stationary_tracker\n use_blueprint:\n path: devices/update_phone_tracker.yaml\n input:\n wifi_entity: sensor.sarah_pixel_wi_fi_connection\n ssid: White Rabbit\n topic_suffix: sarah_phone_stationary",
"config": [
{
"name": "Sarah Pixel Wifi Connection",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.sarah_pixel_wi_fi_connection",
"device_id": null
}
}
]
},
{
"id": "toggle_david_phone_stationary_tracker",
"automation": "- alias: Toggle David Phone Stationary Tracker\n id: toggle_david_phone_stationary_tracker\n use_blueprint:\n path: devices/update_phone_tracker.yaml\n input:\n wifi_entity: sensor.david_s_latest_phone_wi_fi_connection\n ssid: White Rabbit\n topic_suffix: david_phone_stationary",
"config": [
{
"name": "David's Latest Phone Wifi Connection",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.david_s_latest_phone_wi_fi_connection",
"device_id": null
}
}
]
},
{
"id": "handle_child_tag_scan",
"automation": "- alias: Handle Child Tag Scan\n id: handle_child_tag_scan\n triggers:\n - trigger: tag\n tag_id: 0c6d2dfd-4ad7-4281-9ec0-54756ed2d539\n id: skylar\n - trigger: state\n entity_id: input_button.skylar_tag_scan\n id: skylar_simulated\n actions:\n - variables:\n tracker_entity: '{{ ''device_tracker.'' ~ trigger.id.split(''_'')[0] ~ ''_nfc_tag''\n }}'\n new_state: \"{% if states(tracker_entity) != 'home' %}\\n home\\n{% else %}\\n\\\n \\ not_home\\n{% endif %}\\n\"\n topic_suffix: '{{ tracker_entity.split(''.'')[1] }}'\n toggle_action: '{{ iif(new_state == ''home'', ''on'', ''off'') }}'\n - action: mqtt.publish\n data:\n topic: '{{ ''homeassistant/device_tracker/'' ~ topic_suffix }}'\n payload: '{{ new_state }}'",
"config": [
{
"name": "Skylar Tag Scan Button",
"room": null,
"type": "input_button",
"id": {
"entity_id": "input_button.skylar_tag_scan",
"device_id": null
}
}
]
},
{
"id": "set_sleep_start",
"automation": "- alias: Set Sleep Start\n id: set_sleep_start\n triggers:\n - trigger: state\n entity_id: binary_sensor.jon_sleeping\n to: 'on'\n actions:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.sleep_start\n data:\n datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'",
"config": [
{
"name": "Jon Sleeping",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.jon_sleeping",
"device_id": null
}
},
{
"name": "Sleep Start Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.sleep_start",
"device_id": null
}
}
]
},
{
"id": "handle_jon_awake",
"automation": "- alias: Handle Jon Awake\n id: handle_jon_awake\n triggers:\n - trigger: state\n entity_id: binary_sensor.jon_sleeping\n from: 'on'\n to: 'off'\n actions:\n - variables:\n duration: '{{ ((as_timestamp(now().strftime(''%Y-%m-%d %H:%M:%S'')) - as_timestamp(states(''input_datetime.sleep_start'')))\n / 3600) | round(2) }}'\n echo_list: '{{ expand(integration_entities(''alexa_media'') | select(''search'',\n ''media_player'')) | rejectattr(''attributes.friendly_name'', ''in'', [''This\n Device'', ''Everywhere'']) | map(attribute = ''entity_id'') | list }}'\n - action: input_boolean.turn_off\n entity_id:\n - input_boolean.nighttime\n - input_boolean.sleeptime\n - action: script.turn_on\n target:\n entity_id: script.reset_bedtime_environment\n - action: input_number.set_value\n target:\n entity_id: input_number.sleep_duration\n data:\n value: '{{ duration }}'\n - delay:\n milliseconds: 500\n - variables:\n normal_volume: 0.5\n quiet_volume: 0.3\n - repeat:\n for_each: '{{ echo_list }}'\n sequence:\n - variables:\n volume: '{{ iif((repeat.item).split(''.'')[1] == ''master_bedroom_echo'',\n quiet_volume, normal_volume) }}'\n - if:\n - '{{ not is_state_attr(repeat.item, ''volume_level'', volume) }}'\n then:\n - action: media_player.volume_set\n target:\n entity_id: '{{ repeat.item }}'\n data:\n volume_level: '{{ volume }}'\n - repeat:\n until: '{{ is_state(''switch.master_bedroom_echo_do_not_disturb_switch'', ''off'')\n }}'\n sequence:\n - event: unused_event\n - delay:\n milliseconds: 10\n - variables:\n time: '{{ states(''sensor.sleep_duration_display'') }}'\n hours: '{{ time.split('':'')[0] | int(0) }}'\n minutes: '{{ time.split('':'')[1] | int(0) }}'\n hours_str: '{{ iif(hours == 1, ''hour'', ''hours'') }}'\n minutes_str: '{{ iif(minutes == 1, ''minute'', ''minutes'') }}'\n keys: '{{ state_attr(''sensor.mobile_tag_registry_keys'', ''tags'') }}'\n calendar: '{{ iif(''calendar_appointment'' in keys or ''calendar_home'' in keys,\n true, false) }}'\n - action: script.send_notification\n data:\n destination:\n - voice_assistant\n message: \"{% set msg = 'Good morning. You slept ' ~ hours ~ ' ' ~ hours_str\\\n \\ ~ iif(minutes | int(0) > 0, ' and ' ~ minutes ~ ' ' ~ minutes_str ~ '.',\\\n \\ '.') %} {% if calendar == true %}\\n {% set msg = msg + ' Also, check your\\\n \\ phone for upcoming calendar items.' %}\\n{% endif %}\\n{{ msg }}\\n\"\n room:\n - master_bedroom\n voice_type: tts\n - if:\n - condition: numeric_state\n entity_id: sensor.downstairs_sensor_ambient_light\n below: input_number.family_room_ambient_max\n then:\n - action: scene.turn_on\n target:\n entity_id: scene.voice_assistants_on_dim\n else:\n - action: scene.turn_on\n target:\n entity_id: scene.voice_assistants_on_bright\n - wait_template: '{{ is_state(''script.modify_master_suite'', ''off'') }}'\n - action: media_player.volume_set\n target:\n entity_id: media_player.master_bedroom_echo\n data:\n volume_level: '{{ normal_volume }}'\n - action: script.turn_on_lights_per_conditions\n data:\n light_entity: light.kitchen_island\n lux_entity: sensor.downstairs_sensor_ambient_light\n min_lux_value: '{{ states(''input_number.kitchen_ambient_min'') | float(0) }}'",
"config": [
{
"name": "Nighttime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.nighttime",
"device_id": null
}
},
{
"name": "Mobile Tag Registry Keys",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.mobile_tag_registry_keys",
"device_id": null
}
},
{
"name": "Master Bedroom Echo Do Not Disturb Switch",
"room": "master_bedroom",
"type": "switch",
"id": {
"entity_id": "switch.master_bedroom_echo_do_not_disturb_switch",
"device_id": null
}
},
{
"name": "Downstairs Sensor Ambient Light",
"room": "downstairs",
"type": "sensor",
"id": {
"entity_id": "sensor.downstairs_sensor_ambient_light",
"device_id": null
}
},
{
"name": "Family Room Ambient Max",
"room": "family_room",
"type": "input_number",
"id": {
"entity_id": "input_number.family_room_ambient_max",
"device_id": null
}
},
{
"name": "Voice Assistants On Dim Scene",
"room": null,
"type": "scene",
"id": {
"entity_id": "scene.voice_assistants_on_dim",
"device_id": null
}
},
{
"name": "Voice Assistants On Bright Scene",
"room": null,
"type": "scene",
"id": {
"entity_id": "scene.voice_assistants_on_bright",
"device_id": null
}
},
{
"name": "Jon Sleeping",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.jon_sleeping",
"device_id": null
}
},
{
"name": "Sleep Start Datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.sleep_start",
"device_id": null
}
},
{
"name": "Sleeptime",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.sleeptime",
"device_id": null
}
},
{
"name": "Sleep Duration",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.sleep_duration",
"device_id": null
}
},
{
"name": "Sleep Duration Display",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.sleep_duration_display",
"device_id": null
}
},
{
"name": "Master Bedroom Echo Media Player",
"room": "master_bedroom",
"type": "media_player",
"id": {
"entity_id": "media_player.master_bedroom_echo",
"device_id": null
}
},
{
"name": "Kitchen Island Light",
"room": "kitchen",
"type": "light",
"id": {
"entity_id": "light.kitchen_island",
"device_id": null
}
},
{
"name": "Kitchen Ambient Min",
"room": "kitchen",
"type": "input_number",
"id": {
"entity_id": "input_number.kitchen_ambient_min",
"device_id": null
}
},
{
"name": "Modify Master Suite",
"room": "Master Suite",
"type": "script",
"id": {
"entity_id": "script.modify_master_suite",
"device_id": null
}
},
{
"name": "Reset Bedtime Environment",
"room": "Bedroom",
"type": "script",
"id": {
"entity_id": "script.reset_bedtime_environment",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "resume_cinema",
"automation": "- alias: Resume Cinema\n id: resume_cinema\n trace:\n stored_traces: 20\n trigger:\n - platform: state\n entity_id: media_player.shield_tv\n from:\n - paused\n - idle\n to: playing\n for: 00:00:02\n condition:\n - condition: state\n entity_id: input_boolean.theater_open\n state: 'on'\n action:\n - service: script.restore_lighting_on_resume",
"config": [
{
"name": "Theater Open",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.theater_open",
"device_id": null
}
},
{
"name": "Shield TV Media Player",
"room": "theater",
"type": "media_player",
"id": {
"entity_id": "media_player.shield_tv",
"device_id": null
}
},
{
"name": "Restore Lighting On Resume",
"room": "Theater",
"type": "script",
"id": {
"entity_id": "script.restore_lighting_on_resume",
"device_id": null
}
}
]
},
{
"id": "close_cinema",
"automation": "- alias: Close Cinema\n id: close_cinema\n trigger:\n - platform: state\n entity_id: sensor.harmony_hub\n to: PowerOff\n condition:\n - condition: state\n entity_id: input_boolean.theater_open\n state: 'on'\n action:\n - service: script.close_cinema",
"config": [
{
"name": "Harmony Hub Sensor",
"room": "theater",
"type": "sensor",
"id": {
"entity_id": "sensor.harmony_hub",
"device_id": null
}
},
{
"name": "Theater Open",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.theater_open",
"device_id": null
}
},
{
"name": "Close Cinema",
"room": "Theater",
"type": "script",
"id": {
"entity_id": "script.close_cinema",
"device_id": null
}
}
]
},
{
"id": "handle_cinema_usage_delay",
"automation": "- alias: Handle Cinema Usage Delay\n id: handle_cinema_usage_delay\n trigger:\n - platform: event\n event_type: timer.finished\n event_data:\n entity_id: timer.cinema_usage_delay\n action:\n - if:\n - '{{ states(''input_boolean.theater_open'') == ''off'' }}'\n then:\n - service: script.open_cinema\n else:\n - service: script.close_cinema",
"config": [
{
"name": "Theater Open",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.theater_open",
"device_id": null
}
},
{
"name": "Cinema Usage Delay Timer",
"room": "theater",
"type": "timer",
"id": {
"entity_id": "timer.cinema_usage_delay",
"device_id": null
}
},
{
"name": "Close Cinema",
"room": "Theater",
"type": "script",
"id": {
"entity_id": "script.close_cinema",
"device_id": null
}
},
{
"name": "Open Cinema",
"room": "Theater",
"type": "script",
"id": {
"entity_id": "script.open_cinema",
"device_id": null
}
}
]
},
{
"id": "handle_projector_error",
"automation": "- alias: Handle Projector Error\n id: handle_projector_error\n triggers:\n - trigger: event\n event_type: system_log_event\n event_data:\n name: custom_components.epson_projector_link.projector.projector\n level: ERROR\n conditions: '{{ ''Lamp ON failure'' in trigger.event.data.message[0] }}'\n actions:\n - variables:\n delay_time: 00:02:30\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.projector_error_handling\n - action: script.send_notification\n data:\n destination:\n - voice_assistant\n message: Projector lamp error detected. Please wait a few minutes while I try\n to fix it.\n room:\n - family_room\n - theater\n voice_type: announce\n - delay: '{{ delay_time }}'\n - action: script.send_notification\n data:\n destination:\n - voice_assistant\n message: I'm resetting the projector.\n room:\n - family_room\n - theater\n voice_type: tts\n - action: input_boolean.turn_on\n entity_id: input_boolean.projector_plug_powered_off\n - action: switch.turn_off\n entity_id: switch.projector\n - delay: 00:00:30\n - action: switch.turn_on\n entity_id: switch.projector\n - delay: 00:00:01\n - action: input_boolean.turn_off\n entity_id: input_boolean.projector_plug_powered_off\n - action: script.send_notification\n data:\n destination:\n - voice_assistant\n message: I'm turning the projector back on. Keep your fingers crossed!\n room:\n - family_room\n - theater\n voice_type: tts\n - delay: 00:00:05\n - action: remote.send_command\n entity_id: remote.harmony_hub\n data:\n command: PowerOn\n device: Epson Projector\n - wait_template: '{{ states(''media_player.epson_projector'') in [''warmup'', ''on'']\n or is_state(''input_boolean.projector_active'', ''on'') }}'\n timeout: '{{ delay_time }}'\n - if:\n - '{{ states(''media_player.epson_projector'') in [''warmup'', ''on''] or is_state(''input_boolean.projector_active'',\n ''on'') }}'\n then:\n - action: input_boolean.turn_off\n target:\n entity_id: input_boolean.projector_error_handling",
"config": [
{
"name": "Projector Switch",
"room": "theater",
"type": "switch",
"id": {
"entity_id": "switch.projector",
"device_id": null
}
},
{
"name": "Projector Plug Powered Off",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_plug_powered_off",
"device_id": null
}
},
{
"name": "Projector Error Handling",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_error_handling",
"device_id": null
}
},
{
"name": "Remote Harmony Hub",
"room": "theater",
"type": "remote",
"id": {
"entity_id": "remote.harmony_hub",
"device_id": null
}
},
{
"name": "Epson Projector Media Player",
"room": "theater",
"type": "media_player",
"id": {
"entity_id": "media_player.epson_projector",
"device_id": null
}
},
{
"name": "Projector Active",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_active",
"device_id": null
}
}
]
},
{
"id": "toggle_projector_active",
"automation": "- alias: Toggle Projector Active\n id: toggle_projector_active\n triggers:\n - trigger: numeric_state\n entity_id: sensor.projector_power\n above: 250\n for:\n seconds: 10\n id: 'on'\n - trigger: numeric_state\n entity_id: sensor.projector_power\n below: 250\n for:\n seconds: 10\n id: 'off'\n actions:\n - variables:\n projector_state1: '{{ states(''media_player.epson_projector'') }}'\n projector_error1: '{{ states(''input_boolean.projector_error_handling'') }}'\n projector_active1: '{{ states(''input_boolean.projector_active'') }}'\n - action: input_boolean.turn_{{ trigger.id }}\n target:\n entity_id: input_boolean.projector_active\n - delay: 00:00:01\n - variables:\n projector_state2: '{{ states(''media_player.epson_projector'') }}'\n projector_error2: '{{ states(''input_boolean.projector_error_handling'') }}'\n projector_active2: '{{ states(''input_boolean.projector_active'') }}'\n - action: system_log.write\n data:\n message: '{{ ''Projector active changed from '' ~ projector_active1 ~ '' to\n '' ~ projector_active2 }}'\n level: info",
"config": [
{
"name": "Projector Error Handling",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_error_handling",
"device_id": null
}
},
{
"name": "Projector Power Sensor",
"room": "theater",
"type": "sensor",
"id": {
"entity_id": "sensor.projector_power",
"device_id": null
}
},
{
"name": "Epson Projector Media Player",
"room": "theater",
"type": "media_player",
"id": {
"entity_id": "media_player.epson_projector",
"device_id": null
}
},
{
"name": "Projector Active",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_active",
"device_id": null
}
}
]
},
{
"id": "determine_projector_state",
"automation": "- alias: Determine Projector State\n id: determine_projector_state\n triggers:\n - trigger: template\n value_template: '{{ (states(''media_player.epson_projector'') in [''warmup'',\n ''on''] and is_state(''input_boolean.projector_error_handling'', ''off'')) or\n is_state(''input_boolean.projector_active'', ''on'') }}'\n id: success\n - trigger: event\n event_type: timer.finished\n event_data:\n entity_id: timer.projector_status\n id: failure\n actions:\n - if:\n - '{{ trigger.id == ''success'' }}'\n then:\n - action: timer.cancel\n target:\n entity_id: timer.projector_status\n - action: script.turn_on\n entity_id: script.perform_post_open_tasks\n else:\n - if:\n - '{{ not (states(''media_player.epson_projector'') in [''warmup'', ''on'']\n and is_state(''input_boolean.projector_error_handling'', ''off'')) or is_state(''input_boolean.projector_active'',\n ''on'') }}'\n then:\n - action: script.send_notification\n data:\n destination:\n - voice_assistant\n message: I'm sorry, but I failed to fix a projector lamp error.\n room:\n - family_room\n - theater\n voice_type: announce",
"config": [
{
"name": "Projector Error Handling",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_error_handling",
"device_id": null
}
},
{
"name": "Epson Projector Media Player",
"room": "theater",
"type": "media_player",
"id": {
"entity_id": "media_player.epson_projector",
"device_id": null
}
},
{
"name": "Projector Active",
"room": "theater",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.projector_active",
"device_id": null
}
},
{
"name": "Projector Status Timer",
"room": "theater",
"type": "timer",
"id": {
"entity_id": "timer.projector_status",
"device_id": null
}
},
{
"name": "Perform Post Open Tasks",
"room": "Theater",
"type": "script",
"id": {
"entity_id": "script.perform_post_open_tasks",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "log_projector_state",
"automation": "- alias: Log Projector State\n id: log_projector_state\n triggers:\n - trigger: state\n entity_id: media_player.epson_projector\n to: null\n actions:\n - action: system_log.write\n data:\n message: '{{ ''Projector state changed from '' ~ trigger.from_state.state ~\n '' to '' ~ trigger.to_state.state }}'\n level: info",
"config": [
{
"name": "Epson Projector Media Player",
"room": "theater",
"type": "media_player",
"id": {
"entity_id": "media_player.epson_projector",
"device_id": null
}
}
]
},
{
"id": "initialize_turn_on_volume",
"automation": "- alias: Initialize Turn On Volume\n id: initialize_turn_on_volume\n trigger:\n - platform: state\n entity_id: media_player.marantz_sr7012\n from: 'off'\n to: 'on'\n action:\n - delay: 00:00:30\n - service: media_player.volume_set\n data:\n entity_id: media_player.marantz_sr7012\n volume_level: 0.6",
"config": [
{
"name": "Marantz SR7012 Media Player",
"room": "theater",
"type": "media_player",
"id": {
"entity_id": "media_player.marantz_sr7012",
"device_id": null
}
}
]
},
{
"id": "initialize_application_volume",
"automation": "- alias: Initialize Application Volume\n id: initialize_application_volume\n trigger:\n - platform: state\n entity_id: input_number.selected_app_volume\n to: null\n action:\n - variables:\n selected_app: '{{ states(''input_select.volume_application'').replace('' '',\n ''_'') | lower }}'\n selected_app_volume_entity: '{{ ''input_number.'' ~ selected_app ~ ''_volume''\n }}'\n - service: script.set_application_volume\n data:\n volume_entity: '{{ selected_app_volume_entity }}'\n volume: '{{ trigger.to_state.state }}'",
"config": [
{
"name": "Selected App Volume",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.selected_app_volume",
"device_id": null
}
},
{
"name": "Volume Application Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.volume_application",
"device_id": null
}
},
{
"name": "Set Application Volume",
"room": "Theater",
"type": "script",
"id": {
"entity_id": "script.set_application_volume",
"device_id": null
}
}
]
},
{
"id": "initialize_amazon_prime_volume",
"automation": "- alias: Initialize Amazon Prime Volume\n id: initialize_amazon_prime_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Amazon Prime",
"config": []
},
{
"id": "initialize_amc_plus_volume",
"automation": "- alias: Initialize AMC Plus Volume\n id: initialize_amc_plus_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: AMC+",
"config": []
},
{
"id": "initialize_disney_plus_volume",
"automation": "- alias: Initialize Disney Plus Volume\n id: initialize_disney_plus_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Disney+",
"config": []
},
{
"id": "initialize_espn_volume",
"automation": "- alias: Initialize ESPN Volume\n id: initialize_espn_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: ESPN",
"config": []
},
{
"id": "initialize_hbo_max_volume",
"automation": "- alias: Initialize HBO Max Volume\n id: initialize_hbo_max_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: HBO Max",
"config": []
},
{
"id": "initialize_hulu_volume",
"automation": "- alias: Initialize Hulu Volume\n id: initialize_hulu_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Hulu",
"config": []
},
{
"id": "initialize_kodi_volume",
"automation": "- alias: Initialize Kodi Volume\n id: initialize_kodi_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Kodi",
"config": []
},
{
"id": "initialize_netflix_volume",
"automation": "- alias: Initialize Netflix Volume\n id: initialize_netflix_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Netflix",
"config": []
},
{
"id": "initialize_paramount_plus_volume",
"automation": "- alias: Initialize Paramount Plus Volume\n id: initialize_paramount_plus_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Paramount+",
"config": []
},
{
"id": "initialize_peacock_volume",
"automation": "- alias: Initialize Peacock Volume\n id: initialize_peacock_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Peacock",
"config": []
},
{
"id": "initialize_youtube_tv_volume",
"automation": "- alias: Initialize Youtube TV Volume\n id: initialize_youtube_tv_volume\n use_blueprint:\n path: theater/shield_app_volume.yaml\n input:\n appl_name: Youtube TV",
"config": []
},
{
"id": "initialize_bluray_volume",
"automation": "- alias: Initialize Bluray Volume\n id: initialize_bluray_volume\n use_blueprint:\n path: theater/harmony_device_volume.yaml\n input:\n device_name: BD Player",
"config": []
},
{
"id": "initialize_laserdisc_volume",
"automation": "- alias: Initialize Laserdisc Volume\n id: initialize_laserdisc_volume\n use_blueprint:\n path: theater/harmony_device_volume.yaml\n input:\n device_name: LD Player",
"config": []
},
{
"id": "save_feature_movie_name",
"automation": "- alias: Save Feature Movie Name\n id: save_feature_movie_name\n trigger:\n - platform: state\n entity_id: input_select.kodi_movies\n condition:\n - condition: state\n entity_id: input_boolean.kodi_movie_list_restoration\n state: 'off'\n - '{{ ( trigger.to_state.state ) != ( ''Select'' ) and ( trigger.to_state.state\n ) != ( ''unknown'' ) }}'\n action:\n - service: system_log.write\n data:\n message: 'feature movie name: ''{{ trigger.to_state.state }}'''\n level: debug\n - service: input_text.set_value\n data_template:\n entity_id: input_text.current_feature\n value: '{{ ( trigger.to_state.state ) }}'",
"config": [
{
"name": "Kodi Movie List Restoration",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.kodi_movie_list_restoration",
"device_id": null
}
},
{
"name": "Kodi Movies Select",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.kodi_movies",
"device_id": null
}
},
{
"name": "Current Feature Text",
"room": null,
"type": "input_text",
"id": {
"entity_id": "input_text.current_feature",
"device_id": null
}
}
]
},
{
"id": "process_kodi_command_result",
"automation": "- alias: Process Kodi Command Result\n id: process_kodi_command_result\n mode: queued\n triggers:\n - trigger: event\n event_type: kodi_call_method_result\n event_data:\n result_ok: true\n input:\n method: VideoLibrary.GetMovies\n id: movies\n - trigger: event\n event_type: kodi_call_method_result\n event_data:\n result_ok: true\n input:\n method: VideoLibrary.GetMusicVideos\n id: videos\n - trigger: event\n event_type: kodi_call_method_result\n event_data:\n result_ok: true\n input:\n method: VideoLibrary.GetMovieSets\n id: sets\n - trigger: event\n event_type: kodi_call_method_result\n event_data:\n result_ok: false\n id: bad\n actions:\n - choose:\n - conditions: '{{ trigger.id == ''movies'' }}'\n sequence:\n - choose:\n - conditions: '{{ trigger.event.data.result.limits.total == 1 }}'\n sequence:\n - action: script.process_single_kodi_movie_result\n data:\n result: '{{ trigger.event.data.result }}'\n - conditions: '{{ trigger.event.data.result.limits.total > 1 }}'\n sequence:\n - action: script.process_all_kodi_movies_result\n data:\n result: '{{ trigger.event.data.result }}'\n default:\n - action: system_log.write\n data:\n message: Kodi GetMovies command returned 0 results.\n level: warning\n - conditions: '{{ trigger.id == ''videos'' }}'\n sequence:\n - action: script.process_kodi_videos_result\n data:\n result: '{{ trigger.event.data.result }}'\n - conditions: '{{ trigger.id == ''sets'' }}'\n sequence:\n - action: input_boolean.turn_on\n target:\n entity_id: input_boolean.kodi_activated\n default:\n - action: system_log.write\n data:\n message: Kodi {{ trigger.event.data.input.method }} call failed.\n level: warning",
"config": [
{
"name": "Kodi Activated",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.kodi_activated",
"device_id": null
}
}
]
},
{
"id": "handle_kodi_video_call_error",
"automation": "- alias: Handle Kodi Video Call Error\n id: handle_kodi_video_call_error\n triggers:\n - trigger: event\n event_type: system_log_event\n event_data:\n name: homeassistant.components.kodi.media_player\n level: WARNING\n conditions:\n - '{{ ''TransportError trying to run API method media_player.kodi.VideoLibrary.GetMusicVideos''\n in trigger.event.data.message[0] }}'\n actions:\n - action: input_boolean.turn_on\n data:\n entity_id: input_boolean.kodi_video_call_error",
"config": [
{
"name": "Kodi Media Player",
"room": null,
"type": "media_player",
"id": {
"entity_id": "media_player.kodi",
"device_id": "7000b71050bd8b00ed5ae05567e931c5"
}
},
{
"name": "Kodi Video Call Error",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.kodi_video_call_error",
"device_id": null
}
}
]
},
{
"id": "update_last_alexa_device",
"automation": "- alias: Update Last Alexa Device\n id: update_last_alexa_device\n mode: queued\n triggers:\n - trigger: state\n entity_id:\n - media_player.family_room_echo\n - media_player.master_bedroom_echo\n - media_player.office_echo\n - media_player.penthouse_echo\n - media_player.studio_echo\n - media_player.theater_echo\n attribute: last_called\n to: true\n actions:\n - event: update_last_alexa_sensor",
"config": [
{
"name": "Family Room Echo Media Player",
"room": "family_room",
"type": "media_player",
"id": {
"entity_id": "media_player.family_room_echo",
"device_id": null
}
},
{
"name": "Master Bedroom Echo Media Player",
"room": "master_bedroom",
"type": "media_player",
"id": {
"entity_id": "media_player.master_bedroom_echo",
"device_id": null
}
},
{
"name": "Office Echo Media Player",
"room": "office",
"type": "media_player",
"id": {
"entity_id": "media_player.office_echo",
"device_id": null
}
},
{
"name": "Penthouse Echo Media Player",
"room": "penthouse",
"type": "media_player",
"id": {
"entity_id": "media_player.penthouse_echo",
"device_id": null
}
},
{
"name": "Studio Echo Media Player",
"room": "studio",
"type": "media_player",
"id": {
"entity_id": "media_player.studio_echo",
"device_id": null
}
},
{
"name": "Theater Echo Media Player",
"room": "theater",
"type": "media_player",
"id": {
"entity_id": "media_player.theater_echo",
"device_id": null
}
}
]
},
{
"id": "update_last_nabu_device",
"automation": "- alias: Update Last Nabu Device\n id: update_last_nabu_device\n triggers:\n - trigger: state\n entity_id:\n - assist_satellite.family_room_nabu_assist_satellite\n - assist_satellite.office_nabu_assist_satellite\n - assist_satellite.studio_nabu_assist_satellite\n - assist_satellite.theater_nabu_assist_satellite\n from: listening\n to: processing\n actions:\n - if:\n - '{{ states(''input_text.last_nabu_device'') == trigger.entity_id }}'\n then:\n - action: input_text.set_value\n target:\n entity_id: input_text.last_nabu_device\n data:\n value: reset\n - action: input_text.set_value\n target:\n entity_id: input_text.last_nabu_device\n data:\n value: '{{ trigger.entity_id }}'",
"config": [
{
"name": "Last Nabu Device Text",
"room": null,
"type": "input_text",
"id": {
"entity_id": "input_text.last_nabu_device",
"device_id": null
}
},
{
"name": "Family Room Nabu Assist Satellite",
"room": "family_room",
"type": "assist_satellite",
"id": {
"entity_id": "assist_satellite.family_room_nabu_assist_satellite",
"device_id": null
}
},
{
"name": "Office Nabu Assist Satellite",
"room": "office",
"type": "assist_satellite",
"id": {
"entity_id": "assist_satellite.office_nabu_assist_satellite",
"device_id": null
}
},
{
"name": "Studio Nabu Assist Satellite",
"room": "studio",
"type": "assist_satellite",
"id": {
"entity_id": "assist_satellite.studio_nabu_assist_satellite",
"device_id": null
}
},
{
"name": "Theater Nabu Assist Satellite",
"room": "theater",
"type": "assist_satellite",
"id": {
"entity_id": "assist_satellite.theater_nabu_assist_satellite",
"device_id": null
}
}
]
}
]