Dan,
I've been playing with the Express Server for Insteonlocal Homebridge plugin. Not sure why I ignored this for so long. It pretty much does exactly what I need. If I enter the correct path for ON and OFF respectively into your HTTP Momentary switch driver, it works and controls my Insteon lights locally, and very quickly.
The groovy could easily be modified by someone that understands it, so that it has two fields, one for ON and one for OFF, but this is really unnecessary. The primary variables will always be the Homebridge IP, the port number, and the Insteon device ID. The other variables in the path, will be the type and state (ON or OFF), but for this purpose, the type "light" is all that's needed. Unfortunately, I don't have the groovy skills to make that happen. No point in my posting the code. It would just be all wrong and missing so much, but I can give you a screen shot of what I'm thinking it could look like so you have a better idea of what I'm talking about. I've posted a shot of what works right now with a single http path.
Here are the possible http paths for the Insteonlocal Express Server. The only two that matter here are the first two for light ON and OFF. Dim would be nice, but so as to not over complicate things, that would be very simple to do once RM can do HTTP GET. And for that matter, your original HTTP Momentary switch would be fine for setting a dim level.
-
/light/[id]/on
: turn on the light with Insteon [id]
-
/light/[id]/off
: turn off the light with Insteon [id]
-
/light/[id]/status
: get status of the light with Insteon [id]
-
/light/[id]/level/[targetlevel]
: set brightness of the light with Insteon [id] to [targetlevel]
-
/scene/[group]/on
: turn on the scene with Insteon [group] number
-
/scene/[group]/off
: turn off the scene with Insteon [group] number
-
/iolinc/[id]/relay_on
: turn on the relay for iolinc with Insteon [id]
-
/iolinc/[id]/relay_off
: turn off the relay for iolinc with Insteon [id]
-
/iolinc/[id]/relay_status
: get status of the relay for iolinc with Insteon [id]
-
/iolinc/[id]/sensor_status
: get status of the sensor for iolinc with Insteon [id]
-
/links
: get all links from your Insteon Hub
-
/links/[id]
: get links for device with Insteon [id]
-
/info/[id]
: get info for device with Insteon [id]
Here's what works now, but currently only supports the single local http path as you know, and momentary isn't desirable in this use case. "Get" will always be used. "Post" and "Push" are not needed.
I'm fairly certain modifying this would be trivial for you (don't want to take you away from the Alex TTS project though ).
Here's what I'm thinking for a basic Insteonlocal Express Server switch. Again, the choice between POST, GET and PUT is unnecessary. Only GET is needed for this use.
[Edit] One other thing that would be nice to have would be the status via polling. If a light is operated outside of hubitat, it would be great if the driver could poll, say every 30 seconds (or a user definable amount) so that the driver state and the Insteon light state are always kept in sync.
-
/light/[id]/status
: get status of the light with Insteon [id]