smarthomej / addons

SmartHome/J addons for openHAB
Eclipse Public License 2.0
59 stars 23 forks source link

[Tuya Binding] Management of battery-powered device #418

Closed Roms56 closed 1 year ago

Roms56 commented 1 year ago

Hello ! I am trying to use the binding with a battery-powered wifi sensor. Its behaviour: It connects to the Wifi only when its temperature/humidity changes, it sends the data to the Tuya Cloud and disconnects from the Wifi. It stays connected less than 2sec.

The issue is we lost some update of data, it is randomly. The Binding tries to connect to it every Xsec (?) for about 7sec, but the device stays connected for less than about 2 seconds when its data changes.

My Battery-powered is at the ip : xxx.xxx.x.71 and its id is **wo0b. Others are standard switch (no battery) and works well ! Here is a log to see what happens after a connection is successfully established: log tuya binding_connection_established.txt

Here is a log to see what happens when the device is offline log tuya binding_connection_timeout.txt

Is there any way to successfully intercept the moment the device connects ?

Thank you to take the time to read me. Best regards.

MiGro1194 commented 1 year ago

Hello @Roms56 ,

have you found a solution here yet? In itself, the "Poll Interval" would still be a possibility, but to set this to every second, I do not see as purposeful.

I will also try something further and if I have something, I will let you know.

Here you can also see very well that the device is only online for a very short time

2023-01-08 18:10:02.033 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:bfa2318f82564829a97p7t' changed from OFFLINE to ONLINE 2023-01-08 18:10:02.055 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:bfa2318f82564829a97p7t' changed from ONLINE to OFFLINE

Best regards

Roms56 commented 1 year ago

Hello @MiGro1194 ! No, I have not found any other solution. I went back to the Tuya-MQTT api (by AgentK), and decreased the connection polling time to 1 second. This works perfectly since 1 month.

Best regards

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MiGro1194 commented 1 year ago

Hello,

I am still interested in consuming a "development" for the Tuya battery devices. Therefore, please do not close the topic.

Best regards MiGro1194

J-N-K commented 1 year ago

Is there cheap sensor available on Amazon?

MiGro1194 commented 1 year ago

I do not know if this is cheap for you 😅 https://amzn.eu/d/28VKp5x

Roms56 commented 1 year ago

Hello, I also have this sensor (visually the same).

0verEngineer commented 1 year ago

Hey, i have the same problem, is there any solution? Thanks :)

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MiGro1194 commented 1 year ago

The problem is not solved :)