Closed simonhac closed 7 years ago
same also happens when sending from Dark WebSocket Terminal
.
(i'm just entering {topic: "get", payload: {"name": "all"}}
-- nothing else.)
try using apostrophes:
{"topic": "get", "payload": {"name": "all"}}
thanks @cflurin -- there were no apostrophes in your sample comment. can you please clarify?
Does it work with apostrophes? I tested homebridge-websocket with node-red, node-red adds apostrophes automatically when missing. If it works with apostrophes, I'll revise README.
sorry, i don't know what you mean by apostrophes -- i know the ' symbol, but where do you intend for it to go? around the text or instead of the quotes or somewhere else?
sorry, I mean quotes (" symbol) around "topic" and "payload":
{"topic": "get", "payload": {"name": "all"}}
thanks @cflurin -- that works:
can you suggest a more interesting query that shows off an interesting data stream? (i'll spend some more time over the next couple of days familiarising myself with WS and homebridge-websocket
.)
can i suggest that it might be a good idea to harden homebridge-websocket
against bad input?
Ok, I've revised README.
I'd try to add an accessory and get/set the value. I generally use node-red for testing but for my home automation I use node-red and homebridge-mqtt.
Actually homebridge-mqtt
has better error handling (e.g. "invalid JSON format").
I've planed a new homebridge-websocket
version based on homebridge-mvc
.
thanks @cflurin -- i really appreciate your help. (i'll check out homebridge-mqtt
and homebridge-mvc
.)
(apologies that i've had very little experience with WS, so there's every chance that i'm doing something stupid.)
i'm using the
Simple WebSocket Client
to communicate withhomebridge-websocket
. after connecting (successfully) tows://127.0.0.1:4050
, i send{topic: "get", payload: {"name": "all"}}
.the homebridge instance bails with the exception:
any advice welcome.