Advertisement
BoorAndras

Untitled

Jun 29th, 2024
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.32 KB | None | 0 0
  1. blueprint:
  2.   name: Scheduled switch
  3.   description: Trun something on and turn the same thing off later
  4.   domain: automation
  5.   author: bbkbarbar
  6.  
  7.   input:
  8.     myswitch:
  9.       name: "Thing(s) to turn on and off later"
  10.       description: "you can select multiple switch here :)"
  11.       selector:
  12.         entity:
  13.           domain:
  14.            - switch
  15.           multiple: true
  16.  
  17.     turn_on_time:
  18.       name: Turn on time
  19.       description: Time when the thing should turn on
  20.       selector:
  21.         time:
  22.       default: "06:00:00"
  23.  
  24.     turn_off_time:
  25.       name: Turn off time
  26.       description: Time when the thing should turn off
  27.       selector:
  28.         time:
  29.       default: "08:00:00"
  30.  
  31. mode: single
  32.  
  33. trigger:
  34.   - platform: time
  35.     at: !input turn_on_time
  36.     id: Bekapcs
  37.   - platform: time
  38.     at: !input turn_off_time
  39.     id: Kikapcs
  40. condition: []
  41. action:
  42.   - if:
  43.       - condition: trigger
  44.         id:
  45.          - Bekapcs
  46.     then:
  47.       - service: switch.turn_on
  48.         metadata: {}
  49.         data: {}
  50.         target:
  51.           entity_id: !input myswitch
  52.     alias: Be
  53.   - alias: Ki
  54.     if:
  55.       - condition: trigger
  56.         id:
  57.          - Kikapcs
  58.     then:
  59.       - service: switch.turn_off
  60.         metadata: {}
  61.         data: {}
  62.         target:
  63.           entity_id: !input myswitch
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement