vayavalla
(vayavalla)
January 28, 2021, 5:30pm
1
Platform information:
Hardware: Raspberry pi4
OS: raspi
Java Runtime Environment: Openjdk 11
openHAB version: 3
I’m trying to configure one Zigbee LED, but I can’t figure out how to get and command the brightness.
I can turn it ON and OFF, but no success extracting the brightness out ot the MQTT message or sending the command to it
I can see the mqtt message /zigbee2mqtt/LedLidl with Payload {“brightness”:80,“color”:{“x”:0.270103566139535,“y”:0.275462785681784},“color_temp”:80,“linkquality”:31,“state”:“ON”} with MQTT.fx
Any Idea how to solve it or where to look for the error?
zigbee2mqtt.thing file
Bridge mqtt:broker:mosquitto "mosquitto" [ host="192.168.8.213", port=1883, secure=false, username="openhab", password="" ] {
Thing topic LedLidl "Luz Led Lidl" @ "Salón" {
Channels:
Type switch : Encendido "Encendido" [
stateTopic="zigbee2mqtt/LedLidl",
transformationPattern="JSONPATH:$.state",
commandTopic="zigbee2mqtt/LedLidl/set",
transformationPatternOut="JS:settradfristate.js"
]
Type dimmer : Brillo "Brillo" [
stateTopic="zigbee2mqtt/LedLidl",
transformationPattern="JSONPATH:$.brightness",
commandTopic="zigbee2mqtt/LedLidl/set",
min=0,
max=254,
step=1
// formatBeforePublish="{ \"brightness\" : 30 }"
]
}
}
thigbee2mqtt.items
Group g_LuzLedLidl "Luz Led Lidl"
Switch LuzLedLidl "Luz Led Lidl" <light> (g_luces, g_LuzLedLidl) {channel= "mqtt:topic:mosquitto:LedLidl:Encendido"}
Dimmer LuzLedLidlBrillo "Luz Led Lidl Brillo [%d %%]" <light> (g_LuzLedLidl) {channel="mqtt:topic:LedLidl:Brillo"}
Can you link the product from this page?
vavo01
(Valentin Voth)
January 28, 2021, 5:55pm
4
Have you been successful changing brightness with mqtt.fx? According to the docs
zigbee2mqtt/LedLidl/set
{“brightness”:VALUE}
should do the job
By the way, I recommend http://mqtt-explorer.com for debugging mqtt setup.
vayavalla
(vayavalla)
January 28, 2021, 5:58pm
5
Sending the message via MQTT.fx works, but no success with openhab
It seems that it doesn’t send anything, when I try to change the value with one slider in my sitemap
This is commented out. Did you try some variations here? This should work:
formatBeforePublish="{ \"brightness\" : %s }"
vavo01
(Valentin Voth)
January 28, 2021, 6:09pm
7
Thats my default setup for such devices. Should also work in your case
Thing mqtt:topic:livingRoomLEDstripe "Hintergrundbeleuchtung im Wohnzimmer"{
Channels:
Type switch : state "Zustand Hintergrundbeleuchtung" [stateTopic = "zigbee2mqtt/livingRoomLEDstripe", transformationPattern="JS:getZigbeeONOFFstate.js", commandTopic = "zigbee2mqtt/livingRoomLEDstripe/set/state", on="on", off="off"]
Type number : linkquality "Link Hintergrundbeleuchtung" [stateTopic = "zigbee2mqtt/livingRoomLEDstripe", transformationPattern="JS:normZigbeeLink.js"]
Type number : brightness "Helligkeit Hintergrundbeleuchtung" [stateTopic = "zigbee2mqtt/livingRoomLEDstripe", transformationPattern="JSONPATH:$.brightness", commandTopic = "zigbee2mqtt/livingRoomLEDstripe/set/brightness"]
}
vavo01
(Valentin Voth)
January 28, 2021, 6:19pm
9
I think it should be “…/set/brightness” in the command topic of the dimmer channel
vayavalla
(vayavalla)
January 28, 2021, 6:48pm
10
Yes I tried it. No success
You may be running into a known bug with Things files - try restarting openHAB and try again. If that doesn’t work, please show us your latest configuration.
vayavalla
(vayavalla)
January 28, 2021, 7:05pm
12
I found my error. So dumb!!
In my item it was written
{channel=“mqtt:topic:LedLidl:Brillo”}
instead of
{channel=“mqtt:topic:mosquitto:LedLidl:Brillo”}
More than 4 hours looking for this error!!!