Porting drivers from Zigbee zha device handlers to ST edge Lua drivers: is it possible?

Hi, looking at Lua and ST documentation looks like it would not be the biggest challenge to port drivers over.

Are there any examples of drivers that have been ported over so I can compare both types and understand the difference between the two?

Looking at starting with the Ikea air purifier, which only currently works as a fan.

They are two different programming languages. You have to rewrite the groovy one in Lua, but it’s not that complicated as Long as the functionality you need is supported. Which it may or may not be, it just comes down to the specifics. For example, when edge drivers were first introduced, the parent/child structure from the old architecture was not replicated and for a while it wasn’t possible to have a voice assistant control a multi endpoint device. But eventually smartthings did modify that, and now it can be done.

So there’s no instant or easy or automated way to do it, but lots of people have done it. It’s basically like translating something from Russian to Spanish. So, just take the existing examples for writing an edge driver, and as long as you understand what you have in the other integration, you should be able to do it in most cases.

The biggest advantage of having an existing integration is knowing what the different clusters are, including any proprietary clusters, and what the values are. Because those may be different from model model, so knowing what they are can definitely help.

OK, looking a little deeper at what people have been doing on other platforms, it’s important to know that the Zigbee independent third-party standard allows for “manufacturer proprietary” clusters, Which are messaging formats that a manufacturer makes up for themselves to support custom functionality which is not included in the basic specification. And the manufacturer does not have to detail exactly how these work.

IKEA is using manufacturer proprietary clusters for a number of the sensor functions on these newer devices, which is why they don’t currently work with other certified Zigbee platforms.

Porting something with custom clusters is always way harder than something which is vanilla ZHA. Doesn’t mean it’s impossible, but it means both that you have to figure out what the clusters are used for and what the values are, you also have to write code to process those values since again, it’s not part of vanilla Zigbee 3.0 or ZHA.

So, in this case, it’s not just translating Russian to Spanish: it’s translating a particular Russian family’s favorite slang, something you can’t just look up in the dictionary

thats what I was worried about. Hence why i started looking to see if anyone had already done the extraction of the cluster details.

From what i can see ZHA references the 2.5u ppm value, the filter age etc

1 Like

Yeah, there’s another completely separate known issue with the newest IKEA products, which is that you may be able to pair them directly to a certified Zigbee hub, but they won’t work through repeaters (which in Zigbee are called “routers”). So, even if you write an edge driver that works, it will probably only work with devices which are within one hop of the hub. :disappointed_relieved:

The folks over at hubitat have been working on exactly this issue regarding the newer IKEA devices, but they don’t have a fix yet.

dam that’s a really problem, as have quite a few devices that are mains connected, and therefore they will work as routers/repeaters?