|
| 1 | + - id: 8a08e182-8b64-43e0-8835-42a46acf228b |
| 2 | + alias: really_cool_automation |
| 3 | + trigger: |
| 4 | + - platform: state |
| 5 | + entity_id: button.get_tagline |
| 6 | + id: easy_button |
| 7 | + - platform: state |
| 8 | + entity_id: binary_sensor.aqara_vibrator |
| 9 | + to: 'on' |
| 10 | + id: baited_by_the_master |
| 11 | + - platform: state |
| 12 | + entity_id: sensor.3d_printer_state |
| 13 | + to: 'finished' |
| 14 | + id: nice |
| 15 | + action: |
| 16 | + - variables: |
| 17 | + slackerlabs: "Automate the Boring Stuff!" |
| 18 | + paulhibbert: "ooooh the Zigbee." |
| 19 | + everythingsmarthome: "nice" |
| 20 | + - choose: |
| 21 | + - conditions: |
| 22 | + - condition: trigger |
| 23 | + id: easy_button |
| 24 | + sequence: |
| 25 | + - service: notify.jeff_ios |
| 26 | + data: |
| 27 | + message: '{{ slackerlabs }}' |
| 28 | + - conditions: |
| 29 | + - condition: trigger |
| 30 | + id: baited_by_the_master |
| 31 | + sequence: |
| 32 | + - service: script.ohyeah |
| 33 | + - conditions: |
| 34 | + - condition: trigger |
| 35 | + id: nice |
| 36 | + sequence: |
| 37 | + - service: notify.jeff_ios |
| 38 | + data: |
| 39 | + message: '{{ everythingsmarthome }}' |
| 40 | + default: [] |
| 41 | + |
| 42 | + - id: dff6ec8c-afbe-40ab-9d9d-bda94539e9a0 |
| 43 | + alias: really_really_cool_automation |
| 44 | + trigger: |
| 45 | + - platform: state |
| 46 | + entity_id: button.get_tagline |
| 47 | + id: easy_button |
| 48 | + - platform: state |
| 49 | + entity_id: binary_sensor.aqara_vibrator |
| 50 | + to: 'on' |
| 51 | + id: baited_by_the_master |
| 52 | + - platform: state |
| 53 | + entity_id: sensor.3d_printer_state |
| 54 | + to: 'finished' |
| 55 | + id: nice |
| 56 | + action: |
| 57 | + - service: script.get_taglines |
| 58 | + response_variable: "taglines" |
| 59 | + - choose: |
| 60 | + - conditions: |
| 61 | + - condition: trigger |
| 62 | + id: easy_button |
| 63 | + sequence: |
| 64 | + - service: notify.jeff_ios |
| 65 | + data: |
| 66 | + message: '{{ taglines.slackerlabs }}' |
| 67 | + - conditions: |
| 68 | + - condition: trigger |
| 69 | + id: baited_by_the_master |
| 70 | + sequence: |
| 71 | + - service: script.ohyeah |
| 72 | + - conditions: |
| 73 | + - condition: trigger |
| 74 | + id: nice |
| 75 | + sequence: |
| 76 | + - service: notify.jeff_ios |
| 77 | + data: |
| 78 | + message: '{{ taglines.everythingsmarthome }}' |
| 79 | + |
| 80 | + - id: 618bd49f-3b0a-4b09-85ce-52f4e3b2f38c |
| 81 | + alias: Smart Kitchen Lighting |
| 82 | + description: '' |
| 83 | + trigger: |
| 84 | + # The jina here might work better as a binary_sensor entity, because you could |
| 85 | + # visually see the currnt state and be able to check timestamps. But this should work |
| 86 | + # and trigger your automation any time a motion, occupancy, or door sensor in the |
| 87 | + # kitchen area turns on. |
| 88 | + - platform: template |
| 89 | + value_template: > |
| 90 | + {{ states.binary_sensor | |
| 91 | + selectattr('entity_id', 'in', area_entities('kitchen')) | |
| 92 | + rejectattr('attributes.device_class', 'undefined') | |
| 93 | + selectattr('attributes.device_class', 'search', '(occupancy|motion|door)') | |
| 94 | + selectattr('state', 'eq', 'on') | |
| 95 | + map(attribute='entity_id') | |
| 96 | + list | count > 0}} |
| 97 | + id: Light_Needed |
| 98 | + - platform: template |
| 99 | + value_template: > |
| 100 | + {{ states.binary_sensor | |
| 101 | + selectattr('entity_id', 'in', area_entities('kitchen')) | |
| 102 | + rejectattr('attributes.device_class', 'undefined') | |
| 103 | + selectattr('attributes.device_class', 'search', '(occupancy|motion|door)') | |
| 104 | + selectattr('state', 'eq', 'on') | |
| 105 | + map(attribute='entity_id') | |
| 106 | + list | count > 0}} |
| 107 | + for: '00:01:00' |
| 108 | + id: lights_dim |
| 109 | + - platform: template |
| 110 | + value_template: > |
| 111 | + {{ states.binary_sensor | |
| 112 | + selectattr('entity_id', 'in', area_entities('kitchen')) | |
| 113 | + rejectattr('attributes.device_class', 'undefined') | |
| 114 | + selectattr('attributes.device_class', 'search', '(occupancy|motion|door)') | |
| 115 | + selectattr('state', 'eq', 'on') | |
| 116 | + map(attribute='entity_id') | |
| 117 | + list | count > 0}} |
| 118 | + for: '00:05:00' |
| 119 | + id: light_not_needed |
| 120 | + condition: [] |
| 121 | + action: |
| 122 | + # This action calls our get_room_lights script and gets a list of all the light entities in your kitchen |
| 123 | + - service: script.get_room_lights |
| 124 | + data: |
| 125 | + room: kitchen |
| 126 | + response_variable: "room" |
| 127 | + - choose: |
| 128 | + - conditions: |
| 129 | + - condition: trigger |
| 130 | + id: Light_Needed |
| 131 | + sequence: |
| 132 | + - service: light.turn_on |
| 133 | + data: |
| 134 | + brightness_pct: 100 |
| 135 | + target: |
| 136 | + entity_id: '{{room.lights}}' # this uses the response the get_room_lights script to the entity ids. |
| 137 | + - conditions: |
| 138 | + - condition: trigger |
| 139 | + id: Light_Needed |
| 140 | + - condition: state |
| 141 | + entity_id: input_boolean.audible_notifications |
| 142 | + state: 'off' |
| 143 | + sequence: |
| 144 | + - service: light.turn_on |
| 145 | + data: |
| 146 | + brightness_pct: 50 |
| 147 | + target: |
| 148 | + entity_id: '{{room.lights}}' |
| 149 | + - conditions: |
| 150 | + - condition: trigger |
| 151 | + id: lights_dim |
| 152 | + sequence: |
| 153 | + - service: light.turn_on |
| 154 | + data: |
| 155 | + brightness_pct: 20 |
| 156 | + target: |
| 157 | + entity_id: '{{room.lights}}' |
| 158 | + - conditions: |
| 159 | + - condition: trigger |
| 160 | + id: light_not_needed |
| 161 | + sequence: |
| 162 | + - service: light.turn_off |
| 163 | + target: |
| 164 | + entity_id: '{{room.lights}}' |
| 165 | + default: [] |
| 166 | + mode: restart |
0 commit comments