Hey,
- Platform information:
- Hardware: Raspberry Pi 3
- OS: openhabian
- openHAB version: 3
- Issue of the topic:
I have got a zigbee light and got it working via zigbee2mqtt. (this light: Lidl HG06106B control via MQTT | zigbee2mqtt.io) I can send commands to it via mqtt.fx. The commands are send via a json format. If I send commands via the Sitemap, the number e.g. 210 for color_temp, the output is just 210 and not converted to json ( What I want: {“color_temp”: 210})
If I set the value manualy via MQTT.fx, the sitemap gets updated. So Jsonpath seems to be working.
How do I convert the number from the sitemap into a json message?
Configuration
Thing:
Thing mqtt:topic:e14 "Test Lampe " {
Channels:
Type switch : e14_switch "Switch" [ stateTopic="zigbee2mqtt/e14" , commandTopic="zigbee2mqtt/e14/set", on="ON", off="OFF", transformationPattern="JSONPATH:$.state"]
Type number : e14_birghtness "Brightness" [ stateTopic="zigbee2mqtt/e14" , commandTopic="zigbee2mqtt/e14/set", min=1, max=254, transformationPattern="JSONPATH:$.brightness" ]
Type number : e14_temp "Color Temp" [ stateTopic="zigbee2mqtt/e14" , commandTopic="zigbee2mqtt/e14/set", min=150, max=500, transformationPattern="JSONPATH:$.color_temp" ]
Type color : e14_color "Color" [stateTopic="zigbee2mqtt/e14", commandTopic="zigbee2mqtt/e14/set", transformationPattern="JSONPATH:$.color.rgb" ]
}
Item:
The Item is auto generated via the schemantic view (Create Equiptment from thing)
Sitemap:
Frame label="lampen" {
Switch item=TestLampe_OnOffSwitch label="Lampe"
Default item=TestLampe_ColorValueHSBRGBorCIExyY label="Farbe"
Slider item=TestLampe_E14_Birghtness label="Helligkeit[%d]" minValue=1 maxValue=254
Slider item=TestLampe_E14_Temp label="Temperature [%d]" minValue=150 maxValue=500 step=10
}
Best Regards and thanks for the help
Schotte