I've been using Domoticz on a Pi for a little while now, and wanted to build a simple dashboard webpage. I was inspired by dcnoren's work in using MQTT.
The main difference is that my project won't require a node server to run. It's also entirely configured from the interface, and settings are stored locally on the browser. That makes it possible to build different layouts on different devices. Many dashboards I've seen require a rather cumbersome configuration involving file editing, idx hunting and trial & error that I'd like to avoid here. And it's also an excuse for me to build something with React

I have a working prototype that's promising, but as I started implementing different controls I hit a major problem: I can't seem to find how to control anything that's not a basic switch, such as blinds and RGB lights for starters. The wiki page for MQTT doesn't mention them, nor how to control a whole Group. I ran a few searches against the main MQTT topic without much success.
For blinds (mine are Somfy and on Domoticz the control is of simple type, with just Open, Close and Stop), I can get them to open and close by sending basic "switchlight" On and Off messages. But for Stop nothing happened. After a while I came up with this:
Code: Select all
{
command: "switchlight",
idx: blindsDeviceId,
switchcmd: "Set Level",
level: 2 // anything but 0 here seems to work
}
For RGB (Hue bulbs) I found this JSON API query somewhere on the forum:
Code: Select all
/json.htm?type=command¶m=setcolbrightnessvalue&idx=15&hex=FF00FF&brightness=100&iswhite=false
Lastly, I don't know how to control groups. I can read messages and retrieve their status, but I don't know how to send commands. There are some idx collisions between groups, scenes and devices in my domoticz install and I'm not sure it's normal, but it means a "swichlight" command will act on the device, not a group with the same idx.
If all else fails, I'll fallback to using the JSON API to send the missing/unsupported commands, but this feels rather inelegant.
Thanks for reading
