binary switch target value seems to ignore targetValue #1222
-
I will preface this by saying it's entirely possible that I don't have the correct syntax. I'm trying to get mqtt to issue switch binary on/off commands, testing with mosquitto_pub right now. Long story short, no matter what the value I pass in targetValue, the device turns on. Pass it true, turns on. Pass it false, turns on. Pass it a null, turns on. Pass it a string, turns on. Seems basic, so I'm thinking I'm passing something badly and it's just doing its best guess?
Which causes things to happen (ON!), and I get the following output...
So, I'm clearly not doing something right, so uh... how do I get it to turn off instead? :D Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 15 replies
-
Wait you are tring to write a value right? you shouldn't use sendCommand for this: https://zwave-js.github.io/zwavejs2mqtt/#/guide/mqtt?id=set-values In poor words you should add a |
Beta Was this translation helpful? Give feedback.
-
As per the OP: "I will preface this by saying it's entirely possible that I don't have the correct syntax." Plus I'm new to this app. My query seems similar to the OP's. I am testing an old Aeon dimmer. I can control it through the UI with no problems. However if I do this:
I get:
If I change the argument name from "targetValue" to "Heidi" in the command, I still get the same result "targetValue is not a number". No matter what I do with the argument(s) they are totally ignored. Except if I leave out the array brackets around [{"targetValue":55}] then I get:
So yes, I could use any one of the following (and I would like to) but none of them show anything in the log whatsoever and don't work. Noting I have adjusted the Gateway settings to accommodate the different variations:
Just doesn't respond, although they show up in mqttexplorer OK. Note, if I do a get (which is successful):
The log says:
Note that: "targetValue: undefined". Shouldn't the result show "targetValue: 55"? Any ideas? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Mmmm - tried that as per above: With payload of 55 or {"value" : 55} and I thought it would work. May be a secondary problem in my case. Still want to see why the api call doesn't work as advertised! |
Beta Was this translation helpful? Give feedback.
Wait you are tring to write a value right? you shouldn't use sendCommand for this: https://zwave-js.github.io/zwavejs2mqtt/#/guide/mqtt?id=set-values
In poor words you should add a
/set
suffix to the values you want to write sending as payload the value you want to set