Currently the light level is only available in Z2M but not yet ZHA, and obviously via the Sonoff hub if you’re connected that way.
I didn’t realise that Z2M offered extra sensor data for these newer devices, I might have to read up on how to set it up and access this extra sensor data.
I find myself in the same situation as you, I’m trying to use the ‘brightness’ and ‘presence’ of the SNZB-06P in an a light automation, it would be a really neat automation.
The documentatioin I reviewed
states that the brightness is only updated when presence is detected so using it in an automation will not be straightforward
Yes, this is happening to me. It usually involves me having to plug it out and in again.
I am currently running Z2M with the Sky Connect adapter and having lots of issues, this being one of them.
The same problem was happening in the folks house so I switched out the Sky Connect adapter for the Sonoff Dongle E and the issues were resolved… Switching the adapter in my own house is my next approach.
Can confirm the exact same issues using HA green, sky connect via Z2M. The luminance detection hasn’t been very accurate. Had an issue with the occupancy status being stuck and had to manually reconnect for it to work.
I too am disappointed with the performance of this sensor. I did not expect that with a constant connection to the network it would be less functional than the Acuara sensor that is powered by batteries.
I have this presence sensor in my kitchen. If the ceiling fan is on it shows Occupied. Once the fan is turned off, it works normally. The luminance detection has not been at all useful.
I just set this sensor up in my house with an almost identical configuration, though my OS is version 13.2 (I didn’t check the other versions), and I don’t have Z2M installed.
I stumbled upon the same issue of the luminance value not being accessible from the automations ‘Devices’ dropdown.
However, I did find it under ‘Entities’ as ‘SONOFF SNZB-06P Last illumination state’, and I could use it as a condition to check for turning a LED strip on when presence is detected.
I just tested this, and everything works as intended: the light turns on when entering the room if it is dark, and doesn’t turn on otherwise.
I wish the light level measurement was more refined than simply dark and light, but this seems to work well enough for the room it is in.
Here’s a screenshot of the working condition (forgive the italian titles, for the life of me I couldn’t manage to switch the app to english):
Grazie mille, Francesco! This works. However the light state of the sensor is only updated when the presence sensor changes state, so using this entity in the conditions of the automation does not work as intended for me as the light state is incorrect when the automation is started. Did you find a solution to this issue?
My use case is as follows: when someone enters the bathroom, I want a LED strip under my sink to dimly turn on only if the room is dark (eg. at night time). If the room is lit (be it by the sun or by the ceiling lamp, which is not smart… yet), nothing should happen.
By simply setting the light state as a condition for the automation (as shown in my screenshot above), this works flawlessly for me. I can only assume that the sensor effectively updates the light state only when presence is detected, but fast enough to be picked up by the condition right after.
I’m dabbling with HA for the very first time, so everything I do is as bog standard and vanilla as it can be, I don’t think I set up anything in a way that makes it work differently from other setups.
Also, looking at your automation I’m not sure I uderstand what you’re trying to achieve: it looks to me like you want to turn on a lamp when presence is detected, then wait 1 second to check if the room is lit, in which case you turn the lamp back off? Again, total noob here, so I’ll be happy to be schooled!
I’m an absolute beginner in Home Assistant. I tried using a condition like your screenshot, but for me it did not work as the condition seems to be checked before the motion detection can update the light state. That is why I’m using this workaround, to wait a little while so the light state can be updated.
If the updated light state is ‘bright’ I turn off the lights again, as they are not needed. If it is ‘dark’ I need the lights so → do nothing (lights are already on).
I’ll update back if I find another solution to this/fix my setup, since it’s working for you.
I was able to improve my workaround by lots of trial and error.
The issue is, the light state is only updated when presence is detected. So if it says “dark” and you leave the room and outside its sunrise and enough light is coming in the window, the state changes to “light” and you enter the room again after the presence has been cleared, it will still trigger the lights. I was able to reproduce this reliably by turning on the conventional lights at night when leaving the room, waiting for the presence to clear and re-entering the room. 1 millisecond is enough for the light state to be updated, so here is my improved workaround for this issue:
I bought this sensor today, it has FW-version 1.0.6 and it seems the behavior has changed. The “Last Illumination State” is not updated when movement is detected. So, using it to switch on lamps appears useless as it will not check whether it is daylight or not…
Seems like a crappy device…
I have the same, I have been in dialogue with Sonoff and requested firmware change so that the Illumination State is reported frequently as it is anyway powered so no need to limit communication.
In the meantime I use the Ikea Vallhorn…