Well guys, I got the wild hair to build an ESP32 based control panel for my Hubitat C8. I tried the MQTT app / driver a couple of years back and wasn't ever quite satisfied with it. So yesterday I decided to try something "different".
First off, I set up the Hubitat Maker API and selected the devices I wanted to be able to monitor / control. That Maker API is pretty darn powerful. Now I know I COULD just use the REST end points directly from the ESP32, but what's the fun in that? So instead I decided to use Node-Red as an interface layer to MQTT. The beauty of Node-Red is that it's made for this very type of thing. There are built in HTTP listener, MQTT Publish and MQTT Subscribe nodes, etc .
Next I set up a Node-Red flow that is kicked off by an HTTP request and pointed the Maker API PUSH capability at that end point. Now whenever any of the monitored devices change status, the Node-Red flow is kicked off and I process the message in Node-Red and publish the state values (with "retain=true") from Hubitat to seperate MQTT topics. For example, if I want to check if my living room light is on, I can subscribe to hubitat/31/value and get "on" or "off".
Now to controll the devices I set up a second Node-Red flow that is triggered by a wildcard MQTT topic (subscribed to hubitat/+/set) and then I parse the topic name and call the Maker API to send commands back to Hubitat. For example when I publish the value "on" to hubitat/31/set it turns on my living room lights.
Anyway, I doubt anyone has maee it this far, but if you are interested in the code, I can provide it. Thanks!