Skip to content

Instantly share code, notes, and snippets.

@smarthomehobby
Created June 11, 2018 00:41
Show Gist options
  • Save smarthomehobby/5e5d4dfed292403e8e1911655309f920 to your computer and use it in GitHub Desktop.
Save smarthomehobby/5e5d4dfed292403e8e1911655309f920 to your computer and use it in GitHub Desktop.
binary_sensor:
- platform: ping
count: 5
scan_interval: 10
name: chromecast_status
host: !secret chromecast_host
switch:
- platform: template
switches:
tv:
friendly_name: TV
value_template: "{{ is_state('binary_sensor.chromecast_status', 'on') }}"
turn_on:
service: script.turn_on
entity_id: script.tv_on_script
turn_off:
service: script.turn_on
entity_id: script.tv_off_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment