How to sync homey device state?

Hi,

I have a problem, mainly with the logitech harmony hub and homey but I think it’s more like a general topic. Might be that it already is covered in some topic, didn’t find it with a quick search.

My setup for the harmoney is that I have a virtual device in homey which has on and off actions that trigger flows to do all the magic. I need the virtual device to be able to launch the playstation flow using alexa.

Now I have a second device that can somewhat shut down the device: The harmony remote. But if I start the playstation with alexa > homey flow and then shut it off using the remote, that obviously does not switch the virtual device status back to ‘off’ in homey. So next time I try switching it on with alexa / homey, nothing will happen.

Similar issue with some old radio controlled power switches where I also have the original remote for.

So the general question is, is there some way to sync the state of the virtual device back to homey if switched off from the outside? In case of the harmoney remote, maybe some tricky stuff like having the logitech action triggering a webhook or something like that?

Create a new flow and use the “Activity has stopped” trigger card of the app itself?
That will always trigger when the current activity was stopped.
As for individual devices, you’ll need another way of detecting it, like a power metering wall plug.

Great tip with the app activity trigger, that basically works, with the flaw that it triggers not before harmony is completely done.

This means I have to trigger the activity a second time in my flow (because power is switched on within the flow, harmony cannot do that) and that cuts out the possiblity of switching the virtual device state within the flow because that would trigger an endless loop.

There must be an easier way to do this which I just don’t see. So what I want is:

  • If the Harmony action is started via remote, switch on the power (not possible with harmony, but with homey), then execute the harmony activity and swith the virtual device on without triggering anything else

  • if the virtual device is switched on via alexa, switch on the power and start the harmony activity