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

always says "disconnected" #9

Open
kiai72 opened this issue May 13, 2019 · 28 comments
Open

always says "disconnected" #9

kiai72 opened this issue May 13, 2019 · 28 comments

Comments

@kiai72
Copy link

kiai72 commented May 13, 2019

Hello,

got deviceId + key with tuyacli. these are the 2 values i configured in the node-red tuya-smart-node.
But i always says "disconnected" - don't get any feedback.
IP i left blank - and that's why node red always says this node is not configured correctly.
Is this related to my problem ?

what ip should i give here ? my internal IP of the doorsensor ?

@mturbutt
Copy link

Yes, you need to provide the local IP address of the device on your network (192.168.x.x).

@kiai72
Copy link
Author

kiai72 commented May 13, 2019

i did now. but this does not change anything. ok, it don't the errormessage when i deploy the flow anymore.
but status is always disconnected. Trigger never runs.
I don't get the point of giving the local IP anyway. This sensor is not online all the time.
When i open/close the door - i see it on my router: it goes online for maybe a minute (sends the events to tuya) - then it goes offline again.

@mturbutt
Copy link

The tuya api (tuyapi - that this node is built upon) requires an ip address to communicate with the device via your network.

As I understand it, these door sensors are battery powered so the sensor wakes up the board and connects to the network, sends the signal and goes back to sleep to preserve battery power. So what you're seeing is expected.

What is it that you're trying to do?
If you connect a debug node to the output of the tuyasmart node and trigger the sensor, do you receive any payload data in the node-red debug console?

@kiai72
Copy link
Author

kiai72 commented May 14, 2019

What is it that you're trying to do?
i want to recorgnize door-open and door-close event.
i assumed tuyapi acts similar as the tuya app on the smartphone. The smartphone app obviously communicates with the tuya server. isn't it that way ?

If you connect a debug node to the output of the tuyasmart node and trigger the sensor, do you receive any payload data in the node-red debug console?
No it just goes on "disconnected" - and does not even runs the following debug node.

@mturbutt
Copy link

