Giter VIP home page Giter VIP logo

Comments (5)

vinodsr avatar vinodsr commented on September 28, 2024

Good thought.

But how will you turn on from the off state ( physical ) . ?

from node-red-contrib-tuya-smart-device.

msillano avatar msillano commented on September 28, 2024

See also issue#429.
I found 2 ERRORs not catched:

  3 Mar 18:48:14 - [error] [tuya-smart-device:12896b89.d95c84] Error: find() timed out. Is the device powered on and the ID or IP correct?
  3 Mar 18:49:56 - [error] [tuya-smart-device:e543af34.b2468] Error: Error from socket


More notes on ver. 2.0.0. used in production environment tuyaDAEMON:

  1. New in this version is the extra infos:
3 Mar 18:56:00 - [info] [tuya-smart-device:12896b89.d95c84] Recieved the config {"id":"12896b89.d95c84","type":"tuya-smart-device","z":"173260fb.d021ff","deviceName":"siren","deviceId":"42027807d8bfc0c5831e","deviceKey":"70e17a0208ae2e5c","deviceIp":"","retryTimeout":"100279","findTimeout":"100291","tuyaVersion":"3.1","x":970,"y":460,"wires":[["2ec83963.a7d146"]],"info":"**tuya_ms_104**   \n\n_tuya bridge for \"WiFi Smart Switch Module MS-104\"_\n\nAfter any command, this device sends (and this node captures) a 'status' message carring only the changed values.\n\nA command can be send by node-red, SmartLife app, Google home, Google voice: in any case this node captures the status message.\n\n_note:_\n If node-red changes the switch state, SmartLife is updated correctly, but Google Home not.\n \n_Input:_\nTo send a command via node-red. the payload structure must be:\n` multiple: true\n  data: object\n    1: true\n    102: 5`\n\n_nb:_\nset **Device Virtual ID** and **Device Key** to a tuya connected and working switch, model M-104 ( see [https://it.aliexpress.com/wholesale?SearchText=smart+switch+ms+104](https://it.aliexpress.com/wholesale?SearchText=smart+switch+ms+104))."}

All stuff after "tuyaVersion":"3.1" is not usefull.

  1. User config timeouts are very useful: with prime numbers I can better distribute the load over the time. But it would be even better with the dynamic timeouts: so I can "hibernate" some devices via the program (see ISSUE#35).

  2. tuyapi is now ver. 6.1.5

Best regards
m.s.

from node-red-contrib-tuya-smart-device.

mroziken avatar mroziken commented on September 28, 2024

Good thought.

But how will you turn on from the off state ( physical ) . ?

Hi

I have a phisical/traditional switch in wall (2-wire). So when switch is off the bulb is off. If the wall switch is off then obviously there is not way to switch on the bulb. The status of bulb in my custom app should be INACTIVE. To detect if bulb is connected I'm using status of your tuya-smart-device node. If status is connected then then in my app the bulb is accessible and you can perform operations (On/Off/Dimm/etc). In case of other status I assume the bulb is not connected and it should be inactive in my app (no operations allowed).

I hope that clarifies.

from node-red-contrib-tuya-smart-device.

mroziken avatar mroziken commented on September 28, 2024

The catch node fails to catch the error, for example "Error: Error from socket". I would like to request that node.error is called with a 2nd parameter to permit the catch node to catch errors it raises.

The rationale behind. When tuya-smart-device cannot connect to tuya bulb it generate error and report it to debug window. But when the bulb swith is off then it is normal situation and there is need to handle that programatically. For example catch error from the node and decide not to display in debug.

I localy modified the following:

tuya-smart-device.js:
var setStatusOnError = function (e, message = "error", msg = {}) { node.error(e, msg); return node.status({ fill: "red", shape: "ring", text: message }); };

And it is working as expected

from node-red-contrib-tuya-smart-device.

vinodsr avatar vinodsr commented on September 28, 2024

@mroziken Please check version 3.1.0

from node-red-contrib-tuya-smart-device.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.