Pulling in Victron VRM data

Hello,

Anyone tried pulling in Victron VRM data in to the hubitat dashboard?

Thanks

RT

2 Likes

I am looking for this also.

I suspect MQTT maybe the way forward but have yet to spend time on it.

Did you make any progress with this? Would be great to turn off devices in HE using the State of Charge of the batteries connected to the Victron.

Did you ever find away ?

No. I believe it would be possible if you're prepared to set up Home Assistant. There is a Victron > HA integration.
Once you have that going, you will use the Hubitat Home Assitant Bridge to exchange the data between HA and HE.

Victron user here but I don't really have a use case for my data. And, this topic is largely beyond my skillset.

But, I saw the below diagram and remembered this post. Maybe it's relevant and useful, maybe not.

SOURCE:
https://www.victronenergy.com/media/pg/Cerbo_GX/en/installation.html

So I just gave this a try with ChatGPT helping, and I get stuck in a loop with http method or something. Def not a programmer!

Anyone able to help get me past the finish line? All I need is to pull the temp from my battery.

No signature of method: Script1.httpGet() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [null/temperature?apikey=null] on line 25

// Define Victron VRM API endpoint
def vrmApiUrl = "https://vrm.victronenergy.com/v2"

// Define API key
def apiKey = "aa967cc0b78699d504c7ea1bf7b6d89abc8beb3bf3bf0dfe679c7bac3bca8a99"

// Define function to fetch temperature data from VRM API
def fetchTemperatureData() {
    // Construct the full URL with the API key included as a query parameter
    def fullUrl = "${vrmApiUrl}/temperature?apikey=${apiKey}"
    
    // Make the HTTP GET request
    def response = httpGet(fullUrl)

    if (response.status == 200) {
        def temperatureData = response.data
        return temperatureData
    } else {
        log.error "Failed to fetch temperature data. Status code: ${response.status}"
        return null
    }
}

// Fetch temperature data from VRM API
def temperatureData = fetchTemperatureData()

// Process temperature data
if (temperatureData) {
    // Example: Extract temperature values and log them
    temperatureData.each { sensor ->
        log.info "Sensor: ${sensor.name}, Temperature: ${sensor.value} °C"
    }
} else {
    log.error "Temperature data fetch failed. Check API key and endpoint."
}