turn on the shield activity, then look at current_activity
attribute on the entity 'remote.harmony_hub_woonkamer
. Do this from Developer Tools → States page.
Copy/Paste the text here.
turn on the shield activity, then look at current_activity
attribute on the entity 'remote.harmony_hub_woonkamer
. Do this from Developer Tools → States page.
Copy/Paste the text here.
Thanks for this… brilliant
change your shield TV template to
{{ is_state_attr('remote.harmony_hub_woonkamer', 'current_activity', 'SHIELD\_TV') }}
Hi Petro,
Thanks again.
Normally I eventually manage to get certain things working. But now it just doesn’t work. I did what you suggested, but unfortunately without results. Now the switch doesn’t work at all anymore. Not on and not off. It’s driving me crazy now.
Below is what my config looks like now.
#### Harmony Hub Woonkamer ####
###############################
- platform: template
switches:
### Harmony Hub Woonkamer SHIELD TV Harmony Activty ###
harmony_hub_woonkamer_shield_tv:
unique_id: harmony-activity-harmony_hub_woonkamer-shield_tv
friendly_name: Harmony Hub Woonkamer SHIELD TV
value_template: >
{{ is_state_attr('remote.harmony_hub_woonkamer', 'current_activity', 'SHIELD\_TV') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub_woonkamer
data:
activity: SHIELD TV
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub_woonkamer
data:
activity: PowerOff
This is how my harmony_xxxx.conf looks like.
"Activities": {
"-1": "PowerOff",
"51844540": "Ziggo TV",
"51844541": "SHIELD\u00a0TV",
"51844542": "Chromecast Denon",
"51844543": "Ziggo Radio",
"51844544": "Netflix",
"51844545": "Heos Radio",
"52447163": "Wii spelen"
Updated to remove the {% set entity ...}
line (so it matches what you said in your directions), and it still doesn’t work, and throws the same error.
Have you ever used include_dir_merge_list
? I think there may be something with that setup that breaks your solution.
No… you don’t paste that into your configuration.
You’re completely skipping this step.
I see. Sorry, I thought this code would dynamically monitor and generate switches for activities permanently, not just output code to THEN put in my yaml files. I understand now.
So I will need to run this whenever my activities change (add/remove, etc). Thanks.
Hi,
Finally I got it working. The problem was with the MyHarmony app. I changed the names of the activities that caused problems. Reloaded the integration and changed the code.
Apparently the Harmony integration or the code is uppercase and lowercase sensitive.
See my final config below.
#### Harmony Hub Woonkamer ####
###############################
- platform: template
switches:
### Harmony Hub Woonkamer SHIELD TV Harmony Activty ###
harmony_hub_woonkamer_shield_tv:
unique_id: harmony-activity-harmony_hub_woonkamer-shield_tv
friendly_name: Harmony Hub Woonkamer Shield Tv
value_template: >
{{ is_state_attr('remote.harmony_hub_woonkamer', 'current_activity', 'Shield Tv') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub_woonkamer
data:
activity: Shield Tv
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub_woonkamer
data:
activity: PowerOff
{
"Activities": {
"-1": "PowerOff",
"51844540": "Ziggo TV",
"51844541": "Shield Tv",
"51844542": "Chromecast Denon",
"51844543": "Ziggo Radio",
"51844544": "Netflix",
"51844545": "Heos Radio",
"52447163": "Wii spelen"
},
Thanks!
hello, so if im taking this right, following the template code and pasting that into my confi.yaml file. this will make my switch buttons work as they were? or is there something im missing after doing all that?
Yes. If you follow Petro’s template code. Restart HA and the switches will appear again under entities.
Good day,
I have this in my configuration file copied, the switches appear, but only turn off is working.
greetings, Marc
switch:
- platform: template
switches:
### Harmony Hub SHIELD TV Harmony Activty ###
harmony_hub_shield_tv:
unique_id: harmony-activity-harmony_hub-shield_tv
friendly_name: Harmony Hub SHIELD TV
value_template: >
{{ is_state_attr('remote.harmony_hub', 'current_activity', 'SHIELD TV') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: SHIELD TV
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: PowerOff
### Harmony Hub Radio Harmony Activty ###
harmony_hub_radio:
unique_id: harmony-activity-harmony_hub-radio
friendly_name: Harmony Hub Radio
value_template: >
{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Radio') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: Radio
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: PowerOff
### Harmony Hub Ziggo Harmony Activty ###
harmony_hub_ziggo:
unique_id: harmony-activity-harmony_hub-ziggo
friendly_name: Harmony Hub Ziggo
value_template: >
{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Ziggo') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: Ziggo
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: PowerOff
### Harmony Hub Videorecorder Harmony Activty ###
harmony_hub_videorecorder:
unique_id: harmony-activity-harmony_hub-videorecorder
friendly_name: Harmony Hub Videorecorder
value_template: >
{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Videorecorder') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: Videorecorder
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: PowerOff
### Harmony Hub Satelliet Harmony Activty ###
harmony_hub_satelliet:
unique_id: harmony-activity-harmony_hub-satelliet
friendly_name: Harmony Hub Satelliet
value_template: >
{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Satelliet ') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: Satelliet
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: PowerOff
### Harmony Hub Blu-ray Harmony Activty ###
harmony_hub_blu_ray:
unique_id: harmony-activity-harmony_hub-blu_ray
friendly_name: Harmony Hub Blu-ray
value_template: >
{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Blu-ray') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: Blu-ray
turn_off:
service: remote.turn_on
target:
entity_id: remote.harmony_hub
data:
activity: PowerOff