otaviojr / node-red-contrib-smartthings

Allows you to control your devices and get their status using NodeRed
MIT License
32 stars 16 forks source link

Can't request "update" #12

Closed minedaddy closed 2 years ago

minedaddy commented 4 years ago

There seem to be a lot of commands/topics (update, hue, saturation, temperature …) on many of the contrib-smartthings nodes that don't work for me. I haven't tested all nodes but in the case of the "update" topic, I cannot get the onoff, color, openclose or temperature nodes (among others) to return the device state, they only echo the request object sent via the standard inject node. Looking through the code I found:

if(original !== undefined){ Object.assign(msg,original); }

which is what is responsible for replacing the device status message and echoing my request. This looks like it would be useful for debugging but if I comment it out, the update request works as expected. Am I missing something? Thanks for any insights you may have.

otaviojr commented 4 years ago

I think that you are right.

There are some nodes with more than one output. On those cases, the output is an array. On those cases, the assign could possibly not work as expected.

I will look it better tomorrow, but, this can be a real problem.

I did this to keep any information sent within the update command. But on those arrays I will need to assign for each item. So, I can pass through the original data on all outputs.

Commenting it is not a good solution. Consider this.

You have a http request node, after it you will inject the update command to request the device data, you will have some transformation nodes and finally the http response node. The http request node will put some informations inside the message that must reach the http response node. Without them, the response node will fail. So, the ideia is to pass through those informations to the http response node, so it can work.

regards, Otávio Ribeiro

otaviojr commented 4 years ago

I published a new version 0.0.15.

Could you please give it a try?

regards, Otávio Ribeiro

mane-wt commented 4 years ago

Hi,

I have tested the new version with the nodes: OnOff, Motion, Level, Color, Color Temp, Temperature, Battery, Humidity, Thermostat and Button.

All worked well to force a update output except the Humidity and Thermostat nodes.

The Humidity node outputs: { "deviceId": "602f64f3-d52e-4b53-6e92-ec84450e5d0e", "deviceType": "humidity", "name": "Fuktighet luftkonditionering", "value": null, "unit": "%" }

And the Thermostat outputs nothing when injected with the update-topic. I also tried to inject: { "topic": "coolingSetpoint", "payload": { "value": 18 } } with output: thermostatCoolingSetpoint

In the node Properties I can only choose: Capabilities

The other choices have no device to select. My HVAC is a Samsung devices capable of heating, cooling, drying or just fanblowing.

I can read out if it is on/off with the OnOff node, Get the temp from it with the temperature node and get the null value above for humidity.

BR Magnus

minedaddy commented 4 years ago

Happy New Year to everyone …

I have tested several nodes and found the following:

onoff, openclose, and temperature nodes all work correctly now.

The color node has several problems. update, switch, level and temperature work correctly. hue and saturation have no effect and produce nothing on the node outputs. I can't recreate the circumstances but my first test of sending "update" showed output 2 (level) and output 4 (temperature) both as null while output 3 (color) showed 0,0,0. Later, after trying different settings, the correct values were reported. It looks like, until a switch or temperature setting is made, the data is not reported.

The "level" node works well except that, if it is initially off and a request to set level (value:100) my lamp lights, the reported level is correct but the "switch" state remains 0. Only sending a switch command makes the switch report 0|1 correctly. This may be a characteristic of the lamp itself and not a bug but I think that if the lamp is on, even at the lowest level, the switch state should read 1.

I hope this helps and I am available if there are further tests needed. Thanks!

wkossen commented 3 years ago

Hi,

I'm trying temp and hum nodes on my airconditioning, but they only update on deploy. can you please add a simple howto on how to actually inject something to make them update? Or is this not working atm?