Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.54k stars 1.63k forks source link

Trying to set up SONOFF SNZB-06P timeout - what's the format? #19771

Open fribse opened 8 months ago

fribse commented 8 months ago

What happened?

I've set up the SONOFF SNZB-06P in Z2M, it is recognized nicely. There is only one topic in 'Exposes', and that is occupancy

There is no Sensitivity Setting and there is no Timeout setting exposed. Both of these are available in Sonoff's own Zigbee bridge. There is some explanation in 'Settings (specific)' that explains Sends a message after the last time no occupancy (occupancy: false) was detected. So it looks like you can have it send multiple messages. It also explains that it should be set to an object like [10,60] and it will then send a message after 10s and after 60s. But the field shown does not accept objects, only numbers, and setting it to a number doesn't change anything.

What did you expect to happen?

That I could enter [10] and it would timeout after 10s, or [60] and it would time out after 60s. When I saw the device was supported, I actually expted it to support the parameters exposed to eWeLink though Sonoff ZBBridge.

How to reproduce it (minimal and precise)

Just add it to Z2M

Zigbee2MQTT version

1.33.2

Adapter firmware version

20230507

Adapter

TubesZB CC2652P2 POE adapter

Debug log

No response

Busta999 commented 8 months ago

Same issue.

Tested 2 so far, it reports occupancy indefinitely even when placed in an empty box.

occupancy is permanently on

tjeffree commented 8 months ago

@Busta999 I got a couple delivered today. They do work ok at reporting occupancy - it's annoying that I can't adjust the timeout yet so they don't "clear" for 60 seconds.

I did have to reset one a couple of times closer to a coordinator to get it to report something other than "N/A". Press and hold the button for ~5 seconds.

nadi1971 commented 8 months ago

Same here. I tried to configure it on both Z2M and ZHA, the status is always occupancy detected

ramyaladdin commented 8 months ago

same thing here , Its always showing occupancy detected, I did reset it for a couple of times and it gets configured but then shows offline all the time.

Busta999 commented 8 months ago

I have ordered a Sonoff Hub to test the sensors on.

Identify if I have bad sensors or an issue in zigbee2MQTT.

should have an answer by Wednesday this week.

yanhao666 commented 8 months ago

Right now the minimum timeout can be set to 30s. Setting below 30s will keep the device occupied. Both ZHA and Z2M can configure it. image image And it will be optimized to 15s in the V1.0.5 firmware, sonoff is working on it. OTA may be available in the coming weeks.

yanhao666 commented 8 months ago

Same issue.

Tested 2 so far, it reports occupancy indefinitely even when placed in an empty box.

occupancy is permanently on

In fact, microwave radar can penetrate most non-metallic materials, including walls. Moreover, it has reflection capabilities, meaning that objects in motion behind the sensor or outside of the room may trigger it.

Busta999 commented 8 months ago

Same issue. Tested 2 so far, it reports occupancy indefinitely even when placed in an empty box. occupancy is permanently on

In fact, microwave radar can penetrate most non-metallic materials, including walls. Moreover, it has reflection capabilities, meaning that objects in motion behind the sensor or outside of the room may trigger it.

Good point, I tested the device in a closed cardboard box with sensor pointing away from towards a wall and it continued to report occupancy.

Overnight the sensor reset to clear, when the room was unoccupied.

I have just returned to the room and the sensor did take 60+ seconds to report occupied.

It went to clear very quickly after leaving the room, No occupancy is set to 1 second.

I’ll have the sonoff hub hopefully today and will test further.

But your point is valid and I suspect correct, the device was continuing to detect presence, even while sat in cardboard box.

If it continues to function as this morning’s testing indicates then this device will perform as desired.

Use a PIR sensor to detect entrance into the space to turn on lights, then use the Sonoff to detect ongoing presence to stop lights from going off.

My main use case is in rooms where people may be still for longer periods than a PIR sensor time out period, for me Lounge, Kitchen, Office.

At this stage I am not so sure either sensor of zigbee2MQTT is malfunctioning, I suspect the sensor is just slow identifying and reporting occupancy, which for its price, is ok and workable.

Will perform further testing on zigbee2MQTT and sonoff hub.

fribse commented 8 months ago

I have ordered a Sonoff Hub to test the sensors on.

Identify if I have bad sensors or an issue in zigbee2MQTT.

should have an answer by Wednesday this week.

