seaky / nspanel_pro_tools_apk

286 stars 4 forks source link

Getting illumminance (lux) values from sensor #76

Open acseven opened 4 months ago

acseven commented 4 months ago

I'm using HA companion on my NSPanel Pro and getting illuminance values from the light sensor that the integration publishes.

However, the published values do not make sense (most of the time at ~10.000 lux).

Is there a possilbility to have illuminance values from nspanel_pro_tools_apk available in HA, e.g. via MQTT?

s

seaky commented 4 months ago

Technically yes but I didn't want to flood HA with useless illuminance values i used the following approach: Instead of sending all the values to HA, I left the logic on the Panel side and I introduced tree states. Detect illuminance under certain value, above certain value or between. Those are light-above, light-below, light-undefinied and can be used as a trigger.

In the app if you set the thresholds it will send a trigger in every situation ex: light above is 5000 it means the sun is shining. light-below 800 means the room is dark, between the two values means probably somebody turned the light on in the room.

acseven commented 4 months ago

Thank you for your clarification; I was hoping to have illumminance values on HA for other automation purposes, hence me asking. In any case those triggers may be useful as well, I'll have a look into it.