Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- automation:
- - alias: youtube auto
- trigger:
- - platform: time
- at: input_datetime.youtube_auto_pa
- - platform: time
- at: input_datetime.youtube_auto_av
- - platform: homeassistant
- event: start
- action:
- - service: >-
- {% set n = as_timestamp(now(), true)|timestamp_custom('%H:%M') %}
- switch.turn_{{ 'off' if n>=states('input_datetime.youtube_auto_pa')[:5] and n<states('input_datetime.youtube_auto_av')[:5] else 'on'}}
- target:
- entity_id: switch.unifi_network_youtube_off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement