Just starting a search. May be supported by rtl_433, per the GitHub readme. I have HA.
Any tips?
@ymerj , @Rxich ?
Applying a little AI to your query....
BROTGauge Driver(untested)
metadata {
definition (name: "Beckett Rocket Oil Gauge", namespace: "custom", author: "AI Collaborator") {
capability "Sensor"
capability "Polling"
capability "Refresh"
attribute "levelPercent", "number"
attribute "remainingGallons", "number"
attribute "bars", "number"
attribute "status", "string"
attribute "lowFuelAlert", "string"
attribute "lastUpdated", "string"
}
preferences {
input name: "apiUri", type: "text", title: "API Endpoint URI", description: "e.g., http://192.168.1", required: true
input name: "pollInterval", type: "enum", title: "Poll Interval", options: ["Manual Only", "1 Hour", "3 Hours", "6 Hours"], defaultValue: "3 Hours"
}
}
// Triggers when the device is initialized or preferences save
def updated() {
log.info "Updating settings for Beckett Rocket Gauge..."
unschedule()
switch(pollInterval) {
case "1 Hour": runEvery1Hour(refresh); break
case "3 Hours": runEvery3Hours(refresh); break
case "6 Hours": runEvery6Hours(refresh); break
}
}
def poll() {
refresh()
}
// Performs the HTTP GET request to your Flask endpoint
def refresh() {
if (!apiUri) {
log.warn "API Endpoint URI is not configured."
return
}
def params = [
uri: apiUri,
requestContentType: "application/json",
contentType: "application/json",
timeout: 10
]
log.debug "Polling Beckett API: ${apiUri}"
try {
httpGet(params) { response ->
if (response.status == 200 && response.data) {
parseData(response.data)
} else {
log.error "API returned unexpected status: ${response.status}"
}
}
} catch (Exception e) {
log.error "Failed to connect to Beckett REST API: ${e.message}"
}
}
// Parses JSON properties into Hubitat Device events
private def parseData(Map data) {
log.debug "Parsing data received from API: ${data}"
sendEvent(name: "levelPercent", value: data.levelPercent, unit: "%")
sendEvent(name: "remainingGallons", value: data.remainingGallons, unit: "gal")
sendEvent(name: "bars", value: data.bars)
sendEvent(name: "status", value: data.status)
sendEvent(name: "lowFuelAlert", value: data.lowFuelAlert ? "active" : "inactive")
sendEvent(name: "lastUpdated", value: data.lastUpdated)
log.info "Beckett Gauge Updated: ${data.levelPercent}% (${data.remainingGallons} Gal remaining)"
}
1 Like
You AI guys!
One day.........
1 Like