I have set up the Harmony Hub as per the advice in another thread.
I have a quite simple choice, just with activity selection.
The problem is that when I do a PowerOff, the Hub powers everything off, and then after a short while the PS3 is turned on again.
In my configuration.yaml I have this:
remote:
- platform: harmony
name: Stue harmonyhub
host: A.B.C.D
port: 5222
input_select:
stue_remote:
name: Fjernbetjening i stuen
options:
- PowerOff
- TV
- PS4
- PS3
- TV med Surround
- Musiccast
- PS3
- Spil Wii
- Hør radio
initial: PowerOff
icon: mdi:monitor
My automations.yaml has these:
- alias: Remote external update living room
trigger:
platform: state
entity_id: remote.stue_harmonyhub
action:
service: input_select.select_option
data_template:
entity_id: input_select.stue_remote
option: "{{ states.remote.stue_harmonyhub.attributes.current_activity }} \n"
- alias: Remote start activity from input select living room tv
trigger:
platform: state
entity_id: input_select.stue_remote
action:
service: script.turn_on
entity_id: script.input_select_harmony
seem’s like you’re getting a feedback loop. Your automations will circularly call each other when 1 is triggered. hit remote -> change input select -> detect input select change -> change remote -> change input select -> detect input select change -> etc
This is why I moved to buttons in the UI instead. No feedback loop, just longer configuration.
Hi @petro, hmm, well it only happens for poweroff, and there it turns on the ps3 after a while. If I change it to buttons, how do I then see the current state of the harmony?
You can make a sensor that displays the current state, if you want to see that. Otherwise you can have a setup like mine: This is what it looks like off.
The xbox, playstation, wii u, switch, and tv are the activities. the power off activity is inverted on the upper left button. So technically, in this state, the harmony activity is ‘PowerOff’.
So, the poweroff activity is actually off, but the inverted button makes it look like there is power going to the harmony. I liked this more than having the activity displayed on when off. And the current activity is xbox. Having the button appear on makes it pretty clear that xbox is on.
If you click on my name, you can see my entire configuration for this. It’s complicated but I can help set it up.
Take a look this post for the backend. This is my old setup. Most of the switches and backend sensors have not changed when I moved to the interface above.
Did you ever figure this out? My PS3 does this too almost every night when the harmony hub is sent a remote.power_off from my ‘go to sleep’ script, but I have a difficult time isolating/reproducing it reliably.
I’ ve debugged this a little further and it seems to happen if you poweroff the activity twice… so if the state is already powered off, you send another ‘poweroff’. It also does from the harmony companion remote.
So to reproduce: Start an activity -> Power off activity -> Power off again
…and the PS3 turns on.
But… it only does it the first time after powering off an activity. Because on subsequent poweroffs it seems to select a random other device to power ON … yet another example of Harmony software quality.
So I suspect in your case you call remote.turn_off twice somehow.
Myself I’m going to implement a check for the current state of the hub before sending a poweroff. I.e.: don’t send a poweroff if it’s already off.
But Petro, as I see your description you have the ‘automations’ in harmony duplicated to HA, and just use the harmony as a IR blaster, and then I will loose the ability to use the remotes’ automations, or did I miss something?
All that i’m doing is creating activity buttons. So instead of a dropdown list and 2 automations, you have a series of switches that act as the dropdown list items.
To elaborate. Lets say you have 3 activities: TV, Playstation, and Xbox.
In your setup, you have an input_select with 4 options: TV, Playstation, Xbox, and PowerOff.
In my setup, I have 3 switches: switch.tv, switch.playstation, switch.xbox.
No power off because you just flick the switch that’s on to off and it will power off.
If you select an item from your input select. It triggers an automation1 to change the activity. The change in activity triggers automation2 to update the input_select. Which triggers automation1 to change the activity… Do you see the feedback loop now?
I never use the power off button as the remote then becomes useless and won’t control the lights, fan etc.
Better method is to create a ‘Bedtime’ or ‘All off’ activity, don’t add any devices that you want to turn off automatically and then they will when starting this activity. You can then program any buttons, real or otherwise, to control your lights etc as per normal.
No need to worry about self-inflicted problems then
Also watch out for what you have sending IR in case you are getting reflections, by default the hub and blasters all send everything, just set each device to only use the most appropriate one.
That works for me and the setup is more “elegant” than having to enumerate everything many times.
Needless to say that you may (and I have) mirror the input_select in some input_booleans to be exported to homekit, so that you get voice control of the whole thing.
Welcome and big thanks to petro for helping out with my solution while I was AFK
If you are exposing the input_select by translating into input_boolean state for homekit, you would have to put something similar also there. (I have done some, so far no problems)
I’ve just added a projector to the livingroom (will add a screen for it also), it has no activity set up yet, but now that turns on when I turn off the tv, rather odd I’m not sure if it’s the harmony itself doing that, or if it’s the automations yet.