As I wrote, it was set up with that already, and it works, I can also see it showing clear now, so I guess it's working. And thankyou to all you other guys about how to interpret the explanation on the 'Time' in Settings Specific, seems like the text is simply wrong.

Pedro-vk commented 7 months ago

Same issue here, the documentation is not very clear about how to configure the timeout format and, apart from that, it always emits a {"occupancy": true}

evelant commented 7 months ago

What's needed to allow zigbee2mqtt to configure the sensitivity of the sensor? The product page lists "Three levels of sensitivity (2.5m, 3.5m, 4m)" but there's no way to configure it yet in z2m

nanderson97651 commented 7 months ago

What's needed to allow zigbee2mqtt to configure the sensitivity of the sensor? The product page lists "Three levels of sensitivity (2.5m, 3.5m, 4m)" but there's no way to configure it yet in z2m

In addition the marketing materials mention some sort of lux sensor but I don't see it exposed either.

Busta999 commented 7 months ago

In the Sonoff Hub you can automate against Luminance High/Low with no configuration of thresholds.

I’ll check the exact field names.

nanderson97651 commented 7 months ago

In the Sonoff Hub you can automate against Luminance High/Low with no configuration of thresholds.

I'm using Z2M with SkyConnect and Home Assistant so no Sonoff Hub anywhere in my system. I was hoping to still be able to automate based on ambient brightness.

Busta999 commented 7 months ago

The hope is that the basic luminance along with presence sensitivity will be added to zigbee2MQTT, I am pretty new to zigbee2MQTT so not yet sure how that happens

nanderson97651 commented 7 months ago

I'm also new to Z2M, switching from ZHA. Happy to help where I can to get these added but it's pretty new territory for me.

yanhao666 commented 7 months ago

What's needed to allow zigbee2mqtt to configure the sensitivity of the sensor? The product page lists "Three levels of sensitivity (2.5m, 3.5m, 4m)" but there's no way to configure it yet in z2m

The sensitivity can be configured here. "1" means 2.5m, "2" means 3.5m, "3" means 4m image

evelant commented 7 months ago

@yanhao666 thanks! How did you find this information? Or rather, where do you find the information about which clusters/attributes can be used to configure any particular device?

fribse commented 7 months ago

The sensitivity can be configured here. "1" means 2.5m, "2" means 3.5m, "3" means 4m image

Gold information, thankyou @yanhao666 !

evelant commented 7 months ago

Hmm it also seems like binding isn't working properly with this sensor. When I try to bind it to a group of lights it doesn't turn them on/off. There's seemingly no way to bind to the on/off cluster of the target. Trying to bind to an individual bulb (ikea tradfri in this case) only shows the "Identify" cluster.

image

KmanOz commented 7 months ago

What's needed to allow zigbee2mqtt to configure the sensitivity of the sensor? The product page lists "Three levels of sensitivity (2.5m, 3.5m, 4m)" but there's no way to configure it yet in z2m

The sensitivity can be configured here. "1" means 2.5m, "2" means 3.5m, "3" means 4m image

Yes this worked for me. Thank you.

zaberxxx commented 7 months ago

Mine showing occupied permanently. I tried chaging the ultrasonicOToUDelay to 30, and ultrasonicUToOThreshold to 1, still no luck. Will repairing the device to Z2M help? The firmware is still 1.0.3 and I don't know how to upgrade to 1.0.5 (I don't own a sonoff hub), no upgrade option in Z2M OTA section.

Bod1985 commented 7 months ago

Mine showing occupied permanently.

I tried chaging the ultrasonicOToUDelay to 30, and ultrasonicUToOThreshold to 1, still no luck.

Will repairing the device to Z2M help?

The firmware is still 1.0.3 and I don't know how to upgrade to 1.0.5 (I don't own a sonoff hub), no upgrade option in Z2M OTA section.

I had to re-pair mine a few times to make them work. Then when they started working they were fine until I turned off power and rebooted them.

I don't believe 1.0.5 is available yet. 1.0.3 is the current firmware I think

linkedupbits commented 7 months ago

Hmm it also seems like binding isn't working properly with this sensor. When I try to bind it to a group of lights it doesn't turn them on/off. There's seemingly no way to bind to the on/off cluster of the target. Trying to bind to an individual bulb (ikea tradfri in this case) only shows the "Identify" cluster.

image

