automations.yaml 7.89 KB
Newer Older
1
- alias: Moritz Licht aus, Sonos aus
Rainer Sokoll's avatar
Rainer Sokoll committed
2 3
  trigger:
    platform: state
4
    entity_id: light.moritz_deckenlampe
5
    to: 'off'
Rainer Sokoll's avatar
Rainer Sokoll committed
6 7 8 9
  condition:
    condition: time
    after: '17:30:00'
    before: '19:45:00'
Rainer Sokoll's avatar
Rainer Sokoll committed
10 11
  action:
    service: media_player.media_pause
12
    entity_id: media_player.moritz
Rainer Sokoll's avatar
Rainer Sokoll committed
13

14
- alias: Moritz Licht an, Sonos an
Rainer Sokoll's avatar
Rainer Sokoll committed
15 16
  trigger:
    platform: state
17
    entity_id: light.moritz_deckenlampe
18
    to: 'on'
Rainer Sokoll's avatar
Rainer Sokoll committed
19 20 21 22
  condition:
    condition: time
    after: '17:30:00'
    before: '19:45:00'
Rainer Sokoll's avatar
Rainer Sokoll committed
23 24
  action:
    service: media_player.media_play
25
    entity_id: media_player.moritz
Rainer Sokoll's avatar
Rainer Sokoll committed
26

Rainer Sokoll's avatar
Rainer Sokoll committed
27 28
- alias: Diesel billig
  trigger:
Rainer Sokoll's avatar
Rainer Sokoll committed
29 30 31 32 33 34 35 36 37 38 39 40
    - platform: numeric_state
      entity_id: sensor.diesel
      below: 1.1
    - platform: numeric_state
      entity_id: sensor.diesel
      below: 1.09
    - platform: numeric_state
      entity_id: sensor.diesel
      below: 1.08
    - platform: numeric_state
      entity_id: sensor.diesel
      below: 1.07
Rainer Sokoll's avatar
Rainer Sokoll committed
41 42 43
  action:
    service: notify.telegram
    data:
Rainer Sokoll's avatar
Rainer Sokoll committed
44
      message: ' Diesel unter 1.10 €! Aktuell {{ states.sensor.diesel.state }} €'
Rainer Sokoll's avatar
Rainer Sokoll committed
45

46 47 48 49
# credits to Thomas Dreher (http://thodre.de/der-heimassi-4)
- alias: Film ab
  trigger:
    platform: state
Rainer Sokoll's avatar
Rainer Sokoll committed
50
    entity_id: media_player.kodi_wohnzimmer, media_player.schwarzes_kastchen_2
51 52 53
    to: 'playing'
  condition:
    - condition: state
54
      entity_id: light.wohnzimmer_couch
55 56 57 58
      state: 'on'
  action:
    service: light.turn_on
    data: 
59
      entity_id: light.wohnzimmer_couch
60
      color_temp: 453
61 62
      brightness_pct: 20
      transition: 3
Rainer Sokoll's avatar
Rainer Sokoll committed
63

64 65 66
- alias: Film Pullerpause
  trigger:
    platform: state
Rainer Sokoll's avatar
Rainer Sokoll committed
67
    entity_id: media_player.kodi_wohnzimmer, media_player.schwarzes_kastchen_2
68 69 70
    to: 'paused'
  condition:
    - condition: state
71
      entity_id: light.wohnzimmer_couch
72 73 74 75
      state: 'on'
  action:
    service: light.turn_on
    data:
76
      entity_id: light.wohnzimmer_couch
77
      color_temp: 400
78 79
      brightness_pct: 80
      transition: 3
Rainer Sokoll's avatar
Rainer Sokoll committed
80

81 82 83
- alias: Film Ende
  trigger:
    platform: state
Rainer Sokoll's avatar
Rainer Sokoll committed
84
    entity_id: media_player.kodi_wohnzimmer, media_player.schwarzes_kastchen_2
