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
Yep, it broke again. According to my studio code server remote.turn_on is also now deprecated. This is getting old.
remote.turn_on is not deprecated, likely you’re looking at vscode telling you the word service
changed to action
. Which you don’t have to change because service
is not deprecated.
You were right! Just wanted to say thanks.
Petro, thanks a ton!
I somehow missed the template code to auto create a switch list.
I now have working switches.
I have a question on operations…
Previously, when the switches were part of the Logitech integration you could switch from one “Activity” to another and the remote would change what needed to be changed.
Activities are for example ‘laserdisc’, with equipment turned on and inputs set…with next activity selected (like bluray) in the old method, it would only change the inputs and power things on as needed.
My interface is based on AppDaemon and my buttons allowed the switching.
I have now applied the new template ‘switches’ to my AppDaemon setup, however something must be set up wrong.
I cannot switch from Activity to Activity, it stays locked to first activity selected…if I deselect the activity, everything is shut off.
So somehow I am missing some setting where I can just toggle the next activity.
Here is an example AppDaemon button…
laserdisc_scene:
widget_type: switch
title: Watch
title2: Laserdisc
entity: switch.hub_laserdisc
icon_on: mdi-movie-roll
icon_off: mdi-movie-roll
Here is the associated template switch.
hub_laserdisc:
unique_id: harmony-activity-hub-laserdisc
friendly_name: hub LaserDisc
value_template: >
{{ is_state_attr('remote.hub', 'current_activity', 'LaserDisc') }}
turn_on:
service: remote.turn_on
target:
entity_id: remote.hub
data:
activity: LaserDisc
turn_off:
service: remote.turn_on
target:
entity_id: remote.hub
data:
activity: PowerOff
I guess really, the activity is the only thing that needs to be activated…so I guess I could have a separate power on button?
Now when I use the Harmony Remote, the above icons indicate correctly based on the “Activity” and it switches as I expect…so I guess I need to change the template.
Mic
Post what’s written in your device file. You’re likely using the wrong activity name
Do you mean in the Harmony_.conf file?
The button works…but I cannot select a different button (the Laserdisc one was just an example) The mode is locked in until I select the same activity again, and then it shuts the whole system off.
Back when the integration had the switches, I could jump from activity to activity in the same manner as with the remote.
With the remote I can move from activity to activity without the system having to shut down.
So I guess, I cannot use the template as shown…I need to be able to change activities without manually deselecting the previous activity.
Mic
"Activities": {
"-1": "PowerOff",
"23079344": "LaserDisc",
"23079372": "Bluray",
"23080087": "XBMC",
"24324490": "House Lights Up",
"24324896": "House Lights Dim",
"24538242": "Popcorn-Equipment",
"25950710": "DVD Changer",
"32656645": "Lights out",
"34398368": "Roku",
"34456145": "Dish Network",
"37343763": "Kodi",
"37384057": "Plug Power Toggle",
"50380420": "Receiver Power",
"52949639": "AppleTV"
I don’t know what you mean here with the phrase “The mode is locked in”. Can you explain with pictures or video instead?
Hard to show with a picture…but lets see.
The 7 items that say “Watch” at the top are Logitech Harmony “Activities”.
Before they changed the Logitech integration, those were switches that activated the different “Activities”.
Harmony handles all the grunt work. With any activity I click on, Harmony will determine if the appropriate hardware is powered on and on the correct input (based on a status it maintains), then if necessary change any parameters (like input).
So let’s say “Watch Bluray” has been selected and the Harmony has finished setting everything up for that ‘Activity’. Now If I select any OTHER activity…lets say “Watch Roku”, the Harmony knows the projector and receiver are aleady powered on, (Roku stays powered on) so the remote only changes the inputs. At least that is how it worked before the integration change.
Now, with the current integration, and the switches set up from your template, If “Watch Bluray” is selected and running, the other ‘Activity’ buttons do not operate. I can press them, but nothing happens. If I deselect “Watch Bluray” then everything powers off, but now I can select a different ‘Activity’.and everything will power back up but for the new ‘Activity’.
The switches on your template work, they just do not allow any other activity to be selected while one is active…I barely understand switches (this system has been operating for about 2 and a half years…I barely understand what I have built…there are about 10 other pages of switches and things for the various pieces and parts around the house)
For the record, my physical Harmony Remote Control still operates correctly.
So the Activities are not working as they would if I was pressing a button on the remote.
A workaround for now is creating a script for each ‘Activity’…but it still isn’t as graceful as the old integration.
Mic