AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.58k stars 405 forks source link

Feature request: Add support for SNZB-06P #1245

Open atlaspl opened 8 months ago

atlaspl commented 8 months ago

Hi Alex, could you add the support for the new SONOFF Zigbee Human Presence Sensor | SNZB-06P:
https://itead.cc/product/sonoff-zigbee-human-presence-sensor/?utm_source=itead&utm_medium=homebanner&utm_campaign=SNZB-06P

Thank you for your great work

AlexxIT commented 8 months ago

Do you have it? Please show device info.

Netfalls commented 6 months ago

Device info SNZB-06P by SONOFF Firmware: 1.0.5

atlaspl commented 5 months ago

May be, did you want this? sonoff-bfafcfbdaa9afbe8d6413cdd8f126169-PresenzaLetto-985d049fc5025cc5ea76c7158b07231c.json.txt

AlexxIT commented 4 months ago

OK. You need to collect debug logs for this device.

malanleroux commented 2 months ago

Hi @AlexxIT.

I recently got the SNZB-06P Human Presence Sensor. And the only Sensor being detected is the Motion & Battery. image

My understanding is that there should be an occupancy sensors as well

As per this video. image

Would it be possible to add that support for the SNZB-06P device?

AlexxIT commented 2 months ago

You need to collect debug logs for this device.

malanleroux commented 2 months ago

The only log I see in home assistant I see with regards to the device in this one. I have redacted some of the properties that I believe might be sensitive, please let me know if this is what you are looking for, and if you need the redacted information, and maybe a way to contact you on a less public manner :)

If this is though not the information/logs you require, would you be able to guide me or point me to documentation to the requested logs.

Kind Regards

Logger: custom_components.sonoff.core.ewelink.cloud
Source: custom_components/sonoff/core/ewelink/cloud.py:394
integration: Sonoff ([documentation](https://github.com/AlexxIT/SonoffLAN), [issues](https://github.com/AlexxIT/SonoffLAN/issues))
First occurred: 8:52:04 AM (1 occurrences)
Last logged: 8:52:04 AM
UNKNOWN cloud msg: {'action': 'subDevice', 'deviceid': '10016aXXXX', 'apikey': '6925XXXX-bXXX-4XXX-bXXX-XXXX69b5XXXX', 'userAgent': 'device', 'd_seq': 54104, 'params': {'cmds': [{'type': 0, 'subDevId': '011f17fefff6ef0cXXXX', 'uiid': 'XXXX', 'deviceid': 'a48009XXXX', 'productName': 'SNZB-06P'}]}}
AlexxIT commented 2 months ago

Have you checked debug logs? https://github.com/AlexxIT/SonoffLAN?tab=readme-ov-file#issues You should do something with device while debug logs enabled

malanleroux commented 2 months ago

Here is the logs I see related to my presence sensor. (Device ID = a480090ad1) I do not see any error's or warning related to it. I have an automation setup to turn on the light (That works).

With that said, maybe your integration just works a little different :) I have another (PIR) motion sensor in same room that "Clears" motion when I sit still, but the SNZB-06p sensor does not "Clear".

An I being a Muppet? If i am, I am so sorry for that. I'm fairly new to the whole HA thing.

Test time was at 17:46:11.281 (Cleared) 17:46:56.688 (Detected)

2024-04-15 15:23:08.149 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] a480090ad1 UIID 2026 | {'bindInfos': {'gaction': ['69252b4d-b9d3-4f33-bcf5-97a569b518b7_ewelinkGoogleHome'], 'smartThings': []}, 'subDevId': '011f17fefff6ef0c2026', 'parentid': '10016ad9d2', 'motion': 1, 'trigTime': '1713186368278', 'subDevRssiSetting': {'active': 60, 'duration': 5}}

