Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. - alias: "Spegnimento Kodi"
  2. initial_state: 'on'
  3. trigger:
  4. - platform: state
  5. entity_id: switch.scenario_samsung_off, switch.scenario_toshiba_off, switch.scenario_western_off
  6. to: 'on'
  7. action:
  8. - service: media_player.turn_off
  9. entity_id: media_player.kodi
  10. - delay: '00:00:02'
  11. - service: script.source
  12. - delay: '00:00:01'
  13. - service: script.sinistra
  14. - delay: '00:00:01'
  15. - service: script.conferma
  16. - delay: '00:00:02'
  17. - service_template: >
  18. {% if trigger.entity_id == 'switch.scenario_samsung_off' %}
  19. shell_command.scenario_samsung_off
  20. {% elif trigger.entity_id == 'switch.scenario_toshiba_off' %}
  21. shell_command.scenario_toshiba_off
  22. {% elif trigger.entity_id == 'switch.scenario_western_off' %}
  23. shell_command.scenario_western_off
  24. {% endif %}
  25.  
  26. shell_command:
  27. scenario_samsung_off: "curl -k POST 'http://cock46.duckdns.org:50202/?btn=VSCENARIO8&act=1&kp=0'"
  28. scenario_toshiba_off: "curl -k POST 'http://cock46.duckdns.org:50202/?btn=VSCENARIO6&act=1&kp=0'"
  29. scenario_western_off: "curl -k POST 'http://cock46.duckdns.org:50202/?btn=VSCENARIO7&act=1&kp=0'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement