I just installed the new Shelly dimmer, I turned on the MQTT function and configured a generic MQTT device and linked a number channel.
For the power on/off button it works just fine, I used the support page from Shelly to configure it, so the status is: shellies/shelltafellamp/light/0 and for the command prefix: shellies/shelltafellamp/light/0/command
So this is the config in PaperUI at the moment, I feel like I need to fill out the transformation field but can’t figure out what the statement should be…
If I remember correct from other shelly device…you have to send the whole payload everytime.
So you need to create a rule to put together the payload and send it
Using data from from the shelly guide the important part of your rule would be:
var shellyDimmerPayload='
{
"turn": "on",
"brightness": 100
}'
YourShellyItem.sendCommand(shellyDimmerPayload)
I don’t know if you can construct the payload only with the brightness line …you could try and let us know.
edit: I edited because I realized I was using wrong data from a different part of the shelly guide, now should be ok.
Thanks, I started playing around a bit with MQTT.fx and with sending some different types of payload.
After some time I figured out that when I use the payload {“turn”: “on”, “brightness”: 100} it wil always set the light at 100% brightness, so I changed the payload to {“turn”: “on”, “brightness”:%s} and that works great, so the dimmer works with a slider on my habpanel.
I used that payload because I saw it in a example somewhere but what does %s mean in this case?
Another question, when I put it to 0, it stays on, have to fix this?
The %s represent the value of the slider.
Glad you’ve found the solution!
In this case if you put 0, only the brightness goes to zero…but the value of “turn” remains on.
To be able to turn it off I think you need to change the structure…maybe with a proxy item slider so when you slide to zero you can via rule send the payload with the “turn” to off.
With a the proxy item you’ll need to clear out all the transformation on the thing definition and send the payload using a rule like I posted above
Thanks for thinking with me, I created a really simple rule but it works
this is it:
rule "Dimmer turn light off when 0"
when
Item Tafellamp_dimmer received command 0
then
Tafellamp_switch.sendCommand(OFF)
end
Now I still want to do more thing, I want the lights to fade in or out when I change the brightness of the lamp, after a quick search it should be possible, but I will try that some other time because it quite big rules to do that.