Hello,
Is it possible to ‘merge’ automatisch to one file/automation? I have for example 7 wall outlet automations that maybe could be in 2 or 3 automations
Example code:
Turn off:
---
#
# Walli Outlet (PHEV) - Automatically Turn Off the Power at Night after Charging
# Zet Snachts de Walli Outlet PHEV Uit wanneer het Opladen is Voltooid, Walli Aan is en Automatisch Uischakelen is Aangezet.
#
id: '1646420240190'
alias: Walli Outlet (PHEV) - Automatically Turn Off the Power at Night after Charging
description: Zet Snachts de Walli Outlet PHEV Uit wanneer het Opladen is Voltooid.
trigger:
- type: power
platform: device
device_id: bcce1523eb2c9354856874b001134309
entity_id: sensor.walli_outlet_phev_electric_consumption_w
domain: sensor
below: 100
for:
hours: 0
minutes: 15
seconds: 0
# Als Walli Outlet (PHEV) Aan staat voor minimaal 15 minuten && Als Walli Outlet (PHEV) Automatische On/Off Mode is ingeschakeld &&
# Het na 1u Snachts is (Zodat de Automatische On/Off Mode Vaste Automatisering gepaseerd is, dus auto aan het laden was nog.)
condition:
- condition: and
conditions:
- condition: device
type: is_on
device_id: bcce1523eb2c9354856874b001134309
entity_id: switch.walli_outlet_phev
domain: switch
for:
hours: 0
minutes: 15
seconds: 0
- condition: state
entity_id: input_boolean.walli_outlet_phev_mode_auto_off
state: 'on'
for:
hours: 0
minutes: 5
seconds: 0
- condition: time
after: 01:05:00
before: 09:00:00
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
# Zet de Walli Outlet (PHEV) Uit & Zet de Automatische OFF Mode Uit & Zet de Automatische ON Mode Aan
action:
- type: turn_off
device_id: bcce1523eb2c9354856874b001134309
entity_id: switch.walli_outlet_phev
domain: switch
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.walli_outlet_phev_mode_auto_off
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.walli_outlet_phev_mode_auto_on
mode: single
Turn off night:
---
#
# Walli Outlet (PHEV) - Automatically Turn Off the Power
# Zet Snachts Automatisch de Walli Outlet (PHEV) Uit wanneer er Niet wordt Opgeladen, Walli Aan is en Automatisch Uischakelen is Aangezet.
#
id: '1646414671039'
alias: Walli Outlet (PHEV) - Automatically Turn Off the Power at Night
description: Zet Snachts de Walli Outlet (PHEV) Uit wanneer er Niet wordt Opgeladen en Automatisch Uischakelen is Aangezet.
# Check de tijd die gezet is in de bijbehoorende input_datetime sensor.
trigger:
- platform: template
value_template: '{{ states(''sensor.time'') == (states.input_datetime.walli_outlet_phev_turn_off_time.attributes.timestamp
| int | timestamp_custom(''%H:%M'', False)) }}'
# Als Walli Outlet (PHEV) Aan staat voor minimaal 10 minuten && Als Walli Outlet (PHEV) Automatische On/Off Mode is ingeschakeld.
condition:
- condition: and
conditions:
- condition: device
type: is_on
device_id: bcce1523eb2c9354856874b001134309
entity_id: switch.walli_outlet_phev
domain: switch
for:
hours: 0
minutes: 10
seconds: 0
- condition: state
entity_id: input_boolean.walli_outlet_phev_mode_auto_off
state: 'on'
for:
hours: 0
minutes: 5
seconds: 0
- condition: device
type: is_power
device_id: bcce1523eb2c9354856874b001134309
entity_id: sensor.walli_outlet_phev_electric_consumption_w
domain: sensor
below: 100
for:
hours: 0
minutes: 10
seconds: 0
# Zet de Walli Outlet (PHEV) Uit & Zet de Automatische OFF Mode Uit & Zet de Automatische ON Mode Aan
action:
- type: turn_off
device_id: bcce1523eb2c9354856874b001134309
entity_id: switch.walli_outlet_phev
domain: switch
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.walli_outlet_phev_mode_auto_off
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.walli_outlet_phev_mode_auto_on
mode: single
Turn on:
---
#
# Walli Outlet (PHEV) - Automatically Turn On the Power
# Zet Smorgens Automatisch de Walli Outlet PHEV weer Aan wanneer Walli Uit is en Automatisch Inschakelen is Aangezet.
#
id: '1646414344322'
alias: Walli Outlet (PHEV) - Automatically Turn On the Power at Morning
description: Zet Smorgens de Walli Outlet (PHEV) weer Aan wanneer Automatisch Inschakelen is Aangezet.
# Check de tijd die gezet is in de bijbehoorende input_datetime sensor.
trigger:
- platform: template
value_template: '{{ states(''sensor.time'') == (states.input_datetime.walli_outlet_phev_turn_on_time.attributes.timestamp
| int | timestamp_custom(''%H:%M'', False)) }}'
# Als Walli Outlet (PHEV) Uit staat voor minimaal 10 minuten && Als Walli Outlet (PHEV) Automatische On/Off Mode is ingeschakeld.
condition:
- condition: and
conditions:
- condition: device
type: is_off
device_id: bcce1523eb2c9354856874b001134309
entity_id: switch.walli_outlet_phev
domain: switch
for:
hours: 0
minutes: 10
seconds: 0
- condition: state
entity_id: input_boolean.walli_outlet_phev_mode_auto_on
state: 'on'
for:
hours: 0
minutes: 5
seconds: 0
# Zet de Walli Outlet (PHEV) Aan & Zet de Automatische ON Mode Uit & Zet de Automatische OFF Mode Aan
action:
- type: turn_on
device_id: bcce1523eb2c9354856874b001134309
entity_id: switch.walli_outlet_phev
domain: switch
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.walli_outlet_phev_mode_auto_on
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.walli_outlet_phev_mode_auto_off
mode: single
Could maybe be in 1 file. but i do not know how to do it.
Can someone please help or give me an example how to put automations into one
Thanks