2024-04-15 15:23:08.150 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 10016ad9d2 UIID 0066 | {'bindInfos': {'gaction': ['69252b4d-b9d3-4f33-bcf5-97a569b518b7_ewelinkGoogleHome'], 'smartThings': []}, 'version': 8, 'subDevNum': 17, 'subDevMaxNum': 32, 'sledOnline': 'on', 'zled': 'off', 'staMac': '48:3F:DA:27:3D:6F', 'fwVersion': '1.7.0', 'timeZone': 2, 'subDevices': [{'subDevId': 'b9ea3429004b12001770', 'deviceid': 'a48005ce4d', 'uiid': '1770', 'index': 0}, {'subDevId': 'd4959623004b12001000', 'deviceid': 'a480058c44', 'uiid': '1000', 'index': 0}, {'subDevId': 'eba74e2a004b12003026', 'deviceid': 'a480066ea4', 'uiid': '3026', 'index': 0}, {'subDevId': 'b5972b29004b12003026', 'deviceid': 'a48007a2de', 'uiid': '3026', 'index': 0}, {'subDevId': 'fdea2b29004b12003026', 'deviceid': 'a4800831ed', 'uiid': '3026', 'index': 0}, {'subDevId': 'fb3f3229004b12002026', 'deviceid': 'a480060f70', 'uiid': '2026', 'index': 0}, {'subDevId': '2f553229004b12002026', 'deviceid': 'a480060f6f', 'uiid': '2026', 'index': 0}, {'subDevId': 'bfeb3429004b12001770', 'deviceid': 'a48005ce49', 'uiid': '1770', 'index': 0}, {'subDevId': 'fb972b29004b12003026', 'deviceid': 'a480071734', 'uiid': '3026', 'index': 0}, {'subDevId': 'b14f3229004b12002026', 'deviceid': 'a4800601b6', 'uiid': '2026', 'index': 0}, {'subDevId': 'fb431729004b12002026', 'deviceid': 'a480052ee2', 'uiid': '2026', 'index': 0}, {'subDevId': '938b9623004b12001000', 'deviceid': 'a480058c47', 'uiid': '1000', 'index': 0}, {'subDevId': 'b6c61829004b12002026', 'deviceid': 'a48007eef6', 'uiid': '2026', 'index': 0}, {'subDevId': '72f41829004b12002026', 'deviceid': 'a48007ef07', 'uiid': '2026', 'index': 0}, {'subDevId': 'c73b2b29004b12003026', 'deviceid': 'a48007172a', 'uiid': '3026', 'index': 0}, {'subDevId': '76673529004b12003026', 'deviceid': 'a480066ea0', 'uiid': '3026', 'index': 0}, {'subDevId': '011f17fefff6ef0c2026', 'deviceid': 'a480090ad1', 'online': True, 'uiid': '2026', 'index': 0}], 'addSubDevState': 'off', 'addDevTime': 180, 'rssi': -27}

2024-04-15 17:46:11.281 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] a480090ad1 <= Cloud3 | {'motion': 0, 'trigTime': '1713195951322'} | None

2024-04-15 17:46:56.688 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] a480090ad1 <= Cloud3 | {'motion': 1, 'trigTime': '1713195995501'} | None
AlexxIT commented 2 months ago

Are you sure a480090ad1 is SNZB-06p? Can you show device diagnostics? Because @atlaspl has another UIID:

"uiid": 7016,
"model": "SNZB-06P",
malanleroux commented 2 months ago

image

AlexxIT commented 2 months ago

This is not a diagnostics

Marcelo-Y commented 2 months ago

"It always has been. This sensor has never been supported in integration:"

But the sensor was working before update, even if was not supported. I don't see any benefit in have RSSI if the sensor is not supported, right?

Hope one day people can use this sensor in your integration. Keep going, you're doing a great job.

Thanks you very much, Alex.

AlexxIT commented 2 months ago

I absolutely agree that the sensor is useless now. But none of its users want its support... I still haven't seen the debug logs collected. I have no idea what this sensor is sending or what its converter should look like.

Only @malanleroux sent debug logs. But these logs are from some other device. He has UIID 2026. But SNZB-06P should be 7016.

@malanleroux can you send device diagnostics?

Marcelo-Y commented 1 month ago

Hello Alex, I understand what you're saying...

I didn't know about this situation, I just decided to buy the sensor to test its integration and it worked very well. So I decided to buy more, I ended up installing several here at home... I'm posting some logs that I captured, it's the first time I've done this, I don't know if I did everything right.

SNZB-06P debug.txt

"Sensitivity" can be: 1 = low 2 = medium 3 = high

"JudgeTime" can be from 15 seconds to 11h59m59s (in steps of 1 second)

My current firmware is 1.0.6

If there's something more I could do, let me know.

Thanks.

AlexxIT commented 1 month ago

You can check latest master version

Marcelo-Y commented 1 month ago

Wow man, you were incredibly fast! I've tested and so far it's working flawlessly. Tested changing "sensitivity" through HA, and updates of light, occupancy and RSSI states. Everything in order.

That's an amazing job! Thank you very, very much!

xeberth commented 1 month ago

Same issue here.

This are my debug and diagnostics for my SNZB-06P that is not showing other sensors than RSSI after latest integration updates. (sensor works well a few versions ago)

sonoff-SNZB-06P-logs&diagnostics.json

image_2024-05-04_041524626

atlaspl commented 1 month ago

Same issue here.

