Sensor for non-reporting entitiy

I am using a dashboard to replicate the harmony remote for my entertainment system.
I have 3 different activities… roku, chromecast and xbox… all is working fine.

but, one thing missing from the real harmony remote and the dashboard is the home key while the roku activity is active.

i added that button and it works fine…

but…

its only valid when the roku activity is active.
SO I used the conditional card to show the card ‘when the roku activity’ is active.

but the harmony integration doesn’t report when that changes (it does, but doesn’t trigger an event)… i created boolean helpers, but they aren’t persistent. so this button appears when I start the activity, but a few seconds later the dashboard updates and the button goes away cause the boolean is reset to false…

i use the ping integration to test if the TV is on in the scripts connected to the dashboard buttons…(no point turning off if no activity is on!)

but I haven’t found a way to make a timed (few seconds) repeating check if the harmony current_activity attribute is still set to the roku activity name…

anyone have any pointers… thanks

obtw, the harmony integration does not reset the current_ (or last_) activity when it gets turned off… so I have to check if the tv is on AND the correct activity for the condition for the card

answer my own question, create a helper, template , sensor

template code, u need to set the name of your harmony hub here

{{ state_attr('remote.harmony_hub','current_activity') }}

this returns the current activity value, which you can then check in a condition