I raised a ticket with Sonoff: “Hi, The presence detector works well, and is linked into Zigbee2MQTT easily. However, the detector doesn’t appear to support binding to lights to control them directly without the coordinator. Is the firmware likely to be updated to support this?” I got this reply: “ Sorry, now we could not support this function.

Regards, Frankie in SONOFF “

KmanOz commented 7 months ago

Mine showing occupied permanently. I tried chaging the ultrasonicOToUDelay to 30, and ultrasonicUToOThreshold to 1, still no luck. Will repairing the device to Z2M help? The firmware is still 1.0.3 and I don't know how to upgrade to 1.0.5 (I don't own a sonoff hub), no upgrade option in Z2M OTA section.

Mine did that as well. It's very sensitive. I moved the position of mine on the wall and has worked well since.

evelant commented 7 months ago

@linkedupbits lol thanks for trying, the product page says 【Local Smart Scene】Scene linkage between Zigbee devices can be executed normally even if there is no internet connection. which I took to mean it supports bindings. Not sure what else it could mean.

I guess they just meant that zigbee hubs continue to work even if the internet is down.

Bod1985 commented 7 months ago

Zigbee2MQTT update has enabled OTA for these.

I've just updated mine to 1.0.5, hopefully there's some improvement.

Does anyone know if/where Sonoff publish firmware changelogs?

rjmcfadd commented 7 months ago

Zigbee2MQTT update has enabled OTA for these.

I've just updated mine to 1.0.5, hopefully there's some improvement.

Does anyone know if/where Sonoff publish firmware changelogs?

How did you update it? When I try to check for an update it says "Failed to check if update available for 'Office presence sensor' (Unexpected token  in JSON at position 0)".

Bod1985 commented 7 months ago

Zigbee2MQTT update has enabled OTA for these. I've just updated mine to 1.0.5, hopefully there's some improvement. Does anyone know if/where Sonoff publish firmware changelogs?

How did you update it? When I try to check for an update it says "Failed to check if update available for 'Office presence sensor' (Unexpected token � in JSON at position 0)".

Strange, all three of my sensors updated without error. Sorry I don't have any suggestions as I haven't done many Z2M OTA upgrades

rjmcfadd commented 7 months ago

What does

Zigbee2MQTT update has enabled OTA for these. I've just updated mine to 1.0.5, hopefully there's some improvement. Does anyone know if/where Sonoff publish firmware changelogs?

How did you update it? When I try to check for an update it says "Failed to check if update available for 'Office presence sensor' (Unexpected token � in JSON at position 0)".

Strange, all three of my sensors updated without error. Sorry I don't have any suggestions as I haven't done many Z2M OTA upgrades

What does the OTA settings page look like in your Z2M?

image

Bod1985 commented 7 months ago

What does

Zigbee2MQTT update has enabled OTA for these. I've just updated mine to 1.0.5, hopefully there's some improvement. Does anyone know if/where Sonoff publish firmware changelogs?

Strange, all three of my sensors updated without error. Sorry I don't have any suggestions as I haven't done many Z2M OTA upgrades

What does the OTA settings page look like in your Z2M?

Like this, I’m running 1.34.0

IMG_0698

rjmcfadd commented 7 months ago

What does

Zigbee2MQTT update has enabled OTA for these. I've just updated mine to 1.0.5, hopefully there's some improvement. Does anyone know if/where Sonoff publish firmware changelogs?

Strange, all three of my sensors updated without error. Sorry I don't have any suggestions as I haven't done many Z2M OTA upgrades

What does the OTA settings page look like in your Z2M?

Like this, I’m running 1.34.0

IMG_0698

Oh sorry, I meant the OTA index override file name. I feel like mine is wrong which is why I can't update.

zaberxxx commented 7 months ago

Still not able to make mine sensor working properly. Tried numerous times of repairing, off power, change position, upgrade to v1.0.5, reboot zigbee2mqtt service, still not able to get it work... I also tried change settings is dev console but is it normal that when I write the new number into ultrasonicUToOThreshold, there's no indicator on page showed that I successfully wrote in?

EDIT: I later tried setting the sensor in a blank space with no moving parts to interfere, and it works properly. This sensor is too sensitive and even the bathroom ventilator/dryer will trigger it.

hjpfourie commented 7 months ago

When I read or write the settings, I get a visible indictaor that it has either read, or set the values as per screenshot.

image

image

evelant commented 7 months ago

