I know I've chatted a bit about this before on here, but I'm looking for a specific recommendation on an existing driver that I can use as a starting point. This is for a LiteTouch centralized lighting control system. All lights are wired back to dimmer or relay modules in the basement, and all rooms have keypads in them ranging from 1 button to 9 buttons. Each light has an ID, in the form of "02-3", where "02" is the relay or dimmer module number, and "3" would be the output on that module. Modules have either 6 or 8 outputs on them.
I need a parent device that takes the following inputs:
- Dimmers - a list of dimmer ID's (e.g. "01-1, 01-2, 02-4")
- Relays - a list of relay ID's (e.g. "03-1, 03-2, 03-3")
- IP address - the IP of my ip->serial gateway attached to the LiteTouch controller
- Port - the TCP port on the serial gateway needed to connect.
The reason I have to specify the dimmer and relay module ID's specifically is because this is an older lighting controller that doesn't have a command I can use to discover configured devices and whether they are a relay or a dimmer.
I need the parent to automatically create the child devices as switches (for the ID's specified in the "Relays" field), and dimmers (for the ID's specified in the Dimmers field). And, ideally if this list was modified it would delete or add the child devices as needed.
Are there any drivers out there now that are similar to this? I know I'll have to write the rest of the logic to support the proprietary protocol used for sending commands and polling, but that's fine since I've already written it once in LUA on the Vera platform. Having something as a starting point that already takes IP/port and a list of device ID's would be really helpful though. Someone once mentioned a specific lighting driver that might be good, but I cannot find that post anymore.
Also, the other thing is polling... Right now on the Vera, I poll the list of relays and dimmers in a circular queue one per second under normal operation. If I make a change to the device through the Vera, I insert that device ID at the top of my circular queue to ensure that the command succeeded, and then it continues on where it left off. If I blast the polling queries all at once, the results come back in a random order from the controller and then get assigned to the wrong device in the Vera. Early 90's technology and slow embedded hardware. The whole thing is run by a PIC chip. So I have to be slow about it. How is this going to affect the load/performance of the Hubitat if I do the same "one per second" polling?
For those who are interested, here is the driver I wrote for the Vera so you can see what it does. This version is direct to a serial port since I can plug a usb->serial converter into the vera.
This file is the one with the actual code in it: