question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No support for door/window contact sensors

See original GitHub issue

Describe the bug Sadly it seems like the library doesn’t support Tuya door/window contact sensors.

To Reproduce Copy the library example code and enter the deviceid+key of a tuya contact sensor

Expected behavior It should print out the sensor data

Debug Output

 TuyAPI IP and ID are already both resolved. +0ms
  TuyAPI Connecting to 10.10.10.19... +3ms
(node:15776) UnhandledPromiseRejectionWarning: Error: connection timed out
    at Socket.client.setTimeout (PATH\node_modules\tuyapi
\index.js:305:18)
    at Object.onceWrapper (events.js:281:20)
    at Socket.emit (events.js:193:13)
    at Socket._onTimeout (net.js:450:8)
    at listOnTimeout (internal/timers.js:535:17)
    at processTimers (internal/timers.js:479:7)
(node:15776) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
 error originated either by throwing inside of an async function without a catch
 block, or by rejecting a promise which was not handled with .catch(). (rejectio
n id: 1)
(node:15776) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate th
e Node.js process with a non-zero exit code.
  TuyAPI Socket closed: 10.10.10.19 +5s
Disconnected from device.

Desktop (please complete the following information):

  • Node Version v11.13.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
codethewebcommented, Apr 27, 2019

Closing this because it’s outside of the scope of this project.

Feel free to keep using it as a discussion thread if you want.

1reaction
kueblccommented, Apr 5, 2019

Unfortunately, these devices disconnect as soon as they update their state and only reconnect momentarily to inform of state changes. See https://github.com/ct-Open-Source/tuya-convert/issues/135

With this in mind, communicating with these devices over the LAN protocol is impractical. You could use dnsmasq or something similar to redirect MQTT calls to your local MQTT server. It’s pretty messy right now but I have the code to set up something like that in kueblc/mocktuyacloud

Read more comments on GitHub >

github_iconTop Results From Across the Web

My Door/Window Contact Sensor is not working
Here are the recommended troubleshooting steps to take if a Door/Window Contact Sensor for your Total Security alarm system is no longer working ......
Read more >
Best Door and Window Sensors of 2023 - SafeWise
Our top door and window sensor pick is the YoLink Smart Home Starter Kit, ... Like the other entries on this list, there's...
Read more >
wifi door sensor - Amazon.com
WiFi Door Sensor, NEO Smart Door/Window Sensor, Detect Open/Close, Support USB Charged and Battery Powered, Support WiFi 2.4GHz, No Hub Required, Work with ......
Read more >
Door/Window Sensor Troubleshooting - Xfinity Support
This article covers how to troubleshoot various issues with Xfinity Home Door and Window Sensors, including low batteries, problems with pairing, ...
Read more >
Door/Window Sensor not Responding - Cove Support
Do you have a door/window sensor not responding? Cove is here to help you find out why the sensor is not responding and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found