Hello Everyone. I am new here and hoping I can get some help.
My end goal is to create a switch that I can setup with Homekit to turn on and off my TV setup (TV, AppleTV, Soundbar)
I have a harmony hub, but I don’t want to use activities, because they tend to fail.
Currently I have the following:
Scripts - I created four individual scripts to do the base items that I wanted - these all work
tv_device_on:
alias: Turn On Vizio
sequence:
- service: remote.send_command
data:
command: PowerOn
device: 46502904
tv_device_off:
alias: Turn Off Vizio
sequence:
- service: remote.send_command
data:
command: PowerOff
device: 46502904
amp_device_toggle:
alias: Turn On/Off Amp
sequence:
- service: remote.send_command
data:
command: PowerToggle
device: 46502932
apple_tv_device_on:
alias: Turn On AppleTV
sequence:
- service: remote.send_command
data:
command: Menu
device: 46502781
I then have two scripts that all the above building blocks. I created these using the UI script creator, so their formatting is different. These also work.
'1526243091969':
alias: Turn On TV
sequence:
- data: {}
service: script.tv_device_on
- service: script.apple_tv_device_on
- service: script.amp_device_toggle
'1526243168145':
alias: Turn Off TV
sequence:
- data: {}
service: script.tv_device_off
- service: script.amp_device_toggle
Now, I run into some trouble. I have created a switch, that I am hoping can turn on and off the “TV” using the scripts above. Right now, the switch is there, but it doesn’t do anything… and it doesn’t keep its state. Once I have this, I plan on connecting this to HomeKit and using Siri to “Turn on TV”
- platform: template
switches:
tv_switch:
friendly_name: 'TV'
value_template: "{{ is_state('switch.TV', 'on') }}"
turn_on:
service: switch.turn_on
data:
entity_id: script.'1526243091969'
turn_off:
service: switch.turn_off
data:
entity_id: script.'1526243168145'
Any help would be greatly appreciated.