Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.27 KB | None | 0 0
  1. #aonfiguration.yaml:
  2. input_boolean:
  3. # Used as virtual switch to turn TV-Screen on/off
  4.   tv_screen:
  5.     name: TV screen
  6.     initial: off
  7.     icon: mdi:television
  8.  
  9.  
  10.  
  11.  
  12. #automations.yaml:
  13. # Turn off TV-screen input-boolean changes to off-state
  14. - alias: Turn off TV-screen
  15.   trigger:
  16.     platform: state
  17.     entity_id: input_boolean.tv_screen
  18.     to: 'off'
  19.   action:
  20.     service: script.turn_on
  21.     entity_id: script.turn_off_tv_screen
  22.  
  23. # Turn on TV-screen input-boolean changes to on-state
  24. - alias: Turn on TV-screen
  25.   trigger:
  26.     platform: state
  27.     entity_id: input_boolean.tv_screen
  28.     to: 'on'
  29.   action:
  30.     service: script.turn_on
  31.     entity_id: script.turn_on_tv_screen
  32.  
  33.  
  34.  
  35.  
  36. #scripts.yaml:
  37. # Turn off TV screen
  38. turn_off_tv_screen:
  39.   alias: Turn off TV screen
  40.   sequence:
  41.     - service: remote.send_command
  42.       entity_id: remote.Livingroom
  43.       data:
  44.         device: "27185296"
  45.         command:
  46.          - Tools
  47.           - DirectionUp
  48.           - DirectionLeft
  49.           - DirectionLeft
  50.           - Return
  51.  
  52. # Turn on TV screen
  53. turn_on_tv_screen:
  54.   alias: Turn on TV screen
  55.   sequence:
  56.     - service: remote.send_command
  57.       entity_id: remote.Livingroom
  58.       data:
  59.         device: "27185296"
  60.         command:
  61.          - Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement