Not sure if right forum, forgive me since it seems like MQTT is new to Bond and everybody’s still working out where it fits into The Order of Things.
I have my SBB device (Minka fan) configured to talk to my local MQTT broker and that’s working well, near as I can figure. To wit, (details changed for clarity, privacy and simplicity), if I do
mosquitto_pub.exe -h 192.168.1.1 -t v2/XYZ123/down/devices/00000001/state/ -m “{}”
The fan spits out
Topic: v2/XYZ123/up/devices/00000001/state/
Message: {“B”:“XYZ123”,“d”:0,“v”:“v3.5.0.3”,“i”:“blahblah”,“f”:4,“s”:200,“m”:0,“x”:“mqtt”,“b”:{“power”:0,“speed”:2,“light”:1,“brightness”:60,“brightness_cycle_phase”:-1,“timer”:0,“breeze”:[0,50,50],“direction”:1,“_”:“whatever”,“__”:“whatever”}}
So that says to me that the MQTT config is good on the fan.
But if I do
mosquitto_pub.exe -h 192.168.1.1 -t v2/XYZ123/down/devices/00000001/actions/TurnLightOff -m “{}”
which should turn off the light, right? I get
Topic: v2/XYZ123/up/devices/1/actions/TurnLightOff
Message: {“B”:“XYZ123”,“d”:0,“v”:“v3.5.0.3”,“i”:“blahblah”,“f”:4,“s”:204,“m”:0,“x”:“mqtt”}
Seems like I’d want a status code of 200, not 204, so I’m guessing I’m missing something in the publish to the fan to turn off the light. I have the same problem with other actions, SetBrightness (with -m “{"argument": 60}” or whatever, TurnOff for the fan itself, no change.
If this was connecting via http, I feel like I’d change the method to PUT instead of GET and it would magically work. I would strongly prefer to use MQTT because that plays nicely with everything else I’m doing (broker ALL the things!) and saves me having to do lots of custom coding.
Regardless, I don’t see anywhere in the API doc that mentions changing the method (or otherwise publishing TO the device.)
Or maybe I should be using a different topic, maybe it’s formatting? But it’s formatted just like the state one, right?
Any guidance appreciated.
– A