hansen-hasst/packages/mailbox/switch.yaml

38 lines
959 B
YAML
Raw Permalink Normal View History

2022-08-12 09:08:44 +00:00
# Example configuration.yaml entry
switch:
- platform: template
switches:
mailbox:
turn_on:
service: switch.turn_on
target:
entity_id: switch.mailbox
turn_off:
service: switch.turn_off
target:
entity_id: switch.mailbox
icon_template: >
{% if is_state('switch.mailbox', 'on') %}
mdi:mailbox
{% else %}
mdi:mailbox-outline
2022-08-18 14:45:03 +00:00
{% endif %}
automation:
- alias: light_save_last_state
mode: single
trigger:
- platform: time_pattern
seconds: "10"
condition:
- condition: state
entity_id: light.office_bulb
state: "on"
action:
- service: scene.create
data:
snapshot_entities:
- light.office_bulb
- switch.adaptive_lighting_default
scene_id: last_on_state