@zaberxxx @hjpfourie There's a silly bug in the UI. If you have filtered the logs tab then messages don't show up in the dev console. Go to the logs tab and make sure log level is set to "info" or "debug" and then you will see readouts in the dev console.

yanhao666 commented 7 months ago

Still not able to make mine sensor working properly. Tried numerous times of repairing, off power, change position, upgrade to v1.0.5, reboot zigbee2mqtt service, still not able to get it work... I also tried change settings is dev console but is it normal that when I write the new number into ultrasonicUToOThreshold, there's no indicator on page showed that I successfully wrote in?

EDIT: I later tried setting the sensor in a blank space with no moving parts to interfere, and it works properly. This sensor is too sensitive and even the bathroom ventilator/dryer will trigger it.

@zaberxxx After configuring the sensitivity, did it work for you? I mean, in the original place.

KmanOz commented 7 months ago

I found that after I upgraded to 1.0.5 I have to re-write the register as their firmware seems to have defaulted it back to 3

barcelona92 commented 7 months ago

What does

Zigbee2MQTT update has enabled OTA for these. I've just updated mine to 1.0.5, hopefully there's some improvement. Does anyone know if/where Sonoff publish firmware changelogs?

How did you update it? When I try to check for an update it says "Failed to check if update available for 'Office presence sensor' (Unexpected token � in JSON at position 0)".

Strange, all three of my sensors updated without error. Sorry I don't have any suggestions as I haven't done many Z2M OTA upgrades

What does the OTA settings page look like in your Z2M?

image

Hi,

I have the same problem appear erro with check for update in SNZB-06 the error: Failed to check if update available for 'Pres entrance' (localIndex.concat(...).map is not a function)

image

Typ1er commented 7 months ago

I can neither read nor write the sensor. what am I doing wrong? Bildschirmfoto 2023-12-12 um 16 04 38

hjpfourie commented 7 months ago

I can neither read nor write the sensor. what am I doing wrong? ![Bildschirmfoto 2023-12-12]

You haven't selected the attribute, only the cluster. Select the attribute you want to read or write.

zaberxxx commented 7 months ago

Still not able to make mine sensor working properly. Tried numerous times of repairing, off power, change position, upgrade to v1.0.5, reboot zigbee2mqtt service, still not able to get it work... I also tried change settings is dev console but is it normal that when I write the new number into ultrasonicUToOThreshold, there's no indicator on page showed that I successfully wrote in? EDIT: I later tried setting the sensor in a blank space with no moving parts to interfere, and it works properly. This sensor is too sensitive and even the bathroom ventilator/dryer will trigger it.

@zaberxxx After configuring the sensitivity, did it work for you? I mean, in the original place.

It works 95% of the time, but sometime false recognition still occurs.

metec22 commented 7 months ago

