enboig
(enBoig)
August 17, 2019, 5:29pm
1
After upgrading to 2.4; I managed to make sensors working again (thanks to other forum entries). Now I am trying add https://www.zigbee2mqtt.io/devices/QBKG12LM.html but I am missing some bits.
I don’t know how to define it at .things neither at .items
The mqtt message when switching is
topic 'zigbee2mqtt/laundryswitch',
payload '{"power":0,
"consumption":0,
"temperature":33,
"linkquality":80,
"state_left":"ON",
"state_right":"OFF",
"click":"",
"device":{"ieeeAddr":"0x00158d0002a6de0e","friendlyName":"laundryswitch","type":"Router","nwkAddr":2841,"manufId":4447,"manufName":"LUMI","powerSource":"Mains (single phase)","modelId":"lumi.ctrl_ln2.aq1","hwVersion":18,"swBuildId":"unknown","dateCode":"06-25-2018","status":"online"}}'
I have defined the thing as
Thing topic lightlaundry "Light" @ "FF_LaundryRoom" {
Channels:
Type switch : PowerSwitch [ stateTopic="zigbee2mqtt/laundryswitch" , commandTopic="zigbee2mqtt/laundryswitch/left/set", on="ON", off="OFF" ]
}
and item as
Switch lightlaundry "Light" <light> (FF_LaundryRoom) {channel="mqtt:topic:mosquitto:laundryswitch" }
rossko57
(Rossko57)
August 17, 2019, 6:16pm
2
You haven’t got a channel named laundryswitch. You did make one called PowerSwitch
belonging to a thing called lightlaundry
.
That will give you all of the JSON payload. I expect you’ll want to parse out some part of the JSON using a JSONPATH transformationPattern
enboig
(enBoig)
August 17, 2019, 6:44pm
3
You are right, I messed (sometimes I mess labels with keywords ), still learning…
Thanks a lot, now it is working.
Windrad
(Ingo)
February 23, 2021, 7:27am
4
Hi enboig,
can you share your .things and .items und the JS scripts?
Thanks,
Ingo
enboig
(enBoig)
February 24, 2021, 6:27pm
5
They are for openhab2; things is
Bridge mqtt:broker:mosquitto "Mosquitto" [ host="127.0.0.1", secure=false, clientID="openHAB2"]
{
Thing topic interruptorssafreig {
Channels:
Type switch : switch_left [ stateTopic="zigbee2mqtt/interruptorssafreig", transformationPattern="JSONPATH:$.st>
Type switch : switch_right [ stateTopic="zigbee2mqtt/interruptorssafreig", transformationPattern="JSONPATH:$.st>
}
...
}
items is
Switch LaundrySwitch "Llum Safreig" <light> (FF_LaundryRoom) {channel="mqtt:topic:mosquitto:interruptorssafreig:switch_left" }
I have to migrate everything to OH3, where all of this should be easier…
enboig:
They are for openhab2
And for openHAB 3 - your configuration will work perfectly fine in OH3!
enboig
(enBoig)
February 24, 2021, 7:04pm
7
well… for some sensors I didn’t install all channels (movement sensors are missing light, temperature are missing humidity…). I was planning a clean install.
I plan keeping my zigbee2mqtt to avoid pairing again all the devices.
enboig
(enBoig)
February 26, 2021, 12:17pm
8
Evey thing connected, in OH3 I missed JINJA transmformation. Once installed everything is working