Looking for recommendations on building a Litetouch plugin

I built this plugin for Vera:

I'm looking to port it to Hubitat. However, there are a couple of things that may influence how I build it. The way I see it, I have 2 options:

  1. Plugin supports making commands over the serial port via an ethernet->serial converter (probably a pi zero w with a usb->serial dongle and socat)
  2. Implement a REST API on the pi zero, and make the HE plugin talk to the REST API.

The controller I have now supports the Litetouch 2000 protocol, which doesn't provide for notifications of changes over the serial port. If someone turns on a light via the keypad, I have to poll for it to see what its status is. And, if I poll too quickly, the data coming back comes back out of order. The result is that the current Vera plugin has a circular queue of all of the loads and it polls one every 2 seconds and updates the status in the Vera. In any case, since my current LiteTouch controller doesn't notify, a REST interface would be fine.

However, I also have a newer Litetouch controller called a 5000LC. The 5000LC supports a newer protocol (over serial) that does have status change notifications. I'm guessing that if I do a REST API when I eventually make a plugin for the newer controller, I will possibly have problems getting immediate notification of load status changes and I'll still have to do polling.

Any thoughts on this?

1 Like

Also, I'm just reading some of the documentation. It appears I need to create a "driver" in HE to support this.

The controller I have now doesn't have anything in it that allows for discovery of configured loads. So, in Vera, when I install the plugin I configure it with a field that lists the load ID's of dimmers, and another field that lists the load ID's of on/off switches. When the plugin starts, it automatically creates the devices in Vera for me, and I can go through and name them all and control them.

In HE, do drivers have the capability to take this list of load ID's and automatically create devices? Or, do I have to manually create each device on the devices page? I have 48 devices that will need to be created, so being able to do it via a list of load ID's on the controller would be ideal.

Hubitat drivers are written in Groovy. It does not appear that any of this is written in the correct language to be able to be used with Hubitat.

I know, I'm going to port it to groovy.

Just looking for some info before I tackle it.