vinodsr / node-red-contrib-tuya-smart-device

a node-red module for managing tuya smart devices
https://flows.nodered.org/node/node-red-contrib-tuya-smart-device
MIT License
47 stars 15 forks source link

How to GET a value of a specific entity #99

Closed goofy2k closed 1 year ago

goofy2k commented 1 year ago

Hi, I have some Hombli smart plugs that use the Tuya API. I manage to connect to them and switch the power on/of using your example flow.

These plugs also measure current, voltage, and power. Actually now and then the device sends a message with these values. These messages come at very irregular instants and not always contain all three values (which are dps nrs 18, 19, 20).

I tried to create a get command in the function block, but without success. I do not quite understand the explanation of the input format in your docs.

How would the contents of the function block have to look for getting one or more values on command?

goofy2k commented 1 year ago

I have been strolling github a bit and found this: tuyaDAEMON

It is (probably) there that I found that writing with set to a dp ID with a value of null is actually equivalent to reading the particular value. At least the Hombli Smart Plug returns the value! This also works with multiple values.

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.

stale[bot] commented 1 year ago

Auto closing the issue