Some weeks ago I switched over from using FHEM as my primary home automation system to HA (with a short stop at OpenHab) and never looked back so far.
However, there is one scenario, I could not yet fully cover in HA:
I am using a Harmony Elite remote (incl. hub). When I was using FHEM, at the start of each activity (e.g. “Watch TV”) a first event was reported by FHEM (“Starting activity ‘Watch TV’”), immediately after the respective button press. A second event (“Activity started ‘Watch TV’”) was sent after all of my devices have been turned on.
I have used this to make my devices completely powerless with a smart plug and turn on that smartplug once the first event (“Starting activity ‘Watch TV’”) was triggered by the remote.
If I interpret the home assistant logs and events correctly, HA only receives the second event (“Activity started ‘Watch TV’”), which is not suitable as a trigger for my scenario.
So the steps were as follows:
Me pushing the button.
Event Starting activity ‘Watch TV’
–> My Ha automatically powering on my smart plug
All devices being turned on by Harmony
Event Activity started ‘Watch TV’
Is this really true or am I missing something? The event seems to be generated by the Harmony remote, because it is reported to FHEM. Is it really not visible in HA?
Many thanks for your ideas! I really love home assistant and this community and could solve all problems and tasks by my own.
To make it work faster I’m rather checking the status of devices directly (e.g. media_player.denon) - status of harmony activity changes to on at the end of sequence, but some devices are on earlier… depends on what you want to achieve.
I have now solved this by integrating an Emulated Roku device to my Harmony activities. This gets started at the very beginning of the activity and I use its start to turn my smart plugs on. Works for now. However, I would really appreciate getting more events from Harmony.
Problem with Harmony hub is that they only report activity to HA at the end of running the power-on sequence.
Would be nice to learn of a work-around. Perhaps an input-boolean entity that Harmony can change at its start of activity?
eg Configure this on Harmony:
Turn on exposed entity in HA first
wait 1s. HA turns on plugs, does other things
Harmony do its normal activity sequence
My problem is: I’d turn on Shield TV activity, and then while it’s going through its sequence, I’d start chromecast. But my chromecast-start automation will fire, because its condition “harmony activity = powered off” was still true.
Unfortunately, I don’t have other networked devices in my old-ish media setup I can use to check
As for power management, I got around this by using a dumb IR receiver plug, using it as it was intended for turning on TV. It gets linked to the TV power IR signal. I then tell Harmony to turn on TV twice and not power off when switching activity.
If FHEM can do it, Home Assistant should also be able to. This might depend on using XML or WebSocket mode. I am not sure what Home Assistant currently does but I remember them being different about activity events. Maybe @ehendrix has some insight?
The Hub sends out notifications when change of activity is being triggered. It will first still show the “current” activity as it is powering things off, and then the new activity as it is powering on. Once all completed it then notifies that starting activity is finished. Only once the starting activity is finished will it update what now the new activity is in HA.
Within HA WebSockets are used right now. There is a newer version of the module to allow both XMPP (Logitech supported method) and websockets (works but can break in the future). It prefers XMPP when enabled on the HUB and falls back to web sockets otherwise.
However there is currently an open issue with the XMPP library in HA that this then relies upon and until that is fixed the newer version of aioharmony can’t go in.
See https://github.com/home-assistant/home-assistant/issues/20860
Curious if this event was ever added. I used the “activity starting” even in homeseer (I actually wrote the plugin over there so I know it’s possible).
I don’t need a configuration to have it set the value an event would do and I actually prefer it. I have automations in homeseer that fire off both events based on the scenario.
I.e. turn on the living room TV and the ceiling fan immediately comes on. But turning it off it waits till the power off event to turn off any lights/fans.
I don’t mind chipping in on the code and may take a peep later when I’m at my computer.
So I just checked this. At least now in 2023, the ha devices value is changing on activity start, not on activity complete. If I had to chose between the two I would rather this option.
I just wanted to report back in case anyone else found this thread.
I also checked the events and there is an attribute called “activity_starting” that seems to change to the name of the starting activity and appears to go null when the activity is done. I think I can use this.
The docs should be update, but also having this as a specific event instead of having to depend on attribute changing would be nice. I will check out the integration and see if I can add that and submit a PR for consideration.