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

Simple Issue: How do you create a message to send to a switch to turn it on #33

Closed mpovolo closed 2 years ago

mpovolo commented 4 years ago

I have tried so many nodes with various formats of topic updates and switch, cannot seem to figure out how to create a node and input it to the Smartthings switch node and toggle it on.

Can you explain how to do that input node, type, format etc.

thanks so much

shmidt commented 4 years ago

I also have a problem with understanding how switches work. Making a function node from example worked:

var msg = {
    topic: "switch",
    payload: {
        value: 1
    }
}
return msg;

But connecting two switches together with wire doesn't work. Injecting number 0 or 1 to the switch doesn't do anything. Seems like value needs to be renamed to number to make it work. Also, it makes more sense to make switch type as boolean.

mpovolo commented 4 years ago

Thanks, that function node actually helped, I couldn't get that to work either and now it does. Thanks so much

GoodGuyTaj commented 4 years ago

Many thanks, I ran into the same issues!

shmidt commented 4 years ago

No problem ;)