I’ve recently flashed a Genio bulb and set it up in Openhab fine. I can turn it on and off and retrieve the current dimmer setting. However am unable to set the dimmer as I get a JSONPATH-transformation error.
[WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path ‘$.Dimmer’ in ‘27.73’
I suspect that the issue lies in the two decimal places being added (27.77) I’ve tried to mess around with the outgoing transformation but that does not seem to have an effect (%0f) .Since I primarily use PaperUI to configure everything, I hope there is a way to fix it in there.
In that case, I’m fairly certain you don’t need the outgoing transformation, nor the outgoing value format.
For my Tasmota dimmers, I use the same incoming transform as you. I do not define the minimum and maximum though.
You may have noticed already that Tasmota sends out the RESULT topic for many different actions, and sometimes they will not include dimmer information. openHAB will then complain in the logs that it can’t find the dimmer values. To get around this you can use a REGEX first which will only pass data on to the JSONPATH transform if the word Dimmer is present:
I’ve now removed both incoming and outgoing transformations, but I still cannot change the dimmer value from Openhab. Any change just on the slider just gives the following:
2020-07-31 20:53:47.603 [ome.event.ItemCommandEvent] - Item ‘mqtt_Bulb1’ received command 77
2020-07-31 20:53:47.606 [nt.ItemStatePredictedEvent] - mqtt_Bulb1 predicted to become 77
2020-07-31 20:53:47.608 [vent.ItemStateChangedEvent] - mqtt_Bulb1 changed from 50 to 77
What does your MQTT broker see? Or even better, navigate to the webpage of your Tasmota device (just type in its IP address into your browser), select Console, and watch what happens as you change the slider…
Hold up though:
You will definitely need the incoming transformation!
When change the dimmer value on the Tasmota device I get the following on the MQTT broker:
{“POWER”:“ON”,“Dimmer”:51,“Color”:“8282828282”,“HSBColor”:“0,0,51”,“Channel”:[50,50,50,50,50],“CT”:500}
And in the Console: 14:44:52 MQT: stat/bulb1/RESULT = {“POWER”:“ON”,“Dimmer”:40,“Color”:“6666666666”,“HSBColor”:“0,0,40”,“Channel”:[40,40,40,40,40],“CT”:500}
However when I change the value from Openhab (PaperUI - Control) I get just the value: 29.71
Outgoing transformation is only needed if your device needs it.
Step one - clearly identify what topic and payload your device needs to be sent to effect a command.
Hint - I very much doubt you want to send your openHAB commands to RESULT topic. The commandTopic parameter.
Yoo hoo! It’s working. The wrong commandTopis was the problem. @hafniumzinc After making the suggested changes, it worked.
I assumed that since the information was being sent as JSON, I had to somehow reply in the same fashion. Great to know that cmnd function does that job.
Another thing I discovered, is that when I also removed the Absolute Minimum and Absolute Maximum, it also fixed the decimals values displayed in the PaperUI - Control slider e.g. 52 was being displayed as 52.599999999999999.
Thanks again everyone. Making a lot more sense now.