85 86 87
    to: 'idle'
  condition:
    - condition: state
88
      entity_id: light.wohnzimmer_couch
89 90 91 92
      state: 'on'
  action:
    service: light.turn_on
    data:
93
      entity_id: light.wohnzimmer_couch
94 95 96
      color_temp: 400
      brightness_pct: 100
      transition: 4
Rainer Sokoll's avatar
Rainer Sokoll committed
97

98 99 100
- alias: Licht an wenn Film spielt
  trigger:
    platform: state
101
    entity_id: light.wohnzimmer_couch
102
    to: 'on'
103
  condition:
104 105 106 107 108 109
    condition: or
    conditions:
      - condition: state
        entity_id: media_player.kodi_wohnzimmer
        state: 'playing'
      - condition: state
Rainer Sokoll's avatar
Rainer Sokoll committed
110
        entity_id: media_player.schwarzes_kastchen_2
111 112 113 114
        state: 'playing'
  action:
    service: light.turn_on
    data:
115
      entity_id: light.wohnzimmer_couch
116 117 118 119
      color_temp: 453
      brightness_pct: 20
      transition: 3

120
- alias: Bine Frühdienst Licht an Montag bis Freitag
Rainer Sokoll's avatar
Rainer Sokoll committed
121 122
  trigger:
    platform: time
Rainer Sokoll's avatar
Rainer Sokoll committed
123
    at: '04:30:03'
Rainer Sokoll's avatar
Rainer Sokoll committed
124
  condition:
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
    condition: and
    conditions:
      - condition: state
        entity_id: calendar.Sabine_Bine_Frueh
        state: 'on'
      - condition: state
        entity_id: 'binary_sensor.workday_sensor'
        state: 'on'
  action:
    service: light.turn_on
    data:
      entity_id: light.schlafzimmer_nachttischlampe_bine
      brightness_pct: 1

- alias: Bine Frühdienst Licht an Wochenende
  trigger:
    platform: time
    at: '04:45:03'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: calendar.Sabine_Bine_Frueh
        state: 'on'
      - condition: state
        entity_id: 'binary_sensor.workday_sensor'
        state: 'off'
Rainer Sokoll's avatar
Rainer Sokoll committed
152
  action:
153 154 155
    service: light.turn_on
    data:
      entity_id: light.schlafzimmer_nachttischlampe_bine
156
      brightness_pct: 1
Rainer Sokoll's avatar
Rainer Sokoll committed
157

158
- alias: Bine Frühdienst Licht aus Montag bis Freitag
Rainer Sokoll's avatar
Rainer Sokoll committed
159 160
  trigger:
    platform: time
161
    at: '04:33:00'
Rainer Sokoll's avatar
Rainer Sokoll committed
162
  condition:
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
    condition: and
    conditions:
      - condition: state
        entity_id: calendar.Sabine_Bine_Frueh
        state: 'on'
      - condition: state
        entity_id: 'binary_sensor.workday_sensor'
        state: 'on'
  action:
    service: light.turn_off
    data:
      entity_id: light.schlafzimmer_nachttischlampe_bine

- alias: Bine Frühdienst Licht aus Wochenende
  trigger:
    platform: time
    at: '04:48:00'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: calendar.Sabine_Bine_Frueh
        state: 'on'
      - condition: state
        entity_id: 'binary_sensor.workday_sensor'
        state: 'off'
Rainer Sokoll's avatar
Rainer Sokoll committed
189
  action:
190 191 192 193
    service: light.turn_off
    data:
      entity_id: light.schlafzimmer_nachttischlampe_bine

Rainer Sokoll's avatar
Rainer Sokoll committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
- alias: Bewegung im Windfang Licht in HWR einschalten
  trigger:
    platform: state
    entity_id: sensor.windfang_bewegungsmelder_motion
    to: 'on'
  action:
    service: light.turn_on
    data: 
      entity_id: light.hwr_deckenlampe
      brightness_pct: 100

