AutomationDataset/Petro31/description-ready.json

2816 lines
139 KiB
JSON

[
{
"id": "d0be7b52-30f2-4947-a8de-a20a15df8849",
"automation": "- alias: MSR 2 Testing\n id: d0be7b52-30f2-4947-a8de-a20a15df8849\n mode: parallel\n trigger:\n - platform: state\n entity_id: &id001\n - binary_sensor.apollo_msr_2_8935e0_radar_zone_1_occupancy\n - binary_sensor.apollo_msr_2_8935e0_radar_zone_2_occupancy\n - binary_sensor.apollo_msr_2_8935e0_radar_zone_3_occupancy\n variables:\n entities: *id001\n colors:\n 'on':\n - 0\n - 255\n - 0\n 'off':\n - 255\n - 0\n - 0\n unknown:\n - 255\n - 255\n - 255\n unavailable:\n - 0\n - 0\n - 255\n color: '{{ colors.get(trigger.to_state.state, colors.unavailable) }}\n\n '\n index: '{{ entities.index(trigger.to_state.entity_id) }}\n\n '\n target: light.test_segment_{{ index + 1 }}\n action:\n - if: '{{ is_state(''light.test_main'', ''off'') }}'\n then:\n - service: light.turn_on\n target:\n entity_id: light.test_main\n data:\n brightness: 255\n - service: light.turn_on\n target:\n entity_id: '{{ target }}'\n data:\n rgb_color: '{{ color }}'",
"config": [
{
"name": "test main",
"room": "test",
"type": "light",
"id": {
"entity_id": "light.test_main",
"device_id": null
}
},
{
"name": "apollo msr 2 zone 1 occupancy",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.apollo_msr_2_8935e0_radar_zone_1_occupancy",
"device_id": null
}
},
{
"name": "apollo msr 2 zone 2 occupancy",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.apollo_msr_2_8935e0_radar_zone_2_occupancy",
"device_id": null
}
},
{
"name": "apollo msr 2 zone 3 occupancy",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.apollo_msr_2_8935e0_radar_zone_3_occupancy",
"device_id": null
}
}
]
},
{
"id": "1d19d3a4-4ce1-433e-b27a-bc5fa8364153",
"automation": "- alias: Notify Aurora\n id: 1d19d3a4-4ce1-433e-b27a-bc5fa8364153\n triggers:\n - trigger: state\n entity_id: binary_sensor.aurora_visibility_visibility_alert\n from: 'off'\n to: 'on'\n conditions:\n - condition: numeric_state\n entity_id: sensor.aurora_visibility_visibility\n above: 0\n actions:\n - service: script.notify\n data:\n title: Snapshot Status\n message: There's a {{ states('sensor.aurora_visibility_visibility') }}% chance\n that Aurora Borealis may be visible.",
"config": [
{
"name": "visibility alert",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.aurora_visibility_visibility_alert",
"device_id": null
}
},
{
"name": "visibility",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.aurora_visibility_visibility",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "plants_update group members",
"automation": "- alias: Update Group Members\n id: plants_update group members\n trigger:\n - platform: time\n at: 00:00:00\n - platform: homeassistant\n event: start\n - platform: event\n event_type: event_template_reloaded\n action:\n - service: group.set\n data:\n name: Plants\n object_id: plants\n icon: mdi:sprout\n entities: '{{ states.plant | map(attribute=''entity_id'') | list }}'",
"config": [
{
"name": "plants",
"room": null,
"type": "plant",
"id": {
"entity_id": "plant",
"device_id": null
}
}
]
},
{
"id": "plants_notify",
"automation": "- alias: Notify\n id: plants_notify\n trigger:\n - platform: state\n entity_id: binary_sensor.plant_issue\n to: 'on'\n from: 'off'\n variables:\n state: '{{ trigger.to_state.state }}'\n - platform: time\n at: '10:00'\n variables: &id002\n state: '{{ states(''binary_sensor.plant_issue'') }}'\n - platform: time\n at: '15:30'\n variables: *id002\n - platform: time\n at: '19:00'\n variables: *id002\n variables:\n problems: '{{ state_attr(''sensor.plant_events'', ''events'') }}\n\n '\n count: '{{ problems | length }}\n\n '\n title: 'Plant{{ ''s'' if count > 1 else '''' }} Need{{ '''' if count > 1 else\n ''s'' }} Attention!\n\n '\n message: \"{%- set ns = namespace(items=[]) %} {%- for issue, plants in problems\\\n \\ | groupby(attribute='problems') %}\\n {%- set phrases = plants | map(attribute='name')\\\n \\ | list %}\\n {%- set phrase = phrases[:-1] | join(', ') ~ ' and ' ~ phrases[-1]\\\n \\ if phrases | length > 1 else phrases | first | default %}\\n {%- set plural\\\n \\ = '' if phrases | length > 1 else 's' %}\\n {%- set ns.items = ns.items +\\\n \\ [ (phrase ~ ' need%s ' % plural ~ issue ~ '.') | capitalize ] %}\\n{%- endfor\\\n \\ %} {{ ns.items | join('\\\\n') }}\\n\"\n condition:\n - condition: template\n value_template: '{{ count > 0 }}'\n action:\n - service: script.notify\n data:\n title: '{{ title }}'\n message: '{{ message }}'",
"config": [
{
"name": "plants",
"room": null,
"type": "plant",
"id": {
"entity_id": "plant",
"device_id": null
}
},
{
"name": "plant issue",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.plant_issue",
"device_id": null
}
},
{
"name": "plant events",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.plant_events",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "button_toggle_lights",
"automation": "- alias: Zigbee Button Toggler\n id: button_toggle_lights\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - event.workshop_button_action\n - event.mikes_button_action\n - event.jims_button_action\n - event.lindsays_button_action\n variables:\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n event: '{{ trigger.to_state.attributes.event_type | default('''') if continue\n else '''' }}\n\n '\n source: '{{ trigger.entity_id }}\n\n '\n config:\n event.workshop_button_action:\n single:\n - light.workshop_desk\n double:\n - light.workshop_desk\n - light.workshop_bench_strip\n hold:\n - light.workshop_desk\n - light.workshop_dome\n - switch.floating_double_plug_left\n - light.workshop_bench_strip\n event.mikes_button_action:\n single:\n - light.mikes_lamp\n double:\n - light.living_room\n hold:\n - switch.movie_time\n event.jims_button_action:\n single:\n - light.jims_lamp\n double:\n - light.all_living_room\n hold:\n - light.all_living_room\n event.lindsays_button_action:\n single:\n - light.lindsays_lamp\n double:\n - light.living_room\n hold:\n - light.all_living_room\n which: '{%- set item = config.get(source, {}) %} {{ item.get(event, []) }}\n\n '\n targets: '{{ which | count > 0 }}\n\n '\n are_on: '{{ which | select(''is_state'', ''on'') | list | count > 0 }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue and targets }}'\n action:\n - service: homeassistant.turn_o{{ 'ff' if are_on else 'n' }}\n target:\n entity_id: '{{ which }}'",
"config": [
{
"name": "workshop button action",
"room": "workshop",
"type": "event",
"id": {
"entity_id": "event.workshop_button_action",
"device_id": null
}
},
{
"name": "workshop desk",
"room": "workshop",
"type": "light",
"id": {
"entity_id": "light.workshop_desk",
"device_id": null
}
},
{
"name": "workshop bench strip",
"room": "workshop",
"type": "light",
"id": {
"entity_id": "light.workshop_bench_strip",
"device_id": null
}
},
{
"name": "workshop dome",
"room": "workshop",
"type": "light",
"id": {
"entity_id": "light.workshop_dome",
"device_id": null
}
},
{
"name": "floating double plug left",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.floating_double_plug_left",
"device_id": null
}
},
{
"name": "mikes button action",
"room": null,
"type": "event",
"id": {
"entity_id": "event.mikes_button_action",
"device_id": null
}
},
{
"name": "mikes lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.mikes_lamp",
"device_id": null
}
},
{
"name": "living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.living_room",
"device_id": null
}
},
{
"name": "movie time",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.movie_time",
"device_id": null
}
},
{
"name": "jims button action",
"room": null,
"type": "event",
"id": {
"entity_id": "event.jims_button_action",
"device_id": null
}
},
{
"name": "jims lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.jims_lamp",
"device_id": null
}
},
{
"name": "all living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.all_living_room",
"device_id": null
}
},
{
"name": "lindsays button action",
"room": null,
"type": "event",
"id": {
"entity_id": "event.lindsays_button_action",
"device_id": null
}
},
{
"name": "lindsays lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.lindsays_lamp",
"device_id": null
}
}
]
},
{
"id": "button_living_room_scene_controller",
"automation": "- alias: Living Room Scene Controller\n id: button_living_room_scene_controller\n mode: parallel\n trigger:\n - platform: event\n event_type: zwave_js_value_notification\n variables:\n device: '{{ trigger.event.data.device_id }}\n\n '\n value: '{{ trigger.event.data.value }}\n\n '\n label: \"{{ trigger.event.data.label }} \\n\"\n config:\n 215253fb0f54a57d98bc940fac442073:\n Scene 001:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.downstairs_ambiance\n Scene 002:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.living_room_uplight\n Scene 003:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.dining_room_uplight_1\n Scene 004:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.dining_room_uplight_2\n Scene 005:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.living_room\n KeyPressed2x:\n service: light.toggle\n data:\n entity_id: light.all_living_room\n f7a1fe2db74bf6a3b652301589f7cebc:\n Scene 001:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.mikes_lamp\n Scene 002:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.lindsays_lamp\n Scene 003:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.jims_lamp\n Scene 004:\n KeyPressed:\n service: switch.toggle\n data:\n entity_id: switch.hyperion_usb_capture\n KeyPressed2x:\n service: switch.toggle\n data:\n entity_id: switch.hyperion_cinema\n KeyPressed3x:\n service: switch.toggle\n data:\n entity_id: switch.hyperion_rainbow_swirl_fast\n Scene 005:\n KeyPressed:\n service: light.toggle\n data:\n entity_id: light.living_room\n KeyPressed2x:\n service: light.toggle\n data:\n entity_id: light.all_living_room\n service: '{{ config.get(device, {}).get(label, {}).get(value, {}).get(''service'')\n }}\n\n '\n data: '{{ config.get(device, {}).get(label, {}).get(value, {}).get(''data'') }}\n\n '\n condition:\n - condition: template\n value_template: '{{ service is not none and data is not none }}'\n action:\n - service: '{{ service }}'\n data: '{{ data }}'",
"config": [
{
"name": "mikes lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.mikes_lamp",
"device_id": null
}
},
{
"name": "living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.living_room",
"device_id": null
}
},
{
"name": "jims lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.jims_lamp",
"device_id": null
}
},
{
"name": "all living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.all_living_room",
"device_id": null
}
},
{
"name": "lindsays lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.lindsays_lamp",
"device_id": null
}
},
{
"name": "living room scene controller device 1",
"room": "living room",
"type": "device",
"id": {
"entity_id": null,
"device_id": "215253fb0f54a57d98bc940fac442073"
}
},
{
"name": "downstairs ambiance",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.downstairs_ambiance",
"device_id": null
}
},
{
"name": "living room uplight",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.living_room_uplight",
"device_id": null
}
},
{
"name": "dining room uplight 1",
"room": "dining room",
"type": "light",
"id": {
"entity_id": "light.dining_room_uplight_1",
"device_id": null
}
},
{
"name": "dining room uplight 2",
"room": "dining room",
"type": "light",
"id": {
"entity_id": "light.dining_room_uplight_2",
"device_id": null
}
},
{
"name": "living room scene controller device 2",
"room": "living room",
"type": "device",
"id": {
"entity_id": null,
"device_id": "f7a1fe2db74bf6a3b652301589f7cebc"
}
},
{
"name": "hyperion usb capture",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_usb_capture",
"device_id": null
}
},
{
"name": "hyperion cinema",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_cinema",
"device_id": null
}
},
{
"name": "hyperion rainbow swirl fast",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_rainbow_swirl_fast",
"device_id": null
}
}
]
},
{
"id": "button_living_room_scene_controller_leds",
"automation": "- alias: Living Room Scene Controller LEDs\n id: button_living_room_scene_controller_leds\n mode: queued\n trigger:\n - platform: state\n entity_id:\n - light.mikes_lamp\n - light.lindsays_lamp\n - light.jims_lamp\n - switch.hyperion_usb_capture\n - switch.hyperion_cinema\n - switch.hyperion_rainbow_swirl_fast\n - light.all_living_room\n - light.downstairs_ambiance\n - light.dining_room_uplight_1\n - light.dining_room_uplight_2\n - light.living_room_uplight\n variables:\n values:\n 'on': 2\n 'off': 3\n unavailable: 3\n unknown: 3\n colors:\n white: 0\n blue: 1\n green: 2\n red: 3\n config:\n light.mikes_lamp:\n devices: f7a1fe2db74bf6a3b652301589f7cebc\n parameter: 2\n light.lindsays_lamp:\n devices: f7a1fe2db74bf6a3b652301589f7cebc\n parameter: 3\n light.jims_lamp:\n devices: f7a1fe2db74bf6a3b652301589f7cebc\n parameter: 4\n switch.hyperion_usb_capture:\n devices: f7a1fe2db74bf6a3b652301589f7cebc\n parameter: 5\n switch.hyperion_cinema:\n devices: f7a1fe2db74bf6a3b652301589f7cebc\n parameter: 5\n switch.hyperion_rainbow_swirl_fast:\n devices: f7a1fe2db74bf6a3b652301589f7cebc\n parameter: 5\n light.all_living_room:\n devices:\n - f7a1fe2db74bf6a3b652301589f7cebc\n - 215253fb0f54a57d98bc940fac442073\n parameter: 1\n light.downstairs_ambiance:\n devices: 215253fb0f54a57d98bc940fac442073\n parameter: 2\n light.dining_room_uplight_1:\n devices: 215253fb0f54a57d98bc940fac442073\n parameter: 4\n light.dining_room_uplight_2:\n devices: 215253fb0f54a57d98bc940fac442073\n parameter: 5\n light.living_room_uplight:\n devices: 215253fb0f54a57d98bc940fac442073\n parameter: 3\n value: '{{ values.get(trigger.to_state.state) }}\n\n '\n state_parameter: '{{ config.get(trigger.entity_id, {}).get(''parameter'') }}\n\n '\n devices: '{% set devices = config.get(trigger.entity_id, {}).get(''devices'')\n %} {{ devices if devices is list else [devices] }}\n\n '\n color_parameter: '{{ state_parameter + 5 if state_parameter is not none else none\n }}\n\n '\n state_good: '{{ trigger.to_state.state in [''on'', ''off''] }}\n\n '\n state_bad: '{{ trigger.to_state.state in [''unavailable'', ''unknown''] }}\n\n '\n state_off: '{{ trigger.to_state.state == ''off'' }}\n\n '\n color: \"{% if state_good and state_off %}\\n {{ colors.get('white') }}\\n{% elif\\\n \\ state_bad %}\\n {{ colors.get('red') }}\\n{% else %}\\n None\\n{% endif %}\\n\"\n condition:\n - condition: template\n value_template: '{{ value is not none and state_parameter is not none }}'\n action:\n - repeat:\n for_each: '{{ devices }}'\n sequence:\n - service: zwave_js.bulk_set_partial_config_parameters\n target: &id003\n device_id: '{{ repeat.item }}'\n data:\n parameter: '{{ state_parameter }}'\n value: '{{ value }}'\n - condition: template\n value_template: '{{ color is not none and (state_bad or state_off) }}'\n - repeat:\n for_each: '{{ devices }}'\n sequence:\n - service: zwave_js.bulk_set_partial_config_parameters\n target: *id003\n data:\n parameter: '{{ color_parameter }}'\n value: '{{ color }}'",
"config": [
{
"name": "mikes lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.mikes_lamp",
"device_id": null
}
},
{
"name": "living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.living_room",
"device_id": null
}
},
{
"name": "jims lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.jims_lamp",
"device_id": null
}
},
{
"name": "all living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.all_living_room",
"device_id": null
}
},
{
"name": "lindsays lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.lindsays_lamp",
"device_id": null
}
},
{
"name": "living room scene controller device 1",
"room": "living room",
"type": "device",
"id": {
"entity_id": null,
"device_id": "215253fb0f54a57d98bc940fac442073"
}
},
{
"name": "downstairs ambiance",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.downstairs_ambiance",
"device_id": null
}
},
{
"name": "living room uplight",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.living_room_uplight",
"device_id": null
}
},
{
"name": "dining room uplight 1",
"room": "dining room",
"type": "light",
"id": {
"entity_id": "light.dining_room_uplight_1",
"device_id": null
}
},
{
"name": "dining room uplight 2",
"room": "dining room",
"type": "light",
"id": {
"entity_id": "light.dining_room_uplight_2",
"device_id": null
}
},
{
"name": "living room scene controller device 2",
"room": "living room",
"type": "device",
"id": {
"entity_id": null,
"device_id": "f7a1fe2db74bf6a3b652301589f7cebc"
}
},
{
"name": "hyperion usb capture",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_usb_capture",
"device_id": null
}
},
{
"name": "hyperion cinema",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_cinema",
"device_id": null
}
},
{
"name": "hyperion rainbow swirl fast",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_rainbow_swirl_fast",
"device_id": null
}
}
]
},
{
"id": "467417d9-fe47-4fb8-a0fd-2764c92e099a",
"automation": "- alias: Calibration Helper\n id: 467417d9-fe47-4fb8-a0fd-2764c92e099a\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - sensor.basement_bme280_temperature\n - sensor.basement_bme280_humidity\n variables:\n config:\n sensor.basement_bme280_temperature:\n notify: notify.basement_temperature\n sensor: sensor.apollo_air_1_1ecac0_sen55_temperature\n sensor.basement_bme280_humidity:\n notify: notify.basement_humidity\n sensor: sensor.apollo_air_1_1ecac0_sen55_humidity\n which: '{{ config.get(trigger.to_state.entity_id) }}'\n condition:\n - condition: template\n value_template: '{{ which is not none }}'\n action:\n - service: notify.send_message\n target:\n entity_id: '{{ which.notify }}'\n data:\n message: '{{ now().isoformat() }},{{ trigger.to_state.state }},{{ states(which.sensor)\n }}'",
"config": [
{
"name": "basement bme280 temperature",
"room": "basement",
"type": "sensor",
"id": {
"entity_id": "sensor.basement_bme280_temperature",
"device_id": null
}
},
{
"name": "basement bme280 humidity",
"room": "basement",
"type": "sensor",
"id": {
"entity_id": "sensor.basement_bme280_humidity",
"device_id": null
}
},
{
"name": "basement temperature notify",
"room": "basement",
"type": "notify",
"id": {
"entity_id": "notify.basement_temperature",
"device_id": null
}
},
{
"name": "apollo air 1 temperature",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.apollo_air_1_1ecac0_sen55_temperature",
"device_id": null
}
},
{
"name": "basement humidity notify",
"room": "basement",
"type": "notify",
"id": {
"entity_id": "notify.basement_humidity",
"device_id": null
}
},
{
"name": "apollo air 1 humidity",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.apollo_air_1_1ecac0_sen55_humidity",
"device_id": null
}
}
]
},
{
"id": "turn_off_outside_cameras_based_on_temperature",
"automation": "- alias: Turn off Outside Cameras based on temperature\n id: turn_off_outside_cameras_based_on_temperature\n trigger:\n - platform: state\n entity_id: binary_sensor.camera_shutoff\n from: 'off'\n to: 'on'\n action:\n - service: script.notify\n data:\n message: '[{{ now().strftime(''%-I:%M:%S %p'') }}] Temperature is moving below\n 16°F, turning off the driveway and backyard camera.\n\n '\n - service: switch.turn_off\n data:\n entity_id:\n - switch.driveway_camera_port\n - switch.patio_camera_port",
"config": [
{
"name": "camera shutoff",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.camera_shutoff",
"device_id": null
}
},
{
"name": "driveway camera port",
"room": "outside",
"type": "switch",
"id": {
"entity_id": "switch.driveway_camera_port",
"device_id": null
}
},
{
"name": "patio camera port",
"room": "outside",
"type": "switch",
"id": {
"entity_id": "switch.patio_camera_port",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "turn_on_outside_cameras_based_on_temperature",
"automation": "- alias: Turn on Outside Cameras based on temperature\n id: turn_on_outside_cameras_based_on_temperature\n trigger:\n - platform: state\n entity_id: binary_sensor.camera_turn_on\n from: 'off'\n to: 'on'\n action:\n - service: script.notify\n data:\n message: '[{{ now().strftime(''%-I:%M:%S %p'') }}] Temperature is moving above\n 20°F, turning on the driveway and backyard camera.\n\n '\n - service: switch.turn_on\n data:\n entity_id:\n - switch.driveway_camera_port\n - switch.patio_camera_port",
"config": [
{
"name": "driveway camera port",
"room": "outside",
"type": "switch",
"id": {
"entity_id": "switch.driveway_camera_port",
"device_id": null
}
},
{
"name": "patio camera port",
"room": "outside",
"type": "switch",
"id": {
"entity_id": "switch.patio_camera_port",
"device_id": null
}
},
{
"name": "camera turn on",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.camera_turn_on",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "f6524e79-6b0c-4aa2-b508-3d67f83901a8",
"automation": "- id: f6524e79-6b0c-4aa2-b508-3d67f83901a8\n alias: Cube Actions\n mode: parallel\n trigger:\n - platform: state\n entity_id: event.mikes_cube_action\n from: null\n variables:\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n event: '{{ trigger.to_state.attributes.event_type | default(None) if continue\n else None }}'\n player: media_player.yamaha_rx_v6a\n volume: '{{ state_attr(player, ''volume_level'') }}'\n condition:\n - condition: template\n value_template: '{{ event is not none }}'\n action:\n - alias: Which action\n choose:\n - alias: Shake\n conditions: '{{ event == ''shake'' }}'\n sequence:\n - service: switch.toggle\n target:\n entity_id: switch.movie_time\n - alias: Rotate\n conditions: '{{ ''rotate'' in event }}'\n sequence:\n - if: '{{ volume is not none }}'\n then:\n - service: media_player.volume_set\n target:\n entity_id: '{{ player }}'\n data:\n volume_level: '{% set c = 0.05 if event == ''rotate_right'' else -0.05\n %} {{ ([ 0, volume + c, 1] | sort)[1] | round(2) }}\n\n '",
"config": [
{
"name": "movie time",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.movie_time",
"device_id": null
}
},
{
"name": "mikes cube action",
"room": null,
"type": "event",
"id": {
"entity_id": "event.mikes_cube_action",
"device_id": null
}
},
{
"name": "yamaha rx v6a",
"room": "living room",
"type": "media_player",
"id": {
"entity_id": "media_player.yamaha_rx_v6a",
"device_id": null
}
}
]
},
{
"id": "mqtt_store_door_states_discovery",
"automation": "- alias: MQTT Discovery\n id: mqtt_store_door_states_discovery\n mode: single\n trigger:\n - platform: homeassistant\n event: start\n variables:\n doors:\n - name: Main Door\n identifiers:\n - a8541\n unique_id: main_door_last_opened\n - name: Sliding Door\n identifiers:\n - 59e40\n unique_id: sliding_door_last_opened\n - name: Garage Door\n identifiers:\n - 922c2\n unique_id: front_garage_door_last_opened\n - name: Garage Entry Door\n identifiers:\n - 5ef46\n unique_id: garage_entry_door_last_opened\n - name: Rear Garage Door\n identifiers:\n - 0fff6\n unique_id: rear_garage_door_last_opened\n - name: Passenger Door\n identifiers:\n - 069aa\n unique_id: passenger_door_last_opened\n action:\n - repeat:\n for_each: '{{ doors }}'\n sequence:\n - service: script.mqtt_automated_config\n data:\n domain: sensor\n name: Last Opened\n unique_id: '{{ repeat.item.unique_id }}'\n device_class: timestamp\n device:\n name: '{{ repeat.item.name }}'\n identifiers: '{{ repeat.item.identifiers }}'\n manufacturer: Petro\n model: Virtual Door\n sw_version: '1.0'",
"config": [
{
"name": "MQTT Automated Config",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_config",
"device_id": null
}
}
]
},
{
"id": "notify_on_door_state_change",
"automation": "- alias: Notify when Open\n id: notify_on_door_state_change\n mode: parallel\n trigger: &id004\n - platform: state\n entity_id:\n - binary_sensor.main_door\n - binary_sensor.garage_entry_door\n - binary_sensor.sliding_door\n - binary_sensor.front_garage_door\n - binary_sensor.rear_garage_door\n - binary_sensor.passenger_door\n from: 'off'\n to: 'on'\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 source: \"{%- if valid %}\\n {{ trigger.to_state.entity_id }}\\n{%- endif %}\\n\"\n timestamp: '{{ (datetime | default(now())).isoformat() }}\n\n '\n object_id: '{{ source.split(''.'')[-1] }}\n\n '\n unique_id: '{{ object_id }}_last_opened\n\n '\n count_script: 'script.notify_count_{{ object_id }}\n\n '\n sensor: 'sensor.{{ unique_id }}\n\n '\n last_opened: '{{ states(sensor) | default('''') }}\n\n '\n quiet_window: \"{%- set times = {\\n 'binary_sensor.main_door': 120,\\n 'binary_sensor.garage_entry_door':\\\n \\ 120,\\n 'binary_sensor.sliding_door': 120,\\n 'input_boolean.test_door': 10,\\n\\\n } %} {%- if valid and source in times %}\\n {{ times[source] }}\\n{%- else %}\\n\\\n \\ 0\\n{%- endif %}\\n\"\n delta: \"{%- set last = last_opened | as_datetime %} {%- set current = timestamp\\\n \\ | as_datetime %} {%- if last and current %}\\n {{ (current - last).seconds\\\n \\ }}\\n{%- else %}\\n {{ quiet_window + 1 }}\\n{%- endif %}\\n\"\n in_quiet_window: '{{ delta < quiet_window }}\n\n '\n count: \"{%- if in_quiet_window %}\\n {%- set current = state_attr(sensor, 'count')\\\n \\ %}\\n {%- if current is none %}\\n 1\\n {%- else %}\\n {{ current + 1\\\n \\ }}\\n {%- endif %}\\n{%- else %}\\n 0\\n{%- endif %}\\n\"\n count_timestamp: \"{%- if count == 0 %}\\n {{ timestamp }}\\n{%- else %}\\n {{ state_attr(sensor,\\\n \\ 'count_timestamp') }}\\n{%- endif %}\\n\"\n who: '{{ state_attr(''sensor.people_at_home'', ''or'') }}\n\n '\n what: '{{ state_attr(trigger.entity_id, ''friendly_name'') }}\n\n '\n condition: &id005\n - condition: template\n value_template: '{{ valid }}'\n action:\n - service: script.mqtt_automated_states\n data:\n domain: sensor\n unique_id: '{{ unique_id }}'\n state: '{{ timestamp }}'\n attributes: '{{ { ''who'': who, ''count'': count, ''source'': source, ''count_timestamp'':\n count_timestamp } | tojson }}'\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ count > 0 }}'\n sequence:\n - service: '{{ count_script }}'\n data:\n door_name: '{{ what }}'\n duration: '{{ quiet_window }}'\n count: '{{ count + 1 }}'\n count_timestamp: '{{ count_timestamp }}'\n default:\n - service: script.notify\n data:\n title: '{{ what }} Opened!'\n message: '{{ who }} used the {{ what }}.\n\n '\n - condition: template\n value_template: '{{ who in [''unknown''] }}'\n - wait_for_trigger:\n - platform: template\n value_template: '{{ states(''sensor.people_at_home'') | int(default=0) > 0 }}'\n timeout:\n seconds: 30\n - choose:\n - conditions:\n - condition: template\n value_template: '{%- set current = timestamp | as_datetime %} {{ (now() -\n current).seconds >= 30 if current else False }}\n\n '\n sequence:\n - service: script.notify\n data:\n title: '{{ what }} user is still unknown!'\n message: The person who used the {{ what | lower }} is still unknown!\n default:\n - service: script.notify\n data:\n title: Found {{ what }} user!\n message: The person who used the {{ what | lower }} is {{ state_attr('sensor.people_at_home',\n 'or') }}!",
"config": [
{
"name": "main door",
"room": "main",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.main_door",
"device_id": null
}
},
{
"name": "garage entry door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.garage_entry_door",
"device_id": null
}
},
{
"name": "sliding door",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.sliding_door",
"device_id": null
}
},
{
"name": "front garage door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.front_garage_door",
"device_id": null
}
},
{
"name": "rear garage door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.rear_garage_door",
"device_id": null
}
},
{
"name": "passenger door",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.passenger_door",
"device_id": null
}
},
{
"name": "people at home",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.people_at_home",
"device_id": null
}
},
{
"name": "input boolean test door",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.test_door",
"device_id": null
}
},
{
"name": "MQTT Automated States",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_states",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "notify_on_door_ajar",
"automation": "- alias: Notify when Open too long.\n id: notify_on_door_ajar\n mode: parallel\n trigger: *id004\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 source: \"{%- if valid %}\\n {{ trigger.to_state.entity_id }}\\n{%- endif %}\\n\"\n timestamp: '{{ (datetime | default(now())).isoformat() }}\n\n '\n duration: \"{%- set times = {\\n 'binary_sensor.main_door': 90,\\n 'binary_sensor.garage_entry_door':\\\n \\ 90,\\n 'binary_sensor.sliding_door': 240,\\n 'binary_sensor.front_garage_door':\\\n \\ 300,\\n 'binary_sensor.rear_garage_door': 300,\\n 'binary_sensor.passenger_door':\\\n \\ 90,\\n 'input_boolean.test_door': 5,\\n} %} {%- if valid and trigger.to_state.entity_id\\\n \\ in times %}\\n {{ times[trigger.to_state.entity_id] }}\\n{%- else %} {# default\\\n \\ to 5 minutes for other doors #}\\n 300\\n{%- endif %}\\n\"\n door_name: '{{ state_attr(trigger.entity_id, ''friendly_name'') }}\n\n '\n condition: *id005\n action:\n - service: script.notify_if_ajar\n data:\n duration: '{{ duration }}'\n door: '{{ source }}'\n door_name: '{{ door_name }}'\n timestamp: '{{ timestamp }}'",
"config": [
{
"name": "main door",
"room": "main",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.main_door",
"device_id": null
}
},
{
"name": "garage entry door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.garage_entry_door",
"device_id": null
}
},
{
"name": "sliding door",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.sliding_door",
"device_id": null
}
},
{
"name": "front garage door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.front_garage_door",
"device_id": null
}
},
{
"name": "rear garage door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.rear_garage_door",
"device_id": null
}
},
{
"name": "passenger door",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.passenger_door",
"device_id": null
}
},
{
"name": "input boolean test door",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.test_door",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
},
{
"name": "Notify If Ajar",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify_if_ajar",
"device_id": null
}
}
]
},
{
"id": "illuminate_doors_when_open",
"automation": "- alias: Illuminate Door\n id: illuminate_doors_when_open\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - binary_sensor.main_door\n - binary_sensor.garage_entry_door\n - binary_sensor.sliding_door\n - binary_sensor.server_room_door_contact\n from: 'off'\n to: 'on'\n variables:\n metadata:\n binary_sensor.main_door:\n entities:\n - switch.foyer\n duration: 120\n binary_sensor.garage_entry_door:\n entities:\n - switch.garage_entry\n - switch.garage_cans\n duration: 120\n binary_sensor.sliding_door:\n entities:\n - light.dining_room_chandelier\n duration: 30\n input_boolean.test_door:\n entities:\n - input_boolean.test_switch\n - input_boolean.test_switch_2\n duration: 10\n valid: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n source: \"{%- if valid %}\\n {{ trigger.to_state.entity_id }}\\n{%- endif %}\\n\"\n timestamp: '{{ (datetime | default(now())).isoformat() }}\n\n '\n object_id: '{{ source.split(''.'')[-1] }}\n\n '\n sensor: 'sensor.{{ object_id }}_last_opened\n\n '\n script: 'script.resume_{{ object_id }}\n\n '\n last_opened: '{{ states(sensor) | default('''') }}\n\n '\n current: \"{%- if valid and source in metadata %}\\n {{ metadata[source] }}\\n{%-\\\n \\ endif %}\\n\"\n snapshot_entities: '{{ current.entities | default([]) }}\n\n '\n action_data: \"{%- macro kvp(k, v) %}{{ '\\\"{}\\\"'.format(k) }}: {{ '\\\"{}\\\"'.format(v)\\\n \\ if v is string and not (v.startswith('{') or v.startswith('['))else v }}{%\\\n \\ endmacro %} {%- macro coll(item, t='curly') %}{{ '{}{}{}'.format('{' if t\\\n \\ == 'curly' else '[',item | join(', ') if item is iterable and item is not\\\n \\ string else item, '}' if t == 'curly' else ']') }}{% endmacro %} {%- set ns\\\n \\ = namespace(entities=[], scene_ids=[], scripts=[]) %} {%- set brightness =\\\n \\ current.brightness | default(255) %} {%- for entity in snapshot_entities %}\\n\\\n \\ {%- set ns.scripts = ns.scripts + [ '\\\"script.resume_{}\\\"'.format(entity.replace('.','_'))]\\\n \\ %}\\n {%- set ns.scene_ids = ns.scene_ids + [ '\\\"{}\\\"'.format(entity.replace('.','_'))]\\\n \\ %}\\n {%- if entity.startswith('light.') %}\\n {%- set ret = [kvp('state',\\\n \\ 'on'), kvp('brightness', brightness)] %}\\n {%- else %}\\n {%- set ret =\\\n \\ kvp('state', 'on') %}\\n {%- endif %}\\n {%- set ns.entities = ns.entities\\\n \\ + [ kvp(entity, coll(ret)) ] %}\\n{%- endfor %} {%- set ret = [ kvp('entities',\\\n \\ coll(ns.entities | join(','))), kvp('scripts', coll(ns.scripts | join(','),\\\n \\ 'list')), kvp('scene_ids', coll(ns.scene_ids | join(','), 'list'))] %} {{\\\n \\ coll(ret) }}\\n\"\n duration: '{{ current.duration | default(0)}}\n\n '\n delta: \"{%- set last = last_opened | as_datetime %} {%- set current = timestamp\\\n \\ | as_datetime %} {%- if last and current %}\\n {{ (current - last).seconds\\\n \\ }}\\n{%- else %}\\n {{ duration + 1 }}\\n{%- endif %}\\n\"\n in_duration: '{{ delta < duration }}\n\n '\n condition: &id006\n - condition: template\n value_template: '{{ valid }}'\n - condition: or\n conditions:\n - condition: state\n entity_id: sun.sun\n state: below_horizon\n - condition: numeric_state\n entity_id: sensor.garage_luminance\n below: 11\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ not in_duration }}'\n sequence:\n - repeat:\n count: '{{ action_data.scene_ids | length }}'\n sequence:\n - service: scene.create\n data:\n scene_id: '{{ action_data.scene_ids[repeat.index - 1] }}'\n snapshot_entities: '{{ snapshot_entities[repeat.index - 1] }}'\n - service: scene.apply\n data:\n entities: '{{ action_data.entities }}'\n - wait_template: '{{ is_state(source, ''off'') }}'\n - repeat:\n count: '{{ action_data.scripts | length }}'\n sequence:\n - event: illuminate_door\n event_data:\n service: '{{ action_data.scripts[repeat.index - 1] }}'\n duration: '{{ duration }}'\n scene_id: '{{ action_data.scene_ids[repeat.index - 1] }}'",
"config": [
{
"name": "main door",
"room": "main",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.main_door",
"device_id": null
}
},
{
"name": "garage entry door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.garage_entry_door",
"device_id": null
}
},
{
"name": "sliding door",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.sliding_door",
"device_id": null
}
},
{
"name": "server room door contact",
"room": "server room",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.server_room_door_contact",
"device_id": null
}
},
{
"name": "foyer",
"room": "foyer",
"type": "switch",
"id": {
"entity_id": "switch.foyer",
"device_id": null
}
},
{
"name": "garage entry",
"room": "garage",
"type": "switch",
"id": {
"entity_id": "switch.garage_entry",
"device_id": null
}
},
{
"name": "garage cans",
"room": "garage",
"type": "switch",
"id": {
"entity_id": "switch.garage_cans",
"device_id": null
}
},
{
"name": "dining room chandelier",
"room": "dining room",
"type": "light",
"id": {
"entity_id": "light.dining_room_chandelier",
"device_id": null
}
},
{
"name": "garage luminance",
"room": "garage",
"type": "sensor",
"id": {
"entity_id": "sensor.garage_luminance",
"device_id": null
}
},
{
"name": "input boolean test door",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.test_door",
"device_id": null
}
},
{
"name": "input boolean test switch",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.test_switch",
"device_id": null
}
},
{
"name": "input boolean test switch 2",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.test_switch_2",
"device_id": null
}
},
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
}
]
},
{
"id": "illuminate_door_event_handler",
"automation": "- alias: Illuminate Event Handler\n id: illuminate_door_event_handler\n mode: parallel\n trigger:\n - platform: event\n event_type: illuminate_door\n variables:\n data: '{{ trigger.event.data | default({}) }}\n\n '\n service: '{{ data.service | default }}\n\n '\n duration: '{{ data.duration | default }}\n\n '\n scene_id: '{{ data.scene_id | default }}\n\n '\n valid: '{{ true if service and duration and scene_id else false }}\n\n '\n condition: *id006\n action:\n - service: '{{ service }}'\n data:\n duration: '{{ duration }}'\n scene_id: '{{ scene_id }}'",
"config": []
},
{
"id": "cancel_scheduled_resume_state",
"automation": "- alias: Cancel Scheduled Resume State\n id: cancel_scheduled_resume_state\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - switch.foyer\n - switch.garage_entry\n - switch.garage_cans\n - light.dining_room_chandelier\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 source: \"{%- if valid %}\\n {{ trigger.to_state.entity_id }}\\n{%- endif %}\\n\"\n script: '{{ ''script.resume_{}''.format(source.replace(''.'',''_'')) }}\n\n '\n condition: *id006\n action:\n - service: script.turn_off\n target:\n entity_id: '{{ script }}'",
"config": [
{
"name": "foyer",
"room": "foyer",
"type": "switch",
"id": {
"entity_id": "switch.foyer",
"device_id": null
}
},
{
"name": "garage entry",
"room": "garage",
"type": "switch",
"id": {
"entity_id": "switch.garage_entry",
"device_id": null
}
},
{
"name": "garage cans",
"room": "garage",
"type": "switch",
"id": {
"entity_id": "switch.garage_cans",
"device_id": null
}
},
{
"name": "dining room chandelier",
"room": "dining room",
"type": "light",
"id": {
"entity_id": "light.dining_room_chandelier",
"device_id": null
}
},
{
"name": "Turn Off",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_off",
"device_id": null
}
}
]
},
{
"id": "illuminate_server_room",
"automation": "- alias: Illuminate Server Room\n id: illuminate_server_room\n mode: parallel\n trigger:\n - platform: state\n entity_id: binary_sensor.server_room_door_contact\n variables:\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n to_state: '{{ trigger.to_state.state | default('''') if continue else '''' }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue and to_state in [''on'',''off''] }}'\n action:\n - service: switch.turn_{{ to_state }}\n target:\n entity_id:\n - switch.server_room_switch",
"config": [
{
"name": "server room door contact",
"room": "server room",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.server_room_door_contact",
"device_id": null
}
},
{
"name": "server room switch",
"room": "server room",
"type": "switch",
"id": {
"entity_id": "switch.server_room_switch",
"device_id": null
}
}
]
},
{
"id": "announce_and_notify_on_doorbell_press",
"automation": "- alias: Notify\n id: announce_and_notify_on_doorbell_press\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - binary_sensor.doorbell_chime\n to: 'on'\n from: 'off'\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 timeout: \"{%- if valid %}\\n {{ as_timestamp(trigger.to_state.last_changed, 0)\\\n \\ - as_timestamp(trigger.from_state.last_changed, 0) }}\\n{% endif %}\\n\"\n continue: '{{ timeout and timeout > 15 }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - service: script.notify\n data:\n title: Door Bell!\n message: Door Bell!",
"config": [
{
"name": "doorbell chime",
"room": "entrance",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.doorbell_chime",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "suppress_doorbell_chime",
"automation": "- alias: Suppress Chime\n id: suppress_doorbell_chime\n mode: single\n trigger:\n - platform: state\n entity_id:\n - binary_sensor.doorbell_chime\n to: 'on'\n from: 'off'\n action:\n - service: switch.turn_off\n target:\n entity_id: switch.doorbell_chime_active\n - delay: 00:00:15\n - service: switch.turn_on\n target:\n entity_id: switch.doorbell_chime_active",
"config": [
{
"name": "doorbell chime",
"room": "entrance",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.doorbell_chime",
"device_id": null
}
},
{
"name": "doorbell chime active",
"room": "entrance",
"type": "switch",
"id": {
"entity_id": "switch.doorbell_chime_active",
"device_id": null
}
}
]
},
{
"id": "mqtt_store_drink_states_discovery",
"automation": "- alias: MQTT Discovery\n id: mqtt_store_drink_states_discovery\n mode: single\n trigger:\n - platform: homeassistant\n event: start\n variables:\n root: homeassistant\n milliliter: 0.20288414\n teaspoon: 1\n tablespoon: 3\n ounce: 6\n shot: 9\n quarter: 12\n third: 16\n half: 24\n two_thirds: 32\n three_forths: 36\n cup: 48\n drinks:\n - name: Soco Manhattan\n id: soco_manhattan\n image: /local/images/manhattan.png\n parts:\n - name: Southern Comfort\n type: parts\n count: '{{ 3 * ounce }}'\n - name: Sweet Vermouth\n type: parts\n count: '{{ ounce }}'\n - name: Angostura Bitters\n type: dash\n - name: Cherry\n type: garnish\n - name: Smoke Rings\n id: smoke_rings\n image: /local/images/smoke_rings.png\n parts:\n - name: Rittenhouse Rye Whiskey\n type: parts\n count: '{{ 3 * ounce }}'\n - name: Sweet Vermouth\n type: parts\n count: '{{ ounce }}'\n - name: Angostura Bitters\n type: dash\n - name: Hickory Smoke\n type: garnish\n - name: Maple Syrup\n type: parts\n count: '{{ teaspoon }}'\n - name: Old Fashioned\n id: old_fashio\n image: /local/images/old_fashioned.png\n parts:\n - name: Rye Whiskey or Bourbon\n type: parts\n count: '{{ 3 * shot }}'\n - name: Cherry Juice\n type: parts\n count: '{{ 1/2 * shot }}'\n - name: Club Soda\n type: parts\n count: '{{ 1/2 * shot }}'\n - name: Angostura Bitters\n type: dash\n - name: Orance Slice\n type: garnish\n - name: 3 Cherries\n type: garnish\n - name: Mango Habanero Margarita\n id: mango_habanero\n image: /local/images/spicy_margarita.png\n parts:\n - name: Habanero Tequila\n type: parts\n count: '{{ quarter }}'\n - name: Naked Mango\n type: parts\n count: '{{ cup }}'\n - name: Cointreau Orange Liqueur\n type: parts\n count: '{{ 2 * tablespoon }}'\n - name: Lime Juice\n type: parts\n count: '{{ tablespoon }}'\n - name: Apple Cider Margarita\n id: apple_cider_margarita\n image: /local/images/apple_cider_margarita.png\n parts:\n - name: Cinnamon Tequila\n type: parts\n count: '{{ quarter }}'\n - name: Cider\n type: parts\n count: '{{ cup }}'\n - name: Cointreau Orange Liqueur\n type: parts\n count: '{{ ounce }}'\n - name: Simple Syrup\n type: parts\n count: '{{ ounce }}'\n - name: Cosmopolitan\n id: cosmopolitan\n image: /local/images/apple_cider_margarita.png\n parts:\n - name: Vodka\n type: parts\n count: '{{ 2 * shot }}'\n - name: Cranberry\n type: parts\n count: '{{ 2 * shot }}'\n - name: Triple Sec\n type: parts\n count: '{{ shot }}'\n - name: Lime Juice\n type: parts\n count: '{{ shot }}'\n action:\n - service: script.mqtt_automated_config\n data:\n domain: sensor\n unique_id: drinks_config\n - service: script.mqtt_automated_states\n data:\n domain: sensor\n unique_id: drinks_config\n state: '{{ drinks | count }}'\n attributes: \"{{ {\\n 'drinks': drinks\\n} }}\\n\"\n - service: mqtt.publish\n data: \"{% set command_template = \\\"{% set drinks = \\\" ~ drinks ~ \\\"%}{% set drink\\\n \\ = drinks | selectattr('name', 'eq', value) | first | default(drinks[0]) %}{{\\\n \\ drink | to_json }}\\\" %} {% set options = drinks | map(attribute='name') |\\\n \\ list %} {{\\n {\\n 'topic': root ~ '/select/drinks/config',\\n 'payload':\\\n \\ {\\n 'name': 'Drink',\\n 'unique_id': 'drink_selector',\\n\\\n \\ 'object_id': 'drink',\\n 'state_topic': root ~ '/select/drinks/state',\\n\\\n \\ 'value_template': '{{ value_json.name }}',\\n 'command_topic':\\\n \\ root ~ '/select/drinks/state',\\n 'command_template': command_template,\\n\\\n \\ 'json_attributes_topic': root ~ '/select/drinks/state',\\n \\\n \\ 'json_attributes_template': '{{ {\\\"parts\\\": value_json.parts, \\\"image\\\"\\\n : value_json.image} | tojson }}',\\n 'value_template': \\\"{{ value_json.name\\\n \\ }}\\\",\\n 'options': options,\\n 'retain': True,\\n }\\\n \\ | to_json,\\n 'retain': True,\\n }\\n}}\\n\"",
"config": [
{
"name": "MQTT Automated Config",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_config",
"device_id": null
}
},
{
"name": "MQTT Automated States",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_states",
"device_id": null
}
}
]
},
{
"id": "mqtt_store_echo_states_discovery",
"automation": "- alias: MQTT Discovery\n id: mqtt_store_echo_states_discovery\n mode: single\n trigger:\n - platform: homeassistant\n event: start\n action:\n - service: script.mqtt_automated_config\n data:\n domain: sensor\n unique_id: alexa_last_tts\n device_class: timestamp",
"config": [
{
"name": "MQTT Automated Config",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_config",
"device_id": null
}
}
]
},
{
"id": "event_milestone_notifications",
"automation": "- alias: Events - Milestone Notifications\n id: event_milestone_notifications\n trigger:\n - platform: time\n at: '10:00:00'\n - platform: time\n at: '15:30:00'\n - platform: time\n at: '19:00:00'\n variables:\n target_date: '{{ today_at().date() | string }}\n\n '\n events: '{{ state_attr(''binary_sensor.personal_events'', ''events'') | selectattr(''when'',\n ''eq'', target_date) | list }}\n\n '\n condition:\n - condition: state\n entity_id: binary_sensor.personal_events\n state: 'on'\n action:\n - repeat:\n for_each: '{{ events }}'\n sequence:\n - service: script.notify\n data:\n message: 'Today is {{ repeat.item.who }}s {{ repeat.item.event }}!\n\n '",
"config": [
{
"name": "personal events",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.personal_events",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "event_milestone_reminders",
"automation": "- alias: Events - Milestone Reminders\n id: event_milestone_reminders\n trigger:\n - platform: time\n at: '10:00:00'\n - platform: time\n at: '15:30:00'\n - platform: time\n at: '19:00:00'\n variables:\n target_dates: '{% set ns = namespace(dates=[]) %} {%- for offset in [30, 14, 7]\n %} {%- set ns.dates = ns.dates + [(today_at() + timedelta(days=offset)).date()\n | string] %} {%- endfor %} {{ ns.dates }}\n\n '\n events: '{{ state_attr(''binary_sensor.personal_events'', ''events'') | selectattr(''when'',\n ''in'', target_dates) | selectattr(''who'', ''search'', ''Mike|Lindsay'') |\n list }}\n\n '\n condition:\n - condition: template\n value_template: '{{ events | count > 0 }}'\n action:\n - repeat:\n for_each: '{{ events }}'\n sequence:\n - service: script.notify\n data:\n message: '{{ repeat.item.who }}s {{ repeat.item.event }} is in {{ repeat.item.days_away\n }} day{{ ''s'' if repeat.item.days_away > 1 else '''' }}!\n\n '",
"config": [
{
"name": "personal events",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.personal_events",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "event_calendar_reminders",
"automation": "- alias: Events - Calendar Reminders\n id: event_calendar_reminders\n trigger:\n - platform: time\n at: '19:00:00'\n action:\n - service: script.events",
"config": [
{
"name": "Events",
"room": null,
"type": "script",
"id": {
"entity_id": "script.events",
"device_id": null
}
}
]
},
{
"id": "reload_templates",
"automation": "- alias: Events - Forward Reload Templates\n id: reload_templates\n trigger:\n - platform: event\n event_type: event_template_reloaded\n action:\n - delay: 00:00:01\n - event: templates_reloaded\n event_data: {}",
"config": []
},
{
"id": "turn_on_livingroom_lights_with_harmony_activities",
"automation": "- alias: Turn On Livingroom lights with Activities\n id: turn_on_livingroom_lights_with_harmony_activities\n trigger:\n - platform: state\n entity_id:\n - switch.xbox_one\n - switch.playstation\n - switch.roku\n - switch.switch\n - switch.tv\n to: 'on'\n from: 'off'\n condition:\n - condition: state\n entity_id: sun.sun\n state: below_horizon\n action:\n - service: homeassistant.turn_on\n target:\n entity_id:\n - light.living_room\n - switch.hyperion_usb_capture",
"config": [
{
"name": "living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.living_room",
"device_id": null
}
},
{
"name": "hyperion usb capture",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_usb_capture",
"device_id": null
}
},
{
"name": "xbox one",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.xbox_one",
"device_id": null
}
},
{
"name": "playstation",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.playstation",
"device_id": null
}
},
{
"name": "roku",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.roku",
"device_id": null
}
},
{
"name": "switch",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.switch",
"device_id": null
}
},
{
"name": "tv",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.tv",
"device_id": null
}
},
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
}
]
},
{
"id": "turn_off_hyperion_lights_with_harmony_activities",
"automation": "- alias: Turn Off Hyperion with Activities\n id: turn_off_hyperion_lights_with_harmony_activities\n trigger:\n - platform: template\n value_template: '{{ is_state_attr(''remote.living_room'', ''current_activity'',\n ''PowerOff'') }}'\n condition:\n - condition: state\n entity_id: sun.sun\n state: below_horizon\n action:\n - service: switch.turn_off\n target:\n entity_id: switch.hyperion_usb_capture",
"config": [
{
"name": "hyperion usb capture",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.hyperion_usb_capture",
"device_id": null
}
},
{
"name": "living room remote",
"room": "living room",
"type": "remote",
"id": {
"entity_id": "remote.living_room",
"device_id": null
}
},
{
"name": "Sun",
"room": null,
"type": "sun",
"id": {
"entity_id": "sun.sun",
"device_id": null
}
}
]
},
{
"id": "harmony_give_chromecast_control_to_remote_using_emulated_roku",
"automation": "- alias: Give ChromeCast control to remote using emulated roku\n id: harmony_give_chromecast_control_to_remote_using_emulated_roku\n mode: restart\n trigger:\n - platform: event\n event_type: roku_command\n event_data:\n source_name: Home Assistant\n variables:\n target: media_player.chromecast\n jump_in_seconds: 10\n key: '{{ trigger.event.data.key | default(\"NoPress\") }}\n\n '\n keys:\n - Play\n - Rev\n - Fwd\n play_pause: '{{ key == ''Play'' }}'\n rev: '{{ key == ''Rev'' }}'\n fwd: '{{ key == ''Fwd'' }}'\n rev_fwd: '{{ fwd or rev }}'\n condition:\n - condition: template\n value_template: '{{ states(target) in [''playing'', ''paused''] and key != ''NoPress''\n }}\n\n '\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ play_pause }}'\n sequence:\n - service: media_player.media_play_pause\n target:\n entity_id: '{{ target }}'\n - conditions:\n - condition: template\n value_template: '{{ rev_fwd }}'\n sequence:\n - service: media_player.media_seek\n target:\n entity_id: '{{ target }}'\n data:\n seek_position: \"{%- set current = state_attr(target, 'media_position') |\\\n \\ default(0) %} {%- set total = state_attr(target, 'media_duration') |\\\n \\ default(0) %} {%- set dir = 1 if fwd else -1 %} {%- set next = current\\\n \\ + jump_in_seconds * dir %} {%- if fwd %}\\n {{ total if next >= total\\\n \\ else next }}\\n{%- else %}\\n {{ 0 if next <= 0 else next }}\\n{%- endif\\\n \\ %}\\n \"",
"config": [
{
"name": "chromecast",
"room": "living room",
"type": "media_player",
"id": {
"entity_id": "media_player.chromecast",
"device_id": null
}
}
]
},
{
"id": "indoor_holiday_lights",
"automation": "- alias: Timed Event - Holiday Lights\n id: indoor_holiday_lights\n mode: parallel\n trigger:\n - id: indoor\n platform: state\n entity_id: binary_sensor.indoor_holiday\n not_from:\n - unknown\n - unavailable\n - id: outdoor_on\n platform: sun\n event: sunset\n - id: outdoor_off\n platform: sun\n event: sunrise\n variables:\n continue: \"{% if trigger.platform == 'state' %}\\n {{ trigger | default(none)\\\n \\ is not none and trigger.to_state is defined and trigger.from_state is defined\\\n \\ }}\\n{% else %}\\n True\\n{% endif %}\\n\"\n to_state: \"{% if trigger.platform == 'state' %}\\n {{ trigger.to_state.state |\\\n \\ default if continue else None }}\\n{% else %}\\n {{ trigger.id.split('_')[-1]\\\n \\ }}\\n{% endif %}\\n\"\n indoor:\n - switch.indoor_holiday\n outdoor: []\n target: '{{ indoor if trigger.id == ''indoor'' else outdoor }}\n\n '\n condition:\n - condition: template\n value_template: '{{ target | count > 0 and continue and to_state in [''on'',''off'']\n }}'\n action:\n - service: switch.turn_{{ to_state }}\n target:\n entity_id: '{{ target }}'",
"config": [
{
"name": "indoor holiday",
"room": "indoor",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.indoor_holiday",
"device_id": null
}
},
{
"name": "indoor holiday switch",
"room": "indoor",
"type": "switch",
"id": {
"entity_id": "switch.indoor_holiday",
"device_id": null
}
}
]
},
{
"id": "bathroom_turn_on_fan_when_humidity_is_high",
"automation": "- alias: Turn on fan when bathroom humidity is high.\n id: bathroom_turn_on_fan_when_humidity_is_high\n mode: restart\n trigger:\n - platform: state\n entity_id: binary_sensor.master_bathroom_humidity_status\n variables:\n check: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n continue: '{%- set valid = [''on'', ''off''] %} {{ check and trigger.to_state.state\n in valid and trigger.from_state.state in valid }}\n\n '\n service: 'switch.turn_{{ trigger.to_state.state if continue else none }}\n\n '\n add_delay: '{{ trigger.to_state.state == ''off'' if continue else False }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - choose:\n - conditions: '{{ add_delay }}'\n sequence:\n - delay: 00:20:00\n - service: '{{ service }}'\n target:\n entity_id: switch.master_bathroom_fan\n - delay:\n seconds: 1",
"config": [
{
"name": "master bathroom humidity status",
"room": "bathroom",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.master_bathroom_humidity_status",
"device_id": null
}
},
{
"name": "master bathroom fan",
"room": "bathroom",
"type": "switch",
"id": {
"entity_id": "switch.master_bathroom_fan",
"device_id": null
}
}
]
},
{
"id": "basement_notify_when_humidity_is_high",
"automation": "- alias: Notify when basement humidity is high\n id: basement_notify_when_humidity_is_high\n mode: parallel\n trigger:\n - id: 2 hours\n platform: state\n entity_id: binary_sensor.basement_humidity_high\n to: 'on'\n for:\n hours: 2\n - id: 10 hours\n platform: state\n entity_id: binary_sensor.basement_humidity_high\n to: 'on'\n for:\n hours: 10\n action:\n - service: script.notify\n data:\n title: Basement humidity has been high for {{ trigger.id }}.\n message: Basement humidity has been high for {{ trigger.id }}.",
"config": [
{
"name": "basement humidity high",
"room": "basement",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.basement_humidity_high",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "hyperion_execute_effects",
"automation": "- alias: Execute Effects\n id: hyperion_execute_effects\n mode: restart\n trigger:\n - platform: state\n entity_id:\n - input_number.hyperion_brightness\n - input_select.hyperion_effects\n variables:\n valid: \"{{ trigger.from_state is defined and trigger.from_state is not none \\n\\\n \\ and trigger.to_state is defined and trigger.to_state is not none \\n and\\\n \\ trigger.from_state.state != trigger.to_state.state }}\\n\"\n source: '{{ trigger.to_state.entity_id }}\n\n '\n target: light.gpio_18_tv\n brightness: \"{%- if source == 'input_number.hyperion_brightness' %}\\n {{ trigger.to_state.state\\\n \\ }}\\n{%- else %}\\n {{ states('input_number.hyperion_brightness') }}\\n{%- endif\\\n \\ %}\\n\"\n effect: \"{%- if source == 'input_select.hyperion_effects' %}\\n {{ trigger.to_state.state\\\n \\ }}\\n{%- else %}\\n {{ states('input_select.hyperion_effects') }}\\n{%- endif\\\n \\ %}\\n\"\n condition:\n - condition: template\n value_template: '{{ valid }}'\n action:\n - service: light.turn_on\n target:\n entity_id: '{{ target }}'\n data:\n brightness: '{{ brightness }}'\n effect: '{{ effect }}'",
"config": [
{
"name": "hyperion effects",
"room": "living room",
"type": "input_select",
"id": {
"entity_id": "input_select.hyperion_effects",
"device_id": null
}
},
{
"name": "hyperion brightness",
"room": "living room",
"type": "input_number",
"id": {
"entity_id": "input_number.hyperion_brightness",
"device_id": null
}
},
{
"name": "gpio 18 tv",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.gpio_18_tv",
"device_id": null
}
}
]
},
{
"id": "aafa91b8-a2e2-4df2-9412-536288327566",
"automation": "- alias: MQTT Discovery\n id: aafa91b8-a2e2-4df2-9412-536288327566\n mode: single\n trigger:\n - platform: homeassistant\n event: start\n action:\n - service: script.turn_on\n target:\n entity_id: script.irrigation_mqtt_discovery",
"config": [
{
"name": "irrigation mqtt discovery script",
"room": null,
"type": "script",
"id": {
"entity_id": "script.irrigation_mqtt_discovery",
"device_id": null
}
},
{
"name": "Turn On",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_on",
"device_id": null
}
}
]
},
{
"id": "54f20352-b2ba-44d7-80f5-44ada2469dbc",
"automation": "- alias: Set Next Irrigation\n id: 54f20352-b2ba-44d7-80f5-44ada2469dbc\n mode: restart\n trigger:\n - platform: homeassistant\n event: start\n - platform: time\n at: 00:00:00\n - platform: state\n entity_id:\n - input_datetime.irrigation_program_start\n - switch.back_yard_status\n - switch.front_yard_status\n - number.back_yard_day_cycle\n - number.front_yard_day_cycle\n - switch.rain_bird_sprinkler_1_status\n - switch.rain_bird_sprinkler_2_status\n - switch.rain_bird_sprinkler_3_status\n - switch.rain_bird_sprinkler_5_status\n - switch.rain_bird_sprinkler_6_status\n - switch.rain_bird_sprinkler_7_status\n - switch.rain_bird_sprinkler_8_status\n - number.rain_bird_sprinkler_1_program_duration\n - number.rain_bird_sprinkler_2_program_duration\n - number.rain_bird_sprinkler_3_program_duration\n - number.rain_bird_sprinkler_5_program_duration\n - number.rain_bird_sprinkler_6_program_duration\n - number.rain_bird_sprinkler_7_program_duration\n - number.rain_bird_sprinkler_8_program_duration\n action:\n - service: script.get_next_irrigations\n response_variable: irrigations\n - condition: template\n value_template: '{{ irrigations.zones | count > 0 }}'\n - repeat:\n for_each: '{{ irrigations.zones }}'\n sequence:\n - service: script.mqtt_automated_states\n data:\n domain: sensor\n unique_id: '{{ repeat.item.zone_next_run_id }}'\n state: '{{ repeat.item.zone_next_run }}'",
"config": [
{
"name": "irrigation program start",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.irrigation_program_start",
"device_id": null
}
},
{
"name": "back yard status",
"room": "back yard",
"type": "switch",
"id": {
"entity_id": "switch.back_yard_status",
"device_id": null
}
},
{
"name": "front yard status",
"room": "front yard",
"type": "switch",
"id": {
"entity_id": "switch.front_yard_status",
"device_id": null
}
},
{
"name": "back yard day cycle",
"room": "back yard",
"type": "number",
"id": {
"entity_id": "number.back_yard_day_cycle",
"device_id": null
}
},
{
"name": "front yard day cycle",
"room": "front yard",
"type": "number",
"id": {
"entity_id": "number.front_yard_day_cycle",
"device_id": null
}
},
{
"name": "rain bird sprinkler 1 status",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.rain_bird_sprinkler_1_status",
"device_id": null
}
},
{
"name": "rain bird sprinkler 2 status",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.rain_bird_sprinkler_2_status",
"device_id": null
}
},
{
"name": "rain bird sprinkler 3 status",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.rain_bird_sprinkler_3_status",
"device_id": null
}
},
{
"name": "rain bird sprinkler 5 status",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.rain_bird_sprinkler_5_status",
"device_id": null
}
},
{
"name": "rain bird sprinkler 6 status",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.rain_bird_sprinkler_6_status",
"device_id": null
}
},
{
"name": "rain bird sprinkler 7 status",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.rain_bird_sprinkler_7_status",
"device_id": null
}
},
{
"name": "rain bird sprinkler 8 status",
"room": null,
"type": "switch",
"id": {
"entity_id": "switch.rain_bird_sprinkler_8_status",
"device_id": null
}
},
{
"name": "rain bird sprinkler 1 program duration",
"room": null,
"type": "number",
"id": {
"entity_id": "number.rain_bird_sprinkler_1_program_duration",
"device_id": null
}
},
{
"name": "rain bird sprinkler 2 program duration",
"room": null,
"type": "number",
"id": {
"entity_id": "number.rain_bird_sprinkler_2_program_duration",
"device_id": null
}
},
{
"name": "rain bird sprinkler 3 program duration",
"room": null,
"type": "number",
"id": {
"entity_id": "number.rain_bird_sprinkler_3_program_duration",
"device_id": null
}
},
{
"name": "rain bird sprinkler 5 program duration",
"room": null,
"type": "number",
"id": {
"entity_id": "number.rain_bird_sprinkler_5_program_duration",
"device_id": null
}
},
{
"name": "rain bird sprinkler 6 program duration",
"room": null,
"type": "number",
"id": {
"entity_id": "number.rain_bird_sprinkler_6_program_duration",
"device_id": null
}
},
{
"name": "rain bird sprinkler 7 program duration",
"room": null,
"type": "number",
"id": {
"entity_id": "number.rain_bird_sprinkler_7_program_duration",
"device_id": null
}
},
{
"name": "rain bird sprinkler 8 program duration",
"room": null,
"type": "number",
"id": {
"entity_id": "number.rain_bird_sprinkler_8_program_duration",
"device_id": null
}
},
{
"name": "Get Next Irrigations",
"room": null,
"type": "script",
"id": {
"entity_id": "script.get_next_irrigations",
"device_id": null
}
},
{
"name": "MQTT Automated States",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_states",
"device_id": null
}
}
]
},
{
"id": "1c67152d-d153-41a9-b5a7-78ce036fecbf",
"automation": "- alias: Start Irrigation Cycle\n id: 1c67152d-d153-41a9-b5a7-78ce036fecbf\n mode: single\n trigger:\n - platform: time\n at: &id007\n - sensor.rain_bird_sprinkler_1_start\n - sensor.rain_bird_sprinkler_2_start\n - sensor.rain_bird_sprinkler_3_start\n - sensor.rain_bird_sprinkler_5_start\n - sensor.rain_bird_sprinkler_6_start\n - sensor.rain_bird_sprinkler_7_start\n - sensor.rain_bird_sprinkler_8_start\n variables:\n entities: *id007\n trigger_time: '{{ trigger.now.astimezone(utcnow().tzinfo).replace(second=0, microsecond=0).isoformat()\n }}\n\n '\n start: '{{ entities | select(''is_state'', trigger_time) | first | default }}\n\n '\n object_id: '{{ start | regex_findall(''sensor.(.*)_start'') | first }}\n\n '\n switch: switch.{{ object_id }}\n number: number.{{ object_id }}_program_duration\n last_run_unique_id: '{% set identifier = device_attr(''sensor.{0}_last_run''.format(object_id),\n ''identifiers'') | list | first | last %} {{ identifier | slugify | replace(''_'',\n '''') ~ ''lr'' }}\n\n '\n last_run_attributes: '{{ dict(by=''irrigation'' if is_state(''binary_sensor.rain_bird_controller_rainsensor'',\n ''off'') else ''rain'') }}\n\n '\n duration: '{{ states(number) | int(0) }}\n\n '\n condition:\n - condition: template\n value_template: '{{ duration > 0 }}'\n action:\n - service: script.mqtt_automated_states\n data:\n domain: sensor\n unique_id: '{{ last_run_unique_id }}'\n state: '{{ trigger_time }}'\n attributes: '{{ last_run_attributes }}'\n - if: '{{ is_state(''binary_sensor.rain_bird_controller_rainsensor'', ''off'') }}'\n then:\n - service: rainbird.start_irrigation\n data:\n entity_id: '{{ switch }}'\n duration: '{{ duration }}'",
"config": [
{
"name": "rain bird controller rainsensor",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.rain_bird_controller_rainsensor",
"device_id": null
}
},
{
"name": "MQTT Automated States",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_states",
"device_id": null
}
}
]
},
{
"id": "a9040111-cd2f-4dd4-9a6b-518bfa2e90e9",
"automation": "- alias: Check Rain Today\n id: a9040111-cd2f-4dd4-9a6b-518bfa2e90e9\n mode: restart\n triggers:\n - trigger: time\n at:\n - entity_id: input_datetime.irrigation_program_start\n offset: -00:01:00\n variables:\n trigger_time: '{{ trigger.now.astimezone(utcnow().tzinfo).replace(second=0, microsecond=0).isoformat()\n }}\n\n '\n conditions:\n - condition: state\n entity_id: binary_sensor.rain_bird_controller_rainsensor\n state: 'on'\n - condition: state\n entity_id: binary_sensor.irrigation_season\n state: 'on'\n actions:\n - action: script.set_last_irrigation\n data:\n time: '{{ (trigger_time | as_datetime).time() }}'\n date: '{{ (trigger_time | as_datetime).date() }}'\n switches: '{{ integration_entities(''rainbird'') | select(''match'', ''^switch.'')\n | list }}'\n reason: rain",
"config": [
{
"name": "irrigation program start",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.irrigation_program_start",
"device_id": null
}
},
{
"name": "rain bird controller rainsensor",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.rain_bird_controller_rainsensor",
"device_id": null
}
},
{
"name": "irrigation season",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.irrigation_season",
"device_id": null
}
}
]
},
{
"id": "33596fc1-7dbf-4837-a589-953f2d5d072a",
"automation": "- alias: Valve Reminders\n id: 33596fc1-7dbf-4837-a589-953f2d5d072a\n trigger:\n - platform: time\n at: '10:00:00'\n - platform: time\n at: '15:30:00'\n - platform: time\n at: '19:00:00'\n variables:\n target_dates: '{% set ns = namespace(dates=[]) %} {%- for offset in [7, 1] %}\n {%- set ns.dates = ns.dates + [(today_at() + timedelta(days=offset)).date()\n | string] %} {%- endfor %} {{ ns.dates }}\n\n '\n entities:\n - sensor.irrigation_season_start\n - sensor.irrigation_season_end\n events: \"{%- from 'easy_time.jinja' import speak_the_days %} {%- set phrase =\\\n \\ 'Turn o{} the water irrigation shutoff value{}{}' %} {%- set ns = namespace(items=[])\\\n \\ %} {%- for e in entities %}\\n {%- set dt = states(e) | as_datetime %}\\n \\\n \\ {%- set date = dt.date() | string %}\\n {%- set name = state_attr(e, 'friendly_name')\\\n \\ %}\\n {%- set p = 'n' if 'Start' in name else 'ff' %}\\n {%- set f = speak_the_days(dt)\\\n \\ %}\\n {%- set m = ' ' if 'in' in f else ' before ' %}\\n {%- set ns.items\\\n \\ = ns.items + [\\n dict(\\n title=name,\\n when=date,\\n message=phrase.format(p,\\\n \\ m, f)\\n )\\n ] -%}\\n{%- endfor %} {{ ns.items }}\\n\"\n event: '{{ events | selectattr(''when'', ''in'', target_dates) | list | first\n | default(None) }}\n\n '\n condition:\n - condition: template\n value_template: '{{ event is not none }}'\n action:\n - service: script.notify\n data:\n title: '{{ event.title }}'\n message: '{{ event.message }}'",
"config": [
{
"name": "irrigation season start",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.irrigation_season_start",
"device_id": null
}
},
{
"name": "irrigation season end",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.irrigation_season_end",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "laser_position_indicator_automation",
"automation": "- alias: Garage position indicator\n id: laser_position_indicator_automation\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - binary_sensor.front_garage_door\n variables:\n laser: switch.garage_ceiling_outlet\n valid: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n is_on: '{{ trigger.to_state.state == ''on'' and trigger.from_state.state == ''off''\n }}\n\n '\n is_off: '{{ trigger.to_state.state == ''off'' and trigger.from_state.state ==\n ''on'' }}\n\n '\n continue: '{{ valid and (is_on or is_off) }}\n\n '\n is_laser_on: '{{ is_state(laser, ''on'') }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ is_on }}'\n sequence:\n - service: script.turn_off\n target:\n entity_id: script.laser_position_timer\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ not is_laser_on }}'\n sequence:\n - service: switch.turn_on\n target:\n entity_id: '{{ laser }}'\n - service: script.laser_position_timer\n - conditions:\n - condition: template\n value_template: '{{ is_off }}'\n sequence:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ is_laser_on }}'\n sequence:\n - service: script.turn_off\n target:\n entity_id: script.laser_position_timer\n - service: switch.turn_off\n target:\n entity_id: '{{ laser }}'",
"config": [
{
"name": "front garage door",
"room": "garage",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.front_garage_door",
"device_id": null
}
},
{
"name": "garage ceiling outlet",
"room": "garage",
"type": "switch",
"id": {
"entity_id": "switch.garage_ceiling_outlet",
"device_id": null
}
},
{
"name": "garage laser position timer script",
"room": "garage",
"type": "script",
"id": {
"entity_id": "script.laser_position_timer",
"device_id": null
}
},
{
"name": "Turn Off",
"room": null,
"type": "script",
"id": {
"entity_id": "script.turn_off",
"device_id": null
}
}
]
},
{
"id": "announce_dryer_when_complete",
"automation": "- alias: Notify\n id: announce_dryer_when_complete\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - binary_sensor.dryer_status\n - binary_sensor.washer\n to: 'off'\n from: 'on'\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 timeout: \"{%- if valid %}\\n {{ as_timestamp(trigger.to_state.last_changed, 0)\\\n \\ - as_timestamp(trigger.from_state.last_changed, 0) }}\\n{% endif %}\\n\"\n continue: '{{ timeout and timeout > 15 }}\n\n '\n name: '{{ trigger.to_state.name.split('' '')[0] if valid else ''Unknown'' }}\n\n '\n announce: '{{ name.lower() if name != ''Unkonwn'' else none }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue and announce is not none }}'\n action:\n - event: announce_energy\n event_data:\n machine: '{{ announce }}'\n - service: script.notify\n data:\n title: '{{ name }} is finished!'\n message: '{{ name }} is finished!'",
"config": [
{
"name": "dryer status",
"room": "laundry",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.dryer_status",
"device_id": null
}
},
{
"name": "washer status",
"room": "laundry",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.washer",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "washer_and_dryer_booleans",
"automation": "- alias: Booleans\n id: washer_and_dryer_booleans\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - sensor.dryer_power\n - sensor.washer_power\n variables:\n config:\n sensor.washer_power:\n input_boolean: input_boolean.washer\n threshold: 80\n sensor.dryer_power:\n input_boolean: input_boolean.dryer\n threshold: 150\n valid: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n current: '{{ config.get(trigger.entity_id) }}\n\n '\n have_current: '{{ current is not none }}\n\n '\n number: '{{ trigger.to_state.state if valid and is_number(trigger.to_state.state)\n else none }}\n\n '\n have_number: '{{ number is not none }}\n\n '\n disposition: '{{ number > current.threshold if have_current and have_number else\n none }}\n\n '\n service_target: '{{ current.input_boolean if have_current else none }}\n\n '\n service_call: 'homeassistant.turn_o{{ ''n'' if disposition else ''ff'' }}\n\n '\n continue: '{{ valid and disposition is not none }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - service: '{{ service_call }}'\n target:\n entity_id: '{{ service_target }}'",
"config": [
{
"name": "dryer power",
"room": "laundry",
"type": "sensor",
"id": {
"entity_id": "sensor.dryer_power",
"device_id": null
}
},
{
"name": "washer power",
"room": "laundry",
"type": "sensor",
"id": {
"entity_id": "sensor.washer_power",
"device_id": null
}
},
{
"name": "washer input boolean",
"room": "laundry",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.washer",
"device_id": null
}
},
{
"name": "dryer input boolean",
"room": "laundry",
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.dryer",
"device_id": null
}
}
]
},
{
"id": "washer_and_dryer_cycle_counter",
"automation": "- alias: Cycle Counter\n id: washer_and_dryer_cycle_counter\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - input_boolean.test_washer\n - binary_sensor.washer_status\n variables:\n prefix: washer_dryer_\n valid: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n continue: '{{ trigger.to_state.state != trigger.from_state.state if valid else\n False }}\n\n '\n source: '{{ trigger.entity_id }}\n\n '\n next_phase: '{{ trigger.to_state.state if valid else none }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - service: script.calculate_washer_cycle\n data:\n prefix: '{{ prefix }}'\n source: '{{ source }}'\n next_phase: '{{ next_phase }}'",
"config": [
{
"name": "washer status",
"room": "laundry",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.washer",
"device_id": null
}
},
{
"name": "input boolean test washer",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.test_washer",
"device_id": null
}
},
{
"name": "Washer Status",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.washer_status",
"device_id": null
}
},
{
"name": "Calculate Washer Cycle",
"room": null,
"type": "script",
"id": {
"entity_id": "script.calculate_washer_cycle",
"device_id": null
}
}
]
},
{
"id": "3e5e2ffb-d811-4818-a6bd-1f1386c6dbae",
"automation": "- alias: MQTT Discovery\n id: 3e5e2ffb-d811-4818-a6bd-1f1386c6dbae\n trigger:\n - platform: homeassistant\n event: start\n action:\n - variables:\n prefix: washer_dryer_\n binary_sensors:\n - test_washer\n - washer\n - repeat:\n count: '{{ binary_sensors | length }}'\n sequence:\n - service: script.mqtt_automated_config\n data:\n domain: binary_sensor\n unique_id: '{{ prefix }}{{ binary_sensors[repeat.index - 1] }}'\n object_id: '{{ binary_sensors[repeat.index - 1] }}'\n device_class: running",
"config": [
{
"name": "MQTT Automated Config",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_config",
"device_id": null
}
}
]
},
{
"id": "0705a3d3-e7e4-475f-9063-70e7c6107c83",
"automation": "- alias: Leak Warning\n id: 0705a3d3-e7e4-475f-9063-70e7c6107c83\n description: Notify if there's a leak\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.leak\n to: 'on'\n actions:\n - action: script.notify\n data:\n title: Leak Detected!\n message: '{{ state_attr(''binary_sensor.leak'', ''message'') }}'\n - action: input_datetime.set_datetime\n target: &id008\n entity_id: input_datetime.leak_annoy\n data: &id009\n datetime: '{{ now() + timedelta(minutes=15) }}\n\n '",
"config": [
{
"name": "leak",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.leak",
"device_id": null
}
},
{
"name": "leak annoy datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.leak_annoy",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "391d15c8-d9de-4937-94e9-c6367690ea4a",
"automation": "- alias: Leak Persistence\n id: 391d15c8-d9de-4937-94e9-c6367690ea4a\n description: Keep notifying if there's a leak.\n triggers:\n - trigger: time\n at: input_datetime.leak_annoy\n conditions:\n - condition: state\n entity_id: binary_sensor.leak\n state: 'on'\n actions:\n - action: script.notify\n data:\n title: Leak Detected!\n message: '{{ message }}'\n - action: input_datetime.set_datetime\n target: *id008\n data: *id009",
"config": [
{
"name": "leak",
"room": null,
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.leak",
"device_id": null
}
},
{
"name": "leak annoy datetime",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.leak_annoy",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "execute_quick_effects_on_ui_updates",
"automation": "- alias: Execute Quick Effects on UI updates\n id: execute_quick_effects_on_ui_updates\n mode: restart\n trigger:\n - platform: state\n entity_id:\n - input_number.quick_strip_brightness\n - input_number.quick_strip_color_temp\n - input_number.quick_strip_hue\n - input_select.quick_strip_effect\n variables:\n valid_trigger: \"{{ trigger.from_state is defined and trigger.from_state is not\\\n \\ none \\n and trigger.to_state is defined and trigger.to_state is not none\\\n \\ \\n and trigger.from_state.state != trigger.to_state.state }}\\n\"\n choose_service: \"{# Should we run a choose service? Returns 0 if we shouldn't\\\n \\ #} {%- if valid_trigger %}\\n {%- set color_temp = 'color_temp' in trigger.to_state.object_id\\\n \\ %}\\n {%- set hue = 'hue' in trigger.to_state.object_id %}\\n {%- set effect\\\n \\ = 'effect' in trigger.to_state.object_id %}\\n {%- if hue or color_temp %}\\n\\\n \\ input_boolean.turn_{{ 'on' if color_temp else 'off' }}\\n {%- elif effect\\\n \\ %}\\n {# This is because you can't turn it off in hue mode for some reason\\\n \\ #}\\n {{ 'input_boolean.turn_on' if trigger.to_state.state == 'off' else\\\n \\ 0 }}\\n {%- else %}\\n 0\\n {%- endif %}\\n{%- else %}\\n 0\\n{%- endif %}\\n\"\n continue_actions: \"{%- if valid_trigger %}\\n {%- if 'effect' in trigger.to_state.object_id\\\n \\ %}\\n true\\n {%- else %}\\n {{ states('input_select.quick_strip_effect')\\\n \\ != 'off' }}\\n {%- endif %}\\n{%- else %}\\n false\\n{%- endif %}\\n\"\n condition:\n - condition: template\n value_template: '{{ continue_actions }}'\n action:\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ choose_service != 0 }}'\n sequence:\n - service: '{{ choose_service }}'\n data:\n entity_id: input_boolean.hue_color_temp\n - service: script.lzw45_ui_quick_effect",
"config": [
{
"name": "quick strip brightness",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.quick_strip_brightness",
"device_id": null
}
},
{
"name": "quick strip color temp",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.quick_strip_color_temp",
"device_id": null
}
},
{
"name": "quick strip hue",
"room": null,
"type": "input_number",
"id": {
"entity_id": "input_number.quick_strip_hue",
"device_id": null
}
},
{
"name": "quick strip effect",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.quick_strip_effect",
"device_id": null
}
},
{
"name": "hue color temp",
"room": null,
"type": "input_boolean",
"id": {
"entity_id": "input_boolean.hue_color_temp",
"device_id": null
}
},
{
"name": "lzw45 ui quick effect script",
"room": null,
"type": "script",
"id": {
"entity_id": "script.lzw45_ui_quick_effect",
"device_id": null
}
}
]
},
{
"id": "manage_lzw_pixel_effects_and_quick_strip_effects",
"automation": "- alias: Manage LZW Pixel Effects & Quick Strip Effects\n id: manage_lzw_pixel_effects_and_quick_strip_effects\n trigger:\n - platform: state\n entity_id:\n - input_select.quick_strip_effect\n - script.lzw45_ui_pixel_effect\n - script.lzw45_ui_custom_effect\n variables:\n from_state_trigger_valid: '{{ trigger.from_state is defined and trigger.from_state\n is not none and trigger.from_state.state not in [''unavailable'', ''unknown'']\n }}\n\n '\n to_state_trigger_valid: '{{ trigger.to_state is defined and trigger.to_state is\n not none and trigger.to_state.state not in [''unavailable'', ''unknown''] }}\n\n '\n valid_trigger: '{{ from_state_trigger_valid and to_state_trigger_valid and trigger.from_state.state\n != trigger.to_state.state }}\n\n '\n last_effect: \"{%- if valid_trigger %}\\n {%- if trigger.to_state.object_id in\\\n \\ ('lzw45_ui_pixel_effect', 'lzw45_party_effect') %}\\n {{ states('input_select.pixel_effect')\\\n \\ }}\\n {%- elif trigger.to_state.object_id == 'lzw45_ui_custom_effect' %}\\n\\\n \\ custom\\n {%- else %}\\n {{ trigger.to_state.state }}\\n {%- endif %}\\n\\\n {%- endif %}\\n\"\n condition:\n - condition: template\n value_template: '{{ valid_trigger }}'\n action:\n - service: input_text.set_value\n data:\n entity_id: input_text.lzw45_last_effect\n value: '{{ last_effect }}'",
"config": [
{
"name": "quick strip effect",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.quick_strip_effect",
"device_id": null
}
},
{
"name": "pixel effect",
"room": null,
"type": "input_select",
"id": {
"entity_id": "input_select.pixel_effect",
"device_id": null
}
},
{
"name": "lzw45 last effect",
"room": null,
"type": "input_text",
"id": {
"entity_id": "input_text.lzw45_last_effect",
"device_id": null
}
},
{
"name": "lzw45 ui pixel effect script",
"room": null,
"type": "script",
"id": {
"entity_id": "script.lzw45_ui_pixel_effect",
"device_id": null
}
},
{
"name": "lzw45 ui custom effect script",
"room": null,
"type": "script",
"id": {
"entity_id": "script.lzw45_ui_custom_effect",
"device_id": null
}
}
]
},
{
"id": "reaction_keep_sunset_switches_on",
"automation": "- alias: Keep Sunset Switches On.\n id: reaction_keep_sunset_switches_on\n mode: parallel\n trigger:\n - platform: state\n entity_id:\n - switch.passenger_sconce\n - switch.sconces_garage\n - switch.sconces_main_entrance\n to: 'off'\n variables:\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - service: switch.turn_on\n target:\n entity_id: '{{ trigger.entity_id }}'\n - service: script.notify\n data:\n title: Sunset Switch Turned Off\n message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }} door sconce\n switch was turned off, turning back on.\n\n '\n - service: script.notify_area\n data:\n message: Jim counter action initiative in affect. Turning on {{ state_attr(trigger.entity_id,\n 'friendly_name') }} door sconces.\n announce: false\n area: living_room\n - condition: sun\n after: sunrise\n before: sunset\n - delay:\n seconds: 5\n - service: light.turn_off\n target:\n entity_id: light.outdoor_bulbs",
"config": [
{
"name": "passenger sconce",
"room": "passenger",
"type": "switch",
"id": {
"entity_id": "switch.passenger_sconce",
"device_id": null
}
},
{
"name": "sconces garage",
"room": "garage",
"type": "switch",
"id": {
"entity_id": "switch.sconces_garage",
"device_id": null
}
},
{
"name": "sconces main entrance",
"room": "main",
"type": "switch",
"id": {
"entity_id": "switch.sconces_main_entrance",
"device_id": null
}
},
{
"name": "outdoor bulbs",
"room": "outside",
"type": "light",
"id": {
"entity_id": "light.outdoor_bulbs",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
},
{
"name": "Notify Area",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify_area",
"device_id": null
}
}
]
},
{
"id": "reaction_keep_living_room_lamps_available",
"automation": "- alias: Living Room Lamp Availability.\n id: reaction_keep_living_room_lamps_available\n mode: parallel\n trigger:\n - platform: state\n entity_id: &id010\n - light.jims_lamp\n - light.mikes_lamp\n - light.lindsays_lamp\n to: unavailable\n variables:\n triggering: '{{ trigger.entity_id }}\n\n '\n entities: *id010\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n only_triggering_light: '{{ expand(entities) | rejectattr(''entity_id'', ''eq'',\n triggering) | map(attribute=''state'') | select(''eq'', ''unavailable'') | list\n | length == 0 }}\n\n '\n name: '{{ state_attr(triggering, ''friendly_name'') or ''unknown'' }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue and only_triggering_light }}'\n action:\n - service: script.notify\n data:\n message: '{{ name.capitalize() }} went unavailable! Notifying living room.\n\n '\n - service: script.notify_area\n data:\n message: \"Please do not turn off living room lamps, turn the lamp back on. \\\n \\ If you want to turn on this lamp in the future, say: Turn on {{ name }}.\\\n \\ \\n\"\n announce: false\n area: living_room",
"config": [
{
"name": "mikes lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.mikes_lamp",
"device_id": null
}
},
{
"name": "jims lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.jims_lamp",
"device_id": null
}
},
{
"name": "lindsays lamp",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.lindsays_lamp",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
},
{
"name": "Notify Area",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify_area",
"device_id": null
}
}
]
},
{
"id": "6c4bb70c-e8a7-40c8-9c78-bb077023e3b9",
"automation": "- alias: Fix Zwave Multicast Errors\n id: 6c4bb70c-e8a7-40c8-9c78-bb077023e3b9\n description: Refreshes a zwave multicast light and attempts to fix it.\n mode: single\n triggers:\n - not_from: &id011\n - unknown\n - unavailable\n not_to: &id012\n - unknown\n - unavailable\n trigger: state\n entity_id: sensor.multicast_error\n variables:\n action: '{{ trigger.to_state.attributes.action | default(None) }}'\n entity_id: '{{ trigger.to_state.attributes.entity_id | default(None) }}'\n new: '{# Stops reload template from triggering. #} {%- set t = now() %} {%- set\n yesterday = t - timedelta(hours=24) %} {{ t - trigger.to_state.state | as_datetime(yesterday)\n | as_local < timedelta(seconds=10) }}\n\n '\n continue: '{{ action is not none and entity_id is not none and new }}'\n conditions:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - action: script.notify\n data:\n notify: notify.mobile_app_petro\n title: Multicast Error\n message: Refreshing {{ state_attr(entity_id, 'friendly_name') }}\n - action: script.get_zwave_entities_from_light_group\n data:\n light: '{{ entity_id }}'\n response_variable: response\n - delay: 1\n - action: zwave_js.refresh_value\n target:\n entity_id: '{{ response.entity_id }}'\n - action: '{{ action }}'\n target:\n entity_id: '{{ entity_id }}'",
"config": [
{
"name": "multicast error",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.multicast_error",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "06cfa18a-fa57-406d-94dc-5037e6096b87",
"automation": "- alias: Fix Wled Errors\n id: 06cfa18a-fa57-406d-94dc-5037e6096b87\n description: Refreshes a zwave multicast light and attempts to fix it.\n mode: single\n triggers:\n - not_from: *id011\n not_to: *id012\n trigger: state\n entity_id: sensor.wled_api_error\n variables:\n config:\n wled_hutch:\n - light.hutch_uplight\n kitchen_uplight:\n - light.cabinet_master\n - light.cabinet_slave\n kitchen_cabinet_2:\n - light.cabinet_surface\n source: '{{ trigger.to_state.attributes.source | default(None) }}\n\n '\n action: '{{ trigger.to_state.attributes.action | default(None) }}\n\n '\n entities: '{{ config.get(trigger.to_state.attributes.source, []) }}\n\n '\n to_state: '{{ action.split(''_'') | last if action else None }}\n\n '\n filtered: '{{ entities | reject(''is_state'', to_state) | list }}\n\n '\n new: '{# Stops reload template from triggering. #} {%- set t = now() %} {%- set\n yesterday = t - timedelta(hours=24) %} {{ t - trigger.to_state.state | as_datetime(yesterday)\n | as_local < timedelta(seconds=10) }}\n\n '\n continue: '{{ filtered | length > 0 and new }}\n\n '\n conditions:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - action: script.notify\n data:\n notify: notify.mobile_app_petro\n title: WLED Error\n message: Refreshing {{ filtered | map('state_attr', 'friendly_name') | list\n | join(', ') }}\n - delay: 1\n - action: homeassistant.turn_{{ to_state }}\n target:\n entity_id: '{{ filtered }}'",
"config": [
{
"name": "wled api error",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.wled_api_error",
"device_id": null
}
},
{
"name": "hutch uplight",
"room": null,
"type": "light",
"id": {
"entity_id": "light.hutch_uplight",
"device_id": null
}
},
{
"name": "cabinet master",
"room": "kitchen",
"type": "light",
"id": {
"entity_id": "light.cabinet_master",
"device_id": null
}
},
{
"name": "cabinet slave",
"room": "kitchen",
"type": "light",
"id": {
"entity_id": "light.cabinet_slave",
"device_id": null
}
},
{
"name": "cabinet surface",
"room": "kitchen",
"type": "light",
"id": {
"entity_id": "light.cabinet_surface",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "3f1c8cab-0151-4961-854e-80fdb956fcae",
"automation": "- alias: Fix Doorbell Chime Status\n id: 3f1c8cab-0151-4961-854e-80fdb956fcae\n description: Checks to see if the doorbell chime is on periodically.\n triggers:\n - id: turn_on\n trigger: state\n entity_id: switch.doorbell_chime_active\n to: 'off'\n for:\n minutes: 5\n - id: turn_on\n trigger: template\n value_template: '{{ states(''sensor.doorbell_chime_off'') | float(0) == 5 }}'\n - id: check\n trigger: time\n at: '8:00:00'\n variables:\n message: \"{% if trigger.id == 'turn_on' %}\\n Doorbell chime has been off for\\\n \\ at least 5 minutes. Turning Back on.\\n{% elif is_state('sensor.doorbell_chime_off',\\\n \\ 'off') %}\\n Doorbell chime was found to be off at 8am, turning back on.\\n\\\n {% else%}\\n None\\n{% endif %}\\n\"\n continue: '{{ message is not none }}'\n conditions:\n - condition: template\n value_template: '{{ continue }}'\n action:\n - action: script.notify\n data:\n notify: notify.mobile_app_petro\n title: Fixing Doorbell Chime\n message: '{{ message }}'\n - action: switch.turn_on\n target:\n entity_id: switch.doorbell_chime_active",
"config": [
{
"name": "doorbell chime active",
"room": "entrance",
"type": "switch",
"id": {
"entity_id": "switch.doorbell_chime_active",
"device_id": null
}
},
{
"name": "doorbell chime off sensor",
"room": "entrance",
"type": "sensor",
"id": {
"entity_id": "sensor.doorbell_chime_off",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "0c371ea2-c700-476b-9c3d-b36bd3c9a662",
"automation": "- alias: Play/Pause lighting in living room\n id: 0c371ea2-c700-476b-9c3d-b36bd3c9a662\n description: Turn on lighting when paused, turn off lighting when playing.\n triggers:\n - trigger: state\n entity_id: media_player.roku_living_room\n to:\n - playing\n - paused\n not_from:\n - unavailable\n - unknown\n variables:\n light: light.living_room\n media_state: '{{ trigger.to_state.state }}'\n light_state: '{{ ''on'' if media_state == ''paused'' else ''off'' }}'\n movie_time: '{{ is_state(''switch.movie_time'', ''on'') }}'\n turned_on_by_this: \"{% if this.context.parent_id is not none %}\\n {{ light |\\\n \\ expand | selectattr('state', 'eq', 'on') | selectattr('context.parent_id',\\\n \\ 'eq', this.context.parent_id) | map(attribute='entity_id') | list }}\\n{% else\\\n \\ %}\\n []\\n{% endif %}\\n\"\n living_room_lights: \"{% if movie_time and media_state == 'paused' and is_state(light,\\\n \\ 'off') %}\\n {{ state_attr(light, 'entity_id') }}\\n{% elif movie_time and\\\n \\ media_state == 'playing' and is_state(light, 'on') %}\\n {{ turned_on_by_this\\\n \\ }}\\n{% else %}\\n []\\n{% endif %}\\n\"\n conditions:\n - condition: template\n value_template: '{{ living_room_lights | length > 0 }}'\n actions:\n - action: light.turn_{{ light_state }}\n target:\n entity_id: '{{ living_room_lights }}'",
"config": [
{
"name": "living room",
"room": "living room",
"type": "light",
"id": {
"entity_id": "light.living_room",
"device_id": null
}
},
{
"name": "movie time",
"room": "living room",
"type": "switch",
"id": {
"entity_id": "switch.movie_time",
"device_id": null
}
},
{
"name": "roku living room",
"room": "living room",
"type": "media_player",
"id": {
"entity_id": "media_player.roku_living_room",
"device_id": null
}
}
]
},
{
"id": "repair_ignore_spook_repair",
"automation": "- alias: Ignore Spook Repair\n id: repair_ignore_spook_repair\n trigger:\n - platform: state\n entity_id: event.repair\n variables:\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n attrs: '{{ trigger.to_state.attributes | default({}) if continue else {} }}\n\n '\n issue_id: '{{ attrs.get(''issue_id'') }}\n\n '\n target: '{{ issue_id if ''timed_event_snapshot_status'' in issue_id else None\n }}\n\n '\n condition:\n - condition: template\n value_template: '{{ target is not none }}'\n action:\n - service: repairs.remove\n data:\n issue_id: '{{ target }}'",
"config": [
{
"name": "repair event",
"room": null,
"type": "event",
"id": {
"entity_id": "event.repair",
"device_id": null
}
}
]
},
{
"id": "snapshot_status",
"automation": "- alias: Notify Snapshot status\n id: snapshot_status\n trigger:\n - platform: state\n entity_id: sensor.samba_backup\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 status: '{{ trigger.to_state.state | default | lower }}\n\n '\n not_idle: '{{ status != ''idle'' }}\n\n '\n condition:\n - condition: template\n value_template: '{{ valid and not_idle }}'\n action:\n - service: script.notify\n data:\n title: Snapshot Status\n message: Samba backup {{ status }}.",
"config": [
{
"name": "samba backup",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.samba_backup",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "garbage_day_message",
"automation": "- alias: Notify Garbage Day Message\n id: garbage_day_message\n trigger:\n - platform: time\n at: '10:00:00'\n - platform: time\n at: '15:30:00'\n - platform: time\n at: '19:00:00'\n variables:\n recycling: '{% set recycling_origin = strptime(states(''input_datetime.recycling''),\n ''%Y-%m-%d'') | as_local %} {% set tomorrow = (today_at() + timedelta(days=1))\n %} {% set days = (tomorrow - recycling_origin).days %} {{ (days // 7) % 2 ==\n 0 }}\n\n '\n what: 'Trash {{ ''and Recycling '' if recycling else '''' }}day tomorrow!\n\n '\n condition:\n - condition: time\n weekday:\n - mon\n action:\n - service: script.notify\n data:\n message: '{{ what }}'",
"config": [
{
"name": "recycling date",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.recycling",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "change_filters_message",
"automation": "- alias: Notify Change Filters Message\n id: change_filters_message\n trigger:\n - platform: time\n at: '10:00:00'\n - platform: time\n at: '19:00:00'\n condition:\n - condition: template\n value_template: '{{ now().day == 1 and now().month in [ 1, 4, 7, 10 ] }}'\n action:\n - service: script.notify\n data:\n message: Change HVAC filter.",
"config": [
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "mosby_heartworm",
"automation": "- alias: Notify Mosby Heartworm and Flee Medication.\n id: mosby_heartworm\n trigger:\n - platform: time\n at: '10:00:00'\n - platform: time\n at: '19:00:00'\n condition:\n - condition: template\n value_template: '{{ now().day == 1 }}'\n action:\n - service: script.notify\n data:\n message: Give mosby heartworm and flee medication.",
"config": [
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "dst_warning",
"automation": "- alias: Notify DST Change\n id: dst_warning\n trigger:\n - platform: time\n at: '10:00:00'\n - platform: time\n at: '19:00:00'\n condition:\n - condition: template\n value_template: '{{ states(''sensor.daylight_savings_days_until'') | int(0) in\n [7,1] }}\n\n '\n action:\n - service: script.notify\n data:\n message: '{%- set days = states(''sensor.daylight_savings_days_until'') | int(0)\n %} {%- set plural = ''s'' if days | int(0) > 1 else '''' %} Daylight savings\n in {{ days }} day{{plural}}, you will {{ states(''sensor.daylight_savings_phrase'')\n }}!\n\n '",
"config": [
{
"name": "daylight savings days until",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.daylight_savings_days_until",
"device_id": null
}
},
{
"name": "daylight savings phrase",
"room": null,
"type": "sensor",
"id": {
"entity_id": "sensor.daylight_savings_phrase",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "outdoor_lights_on_off",
"automation": "- alias: Outdoor Lights On at Sunset, Off at Sunrise\n id: outdoor_lights_on_off\n trigger:\n - platform: sun\n event: sunset\n - platform: sun\n event: sunrise\n variables:\n event: '{{ trigger.event | default(''invalid'') }}\n\n '\n scene: '{{ states(''sensor.seasonal_lights'') }}\n\n '\n action:\n - service: script.sunrise_sunset\n data:\n event: '{{ event }}'\n scene: '{{ scene }}'",
"config": [
{
"name": "seasonal lights",
"room": "outside",
"type": "sensor",
"id": {
"entity_id": "sensor.seasonal_lights",
"device_id": null
}
},
{
"name": "Sunrise Sunset",
"room": null,
"type": "script",
"id": {
"entity_id": "script.sunrise_sunset",
"device_id": null
}
}
]
},
{
"id": "clear_persistent_notifications_around_bedtime",
"automation": "- alias: Clear persistent_notifications at bedtime\n id: clear_persistent_notifications_around_bedtime\n trigger:\n - platform: time\n at: '22:00:00'\n action:\n - service: persistent_notification.dismiss_all",
"config": []
},
{
"id": "simple_thermostat",
"automation": "- alias: Simple Thermostat\n id: simple_thermostat\n trigger:\n - platform: calendar\n event: start\n entity_id: calendar.thermostat\n variables:\n config:\n heat: 70\n cool: 66\n event: '{{ trigger.calendar_event.summary.lower() }}\n\n '\n temperature: '{{ config.get(event) }}\n\n '\n condition:\n - condition: template\n value_template: '{{ temperature is not none }}'\n action:\n - service: climate.set_temperature\n target:\n entity_id: climate.living_room_thermostat\n data:\n temperature: '{{ temperature }}'",
"config": [
{
"name": "thermostat calendar",
"room": "living room",
"type": "calendar",
"id": {
"entity_id": "calendar.thermostat",
"device_id": null
}
},
{
"name": "living room thermostat",
"room": "living room",
"type": "climate",
"id": {
"entity_id": "climate.living_room_thermostat",
"device_id": null
}
}
]
},
{
"id": "d11bb907-e656-4a0b-8f03-ecbbf3e40a3a",
"automation": "- alias: Setup Mike's Todo Lists\n id: d11bb907-e656-4a0b-8f03-ecbbf3e40a3a\n mode: single\n triggers:\n - trigger: time\n at: 00:00:00\n - trigger: event\n event_type: run_manual_schedule_update\n variables:\n day: '{% from ''easy_time.jinja'' import count_the_days %} {# Assumes monday is\n always selected #} {{ count_the_days(''input_datetime.mike_run_program'') }}\n\n '\n week: '{{ (day | abs / 7 + 1) | int }}\n\n '\n action:\n - if: '{{ 1 <= week <= 10 }}'\n then:\n - action: script.set_run_schedule\n data:\n program: 718485f4-3031-46a3-bce5-990189a6e06c\n week: '{{ week }}'\n weekly_todo: todo.mike_this_week\n daily_todo: todo.mike_today\n max_heart_rate: 200\n - action: script.set_mikes_daily_list\n - event: roll_up_todo",
"config": [
{
"name": "mike run program",
"room": null,
"type": "input_datetime",
"id": {
"entity_id": "input_datetime.mike_run_program",
"device_id": null
}
},
{
"name": "mike this week todo",
"room": null,
"type": "todo",
"id": {
"entity_id": "todo.mike_this_week",
"device_id": null
}
},
{
"name": "mike today todo",
"room": null,
"type": "todo",
"id": {
"entity_id": "todo.mike_today",
"device_id": null
}
}
]
},
{
"id": "toggle_game_room_lights",
"automation": "- alias: Game Room Lights\n id: toggle_game_room_lights\n trigger:\n - platform: state\n entity_id: switch.game_room_switch\n variables:\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n to_state: '{{ trigger.to_state.state | default('''') if continue else '''' }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue and to_state in [''on'',''off''] }}'\n action:\n - service: switch.turn_{{ to_state }}\n target:\n entity_id:\n - switch.game_room_bookcase_outlet\n - switch.game_room_buffet_outlet",
"config": [
{
"name": "game room switch",
"room": "game room",
"type": "switch",
"id": {
"entity_id": "switch.game_room_switch",
"device_id": null
}
},
{
"name": "game room bookcase outlet",
"room": "game room",
"type": "switch",
"id": {
"entity_id": "switch.game_room_bookcase_outlet",
"device_id": null
}
},
{
"name": "game room buffet outlet",
"room": "game room",
"type": "switch",
"id": {
"entity_id": "switch.game_room_buffet_outlet",
"device_id": null
}
}
]
},
{
"id": "toggle_basement_lights",
"automation": "- alias: Basement Lights\n id: toggle_basement_lights\n trigger:\n - platform: state\n entity_id: switch.basement_stairs\n variables:\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n to_state: '{{ trigger.to_state.state | default('''') if continue else '''' }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue and to_state in [''on'',''off''] }}'\n action:\n - service: switch.turn_{{ to_state }}\n target:\n entity_id:\n - switch.basement_cans",
"config": [
{
"name": "basement stairs",
"room": "basement",
"type": "switch",
"id": {
"entity_id": "switch.basement_stairs",
"device_id": null
}
},
{
"name": "basement cans",
"room": "basement",
"type": "switch",
"id": {
"entity_id": "switch.basement_cans",
"device_id": null
}
}
]
},
{
"id": "toggle_deck_string_lights",
"automation": "- alias: Deck String Lights\n id: toggle_deck_string_lights\n trigger:\n - platform: state\n entity_id: &id013\n - switch.deck_mood_lighting\n - switch.patio_string_light\n variables:\n entities: *id013\n state_list:\n - 'on'\n - 'off'\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined }}\n\n '\n to_state: '{{ trigger.to_state.state | default(none) if continue else none }}\n\n '\n targets: '{{ expand(entities) | rejectattr(''entity_id'', ''eq'', trigger.entity_id)\n | rejectattr(''state'', ''eq'', to_state) | map(attribute=''entity_id'') | list\n if continue else [] }}\n\n '\n condition:\n - condition: template\n value_template: '{{ continue and to_state in state_list and targets | count >\n 0 }}'\n action:\n - service: switch.turn_{{ to_state }}\n target:\n entity_id: '{{ targets }}'",
"config": [
{
"name": "deck mood lighting",
"room": "deck",
"type": "switch",
"id": {
"entity_id": "switch.deck_mood_lighting",
"device_id": null
}
},
{
"name": "patio string light",
"room": "patio",
"type": "switch",
"id": {
"entity_id": "switch.patio_string_light",
"device_id": null
}
}
]
},
{
"id": "toggle_cabinet_string_lights",
"automation": "- alias: Uplight & Downlight Cabinet from Switch\n id: toggle_cabinet_string_lights\n mode: single\n trigger:\n - platform: state\n entity_id: switch.kitchen_cabinet\n variables:\n entities:\n - switch.kitchen_cabinet_2\n - switch.kitchen_uplight\n in_season: '{% set remove = [''switch.kitchen_uplight''] if is_state(''binary_sensor.indoor_holiday'',\n ''on'') else [] %} {{ entities | reject(''in'', remove) | list }}\n\n '\n state_list:\n - 'on'\n - 'off'\n continue: '{{ trigger | default(none) is not none and trigger.to_state is defined\n and trigger.from_state is defined and trigger.to_state.state in state_list }}\n\n '\n targets: '{{ in_season | reject(''is_state'', trigger.to_state.state) | list if\n continue else [] }}\n\n '\n condition:\n - condition: template\n value_template: '{{ targets | count > 0 }}'\n action:\n - service: switch.turn_{{ trigger.to_state.state }}\n target:\n entity_id: '{{ targets }}'",
"config": [
{
"name": "indoor holiday",
"room": "indoor",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.indoor_holiday",
"device_id": null
}
},
{
"name": "kitchen cabinet",
"room": "kitchen",
"type": "switch",
"id": {
"entity_id": "switch.kitchen_cabinet",
"device_id": null
}
},
{
"name": "kitchen cabinet 2",
"room": "kitchen",
"type": "switch",
"id": {
"entity_id": "switch.kitchen_cabinet_2",
"device_id": null
}
},
{
"name": "kitchen uplight",
"room": "kitchen",
"type": "switch",
"id": {
"entity_id": "switch.kitchen_uplight",
"device_id": null
}
}
]
},
{
"id": "ups_notify_power_outage",
"automation": "- alias: Notify Power Outage\n id: ups_notify_power_outage\n trigger:\n - id: notify\n platform: state\n entity_id: binary_sensor.house_power_status\n to: 'on'\n - id: power off\n platform: state\n entity_id: binary_sensor.house_power_status\n to: 'on'\n for: 00:01:00\n - id: cancel\n platform: state\n entity_id: binary_sensor.house_power_status\n from: 'on'\n to: 'off'\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 message: \"{% if trigger.id == 'notify' %}\\n Detected power outage, starting power\\\n \\ down sequence in 1 minute if power is not restored.\\n{% elif trigger.id ==\\\n \\ 'power off' %}\\n Power was not restored, starting power down sequence.\\n\\\n {% else %}\\n Power has restored, canceling power down sequence.\\n{% endif %}\\n\"\n condition:\n - condition: template\n value_template: '{{ valid }}'\n action:\n - service: script.notify\n data:\n message: '{{ message }}'\n - condition: template\n value_template: '{{ trigger.id == ''power off'' }}'\n - service: script.power_down_sequence",
"config": [
{
"name": "house power status",
"room": "house",
"type": "binary_sensor",
"id": {
"entity_id": "binary_sensor.house_power_status",
"device_id": null
}
},
{
"name": "power down sequence script",
"room": null,
"type": "script",
"id": {
"entity_id": "script.power_down_sequence",
"device_id": null
}
},
{
"name": "Notify",
"room": null,
"type": "script",
"id": {
"entity_id": "script.notify",
"device_id": null
}
}
]
},
{
"id": "mqtt_store_and_automate_weights",
"automation": "- alias: MQTT Discovery and Automation\n id: mqtt_store_and_automate_weights\n mode: parallel\n trigger:\n - id: start\n platform: homeassistant\n event: start\n - id: new\n platform: state\n entity_id: sensor.master_scale_weight\n variables:\n root: homeassistant\n range: 20\n config:\n - person: person.petro\n initial: 200\n - person: person.lambo\n initial: 145\n people: \"{%- set ns = namespace(items=[]) %} {%- for item in config %}\\n {%-\\\n \\ set object_id = item.person.split('.')[-1] ~ '_weight' %}\\n {%- set ns.items\\\n \\ = ns.items + [{\\n 'unique_id': object_id,\\n 'object_id': object_id,\\n\\\n \\ 'initial': item.initial,\\n 'current': states('sensor.' ~ object_id)\\\n \\ | float(None),\\n }] %}\\n{%- endfor %} {{ ns.items }}\\n\"\n weight: \"{%- if trigger.id == 'new' and trigger.to_state.state | is_number %}\\n\\\n \\ {%- set next_weight = trigger.to_state.state | float %}\\n {%- set ns = namespace(items=[])\\\n \\ %}\\n {%- for person in people %}\\n {%- set current = person.current or\\\n \\ person.initial %}\\n {%- if current - range <= next_weight <= current +\\\n \\ range %}\\n {%- set ns.items = ns.items + [{'next':next_weight, 'unique_id':person.unique_id}]\\\n \\ %}\\n {%- endif %}\\n {%- endfor %}\\n {{ ns.items | first | default }}\\n\\\n {%- else -%}\\n None\\n{%- endif %}\\n\"\n action:\n - choose:\n - conditions: '{{ trigger.id == ''start'' }}'\n sequence:\n - repeat:\n for_each: '{{ people }}'\n sequence:\n - service: script.mqtt_automated_config\n data:\n domain: sensor\n unique_id: '{{ repeat.item.unique_id }}'\n object_id: '{{ repeat.item.object_id }}'\n state_class: measurement\n device_class: weight\n unit_of_measurement: lb\n - conditions: '{{ weight is not none }}'\n sequence:\n - service: script.mqtt_automated_states\n data:\n domain: sensor\n unique_id: '{{ weight.unique_id }}'\n state: '{{ weight.next }}'",
"config": [
{
"name": "master scale weight",
"room": "master",
"type": "sensor",
"id": {
"entity_id": "sensor.master_scale_weight",
"device_id": null
}
},
{
"name": "MQTT Automated Config",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_config",
"device_id": null
}
},
{
"name": "MQTT Automated States",
"room": null,
"type": "script",
"id": {
"entity_id": "script.mqtt_automated_states",
"device_id": null
}
}
]
}
]