AutomationDataset/nodes-at-home/nodes-at-home_automations.yaml

4635 lines
139 KiB
YAML

- alias: alarm_triggered
id: alarm_triggered
triggers:
- trigger: state
entity_id: alarm_control_panel.intrusion_detection_system
to: triggered
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: script.notify
data:
domain: alarm
message: Alarm ausgelöst.
- alias: alarm_arm
id: alarm_arm
triggers:
- trigger: state
entity_id: group.family
to: not_home
for:
minutes: '{{ states ( ''input_number.alarm_arming_after'' ) }}'
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: binary_sensor.alarm_activated
state: 'on'
actions:
- action: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.intrusion_detection_system
- action: script.notify
data:
domain: alarm
message: Alarmsystem aktiviert.
- alias: alarm_disarm
id: alarm_disarm
triggers:
- trigger: state
entity_id: lock.eingangstur
from: locked
to: unlocked
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: alarm_control_panel.intrusion_detection_system
state: armed_away
actions:
- action: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.intrusion_detection_system
- action: script.notify
data:
domain: alarm
message: Alarmsystem deaktiviert.
- alias: alarm_state_changed
id: alarm_state_changed
triggers:
- trigger: state
entity_id: alarm_control_panel.intrusion_detection_system
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: script.notify
data:
domain: alarm
message: 'Neuer Status Alarmanlage: {{ states ( ''alarm_control_panel.intrusion_detection_system''
) }}.'
- alias: bambulab_light
id: bambulab_light
mode: restart
variables:
led_brightness: 255
ok_duration: 2
triggers:
- trigger: state
alias: When printer stage,status or chamber light state changes
entity_id:
- light.x1c_00m09a410500788_druckraumbeleuchtung
- sensor.x1c_00m09a410500788_druckstatus
- sensor.x1c_00m09a410500788_aktueller_arbeitsschritt
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- if:
- condition: state
alias: chamber light is on
entity_id: light.x1c_00m09a410500788_druckraumbeleuchtung
state: 'on'
- not:
- condition: state
entity_id: sensor.x1c_00m09a410500788_druckstatus
state: offline
then:
- choose:
- conditions:
- or:
- condition: state
entity_id: sensor.x1c_00m09a410500788_aktueller_arbeitsschritt
state:
- paused_filament_runout
- paused_front_cover_falling
- paused_nozzle_temperature_malfunction
- paused_heat_bed_temperature_malfunction
- paused_ams_lost
- paused_chamber_temperature_control_error
- paused_nozzle_filament_covered_detected
- paused_first_layer_error
- paused_low_fan_speed_heat_break
- paused_skipped_step
- paused_cutter_error
- paused_nozzle_clog
- unknown
- offline
sequence:
- action: light.turn_on
data:
rgb_color:
- 255
- 0
- 0
effect: blink
target:
entity_id: light.ws2812_x1c
- conditions:
- or:
- condition: state
entity_id: sensor.x1c_00m09a410500788_druckstatus
state:
- finish
sequence:
- action: light.turn_on
data:
rgb_color:
- 0
- 255
- 0
effect: static
target:
entity_id: light.ws2812_x1c
- delay:
minutes: '{{ ok_duration }}'
- action: light.turn_on
data:
rgb_color:
- 255
- 255
- 255
effect: static
target:
entity_id: light.ws2812_x1c
- conditions:
- or:
- condition: state
entity_id: sensor.x1c_00m09a410500788_aktueller_arbeitsschritt
state:
- auto_bed_leveling
- scanning_bed_surface
- cleaning_nozzle_tip
- calibrating_extrusion
- calibrating_extrusion_flow
- calibrating_motor_noise
- inspecting_first_layer
- sweeping_xy_mech_mode
- calibrating_micro_lidar
- homing_toolhead
- identifying_build_plate_type
sequence:
- action: light.turn_on
data:
rgb_color:
- 0
- 0
- 255
effect: static
target:
entity_id: light.ws2812_x1c
- conditions:
- or:
- condition: state
entity_id: sensor.x1c_00m09a410500788_aktueller_arbeitsschritt
state:
- heatbed_preheating
- heating_hotend
sequence:
- action: light.turn_on
data:
rgb_color:
- 255
- 169
- 0
effect: static
target:
entity_id: light.ws2812_x1c
- conditions:
- or:
- condition: state
entity_id: sensor.x1c_00m09a410500788_aktueller_arbeitsschritt
state:
- filament_loading
- filament_unloading
sequence:
- action: light.turn_on
data:
rgb_color:
- 255
- 0
- 255
effect: blink
target:
entity_id: light.ws2812_x1c
- conditions:
- or:
- condition: state
entity_id: sensor.x1c_00m09a410500788_aktueller_arbeitsschritt
state:
- cooling_chamber
sequence:
- action: light.turn_on
data:
rgb_color:
- 0
- 0
- 255
effect: static
target:
entity_id: light.ws2812_x1c
default:
- action: light.turn_on
alias: torn on with white light (default)
data:
rgb_color:
- 255
- 255
- 255
effect: static
target:
entity_id: light.ws2812_x1c
else:
- action: light.turn_off
alias: turn off
target:
entity_id: light.ws2812_x1c
- alias: climate_schedule
id: climate_schedule
triggers:
- trigger: time_pattern
minutes: /5
- trigger: state
entity_id: group.family
to: home
- trigger: state
entity_id:
- input_number.climate_target_temperature
- input_number.climate_min_forecast_temperature
- input_number.climate_min_forecast_temperature_sunny
- input_number.climate_min_outdoor_temperature
- sensor.boiler_outside_temperature
- trigger: state
entity_id:
- binary_sensor.fenster_schlafzimmer
- binary_sensor.dachfenster_schlafzimmer
- binary_sensor.fenster_kinderzimmer
- binary_sensor.dachfenster_kinderzimmer
- binary_sensor.fenster_arbeitszimmer
- binary_sensor.dachfenster_arbeitszimmer
to: 'off'
for: 00:00:10
conditions:
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
- condition: time
after: input_datetime.climate_startperiode_begin
before: input_datetime.climate_startperiode_end
- condition: state
entity_id: group.family
state: home
- condition: numeric_state
entity_id: sensor.sh10rt_master_battery_level
above: input_number.climate_min_battery_level
- condition: numeric_state
entity_id: sensor.total_dc_power
above: input_number.climate_min_pv_generation
- or:
- and:
- not:
- condition: state
entity_id: sensor.openweathermap_forecast_condition
state: sunny
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: input_number.climate_min_forecast_temperature
- and:
- condition: state
entity_id: sensor.openweathermap_forecast_condition
state: sunny
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: input_number.climate_min_forecast_temperature_sunny
- condition: numeric_state
entity_id: sensor.boiler_outside_temperature
above: input_number.climate_min_outdoor_temperature
actions:
- repeat:
for_each:
- climate: office
room: arbeitszimmer
- climate: bedroom
room: schlafzimmer
- climate: nursery
room: kinderzimmer
sequence:
- if:
- condition: template
value_template: "{# start only climates which are scheduled, not running\
\ and with closed windows #} {{\n states ( 'input_boolean.climate_start_'\
\ + repeat.item.climate ) == 'on'\n and states ( 'input_boolean.climate_'\
\ + repeat.item.climate + '_scheduled' ) == 'off'\n and (\n states\
\ ( 'climate.' + repeat.item.climate ) == 'off'\n or states ( 'switch.klimaanlage_'\
\ + repeat.item.room ) == 'off'\n )\n and states ( 'binary_sensor.fenster_'\
\ + repeat.item.room ) == 'off'\n and states ( 'binary_sensor.dachfenster_'\
\ + repeat.item.room ) == 'off'\n}}\n"
then:
- if:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
then:
- if:
- condition: template
value_template: '{{ states ( ''switch.klimaanlage_'' + repeat.item.room
) == ''off'' }}'
then:
- action: switch.turn_on
data: {}
target:
entity_id: switch.klimaanlage_{{ repeat.item.room }}
- wait_template: '{{ states ( ''switch.klimaanlage_'' + repeat.item.room
) == ''on'' }}'
- delay:
seconds: 10
- condition: template
value_template: '{{ states ( ''switch.klimaanlage_'' + repeat.item.room
) == ''on'' }}'
- action: input_boolean.turn_on
data:
entity_id: '{{ ''input_boolean.climate_'' + repeat.item.climate + ''_scheduled''
}}'
- alias: climate_start
id: climate_start
triggers:
- trigger: time_pattern
minutes: /1
- trigger: state
entity_id:
- input_boolean.climate_office_scheduled
- input_boolean.climate_bedroom_scheduled
- input_boolean.climate_nursery_scheduled
to: 'on'
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
actions:
- repeat:
for_each:
- climate: office
window: arbeitszimmer
- climate: bedroom
window: schlafzimmer
- climate: nursery
window: kinderzimmer
sequence:
- if:
- condition: template
value_template: "{# start climates which are not running and scheduled #}\
\ {{\n states ( 'input_boolean.climate_' + repeat.item.climate + '_scheduled'\
\ ) == 'on'\n and states ( 'climate.' + repeat.item.climate ) == 'off'\n\
}}\n"
then:
- action: climate.set_hvac_mode
target:
entity_id: climate.{{ repeat.item.climate }}
data:
hvac_mode: '{{ states ( ''input_select.climate_hvac_mode'' ) }}'
- delay: 10
- action: script.climate_set_temperature
data:
device: '{{ repeat.item.climate }}'
- delay: 10
- action: climate.set_fan_mode
target:
entity_id: climate.{{ repeat.item.climate }}
data:
fan_mode: '{{ states ( ''input_select.climate_fan_mode'' ) }}'
- delay: 10
- action: climate.set_swing_mode
target:
entity_id: climate.{{ repeat.item.climate }}
data:
swing_mode: '{{ ''on'' if is_state ( ''input_select.climate_swing_mode'',
''True'' ) else ''off'' }}'
- delay: 10
- action: climate.set_preset_mode
target:
entity_id: climate.{{ repeat.item.climate }}
data:
preset_mode: '{{ states ( ''input_select.climate_preset_mode'' ) }}'
- alias: climate_supervise_temperature
id: climate_supervise_temperature
triggers:
- trigger: state
entity_id:
- climate.office
- climate.bedroom
- climate.nursery
attribute: current_temperature
variables:
device: '{{ trigger.entity_id [8:] }}'
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: template
value_template: '{{ states ( ''input_boolean.climate_'' + device + ''_scheduled''
) == ''on'' }}'
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
actions:
- if:
- condition: template
value_template: '{{ states ( ''climate.'' + device ) != ''off'' }}'
then:
- action: script.climate_set_temperature
data:
device: '{{ device }}'
- alias: climate_target_temperature
id: climate_target_temperature
triggers:
- trigger: state
entity_id:
- input_number.climate_target_temperature
- input_number.climate_target_temperature_step
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
actions:
- repeat:
for_each:
- office
- bedroom
- nursery
sequence:
- if:
- condition: template
value_template: '{{ states ( ''climate.'' + repeat.item ) != ''off'' }}'
then:
- action: script.climate_set_temperature
data:
device: '{{ repeat.item }}'
- alias: climate_stop
id: climate_stop
triggers:
- trigger: numeric_state
entity_id: sensor.total_dc_power
below: input_number.climate_min_pv_generation
for:
minutes: '{{ states ( ''input_number.climate_min_pv_generation_duration'' )
}}'
variables:
immediate_turn_off: false
window_turn_off: false
- trigger: state
entity_id: group.family
to: not_home
variables:
immediate_turn_off: '{{ states ( ''input_boolean.climate_absence_goon'' ) !=
''on'' }}'
window_turn_off: false
- trigger: numeric_state
entity_id: sensor.boiler_outside_temperature
below: input_number.climate_min_outdoor_temperature
variables:
immediate_turn_off: false
window_turn_off: false
- trigger: state
entity_id:
- binary_sensor.fenster_schlafzimmer
- binary_sensor.dachfenster_schlafzimmer
- binary_sensor.fenster_kinderzimmer
- binary_sensor.dachfenster_kinderzimmer
- binary_sensor.fenster_arbeitszimmer
- binary_sensor.dachfenster_arbeitszimmer
to: 'on'
for: 00:00:10
variables:
immediate_turn_off: false
window_turn_off: true
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
actions:
- repeat:
for_each:
- climate: office
window: arbeitszimmer
- climate: bedroom
window: schlafzimmer
- climate: nursery
window: kinderzimmer
sequence:
- if:
- condition: template
value_template: "{{\n states ( 'climate.' + repeat.item.climate ) !=\
\ 'off'\n and (\n immediate_turn_off\n or (\n \
\ not window_turn_off and\n states ( 'input_boolean.climate_'\
\ + repeat.item.climate + '_scheduled' ) == 'on'\n and states\
\ ( 'input_boolean.climate_stop_' + repeat.item.climate ) == 'on'\n \
\ ) \n or (\n window_turn_off and\n \
\ (\n states ( 'binary_sensor.fenster_' + repeat.item.window\
\ ) == 'on'\n or states ( 'binary_sensor.dachfenster_'\
\ + repeat.item.window ) == 'on'\n )\n )\n )\n}}\n"
then:
- action: climate.turn_off
target:
entity_id: climate.{{ repeat.item.climate }}
- alias: climate_turned_off
id: climate_turned_off
triggers:
- trigger: state
entity_id:
- climate.office
- climate.bedroom
- climate.nursery
to: 'off'
variables:
device: '{{ trigger.entity_id [8:] }}'
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
actions:
- action: input_boolean.turn_off
data:
entity_id: '{{ ''input_boolean.climate_'' + device + ''_scheduled'' }}'
- alias: climate_switch_off
id: climate_switch_off
triggers:
- trigger: state
entity_id:
- climate.office
- climate.bedroom
- climate.nursery
to: 'off'
for:
minutes: '{{ states ( ''input_number.climate_switch_off_delay'' ) | int }}'
variables:
device: '{{ trigger.entity_id [8:] }}'
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
actions:
- action: switch.turn_off
data:
entity_id: '{% set room = { "office": "arbeitszimmer", "nursery": "kinderzimmer",
"bedroom": "schlafzimmer" } %} {{ ''switch.klimaanlage_'' + room [device]
}}'
- alias: climate_night_mode
id: climate_night_mode
triggers:
platform: state
entity_id: remote.sony_kd_55ag9
from: 'on'
to: 'off'
for:
minutes: 1
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.climate_activated
state: 'on'
actions:
- repeat:
for_each:
- office
- bedroom
- nursery
sequence:
- if:
- condition: template
value_template: "{{\n states ( 'input_boolean.climate_' + repeat.item\
\ + '_scheduled' ) == 'on'\n and states ( 'climate.' + repeat.item\
\ ) != 'off'\n}}\n"
then:
- action: climate.set_preset_mode
target:
entity_id: climate.{{ repeat.item }}
data:
preset_mode: sleep
- alias: climate_absence_goon
id: climate_absence_goon
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Klimaanlage anlassen
actions:
- action: input_boolean.turn_on
data:
entity_id: input_boolean.climate_absence_goon
- alias: climate_absence_goon_reset
id: climate_absence_goon_reset
triggers:
- trigger: time
at: '23:59:00'
actions:
- action: input_boolean.turn_off
data:
entity_id: input_boolean.climate_absence_goon
- alias: close_cover_bedroom
id: close_cover_bedroom
triggers:
- trigger: sun
event: sunset
offset: 00:30:00
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: numeric_state
entity_id: sensor.dht22_terrace_temperature
below: input_number.rooflight_close_below_temp
- condition: state
entity_id: input_boolean.cover_bedroom
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_schlafzimmer
state: 'off'
actions:
- action: cover.close_cover
target:
entity_id: cover.bedroom
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_closed_at_low_temp
- alias: open_cover_bedroom
id: open_cover_bedroom
triggers:
- trigger: sun
event: sunrise
offset: -00:30:00
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: state
entity_id: input_boolean.cover_bedroom
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_schlafzimmer
state: 'off'
- condition: state
entity_id: input_boolean.cover_closed_at_low_temp
state: 'on'
actions:
- action: cover.open_cover
target:
entity_id: cover.bedroom
- alias: close_cover_bath
id: close_cover_bath
triggers:
- trigger: sun
event: sunset
offset: 00:30:00
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: numeric_state
entity_id: sensor.dht22_terrace_temperature
below: input_number.rooflight_close_below_temp
- condition: state
entity_id: input_boolean.cover_bath
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_bad
state: 'off'
actions:
- action: cover.close_cover
target:
entity_id: cover.bath
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_closed_at_low_temp
- alias: open_cover_bath
id: open_cover_bath
triggers:
- trigger: sun
event: sunrise
offset: -00:30:00
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: state
entity_id: input_boolean.cover_bath
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_bad
state: 'off'
- condition: state
entity_id: input_boolean.cover_closed_at_low_temp
state: 'on'
actions:
- action: cover.open_cover
target:
entity_id: cover.bath
- alias: close_cover_office
id: close_cover_office
triggers:
- trigger: sun
event: sunset
offset: 00:30:00
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: numeric_state
entity_id: sensor.dht22_terrace_temperature
below: input_number.rooflight_close_below_temp
- condition: state
entity_id: input_boolean.cover_office
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_arbeitszimmer
state: 'off'
actions:
- action: cover.close_cover
target:
entity_id: cover.office
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_closed_at_low_temp
- alias: open_cover_office
id: open_cover_office
triggers:
- trigger: sun
event: sunrise
offset: -00:30:00
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: state
entity_id: input_boolean.cover_office
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_arbeitszimmer
state: 'off'
- condition: state
entity_id: input_boolean.cover_closed_at_low_temp
state: 'on'
actions:
- action: cover.open_cover
target:
entity_id: cover.office
- alias: close_cover_nursery
id: close_cover_nursery
triggers:
- trigger: sun
event: sunset
offset: 00:30:00
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: numeric_state
entity_id: sensor.dht22_terrace_temperature
below: input_number.rooflight_close_below_temp
- condition: state
entity_id: input_boolean.cover_nursery
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_kinderzimmer
state: 'off'
actions:
- action: cover.close_cover
target:
entity_id: cover.nursery
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_closed_at_low_temp
- alias: open_cover_nursery
id: open_cover_nursery
triggers:
- trigger: sun
event: sunrise
offset: -00:30:00
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.cover_closing_at_cold_activated
state: 'on'
- condition: state
entity_id: input_boolean.cover_nursery
state: 'on'
- condition: state
entity_id: binary_sensor.dachfenster_kinderzimmer
state: 'off'
- condition: state
entity_id: input_boolean.cover_closed_at_low_temp
state: 'on'
actions:
- action: cover.open_cover
target:
entity_id: cover.nursery
- alias: reset_close_at_low_temp_flag
id: reset_close_at_low_temp_flag
triggers:
- trigger: sun
event: sunrise
offset: 01:00:00
actions:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.cover_closed_at_low_temp
- alias: dishwasher_schedule
id: dishwasher_schedule
triggers:
- trigger: state
entity_id: binary_sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_doorstate
to: 'off'
conditions:
- condition: state
entity_id: input_boolean.dishwasher_activated
state: 'on'
- condition: state
entity_id: binary_sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_doorstate
state: 'off'
- condition: state
entity_id: sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_operationstate
state: BSH.Common.EnumType.OperationState.Ready
- condition: state
entity_id: binary_sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_remotecontrolactive
state: 'on'
- condition: state
entity_id: binary_sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_remotecontrolstartallowed
state: 'on'
actions:
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.dishwasher_start
data:
datetime: "{% set pv_this_hour = states ( 'sensor.solcast_pv_forecast_prognose_aktuelle_stunde'\
\ ) | float %} {% set pv_next_hour = states ( 'sensor.solcast_pv_forecast_prognose_nachste_stunde'\
\ ) | float %} {% set min_pv = states ( 'input_number.dishwasher_min_pv_generation'\
\ ) | float %} {% set peaktime_today = as_datetime ( states ( 'sensor.solcast_pv_forecast_zeitpunkt_spitzenleistung_heute'\
\ ) ) | as_local %} {% set peaktime_tomorrow = as_datetime ( states ( 'sensor.solcast_pv_forecast_zeitpunkt_spitzenleistung_morgen'\
\ ) ) | as_local %} {% if pv_this_hour > min_pv %}\n {{ today_at ( now\
\ ().strftime('%H:%M:%S') ) + timedelta ( seconds = 5 ) }}\n{% elif pv_next_hour\
\ > min_pv %}\n {{ today_at ( now ().strftime ( '%H:00:00' ) ) + timedelta\
\ ( hours = 1 ) }}\n{% else %}\n {% if peaktime_today > now () %}\n \
\ {{ peaktime_today }}\n {% else %}\n {{ peaktime_tomorrow }}\n\
\ {% endif %}\n{% endif %}\n"
- alias: dishwasher_start
id: dishwasher_start
triggers:
- trigger: time
at: input_datetime.dishwasher_start
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.dishwasher_activated
state: 'on'
- condition: state
entity_id: binary_sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_doorstate
state: 'off'
- condition: state
entity_id: sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_operationstate
state: BSH.Common.EnumType.OperationState.Ready
- condition: state
entity_id: binary_sensor.bosch_smv88tx16d_68a40e0c161c_bsh_common_status_remotecontrolactive
state: 'on'
actions:
- action: home_connect_alt.start_program
data:
device_id: '{{ device_id ( ''Geschirrspüler'' ) }}'
program_key: Dishcare.Dishwasher.Program.Quick65
- alias: display_pixelnode_preferences
id: display_pixelnode_preferences
triggers:
- trigger: homeassistant
event: start
- trigger: state
entity_id: input_boolean.pixel_node_time
- trigger: state
entity_id: input_boolean.pixel_node_date
- trigger: state
entity_id: input_boolean.pixel_node_weekday
- trigger: state
entity_id: input_number.pixel_node_display_duration
- trigger: state
entity_id: input_number.pixel_node_display_brightness
- trigger: state
entity_id: input_number.pixel_node_display_shakeperiod
- trigger: state
entity_id: input_boolean.pixel_node_msg0
- trigger: state
entity_id: input_boolean.pixel_node_msg1
- trigger: state
entity_id: input_boolean.pixel_node_msg2
- trigger: state
entity_id: input_boolean.pixel_node_msg3
- trigger: state
entity_id: input_boolean.pixel_node_msg4
- trigger: state
entity_id: input_boolean.pixel_node_msg5
- trigger: state
entity_id: input_boolean.pixel_node_msg6
- trigger: state
entity_id: input_boolean.pixel_node_msg7
- trigger: state
entity_id: input_boolean.pixel_node_msg8
- trigger: state
entity_id: input_boolean.pixel_node_msg9
- trigger: state
entity_id: input_boolean.pixel_node_msg10
- trigger: state
entity_id: input_boolean.pixel_node_msg11
- trigger: state
entity_id: input_boolean.pixel_node_msg12
- trigger: state
entity_id: input_boolean.pixel_node_msg13
- trigger: state
entity_id: input_boolean.pixel_node_msg14
- trigger: state
entity_id: input_boolean.pixel_node_msg15
- trigger: state
entity_id: input_boolean.pixel_node_msg16
- trigger: state
entity_id: input_boolean.pixel_node_msg17
- trigger: state
entity_id: input_boolean.pixel_node_msg18
- trigger: state
entity_id: input_boolean.pixel_node_msg19
actions:
- action: mqtt.publish
data:
topic: nodes@home/display/pixel/kitchen/command
payload: "{\n \"display\": {\n \"duration\": {{ states ( 'input_number.pixel_node_display_duration'\
\ ) | round ( 0 ) }},\n \"brightness\": {{ states ( 'input_number.pixel_node_display_brightness'\
\ ) | round ( 0 ) }},\n \"shakeperiod\": {{ states ( 'input_number.pixel_node_display_shakeperiod'\
\ ) | round ( 0 ) }},\n \"time\": \"{{ states ( 'input_boolean.pixel_node_time'\
\ ) }}\",\n \"date\": \"{{ states ( 'input_boolean.pixel_node_date'\
\ ) }}\",\n \"weekday\": \"{{ states ( 'input_boolean.pixel_node_weekday'\
\ ) }}\",\n \"enabled\": [\n \"{{ states ( 'input_boolean.pixel_node_msg0'\
\ ) }}\",\n \"{{ states ( 'input_boolean.pixel_node_msg1' ) }}\"\
,\n \"{{ states ( 'input_boolean.pixel_node_msg2' ) }}\",\n \
\ \"{{ states ( 'input_boolean.pixel_node_msg3' ) }}\",\n \
\ \"{{ states ( 'input_boolean.pixel_node_msg4' ) }}\",\n \"\
{{ states ( 'input_boolean.pixel_node_msg5' ) }}\",\n \"{{ states\
\ ( 'input_boolean.pixel_node_msg6' ) }}\",\n \"{{ states ( 'input_boolean.pixel_node_msg7'\
\ ) }}\",\n \"{{ states ( 'input_boolean.pixel_node_msg8' ) }}\"\
,\n \"{{ states ( 'input_boolean.pixel_node_msg9' ) }}\",\n \
\ \"{{ states ( 'input_boolean.pixel_node_msg10' ) }}\",\n \
\ \"{{ states ( 'input_boolean.pixel_node_msg11' ) }}\",\n \
\ \"{{ states ( 'input_boolean.pixel_node_msg12' ) }}\",\n \"{{\
\ states ( 'input_boolean.pixel_node_msg13' ) }}\",\n \"{{ states\
\ ( 'input_boolean.pixel_node_msg14' ) }}\",\n \"{{ states ( 'input_boolean.pixel_node_msg15'\
\ ) }}\",\n \"{{ states ( 'input_boolean.pixel_node_msg16' ) }}\"\
,\n \"{{ states ( 'input_boolean.pixel_node_msg17' ) }}\",\n \
\ \"{{ states ( 'input_boolean.pixel_node_msg18' ) }}\",\n \
\ \"{{ states ( 'input_boolean.pixel_node_msg19' ) }}\"\n ]\n\
\ }\n}"
qos: 0
retain: true
- alias: display_outdoor_temperature
id: display_show_outdoor_temperature
triggers:
- trigger: mqtt
topic: nodes@home/sensor/DHT22/terrace/value/temperature
actions:
- action: mqtt.publish
data:
topic: nodes@home/display/pixel/kitchen/message/temperature/outdoor
payload: "{\n \"messages\": [\n {\n \"line\": 0,\n \
\ \"text\": \" Außen: {{ trigger.payload_json.value }}°C\"\n \
\ }\n ]\n}"
qos: 0
retain: true
- alias: display_show_temperature
id: display_show_indoor_temperature
triggers:
- trigger: mqtt
topic: nodes@home/sensor/DHT22/lounge/value/temperature
actions:
- action: mqtt.publish
data:
topic: nodes@home/display/pixel/kitchen/message/temperature/indoor
payload: "{\n \"messages\": [\n {\n \"line\": 1,\n \
\ \"text\": \" Innen: {{ trigger.payload_json.value }}°C\"\n \
\ }\n ]\n}"
qos: 0
retain: true
- alias: display_show_pool_temperature
id: display_show_pool_temperature
triggers:
- trigger: mqtt
topic: nodes@home/sensor/ds18b20/pool/value/temperature
actions:
- action: mqtt.publish
data:
topic: nodes@home/display/pixel/kitchen/message/temperature/pool
payload: "{\n \"messages\": [\n {\n \"line\": 12,\n \
\ \"text\": \" Pool: {{ trigger.payload_json.value | round ( 1 ) }}°C\"\
\n }\n ]\n}"
qos: 0
retain: true
- alias: garage_open_cover
id: garage_open_cover
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Garage auf
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: cover.relay_garage
state: closed
actions:
- action: cover.open_cover
target:
entity_id: cover.relay_garage
- alias: garage_close_cover
id: garage_close_cover
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Garage zu
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: cover.relay_garage
state: open
actions:
- action: cover.close_cover
target:
entity_id: cover.relay_garage
- alias: garage__bosch_powerstation_shutdown_after_inactivity
id: garage_bosch_powerstation_shutdown_after_inactivity
triggers:
- trigger: numeric_state
entity_id: sensor.bosch_ladestation_power
below: input_number.bosch_powerstation_low_power_threshold
for:
minutes: '{{ states ( ''input_number.bosch_powerstation_low_power_duration''
) | int }}'
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_off
target:
entity_id: switch.bosch_ladestation
- alias: garage_unlock_ev6
id: garage_unlock_ev6
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Auto auf
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: device_tracker.ev6_location
state: Zuhause
actions:
- action: kia_uvo.unlock
data:
device_id: '{{ device_id ( ''EV6'' ) }}'
- alias: garage_lock_ev6
id: garage_lock_ev6
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Auto zu
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: device_tracker.ev6_location
state: Zuhause
actions:
- action: kia_uvo.lock
data:
device_id: '{{ device_id ( ''EV6'' ) }}'
- alias: garage_climate_ev6
id: garage_climate_ev6
triggers:
- trigger: state
entity_id: input_button.kia_ev6_climate
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Auto klimatisieren
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: device_tracker.ev6_location
state: Zuhause
actions:
- action: kia_uvo.schedule_charging_and_climate
data:
climate_enabled: true
temperature: '{{ states ( ''input_number.ev6_climate_temperature'' ) | int }}'
temperature_unit: '0'
device_id: '{{ device_id ( ''EV6'' ) }}'
- alias: garden_irrigation_off
id: garden_irrigation_off
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Wasser aus
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_off
target:
entity_id:
- switch.relay_garden_valve1
- switch.relay_garden_valve2
- switch.relay_garden_valve3
- switch.relay_garden2_valve1
- switch.relay_garden2_valve2
- switch.relay_garden2_valve3
- alias: garden_irrigation_on
id: garden_irrigation_on
mode: parallel
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Hecke bewässern
variables:
valve_no: 1
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Hochbeete bewässern
variables:
valve_no: 2
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Rosengarten bewässern
variables:
valve_no: 3
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_on
target:
entity_id: switch.relay_garden{{ 2 if valve_no > 3 else '' }}_valve{{ ( valve_no
- 1 ) % 3 + 1 }}
- alias: garden_irrigation_valve_start
id: garden_irrigation_valve_start
mode: parallel
triggers:
- trigger: time
at:
- input_datetime.irrigation_start_1
- input_datetime.irrigation_start_2
- input_datetime.irrigation_start_3
- input_datetime.irrigation_start_4
- input_datetime.irrigation_start_5
- input_datetime.irrigation_start_6
variables:
valve_no: '{{ trigger.entity_id [32:] }}'
conditions:
- condition: state
entity_id: input_boolean.irrigation_activated
state: 'on'
- condition: template
value_template: "{% set n = valve_no | string %} {% set day = now().weekday()\
\ %} {{\n states ( 'input_boolean.irrigation_scheduled_valve' + n ) == 'on'\
\ and\n (\n day == 0 and states ( 'input_boolean.irrigation_valve'\
\ + n + '_at_monday' ) == 'on' or\n day == 1 and states ( 'input_boolean.irrigation_valve'\
\ + n + '_at_tuesday' ) == 'on' or\n day == 2 and states ( 'input_boolean.irrigation_valve'\
\ + n + '_at_wednesday' ) == 'on' or\n day == 3 and states ( 'input_boolean.irrigation_valve'\
\ + n + '_at_thursday' ) == 'on' or\n day == 4 and states ( 'input_boolean.irrigation_valve'\
\ + n + '_at_friday' ) == 'on' or\n day == 5 and states ( 'input_boolean.irrigation_valve'\
\ + n + '_at_saturday' ) == 'on' or\n day == 6 and states ( 'input_boolean.irrigation_valve'\
\ + n + '_at_sunday' ) == 'on'\n )\n}}\n"
actions:
- variables:
duration: '{{ states ( ''sensor.irrigation_duration_effective_valve'' + valve_no
| string ) }}'
- action: timer.start
target:
entity_id: timer.irrigation_valve{{ valve_no }}
data:
duration: '{{ ( duration / 60 ) | int }}:{{ duration % 60 }}:00'
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- action: switch.turn_on
target:
entity_id: switch.relay_garden{{ 2 if valve_no > 3 else '' }}_valve{{ ( valve_no
- 1 ) % 3 + 1 }}
- alias: garden_irrigation_valve_stop
id: garden_irrigation_valve_stop
mode: parallel
triggers:
- trigger: event
event_type:
- timer.finished
event_data:
entity_id: timer.irrigation_valve1
- trigger: event
event_type:
- timer.finished
event_data:
entity_id: timer.irrigation_valve2
- trigger: event
event_type:
- timer.finished
event_data:
entity_id: timer.irrigation_valve3
- trigger: event
event_type:
- timer.finished
event_data:
entity_id: timer.irrigation_valve4
- trigger: event
event_type:
- timer.finished
event_data:
entity_id: timer.irrigation_valve5
- trigger: event
event_type:
- timer.finished
event_data:
entity_id: timer.irrigation_valve6
actions:
- variables:
valve_no: '{{ trigger.event.data.entity_id [22:] }}'
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- action: switch.turn_off
target:
entity_id: switch.relay_garden{{ 2 if valve_no > 3 else '' }}_valve{{ ( valve_no
- 1 ) % 3 + 1 }}
- alias: garden_irrigation_schedule
id: garden_irrigation_schedule
triggers:
- trigger: state
entity_id: input_boolean.irrigation_activated
- trigger: state
entity_id: sensor.precipitation_7d_plus_forecast
- trigger: state
entity_id: input_number.irrigation_precipitation_threshold
- trigger: state
entity_id: sensor.dht22_terrace_temperature_max
- trigger: state
entity_id: input_number.irrigation_temperature_threshold_low
actions:
- variables:
mode: "{% set val = states ( 'sensor.precipitation_7d_plus_forecast' ) | float\
\ %} {% set thr = states ( 'input_number.irrigation_precipitation_threshold'\
\ ) | float %} {% set t_max = states ( 'sensor.dht22_terrace_temperature_max'\
\ ) | float %} {% set t_thr_low = states ( 'input_number.irrigation_temperature_threshold_low'\
\ ) | float %} {% if val < thr and t_max >= t_thr_low %}\n on\n{% else\
\ %}\n off\n{% endif %}\n"
- repeat:
count: 6
sequence:
- action: input_boolean.turn_{{ mode }}
target:
entity_id: input_boolean.irrigation_scheduled_valve{{ repeat.index }}
- alias: garden_irrigation_set_temperature_thresholds_by_low
id: garden_irrigation_set_temperature_thresholds_by_low
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: input_number.irrigation_temperature_threshold_low
actions:
- variables:
temp_high_new: '{% set temp_low = states ( ''input_number.irrigation_temperature_threshold_low''
) | int %} {% set temp_high = states ( ''input_number.irrigation_temperature_threshold_high''
) | int %} {{ max ( [temp_low, temp_high] ) }}
'
temp_hot_new: '{% set temp_low = states ( ''input_number.irrigation_temperature_threshold_low''
) | int %} {% set temp_hot = states ( ''input_number.irrigation_temperature_threshold_hot''
) | int %} {{ max ( [temp_low, temp_hot] ) }}
'
- action: input_number.set_value
target:
entity_id: input_number.irrigation_temperature_threshold_high
data:
value: '{{ temp_high_new }}'
- action: input_number.set_value
target:
entity_id: input_number.irrigation_temperature_threshold_hot
data:
value: '{{ temp_hot_new }}'
- alias: garden_irrigation_set_temperature_thresholds_by_high
id: garden_irrigation_set_temperature_thresholds_by_high
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: input_number.irrigation_temperature_threshold_high
actions:
- variables:
temp_low_new: '{% set temp_low = states ( ''input_number.irrigation_temperature_threshold_low''
) | int %} {% set temp_high = states ( ''input_number.irrigation_temperature_threshold_high''
) | int %} {{ min ( [temp_low, temp_high] ) }}
'
temp_hot_new: '{% set temp_high = states ( ''input_number.irrigation_temperature_threshold_high''
) | int %} {% set temp_hot = states ( ''input_number.irrigation_temperature_threshold_hot''
) | int %} {{ max ( [temp_high, temp_hot] ) }}
'
- action: input_number.set_value
target:
entity_id: input_number.irrigation_temperature_threshold_low
data:
value: '{{ temp_low_new }}'
- action: input_number.set_value
target:
entity_id: input_number.irrigation_temperature_threshold_hot
data:
value: '{{ temp_hot_new }}'
- alias: garden_irrigation_set_temperature_thresholds_by_hot
id: garden_irrigation_set_temperature_thresholds_by_hot
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: input_number.irrigation_temperature_threshold_hot
actions:
- variables:
temp_low_new: '{% set temp_low = states ( ''input_number.irrigation_temperature_threshold_low''
) | int %} {% set temp_hot = states ( ''input_number.irrigation_temperature_threshold_hot''
) | int %} {{ min ( [temp_low, temp_hot] ) }}
'
temp_high_new: '{% set temp_high = states ( ''input_number.irrigation_temperature_threshold_high''
) | int %} {% set temp_hot = states ( ''input_number.irrigation_temperature_threshold_hot''
) | int %} {{ min ( [temp_high, temp_hot] ) }}
'
- action: input_number.set_value
target:
entity_id: input_number.irrigation_temperature_threshold_low
data:
value: '{{ temp_low_new }}'
- action: input_number.set_value
target:
entity_id: input_number.irrigation_temperature_threshold_high
data:
value: '{{ temp_high_new }}'
- alias: garden_hydrotower_pump_switching
id: garden_hydrotower_pump_switching
triggers:
- trigger: time_pattern
minutes: /1
conditions:
- condition: state
entity_id: input_boolean.hydrotower_activated
state: 'on'
- condition: state
entity_id: timer.hydrotower_pump_period
state: idle
actions:
- action: timer.start
target:
entity_id: timer.hydrotower_pump_period
data:
duration: '{{ ( states ( ''input_number.hydrotower_pump_period'' ) | int / 60
) | int }}:{{ states ( ''input_number.hydrotower_pump_period'' ) | int % 60
}}:0'
- alias: garden_hydrotower_pump_start
id: garden_hydrotower_pump_start
triggers:
- trigger: event
event_type: timer.started
event_data:
entity_id: timer.hydrotower_pump_period
- trigger: state
entity_id: switch.relay_hydrotower_pump
to: 'on'
actions:
- action: timer.start
target:
entity_id: timer.hydrotower_pump_duration
data:
duration: '{{ ( states ( ''input_number.hydrotower_pump_duration'' ) | int /
60 ) | int }}:{{ states ( ''input_number.hydrotower_pump_duration'' ) | int
% 60 }}:0'
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- action: switch.turn_on
target:
entity_id: switch.relay_hydrotower_pump
- alias: garden_hydrotower_pump_stop
id: garden_hydrotower_pump_stop
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.hydrotower_pump_duration
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_off
target:
entity_id: switch.relay_hydrotower_pump
- alias: garden_pool_pump_switching
id: garden_pool_pump_switching
triggers:
- trigger: time_pattern
minutes: /1
conditions:
- condition: state
entity_id: input_boolean.pool_pump_activated
state: 'on'
- condition: state
entity_id: timer.pool_pump_period
state: idle
- condition: time
after: input_datetime.pool_pump_start
before: input_datetime.pool_pump_end
actions:
- action: timer.start
target:
entity_id: timer.pool_pump_period
data:
duration: '{{ ( states ( ''sensor.pool_pump_period_length'' ) | int / 60 ) |
int }}:{{ states ( ''sensor.pool_pump_period_length'' ) | int % 60 }}:0'
- alias: garden_pool_pump_start
id: garden_pool_pump_start
triggers:
- trigger: event
event_type: timer.started
event_data:
entity_id: timer.pool_pump_period
- trigger: state
entity_id: switch.poolpumpe
to: 'on'
actions:
- action: timer.start
target:
entity_id: timer.pool_pump_duration
data:
duration: '{{ ( states ( ''input_number.pool_pump_duration_period'' ) | int
/ 60 ) | int }}:{{ states ( ''input_number.pool_pump_duration_period'' ) |
int % 60 }}:0'
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- action: switch.turn_on
target:
entity_id: switch.poolpumpe
- alias: garden_pool_pump_stop
id: garden_pool_pump_stop
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.pool_pump_duration
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_off
target:
entity_id: switch.poolpumpe
- alias: garden_waterpump_emergency_stop
id: garden_waterpump_emegency_stop
triggers:
- trigger: template
value_template: '{{ states ( ''sensor.wasserpumpe_power'' ) | int > states ( ''input_number.waterpump_emergency_stop_power_threshold''
) | int }}'
for:
minutes: '{{ states ( ''input_number.waterpump_emergency_stop_duration'' ) |
int }}'
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: notify.simplepush
data:
message: Notfallstop Wasserpumpe mit Leistung größer {{ states ( 'input_number.waterpump_emergency_stop_power_threshold'
) | int }} für {{ states ( 'input_number.waterpump_emergency_stop_duration'
) | int }} Minuten.
title: Home Assistant ({{ states ( 'input_text.hostname' ) | lower }})
- action: switch.turn_off
target:
entity_id: switch.wasserpumpe
- alias: garden_mower_start
id: garden_mower_start
triggers:
- trigger: time
at: input_datetime.mowing_start
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.mowing_activated
state: 'on'
- condition: template
value_template: "{% set day = now().weekday() %} {{\n day == 0 and states (\
\ 'input_boolean.mowing_at_monday' ) == 'on' or\n day == 1 and states (\
\ 'input_boolean.mowing_at_tuesday' ) == 'on' or\n day == 2 and states (\
\ 'input_boolean.mowing_at_wednesday' ) == 'on' or\n day == 3 and states (\
\ 'input_boolean.mowing_at_thursday' ) == 'on' or\n day == 4 and states (\
\ 'input_boolean.mowing_at_friday' ) == 'on' or\n day == 5 and states (\
\ 'input_boolean.mowing_at_saturday' ) == 'on' or\n day == 6 and states (\
\ 'input_boolean.mowing_at_sunday' ) == 'on'\n}}\n"
actions:
- action: gardena_smart_system.start_override
target:
entity_id: lawn_mower.sileno
data:
duration: '{{ ( as_timestamp ( today_at ( states ( ''input_datetime.mowing_end''
) ) ) - as_timestamp ( today_at ( states ( ''input_datetime.mowing_start''
) ) ) ) | int }}'
- alias: garden_mower_end
id: garden_mower_end
triggers:
- trigger: time
at: input_datetime.mowing_end
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
action:
- action: lawn_mower.pause
target:
entity_id: lawn_mower.sileno
- alias: gas_meter_send_threshold_high
id: gas_meter_send_threshold_high
triggers:
- trigger: state
entity_id: input_number.gas_meter_threshold_high
actions:
- action: mqtt.publish
data:
topic: nodes@home/sensor/magnetic/utilityroom/service/threshold_high
payload_template: '{{ states ( ''input_number.gas_meter_threshold_high'' ) }}'
qos: 1
retain: true
- alias: gas_meter_send_threshold_low
id: gas_meter_send_threshold_low
triggers:
- trigger: state
entity_id: input_number.gas_meter_threshold_low
actions:
- action: mqtt.publish
data:
topic: nodes@home/sensor/magnetic/utilityroom/service/threshold_low
payload_template: '{{ states ( ''input_number.gas_meter_threshold_low'' ) }}'
qos: 1
retain: true
- alias: gas_meter_send_delay
id: gas_meter_send_delay
triggers:
- trigger: state
entity_id: input_number.gas_meter_delay
actions:
- action: mqtt.publish
data:
topic: nodes@home/sensor/magnetic/utilityroom/service/delay
payload_template: '{{ states ( ''input_number.gas_meter_delay'' ) }}'
qos: 1
retain: true
- alias: heating_mode
id: heating_mode
trigger:
- platform: state
entity_id: select.thermostat_hc1_mode
condition:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
action:
- repeat:
for_each:
- arbeitszimmer
- bad
- dusche
- esszimmer
- flur
- galerie
- kinderzimmer
- kuche
- schlafzimmer
- wohnzimmer
- hauswirtschaftsraum
sequence:
- choose:
- conditions:
- condition: template
value_template: '{{ is_state ( ''select.thermostat_hc1_mode'', ''nofrost''
) }}'
sequence:
- service: climate.turn_off
target:
entity_id: climate.room_climate_{{ repeat.item }}
- conditions:
- condition: template
value_template: '{{ is_state ( ''select.thermostat_hc1_mode'', ''eco''
) }}'
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.room_climate_{{ repeat.item }}
data:
hvac_mode: heat
- service: climate.set_preset_mode
target:
entity_id: climate.room_climate_{{ repeat.item }}
data:
preset_mode: eco
- conditions:
- condition: template
value_template: '{{ is_state ( ''select.thermostat_hc1_mode'', ''heat''
) or is_state ( ''select.thermostat_hc1_mode'', ''auto'' ) }}'
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.room_climate_{{ repeat.item }}
data:
hvac_mode: heat
- service: climate.set_temperature
target:
entity_id: climate.room_climate_{{ repeat.item }}
data:
temperature: '{{ states ( ''input_number.heating_templevel_'' + states
( ''input_select.heating_templevel_'' + repeat.item ) ) }}'
- alias: heating_update_room
id: heating_update_room
trigger:
- platform: state
entity_id: input_select.heating_templevel_arbeitszimmer
- platform: state
entity_id: input_select.heating_templevel_bad
- platform: state
entity_id: input_select.heating_templevel_dusche
- platform: state
entity_id: input_select.heating_templevel_esszimmer
- platform: state
entity_id: input_select.heating_templevel_flur
- platform: state
entity_id: input_select.heating_templevel_galerie
- platform: state
entity_id: input_select.heating_templevel_kinderzimmer
- platform: state
entity_id: input_select.heating_templevel_kuche
- platform: state
entity_id: input_select.heating_templevel_schlafzimmer
- platform: state
entity_id: input_select.heating_templevel_wohnzimmer
- platform: state
entity_id: input_select.heating_templevel_hauswirtschaftsraum
condition:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
action:
- service: climate.set_temperature
target:
entity_id: climate.room_climate_{{ trigger.entity_id.split ( '_' ) [3] }}
data:
temperature: '{{ states ( ''input_number.heating_templevel_'' + states ( ''input_select.heating_templevel_''
+ trigger.entity_id.split ( ''_'' ) [3] ) ) }}'
- alias: heating_update_templevel
id: heating_update_templevel
trigger:
- platform: state
entity_id: input_number.heating_templevel_low
- platform: state
entity_id: input_number.heating_templevel_standard
- platform: state
entity_id: input_number.heating_templevel_comfort
condition:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
action:
- variables:
level: '{{ trigger.entity_id.split ( ''_'' ) [3] }}'
- repeat:
for_each:
- arbeitszimmer
- bad
- dusche
- esszimmer
- flur
- galerie
- kinderzimmer
- kuche
- schlafzimmer
- wohnzimmer
- hauswirtschaftsraum
sequence:
- if:
- condition: template
value_template: '{{ is_state ( ''input_select.heating_templevel_'' + repeat.item,
level ) }}'
then:
- service: climate.set_temperature
target:
entity_id: climate.room_climate_{{ repeat.item }}
data:
temperature: '{{ states ( ''input_number.heating_templevel_'' + level
) }}'
- alias: circulating_pump_set_datetimes
id: circulating_pump_set_datetimes
trigger:
- platform: state
entity_id: input_datetime.standup_workday
- platform: state
entity_id: input_datetime.sleep
- platform: state
entity_id: input_datetime.standup_weekend
- platform: state
entity_id: input_number.circulating_pump_schedule_after_standup
- platform: state
entity_id: input_number.circulating_pump_schedule_before_sleeping
- platform: homeassistant
event: start
- platform: event
event_type:
- automation_reloaded
condition: null
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.circulating_pump_scheduling_after_standup_workday
data:
time: '{{ states ( ''input_datetime.standup_workday'' ) | as_timedelta + timedelta
( hours = states ( ''input_number.circulating_pump_schedule_after_standup''
) | int ) }}'
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.circulating_pump_scheduling_after_standup_weekend
data:
time: '{{ states ( ''input_datetime.standup_weekend'' ) | as_timedelta + timedelta
( hours = states ( ''input_number.circulating_pump_schedule_after_standup''
) | int ) }}'
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.circulating_pump_scheduling_before_sleeping
data:
time: '{{ states ( ''input_datetime.sleep'' ) | as_timedelta - timedelta ( hours
= states ( ''input_number.circulating_pump_schedule_before_sleeping'' ) |
int ) }}'
- alias: circulating_pump_start_scheduling
id: circulating_pump_start_scheduling
trigger:
- platform: time
at: input_datetime.standup_workday
- platform: time
at: input_datetime.standup_weekend
- platform: state
entity_id: group.family
to: home
- platform: time
at: input_datetime.circulating_pump_scheduling_before_sleeping
condition:
- condition: state
entity_id: group.family
state: home
- condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: input_datetime.standup_workday
before: input_datetime.circulating_pump_scheduling_after_standup_workday
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
- condition: time
after: input_datetime.standup_weekend
before: input_datetime.circulating_pump_scheduling_after_standup_weekend
- condition: time
after: input_datetime.circulating_pump_scheduling_before_sleeping
before: input_datetime.sleep
action:
- service: input_boolean.turn_on
entity_id: input_boolean.circulating_pump_scheduled
- alias: circulating_pump_stop_scheduling
id: circulating_pump_stop_scheduling
trigger:
- platform: time
at: input_datetime.sleep
- platform: state
entity_id: group.family
to: not_home
- platform: state
entity_id: remote.sony_kd_55ag9
from: 'on'
to: 'off'
for:
minutes: '{{ states ( ''input_number.tvoff_lightsoff_delay1'' ) | int }}'
condition: null
action:
- service: input_boolean.turn_off
entity_id: input_boolean.circulating_pump_scheduled
- alias: circulating_pump_stop_scheduling_after_standup_workday
id: circulating_pump_stop_scheduling_after_standup_workday
trigger:
- platform: time
at: input_datetime.circulating_pump_scheduling_after_standup_workday
condition:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
action:
- service: input_boolean.turn_off
entity_id: input_boolean.circulating_pump_scheduled
- alias: circulating_pump_stop_scheduling_after_standup_weekend
id: circulating_pump_stop_scheduling_after_standup_weekend
trigger:
- platform: time
at: input_datetime.circulating_pump_scheduling_after_standup_weekend
condition:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
action:
- service: input_boolean.turn_off
entity_id: input_boolean.circulating_pump_scheduled
- alias: circulating_pump_switching
id: circulating_pump_switching
trigger:
- platform: time_pattern
minutes: /1
condition:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: template
value_template: '{% set t = now () %} {{ ( t.hour * 60 + t.minute ) % states (
''input_number.circulating_pump_on_period'' ) | int == 0 }}
'
- condition: state
entity_id: input_boolean.circulating_pump_activated
state: 'on'
- condition: state
entity_id: input_boolean.circulating_pump_scheduled
state: 'on'
action:
- service: switch.turn_on
entity_id:
- switch.shelly_utilityroom_circulatingpump
- delay:
minutes: '{{ states ( ''input_number.circulating_pump_on_duration'' ) | int
}}'
- service: switch.turn_off
entity_id:
- switch.shelly_utilityroom_circulatingpump
- alias: circulating_pump_running_disinfection
id: circulating_pump_running_disinfection
trigger:
- platform: state
entity_id: input_number.circulating_pump_running_above_temp
- platform: state
entity_id: sensor.boiler_dhw_curtemp
- platform: state
entity_id: switch.shelly_utilityroom_circulatingpump
- platform: state
entity_id: input_boolean.circulating_pump_running_disinfection
condition:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
action:
- choose:
- conditions:
- condition: template
value_template: '{{ states ( ''switch.shelly_utilityroom_circulatingpump''
) == ''off'' and states ( ''sensor.boiler_dhw_curtemp'' ) | float >= states
( ''input_number.circulating_pump_running_above_temp'' ) | float }}'
sequence:
- service: switch.turn_on
entity_id:
- switch.shelly_utilityroom_circulatingpump
- service: input_boolean.turn_on
entity_id:
- input_boolean.circulating_pump_running_disinfection
- conditions:
- condition: template
value_template: '{{ states ( ''input_boolean.circulating_pump_running_disinfection''
) == ''on'' and states ( ''sensor.boiler_dhw_curtemp'' ) | float < states
( ''input_number.circulating_pump_running_above_temp'' ) | float }}'
sequence:
- service: switch.turn_off
entity_id:
- switch.shelly_utilityroom_circulatingpump
- service: input_boolean.turn_off
entity_id:
- input_boolean.circulating_pump_running_disinfection
- alias: heating_update_remote_thermostat
id: heating_update_remote_thermostat
triggers:
- trigger: time_pattern
minutes: /1
- trigger: state
entity_id: select.thermostat_hc1_control
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- if:
- condition: template
value_template: '{{ states ( ''select.thermostat_hc1_control'') == ''off'' }}'
then:
- if:
- condition: numeric_state
entity_id: number.thermostat_hc1_room_temperature_from_remote
above: -1
then:
- action: number.set_value
target:
entity_id: number.thermostat_hc1_room_temperature_from_remote
data:
value: -1
else:
- action: number.set_value
target:
entity_id: number.thermostat_hc1_room_temperature_from_remote
data:
value: '{{ state_attr ( ''climate.room_climate_'' + states ( ''input_select.heating_leading_room_remote_thermostat''
) | lower, ''current_temperature'' ) }}'
- alias: lights_send_effect_delay
id: lights_send_effect_delay
triggers:
trigger: state
entity_id: input_number.effect_delay
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: mqtt.publish
data:
topic: nodes@home/light/ws2812/terrace1/service/set
payload: '{"delay":{{ trigger.to_state.state | int }}}'
qos: 0
retain: false
- action: mqtt.publish
data:
topic: nodes@home/light/ws2812/terrace2/service/set
payload: '{"delay":{{ trigger.to_state.state | int }}}'
qos: 0
retain: false
- action: mqtt.publish
data:
topic: nodes@home/light/ws2812/office/service/set
payload: '{"delay":{{ trigger.to_state.state | int }}}'
qos: 0
retain: false
- alias: lights_indoor_on_at_coming_home_or_sunset
id: lights_indoor_on_at_coming_home_or_sunset
triggers:
- trigger: state
entity_id: group.family
to: home
- trigger: sun
event: sunset
offset: 00:00:00
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Licht an
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: sun
after: sunset
after_offset: 00:00:00
- condition: time
before: input_datetime.sleep
- condition: or
conditions:
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: input_boolean.light_simulation
state: 'on'
actions:
- action: homeassistant.turn_on
target:
entity_id:
- light.automatic_indoor_lights_immediatly_switched_off
- light.automatic_indoor_lights_delayed_switched_off
- alias: lights_indoor_by_night_on_at_coming_home
id: lights_indoor_by_night_on_at_coming_home
triggers:
- trigger: state
entity_id: group.family
to: home
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Licht an
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: sun
after: sunset
after_offset: 00:00:00
- condition: time
after: input_datetime.sleep
before: input_datetime.nightlight_end
- condition: state
entity_id: group.family
state: home
actions:
- action: homeassistant.turn_on
target:
entity_id: light.automatic_indoor_lights_by_night
- delay:
minutes: '{{ states ( ''input_number.nightlight_duration'' ) | int }}'
- action: homeassistant.turn_off
target:
entity_id: light.automatic_indoor_lights_by_night
- alias: lights_indoor_off_at_getting_out_or_sunrise
id: lights_indoor_off_at_getting_out_or_sunrise
triggers:
- trigger: state
entity_id: group.family
to: not_home
for:
minutes: 1
- trigger: sun
event: sunrise
offset: +00:00:00
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Licht aus
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: scene.turn_on
target:
entity_id: scene.kitchen_background_light
- service: homeassistant.turn_off
target:
entity_id:
- light.automatic_indoor_lights_immediatly_switched_off
- light.automatic_indoor_lights_delayed_switched_off
- light.automatic_indoor_lights_immediatly_switched_off_extra
- light.automatic_indoor_lights_delayed_switched_off_extra
- light.automatic_indoor_lights_sunrise_switched_off_extra
- alias: lights_indoor_off_when_tv_switched_off
id: lights_indoor_off_when_tv_switched_off
triggers:
trigger: state
entity_id: remote.sony_kd_55ag9
from: 'on'
to: 'off'
for:
minutes: 1
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: time
after: input_datetime.tv_off_period_start
before: input_datetime.tv_off_period_end
actions:
- delay:
minutes: '{{ states ( ''input_number.tvoff_lightsoff_delay1'' ) | int - 1 }}'
- action: scene.turn_on
target:
entity_id: scene.kitchen_background_light
- action: homeassistant.turn_off
target:
entity_id:
- light.automatic_indoor_lights_immediatly_switched_off
- light.automatic_indoor_lights_immediatly_switched_off_extra
- delay:
minutes: '{{ ( states ( ''input_number.tvoff_lightsoff_delay2'' ) | int - states
( ''input_number.tvoff_lightsoff_delay1'' ) | int ) }}'
- action: homeassistant.turn_off
target:
entity_id:
- light.automatic_indoor_lights_delayed_switched_off
- light.automatic_indoor_lights_delayed_switched_off_extra
- switch.fernseher
- alias: lights_indoor_off_after_random_delay
id: lights_indoor_off_after_random_delay
triggers:
- trigger: time
at: input_datetime.sleep
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.light_simulation
state: 'on'
actions:
- delay:
minutes: '{{ range ( 0, states ( ''input_number.max_random_off_duration'' )
| int ) | random | int }}'
- action: scene.turn_on
target:
entity_id: scene.kitchen_background_light
- action: homeassistant.turn_off
target:
entity_id:
- light.automatic_indoor_lights_immediatly_switched_off
- light.automatic_indoor_lights_delayed_switched_off
- light.automatic_indoor_lights_immediatly_switched_off_extra
- light.automatic_indoor_lights_delayed_switched_off_extra
- alias: lights_indoor_simulation_off_at_coming_home
id: lights_indoor_simulation_off_at_coming_home
triggers:
- trigger: state
entity_id: group.family
to: home
conditions:
- condition: state
entity_id: input_boolean.light_simulation
state: 'on'
actions:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.light_simulation
- alias: lights_indoor_attic_light_toggle
id: lights_indoor_attic_light_toggle
triggers:
- trigger: state
entity_id: binary_sensor.dachboden
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: light.turn_{{ 'on' if trigger.to_state.state == 'on' else 'off' }}
target:
entity_id: light.shelly_dachboden
- alias: lights_indoor_off_after_timeout
id: lights_indoor_off_after_timeout
triggers:
- trigger: state
entity_id:
- light.deckenlicht_bad
- light.deckenlicht_dusche
- light.shelly_treppe
- light.shelly_flur
- light.shelly_korridor
to: 'on'
for:
minutes: '{{ states ( ''input_number.light_timeout'' ) | int }}'
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: sun.sun
state: above_horizon
actions:
- action: light.turn_off
target:
entity_id: '{{ trigger.entity_id }}'
- alias: lights_indoor_ikea_jetstrom
id: lights_indoor_ikea_jetstrom
triggers:
- platform: state
entity_id:
- binary_sensor.shelly_bad_input_0
- binary_sensor.shelly_dusche_input_0
variables:
room: '{{ trigger.entity_id.split ( ''_'' ) [2] }}'
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: light.turn_{{ 'on' if trigger.to_state.state == 'on' else 'off' }}
target:
entity_id: light.deckenlicht_{{ room }}
- alias: lights_indoor_hall_on_at_opening_door
id: lights_indoor_lights_on_at_opening_door
triggers:
- platform: state
entity_id: binary_sensor.eingangstur
to: 'on'
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: sun.sun
state: below_horizon
actions:
- action: light.turn_on
target:
entity_id: light.shelly_flur
- alias: lights_bedroom_toggle
id: lights_bedroom_toggle
triggers:
- trigger: state
entity_id: binary_sensor.ttp223_bedroom_touch1
to: 'on'
- trigger: state
entity_id: binary_sensor.ttp223_bedroom_touch2
to: 'on'
- trigger: state
entity_id: binary_sensor.ttp223_bedroom_touch3
to: 'on'
- trigger: state
entity_id: binary_sensor.ttp223_bedroom_touch4
to: 'on'
conditions:
- condition: state
entity_id: input_boolean.touch_bedroom_activated
state: 'on'
actions:
- action: light.toggle
target:
entity_id:
- light.sonoff_bedroom_socket
- alias: lights_kitchen_desk_toggle
id: lights_kitchen_desk_toggle
triggers:
- trigger: state
entity_id: binary_sensor.gesture_kitchen
to: 'on'
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.gesture_kitchen_activated
state: 'on'
actions:
- if:
- condition: or
conditions:
- condition: state
entity_id: light.led_kitchen_led
state: 'off'
- condition: and
conditions:
- condition: state
entity_id: light.led_kitchen_led
state: 'on'
- condition: template
value_template: '{{ states.light.led_kitchen_led.attributes.color_temp ==
500 }}'
then:
- action: scene.turn_on
target:
entity_id: scene.kitchen_full_light
else:
- action: scene.turn_on
target:
entity_id: scene.kitchen_background_light
- if:
- condition: state
entity_id: light.shelly_esszimmerschrank2
state: 'on'
alias: check for night lights switched on
then: null
else:
- action: light.turn_off
target:
entity_id: light.led_kitchen_led
- alias: lights_kitchen_desk_on_by_motion
id: lights_kitchen_desk_on_by_motion
triggers:
- trigger: state
entity_id: binary_sensor.bewegungsmelder1
to: 'on'
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.gesture_kitchen_activated
state: 'on'
- condition: numeric_state
entity_id: sensor.bewegungsmelder1_illuminance
below: input_number.kitchen_desk_illuminance_threshold
actions:
- action: scene.turn_on
target:
entity_id: scene.kitchen_full_light
- alias: lights_kitchen_desk_off_by_motion
id: lights_kitchen_desk_off_by_motion
triggers:
- trigger: state
entity_id: binary_sensor.bewegungsmelder1
to: 'off'
conditions:
- condition: state
entity_id: input_boolean.gesture_kitchen_activated
state: 'on'
actions:
- action: scene.turn_on
target:
entity_id: scene.kitchen_background_light
- if:
- condition: state
entity_id: light.shelly_esszimmerschrank2
state: 'on'
alias: check for night lights switched on
then: null
else:
- action: light.turn_off
target:
entity_id: light.led_kitchen_led
- alias: lights_outdoor_on_at_night
id: lights_outdoor_on_at_night
triggers:
- trigger: sun
event: sunset
offset: 00:00:00
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Außenlichter an
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: light.turn_on
target:
entity_id:
- light.automatic_outdoor_lights
- alias: lights_outdoor_off_at_morning
id: lights_outdoor_off_at_morning
triggers:
- trigger: sun
event: sunrise
offset: +00:00:00
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Außenlichter an
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: light.turn_off
target:
entity_id:
- light.automatic_outdoor_lights
- alias: light_indoor_ikea_jetstrom_set_sunrise
id: light_indoor_ikea_jetstrom_set_sunrise
triggers:
- trigger: time
at: 01:00:00
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- if:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
then:
- action: adaptive_lighting.change_switch_settings
data:
entity_id: switch.adaptive_lighting_ikea_jetstrom
use_defaults: configuration
max_sunrise_time: '{{ states ( ''input_datetime.standup_workday'' ) }}'
else:
- action: adaptive_lighting.change_switch_settings
data:
entity_id: switch.adaptive_lighting_ikea_jetstrom
use_defaults: configuration
- alias: locks_open_entry_door
id: locks_open_entry_door
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Eingangstür auf
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: binary_sensor.eingangstur
state: 'off'
actions:
- action: lock.open
target:
entity_id: lock.eingangstur
- alias: locks_open_garage_door
id: locks_open_garage_door
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Garagentür auf
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: binary_sensor.garagentur
state: 'off'
actions:
- action: lock.open
target:
entity_id: lock.garagentur
- delay:
seconds: 10
- if:
- condition: state
entity_id: binary_sensor.garagentur
state: 'off'
then:
- action: lock.open
target:
entity_id: lock.garagentur
- alias: locks_open_postern_door
id: locks_open_postern_door
triggers:
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Nebentür auf
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: binary_sensor.nebentur
state: 'off'
actions:
- action: lock.open
target:
entity_id: lock.nebentur
- alias: locks_lock_up_all_doors
id: locks_lock_up_all_doors
triggers:
- trigger: state
entity_id: group.family
to: not_home
for:
minutes: '{{ states ( ''input_number.doors_lock_up_after'' ) }}'
- trigger: state
entity_id: remote.sony_kd_55ag9
from: 'on'
to: 'off'
for:
minutes: '{{ states ( ''input_number.doors_lock_up_after'' ) }}'
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Abschliessen
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- repeat:
for_each:
- eingangstur
- nebentur
- garagentur
sequence:
- if:
- condition: template
value_template: '{{ states ( ''binary_sensor.'' + repeat.item ) == ''on''
}}'
then:
- action: script.notify
data:
domain: doorlocks
message: '{{ state_attr ( ''binary_sensor.'' + repeat.item, ''friendly_name''
) }} konnte nicht abgeschlossen werden, da diese offen ist.'
else:
- if:
- condition: template
value_template: '{{ states ( ''lock.'' + repeat.item ) in ( ''unknown'',
''unavailable'' ) }}'
then:
- action: script.notify
data:
domain: doorlocks
message: '{{ state_attr ( ''binary_sensor.'' + repeat.item, ''friendly_name''
) }} konnte nicht abgeschlossen werden, da kein Schloss verfügbar
ist.'
else:
- action: lock.lock
target:
entity_id: lock.{{ repeat.item }}
- id: automation_sungrow_inverter_start_stop
alias: sungrow inverter start stop
description: Starts/ Stops the inverter
trigger:
- platform: state
entity_id:
- input_select.set_sg_start_stop_mode
condition: []
variables:
sg_start: 207
sg_stop: 206
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 12999
value: '{% if is_state(''input_select.set_sg_start_stop_mode'', ''Start'') %}
{{sg_start}} {% else %} {{sg_stop}} {% endif %}
'
mode: single
- id: automation_sungrow_inverter_update_max_soc
alias: sungrow inverter update max SoC
description: Updates Sungrow max Soc holding register
trigger:
- platform: state
entity_id:
- input_number.set_sg_max_soc
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 13057
value: '{{ states(''input_number.set_sg_max_soc'') | int *10}}'
mode: single
- id: automation_sungrow_inverter_update_min_soc
alias: sungrow inverter update min SoC
description: Updates Sungrow min Soc holding register
trigger:
- platform: state
entity_id:
- input_number.set_sg_min_soc
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 13058
value: '{{ states(''input_number.set_sg_min_soc'') | int *10}}'
mode: single
- id: automation_sungrow_inverter_update_reserved_soc_for_backup
alias: sungrow inverter update reserved soc for backup
description: Updates reserved SoC for backup register
trigger:
- platform: state
entity_id:
- input_number.set_sg_reserved_soc_for_backup
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 13099
value: '{{ states(''input_number.set_sg_reserved_soc_for_backup'') | int}}'
mode: single
- id: automation_sungrow_inverter_update_battery_forced_charge_discharge_cmd
alias: sungrow inverter update battery forced charge discharge cmd
description: Updates Sungrow holding register for battery forced charge discharge
command
trigger:
- platform: state
entity_id:
- input_select.set_sg_battery_forced_charge_discharge_cmd
condition: []
variables:
ems_forced_charge: 170
ems_forced_discharge: 187
ems_stop_default: 204
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 13050
value: '{% if is_state(''input_select.set_sg_battery_forced_charge_discharge_cmd'',
''Stop (default)'') %} {{ems_stop_default}} {% elif is_state(''input_select.set_sg_battery_forced_charge_discharge_cmd'',
''Forced charge'') %} {{ems_forced_charge}} {% elif is_state(''input_select.set_sg_battery_forced_charge_discharge_cmd'',
''Forced discharge'') %} {{ems_forced_discharge}} {% else %} {{0xCC}} {% endif
%}
'
mode: single
- id: automation_sungrow_inverter_update_ems_mode
alias: sungrow inverter update EMS mode
description: Updates EMS mode
trigger:
- platform: state
entity_id:
- input_select.set_sg_ems_mode
condition: []
variables:
ems_mode_self_consume: 0
ems_mode_forced: 2
ems_mode_external: 3
ems_mode_vpp: 4
ems_mode_microgrid: 8
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 13049
value: '{% if is_state(''input_select.set_sg_ems_mode'', ''Self-consumption
mode (default)'') %} {{ems_mode_self_consume}} {% elif is_state(''input_select.set_sg_ems_mode'',
''Forced mode'') %} {{ems_mode_forced}} {% elif is_state(''input_select.set_sg_ems_mode'',
''External EMS'') %} {{ems_mode_external}} {% elif is_state(''input_select.set_sg_ems_mode'',
''VPP'') %} {{ems_mode_vpp}} {% elif is_state(''input_select.set_sg_ems_mode'',
''MicroGrid'') %} {{ems_mode_microgrid}} {% else %} 0 {% endif %}
'
mode: single
- id: automation_sungrow_inverter_update_battery_forced_charge_discharge_power
alias: sungrow inverter update battery forced charge discharge power
description: Sets battery forced charge discharge power
trigger:
- platform: state
entity_id:
- input_number.set_sg_forced_charge_discharge_power
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 13051
value: '{{ states(''input_number.set_sg_forced_charge_discharge_power'') | int}}'
mode: single
- id: automation_sungrow_inverter_update_battery_max_charge_power
alias: sungrow inverter update battery max charge power
description: Sets battery max charge power
trigger:
- platform: state
entity_id:
- input_number.set_sg_battery_max_charge_power
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 33046
value: '{{ states(''input_number.set_sg_battery_max_charge_power'') |float
/10 |int}}'
mode: single
- id: automation_sungrow_inverter_update_battery_max_discharge_power
alias: sungrow inverter update battery max discharge power
description: Sets battery max discharge power
trigger:
- platform: state
entity_id:
- input_number.set_sg_battery_max_discharge_power
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 33047
value: '{{ states(''input_number.set_sg_battery_max_discharge_power'') |float
/10 |int}}'
mode: single
- id: automation_sungrow_inverter_update_battery_charging_start_power
alias: sungrow inverter update battery charging start power
description: Sets battery charging start power
trigger:
- platform: state
entity_id:
- input_number.set_sg_battery_charging_start_power
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 33148
value: '{{ states(''input_number.set_sg_battery_charging_start_power'') |float
/10 |int}}'
mode: single
- id: automation_sungrow_inverter_update_battery_discharging_start_power
alias: sungrow inverter update battery discharging start power
description: Sets battery discharging start power
trigger:
- platform: state
entity_id:
- input_number.set_sg_battery_discharging_start_power
condition: []
action:
- service: modbus.write_register
data_template:
hub: SungrowSHx
slave: secret sungrow_modbus_slave
address: 33149
value: '{{ states(''input_number.set_sg_battery_discharging_start_power'') |float
/10 | int}}'
mode: single
- alias: notifications_open_doors_and_windows
id: notifications_open_doors_and_windows
triggers:
trigger: state
entity_id: media_player.sony_kd_55ag9
to: 'on'
for:
minutes: '{{ states ( ''input_number.notification_tv_on_delay'' ) | int }}'
conditions: null
variables:
msg: "{% set ns = namespace ( msg1 = '', msg2 = '' ) %}\n{% for state in states.binary_sensor\
\ \n | selectattr ( 'attributes.device_class', 'defined' ) \n | selectattr\
\ ( 'attributes.device_class', 'eq', 'window' )\n%}\n {% if state.state ==\
\ 'on' %}\n {% if ns.msg1 == '' %}\n {% set ns.msg1 = state.attributes.friendly_name\
\ %}\n {% else %}\n {% set ns.msg1 = ns.msg1 + ', ' + state.attributes.friendly_name\
\ %}\n {% endif %}\n {% endif %}\n{% endfor %}\n{% if ns.msg1 != '' %}\n\
\ {% set ns.msg1 = 'Offene Fenster: ' + ns.msg1 + \" | \" %}\n{% endif %}\n\
{% for state in states.binary_sensor \n | selectattr ( 'attributes.device_class',\
\ 'defined' ) \n | selectattr ( 'attributes.device_class', 'eq', 'door' )\n\
%}\n {% if state.state == 'on' %}\n {% if ns.msg2 == '' %}\n {% set\
\ ns.msg2 = state.attributes.friendly_name %}\n {% else %}\n {% set\
\ ns.msg2 = ns.msg2 + ', ' + state.attributes.friendly_name %}\n {% endif\
\ %}\n {% endif %}\n{% endfor %}\n{% if ns.msg2 != '' %}\n {% set ns.msg2\
\ = '\\nOffene Türen: ' + ns.msg2 %}\n{% endif %}\n{{ ns.msg1 }}\n{{ ns.msg2\
\ }}"
actions:
- action: script.notify
data:
domain: open_doors_and_windows
message: '{{ msg }}'
- alias: notifications_nodestate
id: notifications_nodestate
mode: queued
triggers:
- trigger: state
alias: When any nodestate changes
entity_id:
- binary_sensor.nodestate_dht22_lounge
- binary_sensor.nodestate_dht22_terrace
- binary_sensor.nodestate_dht22_roof
- binary_sensor.nodestate_relay_garage
- binary_sensor.nodestate_sonoff_bedroom
- binary_sensor.nodestate_ttp223_bedroom
- binary_sensor.nodestate_led_kitchen
- binary_sensor.nodestate_led_kitchen2
- binary_sensor.nodestate_gesture_kitchen
- binary_sensor.nodestate_sonoff_gallery1
- binary_sensor.nodestate_sonoff_corridor
- binary_sensor.nodestate_electricity_utilityroom
- binary_sensor.nodestate_pixel_kitchen
- binary_sensor.nodestate_ds18b20_groundfloor
- binary_sensor.nodestate_ds18b20_firstfloor
- binary_sensor.nodestate_gas_utilityroom
- binary_sensor.nodestate_led_corridor
- binary_sensor.nodestate_rain_garden
- binary_sensor.nodestate_dht11_utilityroom
- binary_sensor.nodestate_ds18b20_pool
- binary_sensor.nodestate_ds18b20_brewery
- binary_sensor.nodestate_spindle_fermenter
- binary_sensor.nodestate_xmastree_dining
- binary_sensor.nodestate_relay_garden
- binary_sensor.nodestate_ws2812_terrace1
- binary_sensor.nodestate_ws2812_terrace2
- binary_sensor.nodestate_ws2812_xmasstar
- binary_sensor.nodestate_relay_hydrotower
- binary_sensor.nodestate_ws2812_x1c
- binary_sensor.nodestate_pitouch_corridor
- binary_sensor.nodestate_tasmota
- binary_sensor.nodestate_ems_esp
- binary_sensor.nodestate_watermeter
to: 'off'
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: script.notify
data:
domain: nodestate
message: '{{ trigger.entity_id [24:] }} is not alive'
- alias: notifications_garage_flood
id: notifications_garage_flood
triggers:
- trigger: state
entity_id: binary_sensor.wassermelder
to: 'on'
conditions: null
actions:
- action: script.notify
data:
domain: flood
message: Überschwemmung erkannt
- alias: notifications_mower_error
id: notifications_mower_error
triggers:
- trigger: state
entity_id: lawn_mower.sileno
to:
- error
- unavailable
- unknown
conditions: null
actions:
- action: script.notify
data:
domain: mower
message: 'Rasenmäher Fehler: {{ trigger.to_state.state }}'
- alias: notifications_battery_low
id: notifications_battery_low
triggers:
- trigger: state
entity_id: group.batteries
to: 'on'
conditions: null
variables:
battery: '{{ expand ( ''group.batteries'' ) | selectattr ( ''state'', ''eq'',
''on'' ) | map ( attribute = ''attributes.friendly_name'' ) | map(''regex_replace'',
''^(\S+)\s(\S+).*'', ''\1 \2'') | list | join ( '', '' ) }}'
actions:
- action: script.notify
data:
domain: battery
message: 'Niedriger Batteriestand: {{ battery }}'
- alias: notifications_kia_ev6_warning
id: notifications_kia_ev6_warning
triggers:
- trigger: state
entity_id: group.ev6
to: 'on'
conditions: null
variables:
warning: '{{ expand ( ''group.ev6'' ) | selectattr ( ''state'', ''eq'', ''on''
) | map ( attribute = ''attributes.friendly_name'' ) | map(''regex_replace'',
''^(\S+\s)(.*)'', ''\2'' ) | list | join ( '', '' ) }}'
actions:
- action: script.notify
data:
domain: kia_ev6
message: 'Kia EV6 Warnung: {{ warning }}'
- alias: pitouch_screen_on
id: pitouch_screen_on
triggers:
- trigger: time
at: input_datetime.standup_workday
- trigger: time
at: input_datetime.standup_weekend
- trigger: state
entity_id: group.family
to: home
conditions:
- condition: and
conditions:
- condition: state
entity_id: group.family
state: home
- condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: input_datetime.standup_workday
before: input_datetime.sleep
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
- condition: time
after: input_datetime.standup_weekend
before: input_datetime.sleep
actions:
- action: light.turn_on
target:
entity_id:
- light.pitouch_corridor_screen
- alias: pitouch_screen_off
id: pitouch_screen_off
triggers:
- trigger: time
at: input_datetime.pitouch_off
- trigger: state
entity_id: group.family
to: not_home
actions:
- action: light.turn_off
target:
entity_id:
- light.pitouch_corridor_screen
- alias: pitouch_screen_off_after_tv_off
id: pitouch_screen_off_after_tv_off
triggers:
trigger: state
entity_id: media_player.sony_kd_55ag9
from: 'on'
to: 'off'
for:
minutes: 1
conditions:
- condition: time
after: input_datetime.tv_off_period_start
before: input_datetime.tv_off_period_end
actions:
- delay:
minutes: '{{ states ( ''input_number.pitouch_delay'' ) | int }}'
- action: light.turn_off
target:
entity_id:
- light.pitouch_corridor_screen
- alias: set_default_values
id: set_default_values
trigger: null
actions:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.button_indoor_activated
- action: input_boolean.turn_on
target:
entity_id: input_boolean.button_garage_activated
- action: input_boolean.turn_on
target:
entity_id: input_boolean.button_pool_activated
- action: input_boolean.turn_on
target:
entity_id: input_boolean.gesture_kitchen_activated
- action: input_boolean.turn_on
target:
entity_id: input_boolean.touch_bedroom_activated
- action: input_boolean.turn_off
target:
entity_id: input_boolean.light_simulation
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_time
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_date
- action: input_boolean.turn_off
target:
entity_id: input_boolean.pixel_node_weekday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg0
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg1
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg2
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg3
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg4
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg5
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg6
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg7
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg8
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg9
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg10
- action: input_boolean.turn_off
target:
entity_id: input_boolean.pixel_node_msg11
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg12
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg13
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg14
- action: input_boolean.turn_off
target:
entity_id: input_boolean.pixel_node_msg15
- action: input_boolean.turn_off
target:
entity_id: input_boolean.pixel_node_msg16
- action: input_boolean.turn_off
target:
entity_id: input_boolean.pixel_node_msg17
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg18
- action: input_boolean.turn_on
target:
entity_id: input_boolean.pixel_node_msg19
- action: input_boolean.turn_off
target:
entity_id: input_boolean.daily_vacuum_done
- action: input_boolean.turn_off
target:
entity_id: input_boolean.daily_vacuum
- action: input_boolean.turn_on
target:
entity_id: input_boolean.dustbin_notification
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_activated
- action: input_boolean.turn_on
target:
entity_id: input_boolean.mowing_activated
- action: input_boolean.turn_off
target:
entity_id: input_boolean.circulating_pump_activated
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_scheduled_valve1
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve1_at_monday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve1_at_tuesday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve1_at_wednesday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve1_at_thursday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve1_at_friday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve1_at_saturday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve1_at_sunday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_scheduled_valve2
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve2_at_monday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve2_at_tuesday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve2_at_wednesday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve2_at_thursday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve2_at_friday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve2_at_saturday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve2_at_sunday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_scheduled_valve3
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve3_at_monday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve3_at_tuesday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve3_at_wednesday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve3_at_thursday
- action: input_boolean.turn_on
target:
entity_id: input_boolean.irrigation_valve3_at_friday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve3_at_saturday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.irrigation_valve3_at_sunday
- action: input_boolean.turn_off
target:
entity_id: input_boolean.cover_closing_at_cold_activated
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_bedroom
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_bath
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_office
- action: input_boolean.turn_on
target:
entity_id: input_boolean.cover_nursery
- action: input_boolean.turn_off
target:
entity_id: input_boolean.cover_closed_at_low_temp
- action: input_boolean.turn_on
target:
entity_id: input_boolean.climate_activated
- action: input_boolean.turn_on
target:
entity_id: input_boolean.climate_start_office
- action: input_boolean.turn_on
target:
entity_id: input_boolean.climate_start_bedroom
- action: input_boolean.turn_on
target:
entity_id: input_boolean.climate_start_nursery
- action: input_boolean.turn_on
target:
entity_id: input_boolean.climate_stop_office
- action: input_boolean.turn_on
target:
entity_id: input_boolean.climate_stop_bedroom
- action: input_boolean.turn_on
target:
entity_id: input_boolean.climate_stop_nursery
- action: input_boolean.turn_off
target:
entity_id: input_boolean.climate_office_started
- action: input_boolean.turn_off
target:
entity_id: input_boolean.climate_bedroom_started
- action: input_boolean.turn_off
target:
entity_id: input_boolean.climate_nursery_started
- action: input_boolean.turn_on
target:
entity_id: input_boolean.dishwasher_activated
- action: input_boolean.turn_off
target:
entity_id: input_boolean.circulating_pump_running_desinfection
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.nightlight_end
data:
time: 04:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.pitouch_off
data:
time: '23:30:00'
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.pool_pump_start1
data:
time: '11:00:00'
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.pool_pump_start2
data:
time: '20:00:00'
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.sleep
data:
time: '22:00:00'
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.standup_weekend
data:
time: 08:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.standup_workday
data:
time: 05:30:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.tv_off_period_end
data:
time: 06:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.tv_off_period_start
data:
time: '21:00:00'
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.vacuum_period_end
data:
time: '17:00:00'
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.vacuum_period_start
data:
time: 08:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.irrigation_start_1
data:
time: 04:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.irrigation_start_2
data:
time: 04:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.irrigation_start_3
data:
time: 06:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.mowing_start
data:
time: 08:30:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.mowing_end
data:
time: '16:30:00'
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.climate_startperiode_begin
data:
time: 08:00:00
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.climate_startperiode_end
data:
time: '12:00:00'
- action: input_number.set_value
target:
entity_id: input_number.effect_delay
data:
value: 1500
- action: input_number.set_value
target:
entity_id: input_number.max_random_off_duration
data:
value: 120
- action: input_number.set_value
target:
entity_id: input_number.nightlight_duration
data:
value: 15
- action: input_number.set_value
target:
entity_id: input_number.pitouch_delay
data:
value: 15
- action: input_number.set_value
target:
entity_id: input_number.pixel_node_display_brightness
data:
value: 2
- action: input_number.set_value
target:
entity_id: input_number.pixel_node_display_duration
data:
value: 3
- action: input_number.set_value
target:
entity_id: input_number.pixel_node_display_shakeperiod
data:
value: 130
- action: input_number.set_value
target:
entity_id: input_number.pool_pump_duration
data:
value: 120
- action: input_number.set_value
target:
entity_id: input_number.tvoff_lightsoff_delay1
data:
value: 1
- action: input_number.set_value
target:
entity_id: input_number.tvoff_lightsoff_delay2
data:
value: 7
- action: input_number.set_value
target:
entity_id: input_number.light_timeout
data:
value: 15
- action: input_number.set_value
target:
entity_id: input_number.irrigation_duration
data:
value: 30
- action: input_number.set_value
target:
entity_id: input_number.circulating_pump_activated_after_standup
data:
value: 2
- action: input_number.set_value
target:
entity_id: input_number.circulating_pump_activated_before_sleeping
data:
value: 4
- action: input_number.set_value
target:
entity_id: input_number.circulating_pump_on_period
data:
value: 15
- action: input_number.set_value
target:
entity_id: input_number.circulating_pump_on_duration
data:
value: 1
- action: input_number.set_value
target:
entity_id: input_number.soil_moisture1_min_voltage
data:
value: 1500
- action: input_number.set_value
target:
entity_id: input_number.soil_moisture1_max_voltage
data:
value: 3000
- action: input_number.set_value
target:
entity_id: input_number.soil_moisture2_min_voltage
data:
value: 1500
- action: input_number.set_value
target:
entity_id: input_number.soil_moisture2_max_voltage
data:
value: 3000
- action: input_number.set_value
target:
entity_id: input_number.soil_moisture3_min_voltage
data:
value: 1500
- action: input_number.set_value
target:
entity_id: input_number.soil_moisture3_max_voltage
data:
value: 3000
- action: input_number.set_value
target:
entity_id: input_number.electricity_meter_threshold_power
data:
value: 15000
- action: input_number.set_value
target:
entity_id: input_number.electricity_import_critical_above
data:
value: 100
- action: input_number.set_value
target:
entity_id: input_number.battery_state_off_below
data:
value: 20
- action: input_number.set_value
target:
entity_id: input_number.electricity_price_in
data:
value: 0.4
- action: input_number.set_value
target:
entity_id: input_number.electricity_price_out
data:
value: 0.077
- action: input_number.set_value
target:
entity_id: input_number.waterpump_emergency_stop_duration
data:
value: 20
- action: input_number.set_value
target:
entity_id: input_number.waterpump_emergency_stop_power_threshold
data:
value: 900
- action: input_number.set_value
target:
entity_id: input_number.climate_target_temperature
data:
value: 25
- action: input_number.set_value
target:
entity_id: input_number.climate_min_forecast_temperature
data:
value: 27
- action: input_number.set_value
target:
entity_id: input_number.climate_min_forecast_temperature_sunny
data:
value: 24
- action: input_number.set_value
target:
entity_id: input_number.climate_min_battery_level
data:
value: 95
- action: input_number.set_value
target:
entity_id: input_number.climate_min_pv_generation
data:
value: 2000
- action: input_number.set_value
target:
entity_id: input_number.climate_min_pv_generation_duration
data:
value: 10
- action: input_number.set_value
target:
entity_id: input_number.dishwasher_min_pv_generation
data:
value: 2000
- action: input_number.set_value
target:
entity_id: input_number.dishwasher_min_battery_level
data:
value: 95
- action: input_number.set_value
target:
entity_id: input_number.notification_tv_on_delay
data:
value: 5
- action: input_number.set_value
target:
entity_id: input_number.gasmeter_threshold_high
data:
value: 100000
- action: input_number.set_value
target:
entity_id: input_number.gasmeter_threshold_low
data:
value: 1000
- action: input_number.set_value
target:
entity_id: input_number.gasmeter_heating_value
data:
value: 11.23
- action: input_number.set_value
target:
entity_id: input_number.gasmeter_zustandszahl
data:
value: 0.9655
- action: input_number.set_value
target:
entity_id: input_number.circulating_pump_running_above_temp
data:
value: 65
- action: input_number.set_value
target:
entity_id: input_number.default_brightness
data:
value: 15
- action: input_number.set_value
target:
entity_id: input_number.brightness_delta
data:
value: 5
- action: input_select.select_option
target:
entity_id: input_select.climate_hvac_mode
data:
option: cool
- action: input_select.select_option
target:
entity_id: input_select.climate_fan_mode
data:
option: auto
- action: input_select.select_option
target:
entity_id: input_select.climate_swing_mode
data:
option: true
- action: input_select.select_option
target:
entity_id: input_select.climate_preset_mode
data:
option: none
- alias: solar_set_battery_forced_charge_discharge
id: solar_set_battery_forced_charge_discharge
triggers:
- trigger: state
entity_id: input_select.set_battery_forced_charge_discharge
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
variables:
forced_charge: 170
forced_discharge: 187
stop_default: 204
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 13050
value: "{% set val = states ( 'input_select.set_battery_forced_charge_discharge'\
\ ) %} {% if val == 'Stop (default)' %}\n {{stop_default}}\n{% elif val\
\ == 'Forced charge' %}\n {{forced_charge}}\n{% elif val == 'Forced discharge'\
\ %}\n {{forced_discharge}}\n{% else %}\n {{stop_default}}\n{% endif\
\ %}\n"
- alias: solar_update_battery_forced_charge_discharge
id: solar_update_battery_forced_charge_discharge
triggers:
- trigger: state
entity_id: sensor.battery_forced_charge_discharge
conditions: []
actions:
- action: input_select.select_option
target:
entity_id: input_select.set_battery_forced_charge_discharge
data:
option: '{{ states ( ''sensor.battery_forced_charge_discharge'' ) }}'
- alias: solar_sh10rt_master_set_inverter_runmode
id: solar_sh10rt_master_inverter_runmode
triggers:
- trigger: state
entity_id: input_button.inverter_master_startup
variables:
runmode: startup
- trigger: state
entity_id: input_button.inverter_master_shutdown
variables:
runmode: shutdown
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
variables:
inverter_start: 207
inverter_stop: 206
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 12999
value: "{% if runmode == \"startup\" %}\n {{inverter_start}}\n{% else %}\n\
\ {{inverter_stop}}\n{% endif %}\n"
- alias: solar_sh10rt_slave_set_inverter_runmode
id: solar_sh10rt_slave_set_inverter_runmode
triggers:
- trigger: state
entity_id: input_button.inverter_slave_startup
variables:
runmode: startup
- trigger: state
entity_id: input_button.inverter_slave_shutdown
variables:
runmode: shutdown
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
variables:
inverter_start: 207
inverter_stop: 206
actions:
- action: modbus.write_register
data:
hub: SH10RT_slave
slave: 2
address: 12999
value: "{% if runmode == \"startup\" %}\n {{inverter_start}}\n{% else %}\n\
\ {{inverter_stop}}\n{% endif %}\n"
- alias: solar_set_max_soc
id: solar_set_max_soc
triggers:
- trigger: state
entity_id: input_number.set_max_soc
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 13057
value: '{{ states ( ''input_number.set_max_soc'' ) | int * 10 }}'
- alias: solar_update_max_soc
id: solar_update_max_soc
triggers:
- trigger: state
entity_id: sensor.sh10rt_master_max_soc
conditions: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_max_soc
data:
value: '{{ states ( ''sensor.sh10rt_master_max_soc'' ) }}'
- alias: solar_set_min_soc
id: solar_set_min_soc
triggers:
- trigger: state
entity_id: input_number.set_min_soc
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 13058
value: '{{ states ( ''input_number.set_min_soc'' ) | int * 10 }}'
- alias: solar_update_min_soc
id: solar_update_min_soc
triggers:
- trigger: state
entity_id:
- sensor.sh10rt_master_min_soc
conditions: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_min_soc
data:
value: '{{ states ( ''sensor.sh10rt_master_min_soc'' ) }}'
- alias: solar_set_backup_soc
id: solar_set_backup_soc
triggers:
- trigger: state
entity_id: input_number.set_backup_soc
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 13099
value: '{{ states ( ''input_number.set_backup_soc'' ) | int }}'
- alias: solar_update_backup_soc
id: solar_update_backup_soc
triggers:
- trigger: state
entity_id: sensor.sh10rt_master_reserved_soc_for_backup
conditions: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_backup_soc
data:
value: '{{ states ( ''sensor.sh10rt_master_reserved_soc_for_backup'' ) }}'
- alias: solar_set_battery_charge_start_power
id: solar_set_battery_charge_start_power
triggers:
- trigger: state
entity_id: input_number.set_battery_charge_start_power
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 33148
value: '{{ ( states ( ''input_number.set_battery_charge_start_power'' ) | float
/ 10.0 ) | int }}'
- alias: solar_update_battery_charge_start_power
id: solar_update_battery_charge_start_power
triggers:
- trigger: state
entity_id: sensor.sh10rt_master_battery_charge_start_power
conditions: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_battery_charge_start_power
data:
value: '{{ states ( ''sensor.sh10rt_master_battery_charge_start_power'' ) }}'
- alias: solar_set_battery_discharge_start_power
id: solar_set_battery_dischargestart_power
triggers:
- trigger: state
entity_id: input_number.set_battery_discharge_start_power
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 33149
value: '{{ ( states ( ''input_number.set_battery_discharge_start_power'' ) |float
/ 10.0 ) | int}}'
- alias: solar_update_battery_discharge_start_power
id: solar_update_battery_discharge_start_power
triggers:
- trigger: state
entity_id: sensor.sh10rt_master_battery_discharge_start_power
condition: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_battery_discharge_start_power
data:
value: '{{ states ( ''sensor.sh10rt_master_battery_discharge_start_power'' )
}}'
- alias: solar_set_battery_max_charge_power
id: solar_set_battery_max_charge_power
triggers:
- trigger: state
entity_id: input_number.set_battery_max_charge_power
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 33046
value: '{{ ( states ( ''input_number.set_battery_max_charge_power'' ) | float
/ 10.0 ) | int}}'
- alias: solar_update_battery_max_charge_power
id: solar_update_battery_max_charge_power
triggers:
- trigger: state
entity_id: sensor.sh10rt_master_battery_max_charge_power
conditions: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_battery_max_charge_power
data:
value: '{{ states ( ''sensor.sh10rt_master_battery_max_charge_power'' ) }}'
- alias: solar_set_battery_max_discharge_power
id: solar_set_battery_max_discharge_power
triggers:
- trigger: state
entity_id: input_number.set_battery_max_discharge_power
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 33047
value: '{{ ( states ( ''input_number.set_battery_max_discharge_power'' ) | float
/ 10.0 ) | int}}'
- alias: solar_update_battery_max_discharge_power
id: solar_update_battery_max_discharge_power
triggers:
- trigger: state
entity_id: sensor.sh10rt_master_battery_max_discharge_power
conditions: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_battery_max_discharge_power
data:
value: '{{ states(''sensor.sh10rt_master_battery_max_discharge_power'') }}'
- alias: solar_set_battery_forced_charge_discharge_power
id: solar_set_battery_forced_charge_discharge_power
triggers:
- trigger: state
entity_id: input_number.set_battery_forced_charge_discharge_power
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data:
hub: SH10RT_master
slave: 1
address: 13051
value: '{{ states ( ''input_number.set_battery_forced_charge_discharge_power''
) | int }}'
- alias: solar_update_battery_forced_charge_discharge_power
id: solar_update_battery_forced_charge_discharge_power
triggers:
- trigger: state
entity_id:
- sensor.sh10rt_master_battery_forced_charge_discharge_power
condition: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.set_battery_forced_charge_discharge_power
data:
value: '{{ states ( ''sensor.sh10rt_master_battery_forced_charge_discharge_power''
) }}'
- alias: solcast_update_forecast
id: solcast_update_forecast
triggers:
- trigger: template
value_template: "{% set nr = as_datetime(state_attr('sun.sun','next_rising'))\
\ | as_local %} {% set ns = as_datetime(state_attr('sun.sun','next_setting'))\
\ | as_local %} {% set api_request_limit = 5 %} {% if nr > ns %}\n {% set\
\ nr = nr - timedelta(hours = 24) %}\n{% endif %} {% set hours_difference =\
\ (ns - nr) %} {% set interval_hours = hours_difference / api_request_limit\
\ %} {% set ns = namespace(match = false) %} {% for i in range(api_request_limit)\
\ %}\n {% set start_time = nr + (i * interval_hours) %}\n {% if ((start_time\
\ - timedelta(seconds=30)) <= now()) and (now() <= (start_time + timedelta(seconds=30)))\
\ %}\n {% set ns.match = true %}\n {% endif %}\n{% endfor %} {{ ns.match\
\ }}"
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: sun
before: sunset
after: sunrise
actions:
- delay:
seconds: '{{ range ( 30, 360 ) | random | int }}'
- action: solcast_solar.update_forecasts
data: {}
- alias: tapocam_set_privacy_mode
id: tapocam_set_privacy_mode
mode: single
triggers:
- trigger: state
entity_id: group.family
to: home
- platform: sun
event: sunrise
offset: +00:01:00
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: group.family
state: home
- condition: state
entity_id: sun.sun
state: above_horizon
actions:
- action: switch.turn_on
target:
entity_id: switch.tapo_c520ws_5d82_privacy
- alias: tapocam_set_day_mode
id: tapocam_set_day_mode
mode: single
triggers:
- trigger: sun
event: sunrise
offset: +00:00:00
- trigger: state
entity_id: group.family
to: not_home
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: group.family
state: not_home
actions:
- action: switch.turn_off
target:
entity_id: switch.tapo_c520ws_5d82_privacy
- delay:
seconds: 15
- action: select.select_option
target:
entity_id: select.tapo_c520ws_5d82_move_to_preset
data:
option: '{{ state_attr ( ''select.tapo_c520ws_5d82_move_to_preset'', ''options''
) [1] }}'
- alias: tapocam_set_night_mode
id: tapocam_set_night_mode
mode: single
triggers:
- trigger: sun
event: sunset
offset: +00:00:00
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_off
target:
entity_id: switch.tapo_c520ws_5d82_privacy
- delay:
seconds: 15
- action: select.select_option
target:
entity_id: select.tapo_c520ws_5d82_move_to_preset
data:
option: '{{ state_attr ( ''select.tapo_c520ws_5d82_move_to_preset'', ''options''
) [0] }}'
- alias: tapocam_set_notification
id: tapocam_set_notification
mode: single
triggers:
- trigger: state
entity_id: group.family
to: home
variables:
mode: 'off'
- trigger: state
entity_id: group.family
to: not_home
variables:
mode: '{{ input_boolean.tapocam_notifications }}'
conditions:
- condition: state
alias: process only on production server
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_{{ mode }}
target:
entity_id: switch.tapo_c520ws_5d82_notifications
- delay:
seconds: 15
- action: switch.turn_{{ mode }}
target:
entity_id: switch.tapo_c520ws_5d82_rich_notifications
- alias: television_switch_on_plug
id: television_switch_on_plug
triggers:
- trigger: time
at: input_datetime.television_switch_on_at
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: switch.turn_on
target:
entity_id: switch.fernseher
- alias: ups_status_change
id: ups_status_change
triggers:
- trigger: state
entity_id: sensor.ups_status
conditions:
- condition: template
value_template: '{{ trigger.from_state is not none and trigger.to_state is not
none }}'
actions:
- action: script.notify
data:
domain: ups
message: 'Neuer Status USV: {{ states ( ''sensor.ups_status'' ) }}'
- alias: ups_shutdown_on_low_battery
id: ups_shutdown_on_low_battery
triggers:
- platform: numeric_state
entity_id: sensor.ups_batterielaufzeit
below: input_number.ups_shutdown_at_battery_runtime
conditions:
not:
- condition: state
entity_id: sensor.ups_status
state: Online
actions:
- action: script.notify
data:
domain: ups
message: Runterfahren bei USV-Restlaufzeit von {{ '{:02d}:{:02d}'.format ( (states
( 'sensor.ups_batterielaufzeit' ) | int / 60) | int, (states ( 'sensor.ups_batterielaufzeit'
) | int % 60) | int ) }} min
- delay:
minutes: 1
- action: shell_command.request_shutdown
- alias: send_alert_after_daily_vacuum_to_empty_the_dustbin
id: send_alert_after_daily_vacuum_to_empty_the_dustbin
triggers:
- trigger: state
entity_id: device_tracker.galaxy_note_fan_edition
to: home
for:
minutes: 5
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.daily_vacuum_done
state: 'on'
- condition: time
after: 08:30:00
before: '23:30:00'
- condition: template
value_template: "{% if states.automation.send_alert_after_daily_vacuum_to_empty_the_dustbin.last_triggered\
\ is not none %} {% if as_timestamp(now()) | int - as_timestamp(states.automation.send_alert_after_daily_vacuum_to_empty_the_dustbin.attributes.last_triggered)\
\ | int > 1800 %} true {% else %} false {% endif %} {% else %}\n false\n{%\
\ endif %}\n"
- condition: state
entity_id: input_boolean.daily_vacuum
state: 'on'
actions:
- action: media_player.volume_set
data:
entity_id: media_player.sony_kd_55ag9
volume_level: 0.7
- action: tts.google_say
entity_id: media_player.sony_kd_55ag9
data:
message: Der Saugroboter muss geleert werden!
cache: false
- alias: reset_daily_vacuum_done_state_at_midnight
id: reset_daily_vacuum_done_state_at_midnight
triggers:
- trigger: time
at: 0:00:00
actions:
- action: homeassistant.turn_off
target:
entity_id: input_boolean.daily_vacuum_done
- alias: start_cleaning_ground_floor_room
id: start_cleaning_ground_floor_room
initial_state: false
triggers:
- trigger: state
entity_id: input_select.vacuum_ground_floor_room
from: Auswahl
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: input_select.select_option
target:
entity_id: input_select.vacuum_ground_floor_room
data:
option: Auswahl
- alias: start_cleaning_first_floor_room
id: start_cleaning_first_floor_room
initial_state: false
triggers:
- trigger: state
entity_id: input_select.vacuum_first_floor_room
from: Auswahl
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: input_select.select_option
target:
entity_id: input_select.vacuum_first_floor_room
data:
option: Auswahl
- alias: start_daily_vacuum
id: start_daily_vacuum
triggers:
- trigger: time_pattern
minutes: /5
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: input_boolean.light_simulation
state: 'off'
- condition: state
entity_id: input_boolean.daily_vacuum
state: 'on'
- condition: state
entity_id: input_boolean.daily_vacuum_done
state: 'off'
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: time
after: input_datetime.vacuum_period_start
before: input_datetime.vacuum_period_end
weekday:
- mon
- wed
- condition: state
entity_id: group.family
state: not_home
actions:
- action: vacuum.start
target:
entity_id:
- vacuum.roborock_s6_ground_floor
- vacuum.roborock_s6_first_floor
- action: input_boolean.toggle
target:
entity_id: input_boolean.daily_vacuum_done
- alias: wallbox_update_allow_charging
id: wallbox_update_allow_charging
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_allow_charging
actions:
- variables:
mode: '{{ ''on'' if trigger.to_state.state == ''1'' else ''off'' }}'
- action: input_boolean.turn_{{ mode }}
target:
entity_id: input_boolean.wallbox_allow_charging
- alias: wallbox_set_allow_charging
id: wallbox_set_allow_charging
mode: single
triggers:
- trigger: state
entity_id: input_boolean.wallbox_allow_charging
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 200
value: '{{ [1 if is_state ( trigger.entity_id, ''on'' ) else 0, 0] }}'
- alias: wallbox_update_access_state
id: wallbox_update_access_state
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_access_state
actions:
- action: input_select.select_option
target:
entity_id: input_select.wallbox_access_state
data:
option: '{{ state_attr ( ''input_select.wallbox_access_state'', ''options''
) [trigger.to_state.state | int] }}'
- alias: wallbox_set_access_state
id: wallbox_set_access_state
mode: single
triggers:
- trigger: state
entity_id: input_select.wallbox_access_state
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 201
value: '{{ [state_attr ( trigger.entity_id, ''options'' ).index ( trigger.to_state.state
), 0] }}'
- alias: wallbox_update_cable_lock_mode
id: wallbox_update_cable_lock_mode
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_cable_lock_mode
actions:
- action: input_select.select_option
target:
entity_id: input_select.wallbox_cable_lock_mode
data:
option: '{{ state_attr ( ''input_select.wallbox_cable_lock_mode'', ''options''
) [trigger.to_state.state | int] }}'
- alias: wallbox_set_cable_lock_mode
id: wallbox_set_cable_lock_mode
mode: single
triggers:
- trigger: state
entity_id: input_select.wallbox_cable_lock_mode
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 204
value: '{{ [state_attr ( trigger.entity_id, ''options'' ).index ( trigger.to_state.state
), 0] }}'
- alias: wallbox_update_led_brightness
id: wallbox_update_led_brightness
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_led_brightness
actions:
- action: input_number.set_value
target:
entity_id: input_number.wallbox_led_brightness
data:
value: '{{ trigger.to_state.state | int }}'
- alias: wallbox_set_led_brightness
id: wallbox_set_led_brightness
mode: single
triggers:
- trigger: state
entity_id: input_number.wallbox_led_brightness
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 206
value: '{{ [states ( trigger.entity_id ) | int, 0] }}'
- alias: wallbox_update_led_save_energy
id: wallbox_update_led_save_energy
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_led_save_energy
actions:
- variables:
mode: '{{ ''on'' if trigger.to_state.state == ''1'' else ''off'' }}'
- action: input_boolean.turn_{{ mode }}
target:
entity_id: input_boolean.wallbox_led_save_energy
- alias: wallbox_set_led_save_energy
id: wallbox_set_led_save_energy
mode: single
triggers:
- trigger: state
entity_id: input_boolean.wallbox_led_save_energy
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 207
value: '{{ [1 if is_state ( ''input_boolean.wallbox_led_save_energy'', ''on''
) else 0, 0] }}'
- alias: wallbox_update_max_current
id: wallbox_update_max_current
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_max_current
actions:
- action: input_number.set_value
target:
entity_id: input_number.wallbox_max_current
data:
value: '{{ trigger.to_state.state | int }}'
- alias: wallbox_set_max_current
id: wallbox_set_max_current
mode: single
triggers:
- trigger: state
entity_id: input_number.wallbox_max_current
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 211
value: '{{ [states ( trigger.entity_id ) | int, 0] }}'
- alias: wallbox_update_current_volatile
id: wallbox_update_current_volatile
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_current_volatile
actions:
- action: input_number.set_value
target:
entity_id: input_number.wallbox_current_volatile
data:
value: '{{ trigger.to_state.state | int }}'
- alias: wallbox_set_current_volatile
id: wallbox_set_current_volatile
mode: single
triggers:
- trigger: state
entity_id: input_number.wallbox_current_volatile
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 299
value: '{{ [states ( trigger.entity_id ) | int, 0] }}'
- alias: wallbox_update_current_eeprom
id: wallbox_update_current_eeprom
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_current_eeprom
actions:
- action: input_number.set_value
target:
entity_id: input_number.wallbox_current_eeprom
data:
value: '{{ trigger.to_state.state | int }}'
- alias: wallbox_set_current_eeprom
id: wallbox_set_current_eeprom
mode: single
triggers:
- trigger: state
entity_id: input_number.wallbox_current_eeprom
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 300
value: '{{ [states ( trigger.entity_id ) | int, 0] }}'
- alias: wallbox_update_phase_switch_mode
id: wallbox_update_phase_switch_mode
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_phase_switch_mode
actions:
- action: input_select.select_option
target:
entity_id: input_select.wallbox_phase_switch_mode
data:
option: '{{ state_attr ( ''input_select.wallbox_phase_switch_mode'', ''options''
) [states ( trigger.entity_id ) | int] }}'
- alias: wallbox_set_phase_switch_mode
id: wallbox_set_phase_switch_mode
mode: single
triggers:
- trigger: state
entity_id: input_select.wallbox_phase_switch_mode
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 332
value: '{{ [state_attr ( trigger.entity_id, ''options'' ).index ( states ( trigger.entity_id
) ), 0] }}'
- alias: wallbox_update_cloud_disabled
id: wallbox_update_cloud_disabled
mode: single
triggers:
- trigger: state
entity_id: sensor.go_echarger_cloud_disabled
actions:
- variables:
mode: '{{ ''on'' if trigger.to_state.state == ''1'' else ''off'' }}'
- action: input_boolean.turn_{{ mode }}
target:
entity_id: input_boolean.wallbox_cloud_disabled
- alias: wallbox_set_cloud_disabled
id: wallbox_set_cloud_disabled
mode: single
triggers:
- trigger: state
entity_id: input_boolean.wallbox_cloud_disabled
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
actions:
- action: modbus.write_register
data_template:
hub: go_echarger
slave: 1
address: 217
value: '{{ [state_attr ( trigger.entity_id, ''options'' ).index ( states ( trigger.entity_id
) ), 0] }}'
- alias: wallbox_start_charging
id: wallbox_start_charging
triggers:
- trigger: state
entity_id: sensor.go_echarger_allow_charging
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: sensor.go_echarger_allow_charging
state: '1'
actions:
- action: input_number.set_value
target:
entity_id: number.evcc_wallbox_limit_soc
data:
value: 100
- action: select.select_option
target:
entity_id: select.evcc_priority_soc
data:
option: '95'
- action: select.select_option
target:
entity_id: select.evcc_wallbox_mode
data:
option: pv
- action: script.notify
data:
domain: wallbox
message: Laden gestartet
- alias: wallbox_stop_charging
id: wallbox_stop_charging
triggers:
- trigger: template
value_template: '{{ states ( ''sensor.evcc_wallbox_vehicle_soc'' ) | float >=
states ( ''number.evcc_wallbox_limit_soc'' ) | float }}'
- trigger: event
event_type: bosch_shc.event
event_data:
event_type: SCENARIO
event_subtype: Laden beenden
conditions:
- condition: state
entity_id: binary_sensor.prod_mode
state: 'on'
- condition: state
entity_id: binary_sensor.evcc_wallbox_enabled
state: 'on'
actions:
- action: select.select_option
target:
entity_id: select.evcc_wallbox_mode
data:
option: 'off'
- action: script.notify
data:
domain: wallbox
message: Laden gestoppt