Hi,
I am using a number of Ikea switches via a sonoff zigbee bridge flashed with Zigbee2Tasmota.
Whilst i have them working, my solution is clumsey and i am sure it could be better. In summary:
Thing:
Thing mqtt:topic:Tas_Bridge “Zigbee Bridge” (mqtt:broker:MosquittoMqttBroker) {
Channels:
Type string : lounge “Lounge Switch” [
stateTopic=“tele/Tas_Bridge/A50F/SENSOR”,
transformationPattern=“JSONPATH:$.ZbReceived.Ikea_Switch_2”
]
}
Item:
String Ikea_Sw_2 { channel=“mqtt:topic:Tas_Bridge:lounge” }
The above sets Ikea_SW_2 to {Device=0xA50F, Name=Ikea_Switch_2, 0102!01=, ShutterClose=true, Endpoint=1, LinkQuality=63} When fired.
Currently because the switch uses different variables for different actions ShutterOpen=True, ShutterClosed=True etc I am having to do a string search to fine the relevant text “ShutterOpen” or ShutterClosed.
If it was a Json String I could use $.Ikea_Switch_2.ShutterOpen or $.Ikea_Switch_2.ShutterClosed, but this does not work as it s not a Jason string.
Is there a way to extract the data from this string in a more structured way?
I feel there should be as it is very similar to Json, but used = instead of : ]
{
Device=0xA50F,
Name=Ikea_Switch_2,
0102!01=,
ShutterClose=true,
Endpoint=1,
LinkQuality=63
}
I have searched the forums in vain so any help most welcome