This device is really disappointing. Is anyone else's sensor behaving like a motion sensor? It's about 2-3 ft away from me and if I sit still, it will stop showing presence (if it's not stuck showing presence for hours when no one is present). I have two of them, one on firmware 1.0.5 and one on 1.0.3. Both behave the same way.

yanhao666 commented 7 months ago

This device is really disappointing. Is anyone else's sensor behaving like a motion sensor? It's about 2-3 ft away from me and if I sit still, it will stop showing presence (if it's not stuck showing presence for hours when no one is present). I have two of them, one on firmware 1.0.5 and one on 1.0.3. Both behave the same way.

@metec22 It seems possible that the radar microwave has been interfered with. Are there metal objects blocking the middle? Or using another radar nearby at the same time?

evelant commented 6 months ago

HA 2023.12.x seems to have issues with zigbee and/or mqtt, devices go "unavailable" in HA even though z2m is still communicating with them. Other than that when the network is working smoothly I don't have any of those issues with these sensors. They respond fast and state stays "occupied" when people are still. I set msOccupancySensing -> ultrasonicUToOThreshold to 3 on all of mine. If you have two or more of the sensors too close to each other or pointed toward each other they can interfere. Any other radar based devices might interfere as well (I think some security systems?).

metec22 commented 6 months ago

Weird. I don't have any metal objects anywhere near the sensor. I only used one sensor at a time in the same spot. It's also much slower than a motion sensor I was hoping to replace. When I walk into the room, it takes about 2-3 seconds for the light to come on. On the updated sensor, I set the time out to 30s and tried all three settings for threshold. On the one with the older firmware, I haven't changed anything. Maybe there is some interference in the room but nothing obvious.

fribse commented 6 months ago

@metec22 , for me it sounds defective. I have three mw sensors on top of each other while testing, they all work perfectly, and with the released notes on how to adjust sensitivity / duration, and the firmware at 1.0.3 it works quite nicely.

Alfy1080 commented 6 months ago

This device is really disappointing. Is anyone else's sensor behaving like a motion sensor? It's about 2-3 ft away from me and if I sit still, it will stop showing presence (if it's not stuck showing presence for hours when no one is present). I have two of them, one on firmware 1.0.5 and one on 1.0.3. Both behave the same way.

I received 6 of these sensors yesterday. I've set up one per room in z2m and upgraded the firmware to v1.0.5. One of them is in a 5 meter long hallway with no interference source whatsoever, but the detection time sometimes is instantaneous and sometimes it takes about 3 seconds to detect presence. Another one of these sensors is in my bedroom and while awake and present in the room i see that it properly stays as "Detected" all the time until i leave the room. However, overnight when both me and my wife were sleeping in that bedroom, the sensor switched between "Detected" and "Clear" every few minutes. This has happened with detection sensitivity set to high. If i set it to medium or low it would switch to "Clear" even when I am awake on my laptop in bed. Seems an awful lot like a motion sensor at this point. I've now realised that the nest hub that i also have in the bedroom might interfere with the presence sensor as it uses radar to detect gestures and monitor sleep so i've turned off these features, but to me it sounds like that kind of interference should keep the presence sensor in "Detected" state instead of making it think the room is clear. Anyway I'll get back with new info after testing it overnight.

Edit: after testing with different sensitivity settings and timeout periods, the presence sensor still behaves like a motion sensor. Overnight it constantly changes to detected and clear several times.

Bonus: today, out of the blue, the presence sensor in the bathroom got stuck on detected state for 6 hours without anyone entering or exiting the bathroom for the entire time. No potential interference sources exist in the bathroom (fans, air conditioners, other radar based devices).

Testmangh commented 6 months ago

This device is really disappointing. Is anyone else's sensor behaving like a motion sensor? It's about 2-3 ft away from me and if I sit still, it will stop showing presence (if it's not stuck showing presence for hours when no one is present). I have two of them, one on firmware 1.0.5 and one on 1.0.3. Both behave the same way.

I received 6 of these sensors yesterday. I've set up one per room in z2m and upgraded the firmware to v1.0.5. One of them is in a 5 meter long hallway with no interference source whatsoever, but the detection time sometimes is instantaneous and sometimes it takes about 3 seconds to detect presence. Another one of these sensors is in my bedroom and while awake and present in the room i see that it properly stays as "Detected" all the time until i leave the room. However, overnight when both me and my wife were sleeping in that bedroom, the sensor switched between "Detected" and "Clear" every few minutes. This has happened with detection sensitivity set to high. If i set it to medium or low it would switch to "Clear" even when I am awake on my laptop in bed. Seems an awful lot like a motion sensor at this point. I've now realised that the nest hub that i also have in the bedroom might interfere with the presence sensor as it uses radar to detect gestures and monitor sleep so i've turned off these features, but to me it sounds like that kind of interference should keep the presence sensor in "Detected" state instead of making it think the room is clear. Anyway I'll get back with new info after testing it overnight.

Edit: after testing with different sensitivity settings and timeout periods, the presence sensor still behaves like a motion sensor. Overnight it constantly changes to detected and clear several times.

Bonus: today, out of the blue, the presence sensor in the bathroom got stuck on detected state for 6 hours without anyone entering or exiting the bathroom for the entire time. No potential interference sources exist in the bathroom (fans, air conditioners, other radar based devices).

It is not a good sensor, I`m having problems as well... Wish I had bought the normal Tuya mmwave sensor =(

Alfy1080 commented 6 months ago

I have another update. The bedroom still behaves pretty much the same, but i realised that the behaviour is very much related to the positioning of the sensor. I got much better results when placing the sensors about 1.5 m high on the wall. The bedroom one still stops detecting me from time to time but the bathroom one is now working flawlessly since i repositioned it. I will keep playing with it and report back, but as far as i can tell this is a good sign not to lose faith in this sensor. ATM 5 out of 6 sensors work exactly as expected.

rjmcfadd commented 6 months ago

Mine will work amazingly for a little while then go back to detected for hours at a time.