I recently setup home assistant on a Rpi with the hopes of doing some different things with dashboards. Right now my plan was to leave all the automations and devices on hubitat and just use home assistant for dashboards. My problem is I have not been able to figure out how to read or modify variables that reside in hubitat. Does anybody know how or if this is possible?
You could use hack a virtual notification device like this one and call a webhook in HA maybe,..
Virtual Notification Device Node-RED
metadata {
definition (name: "Virtual Notification Device", namespace: "erktrek", author: "erktrek and Robert Morris") {
capability "Notification"
capability "Actuator"
}
preferences {
input( name: "nodeRedAddr",type:"string",title: "Node-RED server address", description:"The location of the Node-RED server including port #.", defaultValue:"http://[Node-RED ip address]:[port]")
input( name: "nodeRedPath",type:"string",title: "Node-RED path", description:"", defaultValue:"/notify")
input(name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true)
input(name: "txtEnable", type: "bool", title: "Enable descriptionText logging", defaultValue: true)
}
}
void installed() {
log.debug "installed()"
initialize()
}
void updated() {
log.debug "updated()"
initialize()
}
void initialize() {
log.debug "initialize()"
Integer disableTime = 1800
if (logEnable) {
log.debug "Debug logging will be automatically disabled in ${disableTime} seconds"
runIn(disableTime, "debugOff")
}
}
void debugOff() {
log.warn "Disabling debug logging"
device.updateSetting("logEnable", [value:"false", type:"bool"])
}
void deviceNotify() {
}
void myAsynchttpHandler(resp, data) {
if (logEnable) log.debug "HTTP ${resp.status}"
// whatever you might need to do here (check for errors, etc.),
if (logEnable) log.debug "HTTP ${resp.body}"
}
void deviceNotification(notificationText) {
if (logEnable) log.debug "deviceNotification(notificationText = ${notificationText})"
sendEvent(name: "deviceNotification", value: notificationText, isStateChange: true)
Map params = [
uri: nodeRedAddr,
contentType: "application/json", // or whatever
path: nodeRedPath,
body: [notificationText: notificationText], // this will get converted to a JSON
timeout: 15
]
asynchttpPost("myAsynchttpHandler", params)
}
This is a very simple one for Node-RED but should be adjustable.
I think that you need the follwoing bridge:
3 Likes
Thanks Everyone.