seaky / nspanel_pro_tools_apk

361 stars 7 forks source link

HA Fully Kiosk and HACS Wallpanel Prescence Detection #41

Open pacmac opened 8 months ago

pacmac commented 8 months ago

See this post: https://community.home-assistant.io/t/nspanel-pro-custom-android-apps-working/459563/197?u=crankshaft

Spent today trying to find a solution for this but could not.

Is there any known way to disable the HACS wallpanel screensaver when presence is detected on the nspanel ?

there is the input_boolean.wallpanel_screensaver option in home assistant, but I see no way of linking this to the presence detection or any kind of event triggers in Fully Kiosk

seaky commented 7 months ago

will be implemented in v2.1

pacmac commented 7 months ago

Thanks, I found a solution by enabling the injecting javascript:

setInterval(() => { fully.getSensorValue(8) > 250 && document.querySelector("home-assistant").shadowRoot.querySelector("home-assistant-main").shadowRoot.querySelector("wallpanel-view").stopScreensaver(); }, 500);

Under Other Settings, Enable Enable Environment Sensors and paste the above code into Advanced Web Settings > Inject JavaScript

But it's not very efficient as it is polling every 500ms, but it has been working well for a couple of weeks.