This are my debug and diagnostics for my SNZB-06P that is not showing other sensors than RSSI after latest integration updates. (sensor works well a few versions ago)

sonoff-SNZB-06P-logs&diagnostics.json

image_2024-05-04_041524626

I Have the same problem. Since the last SonoffLAN update ican see just the RSI sensor but the presence sensor is unavailable. What could I do to solve the problem or how could I help you to Screenshot_15-5-2024_172430_carhome duckdns org solve it?

neilheyes commented 1 month ago

Hi - I can only see the RSSI as above. sonoff-6e89fa58c5d037f90cafcfce9f711741-KitchenPresence-9a3926f13ed389dacc0c461c98d4de90.json

Hopefully the diagnostics will help, also added the debug log - the device does seem to report the entities but not in the UI.

home-assistant_sonoff_2024-05-19T16-04-02.603Z.log

AlexxIT commented 1 month ago

You can stop sending debug logs. Device supported more than two weeks ago.

neilheyes commented 1 month ago

You can stop sending debug logs. Device supported more than two weeks ago.

Sorry, thought it might help. I can only see the hidden rssi in the entities

neilheyes commented 1 month ago

Same issue here. This are my debug and diagnostics for my SNZB-06P that is not showing other sensors than RSSI after latest integration updates. (sensor works well a few versions ago) sonoff-SNZB-06P-logs&diagnostics.json image_2024-05-04_041524626

I Have the same problem. Since the last SonoffLAN update ican see just the RSI sensor but the presence sensor is unavailable. What could I do to solve the problem or how could I help you to Screenshot_15-5-2024_172430_carhome duckdns org solve it?

Same issue here. This are my debug and diagnostics for my SNZB-06P that is not showing other sensors than RSSI after latest integration updates. (sensor works well a few versions ago) sonoff-SNZB-06P-logs&diagnostics.json image_2024-05-04_041524626

I Have the same problem. Since the last SonoffLAN update ican see just the RSI sensor but the presence sensor is unavailable. What could I do to solve the problem or how could I help you to Screenshot_15-5-2024_172430_carhome duckdns org solve it?

I did figure this out - it seems that the devices.py coming from HACS does not have the full set of entities in it, but the one direct from here does and they both report v3.7.3

atlaspl commented 1 month ago

Issue with SNZB-06P Sensor Status Post-Update of SonoffLAN at v3.7.3

@AlexxIT I’ve encountered a persistent issue where the status of my SNZB-06P sensors is no longer visible, although the RSSI remains accessible. This problem surfaced following the most recent update. Prior to this, the status of my three SNZB-06P sensors was displayed without any complications. It seems that the update may have inadvertently affected the sensor status visibility within the system.

I don't know if it can be useful, but the three devices are all associated with a ZBBridge-P

atrambauer commented 3 weeks ago

Hi @AlexxIT , support for this device is not possible?

atrambauer commented 3 weeks ago

Hi @AlexxIT , support for this device is not possible?

Sorry, i just see that support was added but not compiled into last version. Will update manually

atrambauer commented 3 weeks ago

Hi @AlexxIT , support for this device is not possible?

Sorry, i just see that support was added but not compiled into last version. Will update manually

I can confirm that Occupancy and Light is working.

atlaspl commented 3 weeks ago

Hi @AlexxIT , support for this device is not possible?

Sorry, i just see that support was added but not compiled into last version. Will update manually

I can confirm that Occupancy and Light is working.

What do you mean by "will update manually"? How can I do it as well?

atrambauer commented 3 weeks ago

Hi @AlexxIT , support for this device is not possible?

Sorry, i just see that support was added but not compiled into last version. Will update manually

I can confirm that Occupancy and Light is working.

What do you mean by "will update manually"? How can I do it as well?

I uploaded and replaced the modified files from HA folder https://github.com/AlexxIT/SonoffLAN/commit/af725189c9f506b12c52bda59846dc3bd7deb96a

atlaspl commented 3 weeks ago

Hi @AlexxIT , support for this device is not possible?

Sorry, i just see that support was added but not compiled into last version. Will update manually

I can confirm that Occupancy and Light is working.

What do you mean by "will update manually"? How can I do it as well?

I uploaded and replaced the modified files from HA folder https://github.com/AlexxIT/SonoffLAN/commit/af725189c9f506b12c52bda59846dc3bd7deb96a

Sorry, the link for me didnt' work, is it a my problem?

loiccontesse commented 2 weeks ago

Have you got a solution?

atrambauer commented 2 weeks ago

Have you got a solution?

Check commit af72518, you can replace those files to make it work. Master version hasn't been compiled since that change yet.