- alias: Bewegungsmelder Windfang ausschalten
  trigger:
    platform: state
    entity_id: sensor.windfang_bewegungsmelder_motion
    to: 'off'
    for:
      minutes: 1
  action:
    service: homeassistant.turn_off
    entity_id: sensor.windfang_bewegungsmelder_motion
215 216 217 218 219 220 221 222 223 224 225 226

- alias: Adele saugt
  trigger:
    platform: template
    value_template: "{%if is_state_attr('vacuum.adele', 'status', 'Running') %}true{%endif%}"
  action:
    - service: notify.ios_loopback
      data:
        title: "Nachricht von Adele"
        message: "Ich beginne zu saugen!"
    - service: script.sonos_say
      data:
227 228
#        sonos_entity: group.sonos
        sonos_entity: media_player.arbeitszimmer
229
        volume: 0.3
230
        message: 'Adele beginnt zu saugen.'
231 232 233 234 235
        delay: '00:00:03'

- alias: Adele fährt nach Hause
  trigger:
    platform: template
236
    value_template: "{%if is_state_attr('vacuum.adele', 'status', 'User Docking') %}true{%endif%}"
237 238 239 240 241 242 243
  action:
    - service: notify.ios_loopback
      data:
        title: "Nachricht von Adele"
        message: "Ich fahre nach Hause!"
    - service: script.sonos_say
      data:
244 245
#        sonos_entity: group.sonos
        sonos_entity: media_player.arbeitszimmer
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
        volume: 0.3
        message: 'Adele fährt nach Hause.'
        delay: '00:00:03'

- alias: Adele ist fertig
  trigger:
    platform: template
    value_template: "{%if is_state_attr('vacuum.adele', 'status', 'Charging') %}true{%endif%}"
  action:
    - service: notify.ios_loopback
      data:
        title: "Nachricht von Adele"
        message: "Ich habe fertig!"
    - service: script.sonos_say
      data:
261 262
#        sonos_entity: group.sonos
        sonos_entity: media_player.arbeitszimmer
263 264 265 266 267 268 269 270 271 272 273 274 275 276
        volume: 0.3
        message: 'Adele hat fertig.'
        delay: '00:00:03'

- alias: Adele voll
  trigger:
    platform: template
    value_template: "{%if is_state_attr('vacuum.adele', 'bin_full', true) %}true{%endif%}"
  action:
    - service: notify.ios_loopback
      data:
        message: 'Bitte Adele entleeren!'
    - service: script.sonos_say
      data:
277 278
#        sonos_entity: group.sonos
        sonos_entity: media_player.arbeitszimmer
279 280 281 282 283 284 285 286 287 288 289 290 291 292
        volume: 0.3
        message: 'Adele hat die Windeln voll.'
        delay: '00:00:03'

- alias: Adele festgefahren
  trigger:
    platform: template
    value_template: "{%if is_state_attr('vacuum.adele', 'Stuck', true) %}true{%endif%}"
  action:
    - service: notify.ios_loopback
      data:
        message: 'Bitte Adele befreien.'
    - service: script.sonos_say
      data:
293 294
#        sonos_entity: group.sonos
        sonos_entity: media_player.arbeitszimmer
295 296 297
        volume: 0.3
        message: 'Adele hat sich festgefahren.'
        delay: '00:00:03'
298

299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
- alias: Bine kommt nach Hause
  trigger:
    platform: state
    entity_id: device_tracker.sabine_madnurse
    from: 'not_home'
    to: 'home'
  action:
    - service: notify.ios_loopback
      data:
        message: 'Die Chefin kommt nach Hause.'
    - service: script.sonos_say
      data:
#        sonos_entity: group.sonos
        sonos_entity: media_player.arbeitszimmer
        volume: 0.3
        message: 'Mama kommt!'
        delay: '00:00:03'