Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My New Door Sensors seems to Push state-change only, and then go Unavaiable whitin 15-17 Seconds #110

Closed
boheme61 opened this issue Jan 14, 2024 · 3 comments

Comments

@boheme61
Copy link

boheme61 commented Jan 14, 2024

Seems like the Device only talk with iot.tuya and the App ( Cloud-fixed ) , thou im not sure
Ive tried everything, template-sensors, automations, virtual-device etc, It works ok, as long as it's ( online ) , but as it goes unavailable very fast, and then drops out of the Router, it's sometimes impossible to wake it, and the state doesn't change if i close/open multiple times, even thou it became ( Home , in Device_tracker ) it stays in unavailable , so it seems like the Device Only Push, state-change , and then sleeps again ( very fast ) shows unavailable in HA, thou still for awhile available in Device_tracker and Router ... eventually i gave up

But i then tried to add it in Native Tuya Integration , and everything works fine there , so i've come to the conclusion ( beside cheap shit ) iit seems like it's not possible to retrieve (pull) current state. And it only Push state-change , and go to sleep again ( most likely Push direct to Cloud / App, and leave Local-tuya in the dark ) :) , and HA in ( Unavailable , both battery-state and Device-State )

How ever in iot.tuya i can retrieve state ( in Device-Control / Query Properties #doorcontact_state )

Is it anything you find familiar, or think could be possible to make these Devices Work, in LocalTuya also ?

BR

https://www.google.com/search?q=GS325W+Door&client=firefox-b-d&sca_esv=598437705&ei=k2CkZa2tOPezwPAPnfGJ2As&udm=&ved=0ahUKEwjtwqSV992DAxX3GRAIHZ14ArsQ4dUDCBA&uact=5&oq=GS325W+Door&gs_lp=Egxnd3Mtd2l6LXNlcnAiC0dTMzI1VyBEb29ySJu8AlCiBliNsgJwA3gAkAEAmAF3oAGMA6oBAzQuMbgBA8gBAPgBAcICCBAAGIAEGKIEwgIFECEYoAHiAwQYASBBiAYB&sclient=gws-wiz-serp

@xZetsubou
Copy link
Owner

xZetsubou commented Jan 15, 2024

Cloud integration and localtuya both works completely different.
Localtuya only update via local push if the devices doesn't reports the new states this something else, Tuya devices have really toxic behavior when it comes to "local".

What's your device WiFi or sub-device? from the context I guess it's WiFi
Have you tried to add the dp number you want to update into reset command and set scan interval I think this only works for 3.3 devices

@boheme61
Copy link
Author

boheme61 commented Jan 15, 2024

Yes, i know they are different, i just now installed the Native Tuya, just to test , because i suspected spite it updated while Online ( but not after it dropped out of the Router, doo to it reported unavailable, seconds after open/ close updating state ) ... even thou in the App and iot.tuya it updated fine ... so my guess is these Devices, just Push State change ( And rapidly goes to sleep) iot.tuya/app keeps State-Status.
( i even tried to turn of the phone, so this was out of the equation )
Yes i've tried 10sec and 5sec update-interval and added DP's 1,2 below in the reset-command , no changes ( However i think it's registered for 3.4 protocol

So somehow after 15seconds it changes from Open/Closed to unavailable( In Ha )( a state it actually dont have in iot.tuya UI , there it's only true/false ( open/closed ), and when it doo to unavailable (in HA ) eventually drops out of the Router, the process when the door-contact changes state again, it don't update in HA, as it first have to come online in Router - and Registered in HA / Integration, there is no Push-message , as it already has been executed/changed state in iot.tuya/ App ... and The Status in the integrations is therefore still unavailable, and i have found no ways to update the entity, so it actually Push a Current State, also tried to keep it alive / or update with ping, template-sensor, and automations

However as i said, it works fine in Native Tuya, so i guess it polls for the current state from iot-tuya, how frequent i dont know ... what bothers me is i can follow it in realtime, on iot.tuya, and see the correct status

@xZetsubou
Copy link
Owner

xZetsubou commented Jan 15, 2024

Open/Closed to unavailable( In Ha )( a state it actually dont have in iot.tuya UI , there it's only true/false ( open/closed ),

Unavailable is the state of the entities when the device goes offline. There is no way to fake that out if the device goes offline LocalTuya will tell HA to shutdown the device entities

However as i said, it works fine in Native Tuya, so i guess it polls for the current state from iot-tuya, how frequent i dont know ... what bothers me is i can follow it in realtime, on iot.tuya, and see the correct status

Okay this is weird the fact that it drops connection from "router" then for sure it will drops the connection from LocalTuya So let me guess the device goes into "sleep mode" and for some reason it dc'd from router then when the state changes it will quickly reconnect and push new states to iot at that moment LocalTuya still didn't reconnect

the process when the door-contact changes state again, it don't update in HA, as it first have to come online in Router

Because the device drops the connection LocalTuya will retry to reconnect to the device every 1 minute which probably means it may takes more then 50 seconds to reconnect, "if LocalTuya tried to reconnect seconds ago before device woke up"

As for solutions I'm really not sure how to handle this kinda of devices "maybe" if you try to make LocalTuya to reconnect every "5 seconds" it will reconnect and updates states before the device sleep again.

@xZetsubou xZetsubou closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants