I have an automation that runs an adb command when a certain activity is started on my harmony hub .
However, it doesn’t run the adb command if the activity is already running .
What I need to achieve :
I want to run my harmony activity and in case the activity was already running force the adb command to run separetely, as the automation I currently have only runs the adb command action if the previous activity in harmony was different .
Side Note : Although harmony hub lists the activity as already running you can force it to run again if it’s done from HA, in which case it will just go through all device states and inputs and change any if necessary (for example, if tv is off or different input it will change that when I re-run the activity from HA)
Ideally I’d like to achieve this through an automation so whenever I want to launch my netflix activity in harmony it will also run the adb command to open the netflix app on my android tb but I’m not sure if it can be done that way or if I would need to use a script approach instead .
My third day with HA now so kinda stuck with this one .
I’m not sure you can do what you want. The issue is that Harmony knows it doesn’t need to do anything so it doesn’t update, therefore HA has no idea that anyone pressed a button on the Harmony remote
ha_steve I can launch the Harmony activity directly from HA, from Harmony remote it’s not even an option since it already identifies the activity as running and doesn’t let me re run it again .
I guess it does not make sense to use an automation in this case then ?
I already have a script for running my netflix activity on harmony so maybe better to just add the adb action to that ?
I suppose merging these 2 actions is my only choice here ? The only issue in this case is that I won’t be able to run the harmony hub action directly from the remote or google home assistant …
I guess I’m confused as to what you are trying to do.
What I understand is you want to run your adb command every time you start your Netflix activity. The issue is that if “Watch Netflix” is already the current activity, then telling Harmony to start “Watch Netflix” does nothing. Right?
The reason for that is your trigger will only fire if the current activity changes and the Activity it changes to is “Watch Netflix” . so if it already is Watch Netflix, then your automation will not fire. This is just the way it is. Triggers fire based on something changing (a state, the time, etc.) if nothing changes, then there’s no ‘event’ to cause the trigger.
The only way around this is to always use HA to start “Watch Netflix” then the adb command will run every time because you just make it part of the script or automation (like you said, combine the two things you have in the above post). There will no way you can do this that will work 100% of the time from the remote (due to the fact that nothing changes if you tell Harmony to change to an already active activity, and therefore no trigger event happens in HA)
Edit: You still should be able to use Google Assistant… just have GA run your “start_netflix” script.
Scripts allow you to create if…then…else type logic easier than in automations but the downside is they are not re-entrant so if a script is running you can not call that same script until it completes. This includes if it’s blocked for whatever reason.
I had some glorious scripts to control my lighting but lots of “script already running” and missed events so migrated back to automations except for very specific and non-generic actions.