ezmqtt switch control questions/issues
-
Hi @toggledbits,
i tried the ezmqtt today, i have some issues most likely that i'm doing something wrong.
i have on my ezlo hub 3 switches, 1 dimmer and 1 motion sensor
i can control the dimmer via ezmqtt/set/device/<device-id>/item/<item-name>
but i can't control the switches.i receive on ezmqtt/tele/device/61e8937e124c35129921171d/item/switch payload true or false depending on the state of the switch, but when i send on ezmqtt/set/device/61e8937e124c35129921171d/item/switch payload true or false nothing happens, its the same for all switches.
what i'm doing wrong?
Cheers
-
Crillereplied to eonnet on Jan 20, 2022, 11:04 AM last edited by Crille Jan 20, 2022, 6:12 AM
@eonnet I'm doing the exact same thing right now but
switch
true works but not false so I can turn the light ON but not OFFEdit: This is on a dimmable light with both
switch
anddimmer
items.Edit2: Ah, because it also sends
dimmer
100% so the light turns ON.
This is the errors forswitch
true/false:`Unexpected Json format for value type 'bool': ["true","true"] Unexpected Json format for value type 'bool': null
-
toggledbitswrote on Jan 20, 2022, 1:03 PM last edited by toggledbits Jan 20, 2022, 8:07 AM
I forked this because you're a bit hijacking the other thread. Please start new topics for... new topics.
I have a busy schedule today, but I'll look into this later this afternoon. Make sure your payload is a plain string/raw containing only the word true or false.
-
OK. Everything checks out fine on my end. Works as expected. You're not showing what you're sending, only the error message, and those errors don't even look formatted the ezmqtt way, so I'm not sure where you got them. Not enough here to work with.
-
Publishing on topic "ezmqtt/set/device/61baf5ca129e0725bd9f80ed/item/switch" with payload "true" with MQTT Explorer.
Running ezmqtt directly from console gives this output:mqtt: received <ezmqtt/set/device/61baf5ca129e0725bd9f80ed/item/switch true> EzloClient: request 17e78d40bae (hub.item.value.set) failed: Error: Wrong field of object at EzloClient.handle_message (/usr/local/lib/node_modules/ezmqtt/lib/ezloclient.js:796:25) at WSClient.emit (node:events:390:28) at WebSocket.<anonymous> (/usr/local/lib/node_modules/ezmqtt/lib/wsclient.js:92:30) at WebSocket.emit (node:events:390:28) at Receiver.receiverOnMessage (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/websocket.js:1008:20) at Receiver.emit (node:events:390:28) at Receiver.dataMessage (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:517:14) at Receiver.getData (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:435:17) at Receiver.startLoop (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:143:22) at Receiver._write (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:78:10) { code: -32602, data: 'rpc.params.wrong_field', reason: `Unexpected Json format for value type 'bool': ["true","true"]` } mqtt: <ezmqtt/set/device/61baf5ca129e0725bd9f80ed/item/switch true> failed; Wrong field of object (-32602): Unexpected Json format for value type 'bool': ["true","true"]
Payload "false" gives:
mqtt: received <ezmqtt/set/device/61baf5ca129e0725bd9f80ed/item/switch false> EzloClient: request 17e78d7c502 (hub.item.value.set) failed: Error: Wrong field of object at EzloClient.handle_message (/usr/local/lib/node_modules/ezmqtt/lib/ezloclient.js:796:25) at WSClient.emit (node:events:390:28) at WebSocket.<anonymous> (/usr/local/lib/node_modules/ezmqtt/lib/wsclient.js:92:30) at WebSocket.emit (node:events:390:28) at Receiver.receiverOnMessage (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/websocket.js:1008:20) at Receiver.emit (node:events:390:28) at Receiver.dataMessage (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:517:14) at Receiver.getData (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:435:17) at Receiver.startLoop (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:143:22) at Receiver._write (/usr/local/lib/node_modules/ezmqtt/node_modules/ws/lib/receiver.js:78:10) { code: -32602, data: 'rpc.params.wrong_field', reason: "Unexpected Json format for value type 'bool': null" } mqtt: <ezmqtt/set/device/61baf5ca129e0725bd9f80ed/item/switch false> failed; Wrong field of object (-32602): Unexpected Json format for value type 'bool': null
-
What version of ezmqtt? Reported at startup.
-
Version 22002
-
OK. Can you screen shot MQTTExplorer so I can see what you are sending?
-
-
OK. I think I found the issue., and I had a bunch of other updates from the work on the Node-RED nodes that I needed to back-port. Reinstall using
npm
to get the update. -
Yes, update 22021 resolved the issue. Tnx!
-
Hello @toggledbits i run ezmqtt in a docker, updated to the latest version and still have the same issue:
here is the error in the log that i recieveat EzloClient.handle_message (/opt/ezmqtt/lib/ezlo.js:664:25)
at /opt/ezmqtt/lib/wsclient.js:233:29
at new Promise (<anonymous>)
at WSClient.trigger (/opt/ezmqtt/lib/wsclient.js:229:16)
at WebSocket.<anonymous> (/opt/ezmqtt/lib/wsclient.js:76:30)
at WebSocket.emit (node:events:390:28)
at Receiver.receiverOnMessage (/opt/ezmqtt/node_modules/ws/lib/websocket.js:1008:20)
at Receiver.emit (node:events:390:28)
at Receiver.dataMessage (/opt/ezmqtt/node_modules/ws/lib/receiver.js:517:14)
at Receiver.getData (/opt/ezmqtt/node_modules/ws/lib/receiver.js:435:17) {
code: -32602,
reason:Unexpected Json format for value type 'bool': ["true","true"]
}
mqtt: <ezmqtt/set/device/61e8937e124c35129921171d/item/switch true> failed; Wrong field of object (-32602): Unexpected Json format for value type 'bool': ["true","true"]I send plain payload true on topic ezmqtt/set/device/61e8937e124c35129921171d/item/switch.
version that is shown in the log file is Version 21357
cheers
-
Your container update didn't work. The latest version is 22021.
-
Thanks, found the problem updated and its working, in your instruction for installation the container is named toggledbits/ezmqtt:latest-generic-amd64 and in the docker hub latest version is toggledbits/ezmqtt:latest-amd64, that is why it didnt update.
cheers
-
Got it. Will fix that later today.
3/15