Can I create a Device Handler to control two switches of my double relay device?

In fact I want to create a universal Device Handler for Z-Uno https://z-uno.z-wave.me. For this I want to understand deeper how to host many similiar features in one Device Handler (like many switches or many temperature sensors). Z-Uno is very flexible and the handler should be fexible too.

As I got, “view” (tiles) can be static only, so anyway user will need to upload a custom handler for his individual Z-Uno sketch. Or can we somehow “interview” Z-Uno to then use “if”, “for” to generate tiles?

If not, is it worth to make a Device Handler generator or it is too complex for users to load them? What is the best practice in SmartThings?

Just in brief, Z-Uno can be programmed like an Arduino to them become a Z-Wave device with up to 32 features in one: switches, dimmers, sensors, meters,…

You should take a look at using the Composite Device Handler to allow more that 1 of each capability in a single device. I am using this to create a Parent Device Handler which listens for events from an Arduino/ESP8266 to then automagically create a Child Device for each unique device attached to the microcontroller. So, for example, you could attach 16 relays to an Arduino Mega, and that would result in 16 “Switch” child devices being created by the one Parent Device. This then provides a means to use all 16 relays as if they were individual devices by any other SmartApps.

Take a look at my Parent and Child Device handlers in my Github Repo. If you have an ESP8266 board laying around, you could have one of my example sketches up and running in a few minutes by following my ReadMe. Then you could see exactly how I create child devices on the fly.

Of course, to use the Z-Uno, you’ll need to remove the LAN connection commands and replace them with Z-Wave equivalents.

1 Like

It operates as a multi channel device.

https://z-uno.z-wave.me/z-wave/z-wave-plus-certification/

So I would look at examples of DTHs for other multi channel devices. :sunglasses:

edited to add @ogiewon beat me to it with a much more detailed answer, but I’m going to leave this post up since it includes the links to the Z wave conformance statement. :sunglasses:

1 Like

And here is a another good post about using the Composite Device Handler with a Z-Wave device (although it does not auto-create children on the fly. it assumes a specific device configuration by the parent.)

1 Like

Thank you @ogiewon and @JDRoberts.

Yes, Z-Uno is using MultiChannel and I’ve already got how to handle it, but creating multiple devices out of one physical is not well documented.

Also I was surprised with no DTH for i.e Fibaro FGS-223 (Double Switch) that uses both switches separatelly.

I hope I’ll manage to solve this and publish for the community.

2 Likes

I had to do this for my Philio dual relay device. I made a device handler that spawns 2 child devices, it’s based on code from other devs and a virtual switch child device that’s already been published so you don’t need 2 handlers.

Have a look, it could be easily adapted to work with the Uno. I’m assuming it’s the creation of virtual child devices you’re struggling with, not the multi endpoint mapping.

BTW, here is the device handler I based mine on, and it also handles the Fibaro FGS-222 (and other multi-relay devices) if that’s more use to you, it has a lot more code and options than mine does.

Did anyone ever get the z-uno to work? I have an idea for one.