ezmqtt switch control questions/issues
-
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.
-
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. -
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.