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.75k stars 416 forks source link

Support for SONOFF SNZB-01P button #1488

Closed LPX64 closed 2 months ago

LPX64 commented 2 months ago

Hi, My SONOFF SNZB-01P button is not recognized properly in SonoffLAN integration. Status shows only the last change date. There is no possiblility to use its actions (single press, double press, long press) as a trigger in automations. Only the battery level can cause an action but it is irrelevant in most cases.

I have attached the diagnostic download. config_entry-sonoff-01J4W7HM0NAM4FSMTJR5M26TYG.json

Developer tools --> State friendly_name: Przycisk łazienka state_class: measurement unit_of_measurement: "%" device_class: battery friendly_name: Przycisk łazienka Battery

AlexxIT commented 2 months ago

This model supported. You should lean how to write state based automations. This is general Hass question and not related to this project.

https://github.com/AlexxIT/SonoffLAN/pull/1189

LPX64 commented 2 months ago

Thank you, you're absolutely right. Sorry for wasting your time :-)

I'll put here automations example for others, like me, for the ones that it was not clear from scratch.

SINGLE PRESS `alias: Przycisk Pojedyncze description: "" trigger:

DOUBLE PRESS `alias: Przycisk podwójne description: "" trigger:

HOLD BUTTON `alias: Przycisk Przytrzymano description: "" trigger:

AlexxIT commented 2 months ago

You should use not "from" but "to". Because with from you will have 0.5 second delay after event

LPX64 commented 2 months ago

Thanks for the hint.