Can I just check that you don't have the Tuya app open on your phone while you're trying to use the node-red node? This is a known limitation of the tuyapi (see https://github.com/codetheweb/tuyapi#-notes).
The mobile app takes over the communication protocol of the device and blocks comms with the NR node/tuyapi.
Make sure the mobile app is fully closed and try triggering the sensor again to check the payload data in the debug node. If it was the app causing the issue, you should see the device connect to deliver the data. Fingers crossed...

@kiai72
Copy link
Author

kiai72 commented May 15, 2019

i shut down the smartphone. but no change. It still does not even call the debug-node. isn't there any advanced log that i can check ?
image
image

@mturbutt
Copy link

I'm afraid I don't know. Maybe @hgross is able to shed some light on this.
For what it's worth, this node was originally built to talk to always-on devices like power strips, bulbs and leds. The fact that this device only connects when activated (due to battery saving) might be causing the issue.
I did a bit of Googleing to see if you could do something using the IFTTT SmartLife service and found this Reddit post where others are having issues with real time triggers from SmartLife door sensors.
Other posts seem to suggest flashing the device with Tasmota firmware is the way to go but they also don't support battery operated devices. I'm starting to see a pattern forming here. See the end of this post.
Sorry I couldn't be of more help. From what I've read, it sounds like IFTTT/Smartlife might work but there are latency issues.

@kiai72
Copy link
Author

kiai72 commented May 15, 2019

thank you for all this informations.
But what i still don't understand is: the device works the way you described: goes to sleep mode/offline - to save battery.
But the smartphone app works anyway! that means: the smartphone app does not talk to the doorsensor - it communicates with tuya-server - to query the latest status the sensor sent to the tuya-server.
Actually all i want to have is: have the same logic from the smartphone app on the raspberry pi - so the raspberry pi can query the latest reported status (from tuya server).
But this is not the way tuyapi works - am i right ?
Do you know a way to do this (query the latest reported status from server)?

About Tasmota: interesting project. actually i already thought about it. But you hardly read about success when it comes to doorsensors, that's why i didn't try yet.
In this post they seem to have problems after deep-sleep as well.
If this will work one day - i might try this as well.

@mturbutt
Copy link

You're correct, tuyapi handles all the device traffic locally without accessing tuya-server.
The only way I can think of to handle this is to use IFTTT (which works as a service with tuya-server) and have node-red react to the smartlife trigger using IFTTT broker.
https://flows.nodered.org/node/node-red-contrib-ifttt-broker

@kiai72
Copy link
Author

kiai72 commented May 15, 2019

the tuya->IFTTT connection is terribly slow! i already tried this.
ok, so looks like there's no other option at the moment.
Thank you for all your help. please keep me in mind, in case you hear of some new development.

@mturbutt
Copy link

I will, of course. Interesting devices so I might want to play with them myself once the issues have been resolved. Haven't tried any battery driven sensors yet but I have a few use cases I want to explore. Good luck.

@fuzzyogic
Copy link

fuzzyogic commented May 29, 2019

i have multiple gosund smart plugs and all was working fine until I got this new batch of plugs last week. The old plugs have wifi module 1.0.4/ mcu module 1.0.4 and those work just fine and are still working fine. The new plugs have not worked yet, they have 1.0.5 for both modules and they are also in the disconnected state. When telneting to port 6668 on the old plugs, the session stays open until i escape out or hit the default timeout value which >=10 secs. When telneting to the new plugs on port 6668, "Connection closed by foreign host" in < 1 sec. I do not have the smart life app open on the phone during any of the tests. If this project is still in development, I would gladly provide whatever info i can get to support these newer modules. I greatly appreciate the node red community and want to say thanks for all that has already been done.

-- edit: fix grammar --

@fuzzyogic
Copy link

It looks like the newer firmware implements tls...

codetheweb/tuyapi#175

@fuzzyogic
Copy link

It looks like tuyapi has been updated to 5.1.1 to support the new tuya firmware. Is this node red module going to be updated to use 5.1.1?

@jncanches
Copy link

It looks like tuyapi has been updated to 5.1.1 to support the new tuya firmware. Is this node red module going to be updated to use 5.1.1?

+1 :-)

@andreypopov
Copy link

the same issue
update everything pls)

@andreypopov
Copy link

2019-08-08_22-34-36
2019-08-08_22-34-43

Should I use devId + localKey ?

"devId":"478803312cf43203f93d
"productId": "8QMq5QyBkZDiA8ME",
"localKey": "6efbee0a47399ec3"

@razorRun
Copy link

razorRun commented Sep 8, 2019

I am getting the same issue. Trying to get a smart plug up and running

@kingofmummy
Copy link

was work perfectly before. but now it always disconnected. plzzzzzz update :(

@LukSzyd
Copy link

LukSzyd commented Oct 7, 2019

I confirm now it's not working

@polyphia
Copy link

I also can confirm it's not working, always disconnected !

@Gitarcitano
Copy link

Gitarcitano commented Dec 20, 2019

The same problem here, still disconnected.

@Mallinanga
Copy link

Same here. Disconnected

@bogeuh
Copy link

bogeuh commented Feb 21, 2020

try this
https://github.com/subzero79/node-red-contrib-tuya-local
or ifttt webhooks

@razorRun
Copy link

razorRun commented Feb 25, 2020 via email

@pinpox
Copy link

pinpox commented Sep 11, 2020

Any progress on this? Having the same issue with some Tuya switches. I got the devID and localKey but they are always "disconnected"

@razorRun
Copy link

razorRun commented Sep 11, 2020 via email

@Macht59
Copy link

Macht59 commented Sep 3, 2022

I have the same issue.
Any progress on this?

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