In bash I can get the status with:
But then the value brightness is still part of a string…
So the main question is, does the mqttdimmer device of Pimatic supports json or not?
And if yes, how to get it working?
Thanks.
Shelly mqtt dimmer, how to configure it with json?
In bash I can get the status with:
But then the value brightness is still part of a string…
So the main question is, does the mqttdimmer device of Pimatic supports json or not?
And if yes, how to get it working?
Thanks.
Also using a shelly since a few days, in my case a RGBW dimmer which I only use for white. As it is not properly supported currently I use two devices, one for the brightness and one for switching. Works good for my usecases however my rules currently don’t use the switch but simply dim to 0% which is basically the same.
{
"topic": "shellies/shellyrgbw2-XXXXXX/white/3/set",
"message": "{\"brightness\": value, \"turn\": \"on\"}",
"stateTopic": "shellies/shellyrgbw2-XXXXXX/white/3",
"echo": {
"additionalNames": [],
"active": true
},
"hap": {
"service": "Lightbulb"
},
"id": "arbeitsplatte",
"name": "Arbeitsplatte Helligkeit",
"class": "MqttDimmer",
"resolution": 100
},
{
"topic": "shellies/shellyrgbw2-XXXXXX/white/3/command",
"onMessage": "on",
"offMessage": "off",
"stateTopic": "shellies/shellyrgbw2-XXXXXX/white/3",
"echo": {
"additionalNames": [],
"active": true
},
"hap": {
"service": "Lightbulb"
},
"id": "arbeitsplatte-switch",
"name": "Arbeitsplatte",
"class": "MqttSwitch"
}
Ok, thanks, thats helps a little…
Now I can change the brightness with bash:
So how can I use that in de mqttdimmer devies or can’t I?
I see there should be json support in the pimatic mqttdevice:
But maybe I have an old version? Can I just (and only) update this device in Pimatic?
@lschip That for parsing the payload if its is in JSON format, if not it uses the data directly. It look like the current program is only to receive and set the dimmer value.
You could change this file and play with the functionality. But than its your custom code that needs to be patched every time the plugin is upgraded. Should not be a problem.
@bertreb said in Shelly mqtt dimmer, how to configer it with json?:
It look like the current program is only to receive and set the dimmer value.
That is exectly want I want. But it seems not possible with json strings and the Pimatic dummy device.
Thats a pitty, Domotics en Home assistent can wordk with the shellies with the standard software and mqtt.
For now I solved it with 3 devices and two rules.
One mqtt switch device
One mqtt sensor (te get the actual brightness level
One dummy dimmer
Two rules…
One rule to set the dummy dimmer to the actual value and a one rule to send a mqtt string when the dummy slider changes.
hi, like @thex was already pointing out. The MqttDimmer has only a slider to set the brightness, no on/off switch. For that you need to a MqttSwitch.
The config with 1 MqttDimmer and 1 MqttSwitch will probably work.
{
"brokerId": "your-broker",
"topic": "shellies/shellydimmer-keuken/light/0/set",
"resolution": 101,
"message": "{\"turn\": \"on\", \"brightness\": value}",
"stateTopic": "shellies/shellydimmer-keuken/light/0",
"stateValueKey": "brightness",
"id": "your-id",
"name": "your-name",
"class": "MqttDimmer"
},
{
"brokerId": "your-broker",
"topic": "shellies/shellydimmer-keuken/light/0/command",
"onMessage": "on",
"offMessage": "off",
"stateTopic": "shellies/shellydimmer-keuken/light/0",
"id": "your-id",
"name": "your-name",
"class": "MqttSwitch"
}
The message format is what you see in config.json. In the MqttDimmer device config message field you enter: {“turn”: “on”, “brightness”: value}
Thanks, that works.
Strangs is that I don’t have “stateValueKey” but it still works:
Also strang, when the dimmer is “off” the slider doesn’t work anymore.
For me no problem at all, when the dimmer is “off” I hide the slider in the GUI.
Thanks for all the help.
The on and off come from the mqtt switch or the shelly dimmer (that doesn’t matter).
But when I switch off the dimmer, and I change the slider then the slider doesn’t change on the fysical dimmer any more.
But as I said, so problem at all, I hide the slider in pimatic when the switch is off. Then the slider is’t relevant anymore and saves space on my gui.