AutomationDataset/maxl67/maxl67_automations.yaml

2465 lines
73 KiB
YAML

- id: warning_door_open_in_winter
alias: Lichtband Status Tür in Winter schliessen
mode: single
triggers:
- trigger: time_pattern
minutes: /3
conditions:
- and:
- alias: Heizperiode ist an
condition: state
entity_id: input_boolean.heating_period
state: 'on'
- alias: eine Terassentür ist offen
condition: state
entity_id: group.all_doors
state: 'on'
- '{{ state_attr(''weather.dwd_home'', ''temperature'')|float(default=0) < states(''sensor.wandthermostat_wz_temperatur'')|float(default=0)
}}'
- alias: Ampel-Automation aktiv
condition: state
entity_id: input_boolean.disable_signal_automation
state: 'off'
- alias: nicht wenn Eingangstür offen ...
condition: state
entity_id: group.entrance_door
state: 'off'
- alias: '...und wenn die Signal-Ampel an'
condition: state
entity_id: input_boolean.ll_signals_doorstatus
state: 'off'
actions:
- action: python_script.light_store
data:
store_name: dw_signal_store
entity_id:
- light.philips_lightstrip_ku
overwrite: false
all_attribs: true
- action: light.turn_on
data:
entity_id: light.philips_lightstrip_ku
brightness: 255
rgb_color:
- 0
- 0
- 255
transition: 0.1
- alias: Lichtleiste blinken lassen
action: script.flash_light
data:
light_id: philips_lightstrip_ku
count: 8
- wait_template: '{{ not states(''dw_signal_store.light_philips_lightstrip_ku'')
== ''unknown'' }}'
timeout: 00:00:03
- choose:
- conditions: '{{ wait.completed }}'
sequence:
- action: python_script.light_store
data:
store_name: dw_signal_store
operation: restore
all_attribs: true
default:
- action: light.turn_off
entity_id: light.philips_lightstrip_ku
- id: switch_to_homeofficeprofile
alias: Heizprofil Home-Office
triggers:
- trigger: time
at:
- 08:30:00
- 09:00:00
- 09:30:00
- '10:00:00'
- '10:30:00'
- '11:00:00'
- '11:30:00'
- '13:30:00'
- '14:00:00'
- '14:30:00'
- '15:00:00'
- '15:30:00'
- '16:00:00'
- '16:30:00'
- trigger: state
entity_id: sensor.home_status
to: Home
conditions:
- and:
- condition: state
entity_id: input_boolean.heating_period
state: 'on'
- condition: state
entity_id: input_boolean.automate_heating
state: 'on'
- condition: numeric_state
entity_id: sensor.n_guests_home
below: 1
actions:
- choose:
- conditions:
- condition: state
entity_id: sensor.max_status
state:
- Home
- Just Arrived
sequence:
- action: script.set_profile_thermostat
data:
my_thermostat_id: 177b82bd9b6ed9360a46712d62f884b6
my_profile_no: 2
default:
- action: script.set_profile_thermostat
data:
my_thermostat_id: 177b82bd9b6ed9360a46712d62f884b6
my_profile_no: 1
- choose:
- conditions:
- condition: state
entity_id: sensor.ing_status
state:
- Home
- Just Arrived
sequence:
- action: script.set_profile_thermostat
data:
my_thermostat_id: 5ee2ea2d3204e1391bd380e3e78cc16f
my_profile_no: 2
default:
- action: script.set_profile_thermostat
data:
my_thermostat_id: 5ee2ea2d3204e1391bd380e3e78cc16f
my_profile_no: 1
- choose:
- conditions:
- condition: state
entity_id: sensor.home_status
state:
- Home
sequence:
- action: script.set_profile_thermostat
data:
my_thermostat_id: fded4d6e23eaefefe305963b47357e83
my_profile_no: 2
default:
- action: script.set_profile_thermostat
data:
my_thermostat_id: fded4d6e23eaefefe305963b47357e83
my_profile_no: 1
- id: activate_guest_heating
alias: Change to guest heating profile
triggers:
- trigger: numeric_state
entity_id: sensor.n_guests_home
above: 0
conditions:
- and:
- condition: state
entity_id: input_boolean.heating_period
state: 'on'
- condition: state
entity_id: input_boolean.automate_heating
state: 'on'
actions:
- action: script.set_mode_all
data:
my_hvac_mode: auto
- action: script.set_profile_all
data:
my_profile_no: 3
- id: restore_family_heating
alias: Change to normal heating profile
triggers:
- trigger: numeric_state
entity_id: sensor.n_guests_home
below: 1
conditions:
- and:
- condition: state
entity_id: input_boolean.heating_period
state: 'on'
- condition: state
entity_id: input_boolean.automate_heating
state: 'on'
actions:
- action: script.set_profile_all
data:
my_profile_no: 1
- id: thermo_set_window_open
alias: Set thermostat window state 'open'
mode: queued
triggers:
- trigger: state
entity_id:
- group.doors_wz
- group.doors_kitchen_office
- group.doors_gz
to: 'on'
conditions:
- and:
- condition: state
entity_id: input_boolean.heating_period
state: 'on'
- condition: state
entity_id: input_boolean.automate_heating
state: 'on'
actions:
- choose:
- conditions: '{{ trigger.entity_id == ''group.doors_wz'' }}'
sequence:
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: fded4d6e23eaefefe305963b47357e83
my_window_state: 1
- conditions: '{{ trigger.entity_id == ''group.doors_kitchen_office'' }}'
sequence:
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: 5ee2ea2d3204e1391bd380e3e78cc16f
my_window_state: 1
- conditions: '{{ trigger.entity_id == ''group.doors_gz'' }}'
sequence:
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: 177b82bd9b6ed9360a46712d62f884b6
my_window_state: 1
- id: thermo_set_window_closed
alias: Set thermostat window state 'closed'
mode: queued
triggers:
- trigger: state
entity_id:
- group.doors_wz
- group.doors_kitchen_office
- group.doors_gz
to: 'off'
id: door_closed
- trigger: time_pattern
minutes: /10
conditions:
- condition: state
entity_id: input_boolean.heating_period
state: 'on'
- or:
- condition: trigger
id: door_closed
- or:
- condition: state
entity_id: sensor.pivccu_v_fensteroffen_wz
state: '1'
- condition: state
entity_id: sensor.pivccu_v_fensteroffen_gz
state: '1'
- condition: state
entity_id: sensor.pivccu_v_fensteroffen_ku
state: '1'
actions:
- choose:
- conditions: '{{ trigger.entity_id == ''group.doors_wz'' or (is_state(''group.doors_wz'',''off'')
and is_state(''sensor.pivccu_v_fensteroffen_wz'',''1'')) }}'
sequence:
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: fded4d6e23eaefefe305963b47357e83
my_window_state: 0
- conditions: '{{ trigger.entity_id == ''group.doors_kitchen_office'' or (is_state(''group.doors_kitchen_office'',''off'')
and is_state(''sensor.pivccu_v_fensteroffen_ku'',''1'')) }}'
sequence:
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: 5ee2ea2d3204e1391bd380e3e78cc16f
my_window_state: 0
- conditions: '{{ trigger.entity_id == ''group.doors_gz'' or (is_state(''group.doors_gz'',''off'')
and is_state(''sensor.pivccu_v_fensteroffen_gz'',''1'')) }}'
sequence:
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: 177b82bd9b6ed9360a46712d62f884b6
my_window_state: 0
- id: pause_heating_when_leaving
alias: Pause heating when leaving
triggers:
- trigger: state
entity_id: sensor.home_status
from: Home
to: Away
for:
minutes: 5
conditions:
- and:
- condition: state
entity_id: input_boolean.heating_period
state: 'on'
- condition: state
entity_id: input_boolean.automate_heating
state: 'on'
actions:
- action: script.set_mode_all
data:
my_hvac_mode: heat
- action: script.set_temperature_all
data:
my_temperature: 17
- id: resume_heating_when_arriving
alias: Resume heating when arriving
triggers:
- trigger: state
entity_id: sensor.home_status
to: Home
condition:
- and:
- condition: state
entity_id: input_boolean.heating_period
state: 'on'
- condition: state
entity_id: input_boolean.automate_heating
state: 'on'
actions:
- action: script.set_mode_all
data:
my_hvac_mode: auto
- id: stop_heating
alias: Ende der Heizperiode
triggers:
- trigger: state
entity_id: input_boolean.heating_period
to: 'off'
actions:
- action: automation.turn_off
entity_id: automation.start_heating
- action: automation.turn_on
entity_id: automation.start_heating
- action: script.set_mode_all
data:
my_hvac_mode: heat
- action: script.set_temperature_all
data:
my_temperature: 4.5
- action: switch.turn_off
entity_id: switch.hmipw_drs8_ch14
- action: switch.turn_off
entity_id: switch.hmipw_drs8_ch18
- id: start_heating
alias: Start der Heizperiode
triggers:
- trigger: state
entity_id: input_boolean.heating_period
to: 'on'
actions:
- action: automation.turn_off
entity_id: automation.stop_heating
- action: automation.turn_on
entity_id: automation.stop_heating
- action: script.set_temperature_all
data:
my_temperature: 20
- delay: 00:00:02
- action: script.set_mode_all
data:
my_hvac_mode: auto
- delay: 00:00:02
- action: script.set_profile_all
data:
my_profile_no: 1
- delay: 00:00:02
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: fded4d6e23eaefefe305963b47357e83
my_window_state: '{{ 1 if is_state(''group.doors_wz'', ''on'') else 0 }}'
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: 5ee2ea2d3204e1391bd380e3e78cc16f
my_window_state: '{{ 1 if is_state(''group.doors_kitchen_office'', ''on'') else
0 }}'
- action: script.set_windowstate_thermostat
data:
my_thermostat_id: 177b82bd9b6ed9360a46712d62f884b6
my_window_state: '{{ 1 if is_state(''group.doors_gz'', ''on'') else 0 }}'
- id: closing_cover_in_summer
alias: Jalousien fuer Sonnenschutz runter
description: ''
mode: single
triggers:
- id: nobody_home
trigger: state
entity_id: sensor.home_status
from: Home
to: Away
for:
minutes: 1
- id: sun_shining
trigger: state
entity_id:
- sensor.sunshine_west
- sensor.sunshine_south
to: 'True'
for:
minutes: 10
- id: config_changed
trigger: state
entity_id:
- input_boolean.automate_jalousie
- input_boolean.auto_shade_when_home
- input_boolean.cover_wo_sun
to: 'on'
- id: morning_over
trigger: time
at: 09:00:10
- id: sunrise
trigger: numeric_state
entity_id: sensor.sun_elevation_ratio
above: 0
conditions:
- and:
- alias: Automation is turned on
condition: state
entity_id: input_boolean.automate_jalousie
state: 'on'
- alias: Not when in heating period
condition: state
entity_id: input_boolean.heating_period
state: 'off'
- alias: not windy or stormy
condition: numeric_state
entity_id: sensor.max_wind_warn_level
below: 2
- or:
- alias: nobody home
condition: state
entity_id: sensor.home_status
state:
- Away
- Extended Away
- and:
- alias: automation even when home
condition: state
entity_id: input_boolean.auto_shade_when_home
state: 'on'
- alias: but not before 9:00
condition: time
after: 09:00:00
- alias: and not after 20:00
condition: time
before: '20:00:00'
- or:
- alias: sun is shining
condition: state
entity_id: sensor.sun_is_shining
state: 'True'
- and:
- alias: lower cover without sun
condition: state
entity_id: input_boolean.cover_wo_sun
state: 'on'
- alias: sun above horizon
condition: state
entity_id: sun.sun
state: above_horizon
actions:
- action: script.lower_all_covers_on_side
data:
in_south: '{{ is_state(''sensor.sunshine_south'',''True'') or is_state(''input_boolean.cover_wo_sun'',''on'')
}}'
in_west: '{{ is_state(''sensor.sunshine_west'',''True'') or is_state(''input_boolean.cover_wo_sun'',''on'')
}}'
- id: retract_all_cover_when_windy
alias: alle Jalousien/Markisen rein bei starkem Wind
description: ''
mode: single
triggers:
- trigger: numeric_state
entity_id: sensor.max_wind_warn_level
above: 1
- trigger: numeric_state
entity_id: sensor.max_wind_speed
above: 20
actions:
- action: script.retract_covers_on_side
data:
in_south: true
in_west: true
on_terrace: true
- id: retract_awning_when_windy_or_raining
alias: alle Markisen rein bei Regen oder Wind
description: ''
mode: single
triggers:
- trigger: state
entity_id:
- weather.dwd_home
- weather.home_hourly
to: rainy
- trigger: numeric_state
entity_id: sensor.max_wind_speed
above: 10
actions:
- action: script.retract_covers_on_side
data:
in_south: false
in_west: false
on_terrace: true
- id: retract_all_cover_without_sun
alias: alle Jalousien/Markisen ohne Sonne wieder rein
description: ''
mode: single
triggers:
- id: sun_down
trigger: numeric_state
entity_id: sensor.sun_elevation_ratio
below: 0.01
for:
minutes: 5
- id: sunset
trigger: state
entity_id: sun.sun
to: below_horizon
for:
seconds: 5
- id: south_wo_sun
trigger: template
value_template: '{{ state_attr(''sun.sun'',''azimuth'') | int(default=0) > 240
}}'
- id: west_wo_sun
trigger: template
value_template: '{{ state_attr(''sun.sun'',''azimuth'') | int(default=0) > 330
}}'
conditions:
- alias: Automation is turned on
condition: state
entity_id: input_boolean.automate_jalousie
state: 'on'
actions:
- action: script.retract_covers_on_side
data:
in_south: '{{ state_attr(''sun.sun'', ''azimuth'')>=240 or states(''sensor.sun_elevation_ratio'')|int(0)<=0
}}'
in_west: '{{ state_attr(''sun.sun'', ''azimuth'')>=330 or states(''sensor.sun_elevation_ratio'')|int(0)<=0
}}'
on_terrace: '{{ is_state(''sun.sun'',''below_horizon'') }}'
- id: show_doorstatus_signal_light
alias: Lichtband zeigt Status
mode: single
triggers:
- trigger: state
entity_id: group.entrance_door
to: 'on'
- trigger: state
entity_id:
- group.all_doors
- group.all_windows
- trigger: state
entity_id: input_boolean.disable_signal_automation
to: 'off'
- trigger: state
entity_id: input_boolean.show_signal
to: 'on'
conditions:
- and:
- condition: state
entity_id: input_boolean.disable_signal_automation
state: 'off'
- condition: state
entity_id: sensor.home_status
state: Home
- or:
- condition: state
entity_id: group.entrance_door
state: 'on'
- condition: state
entity_id: input_boolean.show_signal
state: 'on'
actions:
- action: input_boolean.turn_on
entity_id: input_boolean.ll_signals_doorstatus
- action: python_script.light_store
data:
store_name: dw_signal_store
entity_id:
- light.philips_lightstrip_ku
overwrite: false
all_attribs: true
- choose:
- conditions:
- condition: state
entity_id: group.all_doors
state: 'on'
sequence:
action: light.turn_on
data:
entity_id: light.philips_lightstrip_ku
brightness: 255
rgb_color:
- 255
- 0
- 0
transition: 0.2
- conditions:
- condition: state
entity_id: group.all_windows
state: 'on'
sequence:
action: light.turn_on
data:
entity_id: light.philips_lightstrip_ku
brightness: 255
rgb_color:
- 255
- 255
- 0
transition: 0.2
default:
action: light.turn_on
data:
entity_id: light.philips_lightstrip_ku
brightness: 255
rgb_color:
- 0
- 255
- 0
transition: 0.2
- id: clear_doorstatus_signal_light
alias: Lichtband Status löschen
mode: single
triggers:
- trigger: state
entity_id: group.entrance_door
to: 'off'
- trigger: state
entity_id: input_boolean.show_signal
to: 'off'
conditions:
- and:
- condition: state
entity_id: input_boolean.ll_signals_doorstatus
state: 'on'
- condition: state
entity_id: group.entrance_door
state: 'off'
- condition: state
entity_id: input_boolean.show_signal
state: 'off'
actions:
- action: input_boolean.turn_off
entity_id: input_boolean.ll_signals_doorstatus
- wait_template: '{{ not states(''dw_signal_store.light_philips_lightstrip_ku'')
== ''unknown'' }}'
timeout: 00:00:03
- choose:
- conditions: '{{ wait.completed }}'
sequence:
- action: python_script.light_store
data:
store_name: dw_signal_store
operation: restore
all_attribs: true
default:
- action: light.turn_off
entity_id: light.philips_lightstrip_ku
- alias: Notify all - Open Doors
id: send_notification_open_doors
triggers:
trigger: template
value_template: "{{ states('sensor.home_status') in ['Away', 'Extended Away']\
\ \n and is_state('group.all_doors', 'on') }}\n"
for:
seconds: 5
variables:
notification_service: '{{ ''notify.family_main_devices'' if is_state(''sensor.ing_status'',
''Just Left'') else ''notify.max'' }}
'
actions:
- action: input_boolean.turn_on
entity_id: input_boolean.open_backdoor_alert
- action: '{{ notification_service }}'
data:
title: Smart Home Alarm
message: '{{states|selectattr(''entity_id'',''in'',state_attr(''group.all_doors'',''entity_id''))|selectattr(''state'',''eq'',''on'')|list|count}}
{{''Terassentür ist'' if states|selectattr(''entity_id'',''in'',state_attr(''group.all_doors'',''entity_id''))|selectattr(''state'',''eq'',''on'')|list|count==1
else ''Terassentüren sind''}} offen (und {{states|selectattr(''entity_id'',''in'',state_attr(''group.all_windows'',''entity_id''))|selectattr(''state'',''eq'',''on'')|list|count}}
Fenster).
'
data:
subtitle: Türen offen!
push:
badge: '{{states(''sensor.count_notification_alerts'')|int(default=0)}}'
sound:
name: default
critical: 1
volume: 1.0
thread-id: doorswindows-notification-group
apns_headers:
apns-collapse-id: open-doors-detected
clickAction: /lovelace/home
- alias: Notify all - Open Windows
id: send_notification_open_windows
triggers:
trigger: template
value_template: "{{ states('sensor.home_status') in ['Away', 'Extended Away']\
\ \n and is_state('group.all_windows', 'on') \n and is_state('group.all_doors',\
\ 'off') }}\n"
for:
seconds: 5
variables:
notification_service: '{{ ''notify.family_main_devices'' if is_state(''sensor.ing_status'',
''Just Left'') else ''notify.max'' }}
'
actions:
- action: input_boolean.turn_on
entity_id: input_boolean.open_window_alert
- action: '{{ notification_service }}'
data:
title: Smart Home Alarm
message: '{{states|selectattr(''entity_id'',''in'',state_attr(''group.all_windows'',''entity_id''))|selectattr(''state'',''eq'',''on'')|list|count}}
Fenster {{''ist'' if states|selectattr(''entity_id'',''in'',state_attr(''group.all_windows'',''entity_id''))|selectattr(''state'',''eq'',''on'')|list|count==1
else ''sind''}} offen.
'
data:
subtitle: Fenster offen!
push:
badge: '{{states(''sensor.count_notification_alerts'')|int(default=0)}}'
sound:
name: default
critical: 1
volume: 1.0
thread-id: doorswindows-notification-group
apns_headers:
apns-collapse-id: open-windows-detected
clickAction: /lovelace/home
- alias: Reset alert - Open Doors
id: reset_notification_open_doors
triggers:
trigger: template
value_template: "{{ (is_state('sensor.home_status', 'Home') \n or is_state('group.all_doors',\
\ 'off'))\n and is_state('input_boolean.open_backdoor_alert', 'on') }}\n"
for:
seconds: 1
actions:
- action: input_boolean.turn_off
entity_id: input_boolean.open_backdoor_alert
- action: notify.family_main_devices
data:
title: Smart Home ...
message: Türen Alarm aufgehoben.
data:
push:
badge: '{{states(''sensor.count_notification_alerts'')|int(default=0)}}'
thread-id: doorswindows-notification-group
apns_headers:
apns-collapse-id: open-doors-detected
clickAction: /lovelace/home
- alias: Reset alert - Open Windows
id: reset_notification_open_windows
triggers:
trigger: template
value_template: "{{ (is_state('sensor.home_status', 'Home') \n or is_state('group.all_windows',\
\ 'off'))\n and is_state('input_boolean.open_window_alert', 'on') }}\n"
for:
seconds: 1
actions:
- action: input_boolean.turn_off
entity_id: input_boolean.open_window_alert
- action: notify.family_main_devices
data:
title: Smart Home ...
message: Fenster Alarm aufgehoben.
data:
push:
badge: '{{states(''sensor.count_notification_alerts'')|int(default=0)}}'
thread-id: doorswindows-notification-group
apns_headers:
apns-collapse-id: open-windows-detected
clickAction: /lovelace/home
- alias: Test Zone Notify
id: send_notification_zone_test
triggers:
- trigger: zone
entity_id: person.max
zone: zone.tik
event: leave
- trigger: zone
entity_id: person.max
zone: zone.tik
event: enter
conditions:
- and:
- or:
- condition: state
entity_id: group.all_doors
state: 'on'
- condition: state
entity_id: group.all_windows
state: 'on'
- '{{ states(''sensor.ing_status'') not in [''home'', ''Just Arrived''] }}'
actions:
- action: notify.max
data:
title: Smart Home Alerts (Zone-test)
message: Mindestens eine Balkontür/Fenster ist offen.
data:
subtitle: Türen/Fenster offen!
push:
badge: '{{states(''sensor.count_notification_alerts'')|int(default=0)}}'
- id: toggle_lights
alias: Button Lichter an/aus
description: ''
mode: single
triggers:
- id: toggle_licht_az
trigger: webhook
webhook_id: toggle_light_buero
allowed_methods:
- POST
local_only: true
- id: toggle_licht_wz
trigger: webhook
webhook_id: toggle_light_wz
allowed_methods:
- POST
local_only: true
- id: status_light_off
trigger: webhook
webhook_id: switch_off_ampel
allowed_methods:
- POST
local_only: true
variables:
device_map:
toggle_licht_az: light.dimmschalter_buro_dimmaktor_buro
toggle_licht_wz: light.dimmschalter_wz_dimmaktor_wz
status_light_off: light.philips_lightstrip_ku
light_entity_id: '{{ device_map[trigger.id] }} '
actions:
- if:
- alias: light is off
condition: template
value_template: '{{ is_state(light_entity_id, ''off'') and not trigger.id==''status_light_off''
}}'
then:
- action: light.turn_on
data_template:
entity_id: '{{ light_entity_id }}'
brightness_pct: 50
else:
- action: light.turn_off
data_template:
entity_id: '{{ light_entity_id }}'
- id: dimm_lights
alias: Button Lichter dimmen
description: ''
mode: single
triggers:
- id: dimm_lights_darker
trigger: webhook
webhook_id: lights_dunkler
allowed_methods:
- POST
local_only: true
- id: dimm_lights_brighter
trigger: webhook
webhook_id: lights_heller
allowed_methods:
- POST
local_only: true
variables:
value_map:
dimm_lights_darker: -10
dimm_lights_brighter: 10
brightness_increment: '{{ value_map[trigger.id] }} '
actions:
- if:
- alias: AZ light is on
condition: state
entity_id: light.dimmschalter_buro_dimmaktor_buro
state: 'on'
then:
- action: light.turn_on
data_template:
entity_id: light.dimmschalter_buro_dimmaktor_buro
brightness_step_pct: '{{ brightness_increment }}'
transition: 1
- if:
- alias: WZ light is on
condition: state
entity_id: light.dimmschalter_wz_dimmaktor_wz
state: 'on'
then:
- action: light.turn_on
data_template:
entity_id: light.dimmschalter_wz_dimmaktor_wz
brightness_step_pct: '{{ brightness_increment }}'
transition: 1
- id: toggle_power
alias: Button Power an/aus
description: ''
mode: single
triggers:
- id: turn_on_tv
trigger: webhook
webhook_id: switch_on_tv
allowed_methods:
- POST
local_only: true
variables:
device_map:
turn_on_tv: switch.outlet_repeater_hifi_switch
switch_entity_id: '{{ device_map[trigger.id] }} '
actions:
- action: switch.turn_on
data_template:
entity_id: '{{ switch_entity_id }}'
- homeassistant:
customize:
package.node_anchors:
common:
package: homematic
temperature:
package: homematic
unit_of_measurement: °C
actor:
package: homematic
valve:
package: homematic
unit_of_measurement: '%'
sensor.hm_thermo_wz_target_temp:
package: homematic
unit_of_measurement: °C
sensor.hm_thermo_wz_actor_value:
package: homematic
sensor.hm_thermo_wz_actor_state:
package: homematic
sensor.hm_thermo_wz_window_state:
package: homematic
sensor.hm_thermo_wz_active_profile:
package: homematic
sensor.hm_thermo_wz_actor_value_graph:
package: homematic
sensor.hm_thermo_ku_target_temp:
package: homematic
unit_of_measurement: °C
sensor.hm_thermo_ku_actor_value_graph:
package: homematic
unit_of_measurement: '%'
sensor.hm_thermo_ku_window_state:
package: homematic
sensor.hm_thermo_ku_active_profile:
package: homematic
sensor.hm_thermo_gz_target_temp:
package: homematic
unit_of_measurement: °C
sensor.hm_thermo_gz_actor_value_graph:
package: homematic
unit_of_measurement: '%'
sensor.hm_thermo_gz_window_state:
package: homematic
sensor.hm_thermo_gz_active_profile:
package: homematic
binary_sensor.hm_homematic_up:
package: homematic
automation.homematic_reconnect:
package: homematic
template:
- sensor:
- unique_id: hm_thermo_wz_target_temp
name: hm_thermo_wz_target_temp
state: '{{ state_attr(''climate.wandthermostat_wz'',''temperature'') | float(default=0)
}}'
unit_of_measurement: °C
state_class: measurement
icon: mdi:thermostat
attributes:
friendly_name: Wohnzimmer Soll-Temperatur
- unique_id: hm_thermo_wz_actor_value
name: hm_thermo_wz_actor_value
state: '{{ 100 if (states(''binary_sensor.wandthermostat_wz_ch9'') == ''on'')
else 0 }}'
unit_of_measurement: '%'
state_class: measurement
icon: mdi:valve
attributes:
friendly_name: Wohnzimmer Heizungsventilöffnung
description: Konvertiert den on/off Sensor der HmIP Integration in einen Prozentwert
(0%/100%) für Berechnungen
- unique_id: hm_thermo_wz_actor_state
name: hm_thermo_wz_actor_state
state: '{%- if states(''binary_sensor.wandthermostat_wz_ch9'') == ''off'' -%}
zu {%- elif states(''binary_sensor.wandthermostat_wz_ch9'') == ''on'' -%}
offen {%- else -%} {{ states(''binary_sensor.wandthermostat_wz_ch9'') }} {%-
endif -%}'
icon: mdi:valve
attributes:
friendly_name: Wohnzimmer Heizungsventile
description: Konvertiert den on/off Sensor der HmIP Integration in deutsche
Sprache für die 'simple-thermostat' Card
- unique_id: hm_thermo_wz_actor_value_graph
name: hm_thermo_wz_actor_value_graph
state: "{%- if is_state('binary_sensor.wandthermostat_wz_ch9','off') -%}\n \
\ {%- if is_state('input_boolean.heating_period','on') -%}\n0\n {%- else\
\ -%}\n-5\n {%- endif -%}\n{%- elif is_state('binary_sensor.wandthermostat_wz_ch9','on')\
\ -%} 40 {%- endif -%}"
icon: mdi:valve
attributes:
friendly_name: Wohnzimmer Heizventile
description: Konvertiert den on/off Sensor der HmIP Integration in einen numerischen
Wert für die 'mini-graph' Card
- unique_id: hm_thermo_wz_window_state
name: hm_thermo_wz_window_state
state: '{%- if is_state(''sensor.pivccu_v_fensteroffen_wz'',''0'') -%} zu {%-
elif is_state(''sensor.pivccu_v_fensteroffen_wz'',''1'') -%} offen {%- else
-%} {{ states(''sensor.pivccu_v_fensteroffen_wz'') }} {%- endif -%}'
icon: '{% if is_state(''sensor.pivccu_v_fensteroffen_wz'',''0'') %} mdi:window-closed-variant
{% else %} mdi:window-open-variant {% endif %}'
attributes:
friendly_name: Fensterstatus Wohnzimmerthermostat
description: Konvertiert die 0/1 Variable aus der Homematic CCU in deutsche
Sprache für die 'simple-thermostat' Card
- unique_id: hm_thermo_wz_active_profile
name: hm_thermo_wz_active_profile
state: "{% set profile_map = {\n 2: '1 - Work (def)',\n 3: '2 - Homeoffice',\n\
\ 4: '3 - Gäste' }\n%} {%- if is_state('sensor.pivccu_v_wochenprofil_wz','False')\
\ -%} unbekannt {%- else -%} {{ profile_map[states('sensor.pivccu_v_wochenprofil_wz')|int(0)]\
\ }} {%- endif -%}"
attributes:
friendly_name: Heizprofil Wohnzimmerthermostat
description: Konvertiert die Variable aus der Homematic CCU in eine Beschreibung
für die 'simple-thermostat' Card
- unique_id: hm_thermo_ku_target_temp
name: hm_thermo_ku_target_temp
state: '{{ state_attr(''climate.heizungsthermostat_ku'',''temperature'') | float(default=0)
}}'
unit_of_measurement: °C
state_class: measurement
icon: mdi:thermostat
attributes:
friendly_name: Küche Soll-Temperatur
- unique_id: hm_thermo_ku_actor_value_graph
name: hm_thermo_ku_actor_value_graph
state: '{{ -5 if (is_state(''input_boolean.heating_period'',''off'') and states(''sensor.heizungsthermostat_ku_level'')|float(default=0)==0)
else states(''sensor.heizungsthermostat_ku_level'')|float(default=0)/100*40
}}'
icon: mdi:valve
attributes:
friendly_name: Küche Ventilöffnung
description: Konvertiert den Sensor der HmIP Integration in einen numerischen
Wert für die 'mini-graph' Card
- unique_id: hm_thermo_ku_window_state
name: hm_thermo_ku_window_state
state: '{%- if is_state(''sensor.pivccu_v_fensteroffen_ku'',''0'') -%} zu {%-
elif is_state(''sensor.pivccu_v_fensteroffen_ku'',''1'') -%} offen {%- else
-%} {{ states(''sensor.pivccu_v_fensteroffen_ku'') }} {%- endif -%}'
icon: '{% if is_state(''sensor.pivccu_v_fensteroffen_ku'',''0'') %} mdi:window-closed-variant
{% else %} mdi:window-open-variant {% endif %}'
attributes:
friendly_name: Fensterstatus Küchenthermostat
description: Konvertiert die 0/1 Variable aus der Homematic CCU in deutsche
Sprache für die 'simple-thermostat' Card
- unique_id: hm_thermo_ku_active_profile
name: hm_thermo_ku_active_profile
state: "{% set profile_map = {\n 2: '1 - Work (def)',\n 3: '2 - Homeoffice',\n\
\ 4: '3 - Gäste' }\n%} {%- if is_state('sensor.pivccu_v_wochenprofil_ku','False')\
\ -%} unbekannt {%- else -%} {{ profile_map[states('sensor.pivccu_v_wochenprofil_ku')|int(0)]\
\ }} {%- endif -%}"
attributes:
friendly_name: Heizprofil Küchenthermostat
description: Konvertiert die Variable aus der Homematic CCU in eine Beschreibung
für die 'simple-thermostat' Card
- unique_id: hm_thermo_gz_target_temp
name: hm_thermo_gz_target_temp
state: '{{ state_attr(''climate.heizungsthermostat_gz'',''temperature'') | float(default=0)
}}'
unit_of_measurement: °C
state_class: measurement
icon: mdi:thermostat
attributes:
friendly_name: Gästezimmer Soll-Temperatur
- unique_id: hm_thermo_gz_actor_value_graph
name: hm_thermo_gz_actor_value_graph
state: '{{ -5 if (is_state(''input_boolean.heating_period'',''off'') and states(''sensor.heizungsthermostat_gz_level'')|float(default=0)==0)
else states(''sensor.heizungsthermostat_gz_level'')|float(default=0)/100*40
}}'
icon: mdi:valve
attributes:
friendly_name: Gästezimmer Ventilöffnung
description: Konvertiert den Sensor der HmIP Integration in einen numerischen
Wert für die 'mini-graph' Card
- unique_id: hm_thermo_gz_window_state
name: hm_thermo_gz_window_state
state: '{%- if is_state(''sensor.pivccu_v_fensteroffen_gz'',''0'') -%} zu {%-
elif is_state(''sensor.pivccu_v_fensteroffen_gz'',''1'') -%} offen {%- else
-%} {{ states(''sensor.pivccu_v_fensteroffen_gz'') }} {%- endif -%}'
icon: '{% if is_state(''sensor.pivccu_v_fensteroffen_gz'',''0'') %} mdi:window-closed-variant
{% else %} mdi:window-open-variant {% endif %}'
attributes:
friendly_name: Fensterstatus Gästethermostat
description: Konvertiert die 0/1 Variable aus der Homematic CCU in deutsche
Sprache für die 'simple-thermostat' Card
- unique_id: hm_thermo_gz_active_profile
name: hm_thermo_gz_active_profile
state: "{% set profile_map = {\n 2: '1 - Work (def)',\n 3: '2 - Homeoffice',\n\
\ 4: '3 - Gäste' }\n%} {%- if is_state('sensor.pivccu_v_wochenprofil_gz','False')\
\ -%} unbekannt {%- else -%} {{ profile_map[states('sensor.pivccu_v_wochenprofil_gz')|int(0)]\
\ }} {%- endif -%}"
attributes:
friendly_name: Heizprofil Gästethermostat
description: Konvertiert die Variable aus der Homematic CCU in eine Beschreibung
für die 'simple-thermostat' Card
binary_sensor:
- platform: template
sensors:
hm_homematic_up:
unique_id: hm_homematic_up
friendly_name: Homematic is sending updates
value_template: '{% set dummy = states(''sensor.time'') %} {{ (as_timestamp(now())
- as_timestamp(states.sensor.wandthermostat_wz_temperatur.last_changed))
< 3600 }}'
- id: random_lights_during_vacation
alias: zufälliges Urlaubslicht
description: Schaltet abends das Wohnzimmerlicht zufällig an, wenn wir länger weg
sind.
triggers:
- id: sunset
trigger: sun
event: sunset
- id: bedtime
trigger: time
at: '23:00:00'
conditions:
- and:
- condition: state
entity_id: input_boolean.disable_light_automation
state: 'off'
- condition: state
entity_id: sensor.home_status
state: Extended Away
actions:
- delay:
minutes: '{{ range(5, 25 if trigger.platform == ''sun'' else 90) | random }}'
- action: light.turn_{{ 'on' if trigger.platform == 'sun' else 'off' }}
entity_id: light.dimmschalter_wz_dimmaktor_wz
- id: switch_on_lights
alias: switch on welcome lights
description: Schaltet abends das Wohnzimmerlicht zufällig an, wenn wir länger weg
sind.
triggers:
- id: returned_home
trigger: state
entity_id: sensor.home_status
to: Home
- id: sunset
trigger: sun
event: sunset
offset: +00:15:00
- id: config_changed
trigger: state
entity_id: input_boolean.disable_light_automation
to: 'off'
conditions:
- and:
- condition: state
entity_id: input_boolean.disable_light_automation
state: 'off'
- condition: state
entity_id: sensor.home_status
state: Home
- condition: state
entity_id: sun.sun
state: below_horizon
actions:
- action: scene.turn_on
data:
entity_id: scene.welcome
transition: 2
- id: switch_off_lights
alias: alle Lichter aus
triggers:
- id: nobody_home
trigger: state
entity_id: sensor.home_status
from: Home
to: Away
for:
minutes: 2
- id: bedtime
trigger: time
at: 00:01:00
- id: sunrise
trigger: sun
event: sunrise
- id: config_changed
trigger: state
entity_id: input_boolean.disable_light_automation
to: 'off'
- id: ha_started
trigger: homeassistant
event: start
conditions:
- and:
- condition: state
entity_id: input_boolean.disable_light_automation
state: 'off'
- or:
- condition: state
entity_id: sensor.home_status
state: Away
- condition: time
after: 00:00:00
before: 06:00:00
actions:
- action: light.turn_off
entity_id:
- light.dimmschalter_wz_dimmaktor_wz
- light.philips_lightstrip_ku
- light.dimmschalter_buro_dimmaktor_buro
- id: switch_off_signal_after_poweron
alias: Lichtleiste aus nach Stromzufuhr
triggers:
- trigger: state
entity_id: light.philips_lightstrip_ku
from: unavailable
to: 'on'
for:
seconds: 10
- trigger: state
entity_id: light.philips_lightstrip_ku
to: 'on'
for:
minutes: 1
conditions:
- and:
- condition: state
entity_id: light.philips_lightstrip_ku
state: 'on'
- condition: state
entity_id: input_boolean.ll_signals_doorstatus
state: 'off'
- condition: state
entity_id: input_boolean.show_signal
state: 'off'
- condition: template
value_template: '{{ state_attr(''light.philips_lightstrip_ku'',''hs_color'')[0]==28.327
and state_attr(''light.philips_lightstrip_ku'',''hs_color'')[1]==64.71}}
'
actions:
- action: light.turn_off
entity_id: light.philips_lightstrip_ku
- id: switch_off_ambientlight_from_sz
alias: Ambientelicht aus (von SZ)
description: ''
triggers:
trigger: device
domain: homematicip_local
device_id: 248828199b3f92a327f134b7e831fd1f
event_type: homematic.keypress
address: 0019DBE9943030
device_type: HmIP-BRC2
interface_id: piVCCU-HmIP-RF
type: press_short
subtype: 2
actions:
action: light.turn_off
entity_id: light.dimmschalter_wz_dimmaktor_wz
- id: switch_off_lights_from_sz
alias: alle Licher aus (von SZ)
description: ''
triggers:
trigger: device
domain: homematicip_local
device_id: 248828199b3f92a327f134b7e831fd1f
event_type: homematic.keypress
address: 0019DBE9943030
device_type: HmIP-BRC2
interface_id: piVCCU-HmIP-RF
type: press_long_start
subtype: 2
actions:
- action: light.turn_off
entity_id: light.dimmschalter_wz_dimmaktor_wz
- action: light.turn_off
entity_id: light.philips_lightstrip_ku
- action: light.turn_off
entity_id: light.dimmschalter_buro_dimmaktor_buro
- id: switch_on_ambientlight_from_sz
alias: Ambientelicht an (von SZ)
description: ''
triggers:
trigger: device
domain: homematicip_local
device_id: 248828199b3f92a327f134b7e831fd1f
event_type: homematic.keypress
address: 0019DBE9943030
device_type: HmIP-BRC2
interface_id: piVCCU-HmIP-RF
type: press_short
subtype: 1
actions:
action: light.turn_on
entity_id: light.dimmschalter_wz_dimmaktor_wz
- id: switch_on_lights_from_sz
alias: Licher an (von SZ)
description: ''
triggers:
trigger: device
domain: homematicip_local
device_id: 248828199b3f92a327f134b7e831fd1f
event_type: homematic.keypress
address: 0019DBE9943030
device_type: HmIP-BRC2
interface_id: piVCCU-HmIP-RF
type: press_long_start
subtype: 1
actions:
- action: light.turn_on
entity_id: light.dimmschalter_wz_dimmaktor_wz
- action: light.turn_on
data:
brightness_pct: 10
target:
entity_id: light.dimmschalter_buro_dimmaktor_buro
- id: power_off_unused_mediarack
alias: switch off unused media rack at night
triggers:
- id: past_midnight
trigger: time
at: 00:10:00
- id: devices_unused
trigger: state
entity_id: group.mediadevices_in_use
to: 'off'
for:
minutes: 15
- id: config_changed
trigger: state
entity_id: input_boolean.disable_power_automation
to: 'off'
conditions:
- and:
- or:
- condition: time
after: '23:00:00'
- condition: time
before: 07:00:00
- condition: state
entity_id: group.mediadevices_in_use
state: 'off'
- condition: state
entity_id: input_boolean.disable_power_automation
state: 'off'
actions:
- action: switch.turn_off
entity_id: switch.outlet_repeater_hifi_switch
- id: power_on_mediarack_for_use
alias: switch on media rack for use
triggers:
- id: afternoon
trigger: time
at: '17:00:00'
- id: morning
trigger: time
at: 07:00:00
- id: config_changed
trigger: state
entity_id: input_boolean.disable_power_automation
to: 'off'
conditions:
- and:
- condition: state
entity_id: input_boolean.disable_power_automation
state: 'off'
- condition: state
entity_id: sensor.home_status
state: Home
- condition: state
entity_id: switch.fritz_dect_200_netz
state: 'on'
- or:
- condition: trigger
id: afternoon
- and:
- condition: trigger
id: morning
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
actions:
- action: switch.turn_on
entity_id: switch.outlet_repeater_hifi_switch
- id: set_scene_movies
alias: Scene 'Movies'
triggers:
- id: tv_playing
trigger: state
entity_id: media_player.samsungtv
to: 'on'
- id: tv_online
trigger: state
entity_id: binary_sensor.smarttv
to: 'on'
- id: lights_on
trigger: state
entity_id: light.dimmschalter_wz_dimmaktor_wz
to: 'on'
conditions:
- and:
- or:
- condition: state
entity_id: media_player.samsungtv
state: 'on'
- condition: state
entity_id: binary_sensor.smarttv
state: 'on'
- condition: state
entity_id: light.dimmschalter_wz_dimmaktor_wz
state: 'on'
- condition: state
entity_id: input_boolean.disable_power_automation
state: 'off'
actions:
- action: python_script.light_store
data:
store_name: dw_signal_store
entity_id:
- light.dimmschalter_wz_dimmaktor_wz
overwrite: true
all_attribs: true
- action: scene.turn_on
data:
entity_id: scene.movies
transition: 2
- id: reload_speedtest
alias: Re-Load Speedtest integration
description: Perform a manual speed test when sensors goes unavailable
triggers:
- trigger: state
entity_id: sensor.speedtest_download
to: unavailable
for:
minutes: 15
actions:
- action: homeassistant.update_entity
target:
entity_id: sensor.speedtest_download
mode: single
- id: power_down_mediarack
alias: switch off media rack
description: Schaltet TV/Hifi und Raspi3 aus, wenn niemand für 20 min zuhause.
triggers:
- id: nobody_home
trigger: state
entity_id: sensor.home_status
from: Home
to: Away
for:
minutes: 20
- id: config_changed
trigger: state
entity_id: input_boolean.disable_power_automation
to: 'off'
conditions:
- and:
- condition: state
entity_id: sensor.home_status
state: Away
- condition: state
entity_id: input_boolean.disable_power_automation
state: 'off'
actions:
- action: switch.turn_off
entity_id: switch.outlet_repeater_hifi_switch
- id: power_up_mediarack
alias: switch on media rack
description: Schaltet TV/Hifi und Raspi3 an, wenn wir wieder für 3 min zuhause sind.
triggers:
- id: returned_home
trigger: state
entity_id: sensor.home_status
to: Home
for:
minutes: 3
- id: config_changed
trigger: state
entity_id: input_boolean.disable_power_automation
to: 'off'
conditions:
- and:
- condition: state
entity_id: input_boolean.disable_power_automation
state: 'off'
- condition: state
entity_id: sensor.home_status
state: Home
actions:
- action: switch.turn_on
entity_id: switch.outlet_repeater_hifi_switch
- id: switch_off_network
alias: switch off network
mode: restart
description: Schaltet Netzkomponenten (nicht wenn SaugE aktiv) und Raspi3 aus, 20
min nach dem Verlassen oder nach Mitternacht.
triggers:
- id: nobody_home
trigger: state
entity_id: sensor.home_status
from: Home
to: Away
for:
minutes: 20
- id: past_midnight
trigger: time
at: 00:45:00
- id: duste_docked
trigger: state
entity_id: vacuum.xiaomi_vacuum_cleaner
to: docked
from:
- cleaning
- returning
for:
minutes: 5
conditions:
- condition: state
entity_id: input_boolean.disable_power_automation
state: 'off'
- or:
- and:
- condition: trigger
id: duste_docked
- condition: state
entity_id: sensor.home_status
state:
- Away
- Extended Away
- not:
- condition: trigger
id: duste_docked
actions:
- action: automation.turn_off
entity_id: automation.switch_on_network
- action: automation.turn_on
entity_id: automation.switch_on_network
- action: switch.turn_off
entity_id: switch.fritz_dect_200_gz
- delay: 00:00:05
- choose:
- alias: Switch of Raspi1 and network
conditions:
- condition: state
entity_id: vacuum.xiaomi_vacuum_cleaner
state:
- docked
- unavailable
sequence:
- action: script.kill_raspi1
- wait_for_trigger:
- trigger: state
entity_id: binary_sensor.rpi_ost
to: 'off'
timeout:
minutes: 1
continue_on_timeout: true
- choose:
- conditions: '{{ states(''sensor.raspi3_last_message'') = ''unavailable''
}}'
sequence:
- action: script.turn_on
target:
entity_id: script.kill_raspi3
- wait_for_trigger:
- trigger: state
entity_id: binary_sensor.rpi_sued
to: 'off'
timeout:
minutes: 1
continue_on_timeout: true
- action: switch.turn_off
entity_id: switch.outlet_repeater_wz_018780fe_on_off
- action: switch.turn_off
entity_id: switch.fritz_dect_200_netz
- id: switch_on_network
alias: switch on network
mode: restart
description: Schaltet Netzkomponenten und Raspi3 wieder an - bei Rückkehr nach Hause,
wenn die Eingangstür aufgeht und morgens um 6:00
trigger:
- id: returned_home
trigger: state
entity_id: sensor.home_status
to: Home
- id: door_opened
trigger: state
entity_id: group.entrance_door
to: 'on'
- id: in_the_morning
trigger: time
at: 06:00:00
- id: config_changed
trigger: state
entity_id: input_boolean.disable_power_automation
to: 'off'
conditions:
- and:
- alias: Automation is turned on
condition: state
entity_id: input_boolean.disable_power_automation
state: 'off'
- or:
- alias: someone is home
condition: state
entity_id: sensor.home_status
state: Home
- '{{ trigger.entity_id == ''group.entrance_door'' }}'
actions:
- action: automation.turn_off
entity_id: automation.switch_off_network
- action: automation.turn_on
entity_id: automation.switch_off_network
- action: switch.turn_on
entity_id: switch.fritz_dect_200_netz
- delay: 00:00:30
- action: mqtt.publish
data:
topic: monitor/scan/arrive
payload: '{''data'' : ''west''}'
- delay: 00:01:30
- action: switch.turn_on
entity_id: switch.fritz_dect_200_gz
- action: switch.turn_on
entity_id: switch.outlet_repeater_wz_018780fe_on_off
- delay: 00:00:30
- choose:
- conditions: '{{ states(''sensor.raspi1_last_message'') == ''unavailable'' }}'
sequence:
- action: script.reboot_raspi1
- delay: 00:01:00
- choose:
- conditions: '{{ states(''binary_sensor.rpi_ost'') = ''on'' or states(''sensor.raspi1_last_message'')
== ''unavailable'' }}'
sequence:
- action: switch.turn_off
entity_id: switch.fritz_dect_200_netz
- delay: 00:00:03
- action: switch.turn_on
entity_id: switch.fritz_dect_200_netz
- choose:
- conditions: '{{ states(''binary_sensor.rpi_sued'') = ''on'' or states(''sensor.raspi3_last_message'')
== ''unavailable'' }}'
sequence:
- action: switch.turn_off
entity_id: switch.outlet_repeater_wz_018780fe_on_off
- delay: 00:00:05
- action: switch.turn_on
entity_id: switch.outlet_repeater_wz_018780fe_on_off
- delay: 00:00:45
- choose:
- conditions: '{{ states(''sensor.raspi3_last_message'') == ''unavailable'' }}'
sequence:
- action: script.reboot_raspi3
- alias: Notify - Powersensor offline
id: send_notification_powersensor_offline_2
triggers:
- id: powermeter_offline
trigger: state
entity_id: binary_sensor.powermeter_offline_alert
to: 'on'
for:
seconds: 180
- id: solarpanel_offline
trigger: state
entity_id: binary_sensor.bwk_sued_offline_alert
to: 'on'
for:
seconds: 180
variables:
notification_service: '{{ ''notify.max'' }}
'
notification_entity_id: '{{ ''input_boolean.powermeter_offline_notification''
if trigger.id == ''powermeter_offline'' else ''input_boolean.bwk_sued_offline_notification''
}}
'
actions:
- action: input_boolean.turn_on
data_template:
entity_id: '{{ notification_entity_id }}'
- action: '{{ notification_service }}'
data:
title: Smart Home Alarm
message: '{{ ''Der Stromzählersensor im Keller ist nicht erreichbar'' if trigger.id
== ''powermeter_offline'' else ''Das Solarpanel ist offline. Vermutlich wurde
der Schalter im Esszimmer ausgeschaltet''}}.
'
data:
subtitle: Power-Sensor offline
push:
badge: '{{states(''sensor.count_notification_alerts'')|int(default=0)}}'
sound:
name: default
volume: 0.5
thread-id: power-notification-group
apns_headers:
apns-collapse-id: power-sensor-offline
clickAction: /lovelace/strom_analyse
- alias: Reset alert - Powersensor offline
id: reset_notification_powersensor_offline
triggers:
- id: all_sensors_online
trigger: template
value_template: "{{ is_state('binary_sensor.powermeter_offline_alert', 'off')\
\ \n and is_state('binary_sensor.bwk_sued_offline_alert', 'off') }}\n"
for:
seconds: 1
conditions:
- or:
- and:
- alias: Notification BKW offline was sent
condition: state
entity_id: input_boolean.bwk_sued_offline_notification
state: 'on'
- alias: Alert BKW offline went to off
condition: state
entity_id: binary_sensor.bwk_sued_offline_alert
state: 'off'
- and:
- alias: Notification powermeter sensor offline was sent
condition: state
entity_id: input_boolean.powermeter_offline_notification
state: 'on'
- alias: Alert powermeter offline went to off
condition: state
entity_id: binary_sensor.powermeter_offline_alert
state: 'off'
actions:
- action: input_boolean.turn_off
entity_id: input_boolean.powermeter_offline_notification
- action: input_boolean.turn_off
entity_id: input_boolean.bwk_sued_offline_notification
- action: notify.max
data:
title: Smart Home ...
message: Power-Sensoren wieder online.
data:
push:
badge: '{{states(''sensor.count_notification_alerts'')|int(default=0)}}'
thread-id: power-notification-group-group
apns_headers:
apns-collapse-id: power-sensor-offline
clickAction: /lovelace/strom_analyse
- alias: reconnect monitors
id: reconnect_monitor_sensors
mode: queued
triggers:
- id: mon_w_missing
trigger: state
entity_id:
- sensor.max_present_w
- sensor.ing_present_w
to: unavailable
for:
seconds: 5
- id: mon_o_missing
trigger: state
entity_id:
- sensor.max_present_o
- sensor.ing_present_o
to: unavailable
for:
seconds: 5
- id: mon_s_missing
trigger: state
entity_id:
- sensor.max_present_s
- sensor.ing_present_s
to: unavailable
for:
seconds: 5
- id: raspi_back_online
trigger: state
entity_id:
- binary_sensor.rpi_west
- binary_sensor.rpi_ost
- binary_sensor.rpi_sued
from: 'off'
to: 'on'
conditions:
- or:
- and:
- condition: trigger
id: mon_w_missing
- condition: state
entity_id: binary_sensor.rpi_west
state: 'on'
- and:
- condition: trigger
id: mon_o_missing
- condition: state
entity_id: binary_sensor.rpi_ost
state: 'on'
- and:
- condition: trigger
id: mon_s_missing
- condition: state
entity_id: binary_sensor.rpi_sued
state: 'on'
- condition: trigger
id: raspi_back_online
actions:
- action: script.restart_monitor
- alias: change person occupancy
id: change_person_occupancy
description: Changes the BT device tracker status for a person when the home confidence
value drops or raises above threshold.
mode: queued
triggers:
- entity_id: &id001
- sensor.max_home_confidence
- sensor.ing_home_confidence
- sensor.home_confidence_heidi
- sensor.home_confidence_winfried
trigger: numeric_state
above: 10
id: turn_occupany_on
- entity_id: *id001
trigger: numeric_state
below: 10
id: turn_occupany_off
variables:
device_map:
sensor.max_home_confidence: iphone_max_bt
sensor.ing_home_confidence: iphone_ing_bt
sensor.home_confidence_heidi: iphone_heidi_bt
sensor.home_confidence_winfried: iphone_winfried_bt
device_tracker_entity: '{{ device_map[trigger.entity_id] }}
'
actions:
- action: device_tracker.see
data:
dev_id: '{{ device_tracker_entity }}'
location_name: '{{ ''home'' if trigger.id == ''turn_occupany_on'' else ''not_home''
}}
'
source_type: bluetooth
- alias: Start BT Arrival Scan Area
id: start_bt_arrival_scan_area
mode: queued
triggers:
- entity_id: &id002
- sensor.max_present_w
- sensor.ing_present_w
- sensor.heidi_present_w
- sensor.winfried_present_w
trigger: numeric_state
below: 95
id: device_leaving_west
- entity_id: &id003
- sensor.max_present_o
- sensor.ing_present_o
- sensor.heidi_present_o
- sensor.winfried_present_o
trigger: numeric_state
below: 95
id: device_leaving_east
- entity_id:
- sensor.max_present_s
- sensor.ing_present_s
trigger: numeric_state
below: 95
id: device_leaving_south
variables:
id_payload_map: &id004
device_leaving_west: '{''data'' : ''west''}'
device_leaving_east: '{''data'' : ''ost''}'
device_leaving_south: '{''data'' : ''south''}'
payload: '{{ id_payload_map[trigger.id] }}
'
actions:
- action: mqtt.publish
data:
topic: monitor/scan/arrive
payload: '{{ payload }}'
- alias: Start BT Departure Scan Area
id: start_bt_departure_scan_area
mode: parallel
triggers:
- entity_id: *id002
trigger: numeric_state
below: 10
for:
seconds: 15
id: device_leaving_west
- entity_id: *id003
trigger: numeric_state
below: 10
for:
seconds: 15
id: device_leaving_east
variables:
id_payload_map: *id004
payload: '{{ id_payload_map[trigger.id] }}
'
actions:
- action: mqtt.publish
data:
topic: monitor/scan/depart
payload: '{{ payload }}'
- alias: Start BT Arrival Scan
id: start_bt_arrival_scan
triggers:
- entity_id: &id005
- device_tracker.iphonemax13_wifi
- device_tracker.iphone8_ing_wifi
trigger: state
from: not_home
to: home
- trigger: state
entity_id: group.entrance_door
to: 'on'
for:
seconds: 1
actions:
- action: mqtt.publish
data:
topic: monitor/scan/arrive
payload: ''
- alias: Start BT Departure Scan
id: start_bt_departure_scan
triggers:
- entity_id: *id005
trigger: state
from: home
to: not_home
id: wifi
- trigger: state
entity_id: group.entrance_door
to: 'off'
for:
seconds: 20
id: door
conditions:
- '{{ trigger.id == ''door'' or (trigger.id == ''wifi'' and is_state(''switch.fritz_dect_200_netz'',''on''))
}}'
actions:
- action: mqtt.publish
data:
topic: monitor/scan/depart
payload: ''
- delay: 00:00:40
- action: mqtt.publish
data:
topic: monitor/scan/depart
payload: ''
- delay: 00:01:00
- action: mqtt.publish
data:
topic: monitor/scan/depart
payload: ''
- alias: Save last time person status changed
id: personstatus_last_changed_date_and_time
triggers:
trigger: state
entity_id:
- input_select.max_status_dropdown
- input_select.ing_status_dropdown
- input_select.home_status_dropdown
mode: queued
actions:
- action: input_datetime.set_datetime
data:
entity_id: input_datetime.{{ trigger.entity_id[13:] }}_last_changed
time: '{{ (as_timestamp(now()) | timestamp_custom(''%H:%M:%S'', true)) }}'
date: '{{ (as_timestamp(now()) | timestamp_custom(''%Y-%m-%d'', true)) }}'
- alias: Person- and Home-Status correction
id: person_and_homestatus_correction
triggers:
- trigger: homeassistant
event: start
- trigger: time
at: 00:30:00
- trigger: time
at: 06:10:00
conditions:
- '{{ states(''sensor.raspi1_last_message'') != ''unavailable'' and states(''sensor.raspi2_last_message'')
!= ''unavailable'' }}'
actions:
- action: mqtt.publish
data:
topic: monitor/scan/restart
payload: ''
- delay: 00:00:30
- action: mqtt.publish
data:
topic: monitor/ost/KNOWN DEVICE STATES
payload: 'on'
- action: mqtt.publish
data:
topic: monitor/west/KNOWN DEVICE STATES
payload: 'on'
- delay: 00:00:10
- action: input_select.select_option
data:
entity_id: input_select.max_status_dropdown
option: "{% if states('group.phone_max') in ['home', 'on'] %}\n {% if states('input_select.max_status_dropdown')\
\ in ['Just Arrived','Just Left'] %}\n Home\n {% elif states('input_select.max_status_dropdown')\
\ in ['Away', 'Extended Away'] %}\n Just Arrived\n {% else %}\n Home\n\
\ {% endif %}\n{% else %} \n {% if states('input_select.max_status_dropdown')\
\ in ['Just Left'] %}\n Away\n {% elif states('input_select.max_status_dropdown')\
\ in ['Home', 'Just Arrived'] %}\n Just Left\n {% elif (states('input_select.max_status_dropdown')\
\ in ['Away']) and \n (((as_timestamp(now()) - as_timestamp(states('input_datetime.max_status_dropdown_last_changed')))/3600)\
\ | int(default=0) >=24) %}\n Extended Away\n {% elif states('input_select.max_status_dropdown')\
\ in ['Extended Away'] %}\n Extended Away\n {% else %}\n Away\n {%\
\ endif %}\n{% endif %}\n"
- action: input_select.select_option
data:
entity_id: input_select.ing_status_dropdown
option: "{% if states('group.phone_ing') in ['home', 'on'] %}\n {% if states('input_select.ing_status_dropdown')\
\ in ['Just Arrived','Just Left'] %}\n Home\n {% elif states('input_select.ing_status_dropdown')\
\ in ['Away', 'Extended Away'] %}\n Just Arrived\n {% else %}\n Home\n\
\ {% endif %}\n{% else %} \n {% if states('input_select.ing_status_dropdown')\
\ in ['Just Left'] %}\n Away\n {% elif states('input_select.ing_status_dropdown')\
\ in ['Home', 'Just Arrived'] %}\n Just Left\n {% elif (states('input_select.ing_status_dropdown')\
\ in ['Away']) and \n (((as_timestamp(now()) - as_timestamp(states('input_datetime.ing_status_dropdown_last_changed')))/3600)\
\ | int(default=0) >=24) %}\n Extended Away\n {% elif states('input_select.ing_status_dropdown')\
\ in ['Extended Away'] %}\n Extended Away\n {% else %}\n Away\n {%\
\ endif %}\n{% endif %}\n"
- action: input_select.select_option
data:
entity_id: input_select.home_status_dropdown
option: "{% if states('input_select.home_status_dropdown') in ['Away', 'Extended\
\ Away'] %}\n {% if (as_timestamp(now()) - as_timestamp(states('input_datetime.home_status_dropdown_last_changed')))/3600\
\ | int(default=0) >=24 %}\n Extended Away\n {% else %}\n {{ states('input_select.home_status_dropdown')\
\ }}\n {% endif %}\n{% else %}\n {{ states('input_select.home_status_dropdown')\
\ }}\n{% endif %}\n"
- alias: Set person status to just arrived
id: mark_person_as_just_arrived
mode: queued
triggers:
- entity_id: &id006
- group.phone_max
- group.phone_ing
trigger: state
from: not_home
to: home
- entity_id: *id006
trigger: state
from: 'off'
to: 'on'
variables:
device_map: &id007
group.phone_max: input_select.max_status_dropdown
group.phone_ing: input_select.ing_status_dropdown
input_select_entity: '{{ device_map[trigger.entity_id] }}
'
state_map:
Home: Home
Just Left: Home
actions:
- action: input_select.select_option
data:
entity_id: '{{ input_select_entity }}
'
option: '{{ state_map[states(input_select_entity)] if states(input_select_entity)
in state_map else ''Just Arrived'' }}
'
- alias: Set person status to just left
id: mark_person_as_just_left
mode: queued
triggers:
- entity_id: *id006
trigger: state
from: home
to: not_home
- entity_id: *id006
trigger: state
from: 'on'
to: 'off'
variables:
device_map: *id007
input_select_entity: '{{ device_map[trigger.entity_id] }}
'
actions:
- action: input_select.select_option
data:
entity_id: '{{ input_select_entity }}
'
option: Just Left
- alias: Set person status to home
id: mark_person_as_home
mode: queued
triggers:
- entity_id: &id008
- input_select.max_status_dropdown
- input_select.ing_status_dropdown
trigger: state
to: Just Arrived
for:
minutes: 10
- entity_id: *id008
trigger: state
from: Just Left
to: Just Arrived
actions:
- action: input_select.select_option
data:
entity_id: '{{ trigger.entity_id }}'
option: Home
- alias: Set person status to away
id: mark_person_as_away
mode: queued
triggers:
- entity_id: *id008
trigger: state
to: Just Left
for:
minutes: 10
actions:
- action: input_select.select_option
data:
entity_id: '{{ trigger.entity_id }}'
option: Away
- alias: Set person status to extended away
id: mark_person_as_extended_away
mode: queued
triggers:
- entity_id: *id008
trigger: state
to: Away
for:
hours: 24
minutes: 0
actions:
- action: input_select.select_option
data:
entity_id: '{{ trigger.entity_id }}'
option: Extended Away
- alias: Home Status - Leaving
id: set_home_status_leaving
triggers:
trigger: numeric_state
entity_id: sensor.n_people_home
below: 1
conditions:
condition: state
entity_id: input_select.home_status_dropdown
state: Home
actions:
action: input_select.select_option
entity_id: input_select.home_status_dropdown
data:
option: Away
- alias: Home Status - Arriving
id: set_home_status_arriving
triggers:
trigger: state
entity_id: sensor.n_people_home
conditions:
- '{{ trigger.to_state.state|int(default=0) > trigger.from_state.state|int(default=0)
}}'
actions:
action: input_select.select_option
entity_id: input_select.home_status_dropdown
data:
option: Home
- alias: Home Status - Vacation
id: set_home_status_vacation
triggers:
trigger: state
entity_id: input_select.home_status_dropdown
to: Away
for:
hours: 24
minutes: 0
actions:
action: input_select.select_option
entity_id: input_select.home_status_dropdown
data:
option: Extended Away
- id: update_cert_expiry_on_reboot
alias: update_cert_expiry_on_reboot
triggers:
- trigger: homeassistant
event: start
actions:
- delay: 0:00:50
- action: homeassistant.update_entity
entity_id: sensor.cert_expiry_timestamp_hera
- id: vacuum_start_roomcleaning
alias: Start cleaning room
triggers:
- trigger: state
entity_id: input_select.vacuum_room
from: Bitte auswählen
actions:
- action: script.vacuum_room
data:
my_roomname: '{{ states.input_select.vacuum_room.state }}'
- id: vacuum_start_cleanup
alias: Start automatic cleanup
mode: single
triggers:
- trigger: state
entity_id: sensor.home_status
from: Home
to: Away
for:
minutes: 2
- trigger: time
at: 08:02:00
- trigger: state
entity_id: input_boolean.disable_automatic_vacuum
to: 'off'
- trigger: state
entity_id: input_boolean.automatic_vacuum_when_home
to: 'on'
for:
seconds: 5
- trigger: state
entity_id: vacuum.xiaomi_vacuum_cleaner
from: unavailable
conditions:
- and:
- not:
- condition: state
entity_id: vacuum.xiaomi_vacuum_cleaner
state: unavailable
- condition: state
entity_id: input_boolean.disable_automatic_vacuum
state: 'off'
- condition: state
entity_id: input_boolean.automatic_vacuum_first_run
state: 'off'
- condition: time
weekday:
- mon
- tue
- thu
- fri
after: 08:00:00
before: '17:00:00'
- condition: template
value_template: '{{ states(''sensor.home_status'') = ''Extended Away'' }}'
- or:
- condition: state
entity_id: sensor.home_status
state: Away
- condition: state
entity_id: input_boolean.automatic_vacuum_when_home
state: 'on'
variables:
cleanup_area: '{{ ''full'' if (now().weekday() in [0,1]) else ''partly''}}'
messagetext: "{{ 'wöchentliches Saugen der gesamten Wohnung wurde gestartet.'\
\ if (cleanup_area=='full') \n else 'wöchentliches Saugen von Küche, Schlafzimmer\
\ und Bad wurde gestartet.'}}\n"
cleanup_duration: '{{ ''01:50:00'' if (cleanup_area==''full'') else ''00:45:00''}}'
actions:
- delay: 00:00:05
- choose:
- conditions:
- condition: time
weekday:
- mon
- tue
sequence:
- action: script.vacuum_all
- conditions:
- condition: time
weekday:
- thu
- fri
sequence:
- action: script.vacuum_room
data:
my_roomname: Kü,Sz,B (auto)
- delay: 00:00:10
- action: homeassistant.turn_on
entity_id: input_boolean.automatic_vacuum_first_run
- action: notify.family_main_devices
data:
title: Automatisierung Saug-E
message: '{{ messagetext }}'
data:
push:
thread-id: vacuum-notification-group
apns_headers:
apns-collapse-id: vacuum-auto-cleanup
clickAction: /lovelace/vacuum
- delay: '{{ cleanup_duration }}'
- action: homeassistant.turn_on
entity_id: input_boolean.alert_dustbin_full
- id: vacuum_reset_first_run
alias: Reset Vacuum First Run state at midnight
triggers:
- trigger: time
at: 00:30:00
conditions:
- condition: time
weekday:
- mon
- wed
- thu
- sat
- sun
actions:
- action: homeassistant.turn_off
entity_id: input_boolean.automatic_vacuum_first_run
- id: send_alert_after_automatic_vacuum_to_empty_dustbin
alias: Send alert after automatic vacuum to empty the dustbin
triggers:
- trigger: state
entity_id: sensor.home_status
to: Home
for:
minutes: 1
- trigger: state
entity_id: input_boolean.disable_dustbin_notification
to: 'off'
- trigger: state
entity_id: vacuum.xiaomi_vacuum_cleaner
to: docked
conditions:
- and:
- condition: state
entity_id: sensor.home_status
state: Home
- condition: state
entity_id: input_boolean.alert_dustbin_full
state: 'on'
- condition: state
entity_id: input_boolean.disable_dustbin_notification
state: 'off'
- condition: time
after: 07:30:00
before: '23:00:00'
- condition: template
value_template: "{% if state_attr('automation.send_alert_after_automatic_vacuum_to_empty_dustbin','last_triggered')\
\ is not none %}\n {% if as_timestamp(now()) | int(default=0) - as_timestamp(state_attr('automation.send_alert_after_automatic_vacuum_to_empty_dustbin','last_triggered'))\
\ | int(default=0) > 1800 %} \n true \n {% else %} \n false\n {% endif\
\ %}\n{% else %}\n true\n{% endif %}\n"
- condition: state
entity_id: vacuum.xiaomi_vacuum_cleaner
state: docked
actions:
- action: "{% if (states('sensor.max_status') in ['Home', 'Just Arrived']) and (states('sensor.ing_status')\
\ in ['Home', 'Just Arrived']) %}\n notify.family_main_devices\n{% elif states('sensor.max_status')\
\ in ['Home', 'Just Arrived'] %}\n notify.max\n{% elif states('sensor.ing_status')\
\ in ['Home', 'Just Arrived'] %}\n notify.ing\n{% else %}\n notify.max \
\ \n{% endif %}\n"
data:
title: Staubbehälter leeren
message: Nach dem automatischen Saugen den Staubbehälter von Saug-E leeren.
data:
push:
thread-id: vacuum-notification-group
apns_headers:
apns-collapse-id: vacuum-auto-cleanup
clickAction: /lovelace/vacuum
- alias: Notify all - Vacuum Error
id: send_notification_vacuum_error
triggers:
- trigger: state
entity_id: binary_sensor.alert_vacuum_error
to: 'on'
for:
seconds: 6
conditions:
- condition: state
entity_id: binary_sensor.alert_vacuum_error
state: 'on'
actions:
- action: notify.family_main_devices
data:
title: Smart Home Alerts
message: Saug-E hat einen Fehlerstatus.
data:
subtitle: Saug-E Error
push:
badge: '{{states.sensor.count_notification_alerts.state|int(default=0)}}'
thread-id: vacuum-notification-group
apns_headers:
apns-collapse-id: vacuum-error-detected
clickAction: /lovelace/vacuum
- alias: Reset alert - Vacuum Error
id: reset_notification_vacuum_error
triggers:
- trigger: state
entity_id: binary_sensor.alert_vacuum_error
from: 'on'
to: 'off'
conditions:
- condition: state
entity_id: binary_sensor.alert_vacuum_error
state: 'off'
actions:
- action: notify.family_main_devices
data:
title: Smart Home ...
message: Saug-E Fehler behoben.
data:
push:
badge: '{{states.sensor.count_notification_alerts.state|int(default=0)}}'
thread-id: vacuum-notification-group
apns_headers:
apns-collapse-id: vacuum-error-detected
clickAction: /lovelace/vacuum
- id: send_notification_dwd_warning
alias: send_notification_dwd_warning
initial_state: true
triggers:
- trigger: state
entity_id: sensor.dwd_current_warn_count
- trigger: state
entity_id: sensor.dwd_weather_warnings_current_warning_level
conditions:
- and:
- '{{ states.sensor.dwd_current_warn_count.state | int(default=0) > 0 }}'
- condition: state
entity_id: input_boolean.dwd_weather_alert
state: 'off'
- or:
- '{{ states.sensor.dwd_max_warn_level.state | int(default=0) >= 3 }}'
- '{{ states.sensor.dwd_current_warn_level_sturm.state | int(default=0) >= 2
}}'
- '{{ states.sensor.dwd_current_warn_level_gewitter.state | int(default=0) >=
2 }}'
actions:
- action: input_boolean.turn_on
entity_id: input_boolean.dwd_weather_alert
- action: homeassistant.turn_on
entity_id: script.send_dwd_warn_mail
- id: reset_notification_dwd_warning
alias: reset_notification_dwd_warning
triggers:
trigger: template
value_template: '{{ states.sensor.dwd_current_warn_count.state == ''0'' and is_state(''input_boolean.dwd_weather_alert'',
''on'') }}'
for:
seconds: 1
actions:
- action: input_boolean.turn_off
entity_id: input_boolean.dwd_weather_alert
- action: notify.max
data:
title: Smart Home ...
message: delete_alert
data:
push:
badge: '{{ states.sensor.count_notification_alerts.state|int(default=0)
}}'
thread-id: wather-notification-group
apns_headers:
apns-collapse-id: dwd-weather-warning