I set up this integration purely with the rest and curl a long time back and thought i would share it with you.
Texts are in Swedish, i hope you figure it out anyway.
Command line switch to control availability on/off for the chargebox… if you don’t trust your neighbours then you can schedule or automate the availability of charging from the box.
Rest sensor to collect the data from the box as attributes (one call to collect all stats)
Template sensors to calculate and make the collected data representable and enumerate statuses.
Lovelace cards with dynamic image that changes color based on status.
Utility sensors that collect and calculate stats for usage per month and day…
Note: for chargebox with software version earlier than v1.3.1 you need to format the urls like this instead, (i recommend to update the firmware): (thanks @StarkJohan)
I’m doing a pretty basic addition to your example to add support for multiple load balanced chargers. Will post it all once it is finished. A couple of notes on multiple chargers though:
Unfortunately there’s currently no HA-native way of getting all the data without making at least one API call per charger.
Temperature is unfortunately only available for the main charger for some reason.
Also, the “INITIALIZATION” mode makes the LED green, not red as your code suggests. At least that is the case on my chargers. Perhaps this is firmware dependent?
Works great! Is there a way to set the current limit?
Edit: I checked the config and there is no function for setting the current limit. I added a sensor for displaying the current configured current limit. I have also found the POST header and data needed to change the limit but since my coding skills are quite limited I haven’t figured out how to implement this yet. Current limit is a scheduled function but can be set for the whole day as well. My box supports 6-16A charge limit at 1A increments.
I added som magic that solved my need for being able to set the charge limit. There are problably better or cleaner ways to do this but with limited coding experience this is what I came up with.
I added this to pkg_garo_chargebox.yaml
### For setting charge limit
input_number:
charge_limit_set:
name: charge_limit_set
min: 6
max: 16
step: 1
unit_of_measurement: A
shell_command:
laddbox_set_charge_limit: '/usr/bin/curl --header "Content-Type: application/json" --request POST --data "{\"reducedIntervalsEnabled\":true,\"reducedCurrentIntervals\":[{\"schemaId\":1,\"start\":\"00:00:00\",\"stop\":\"00:00:00\",\"weekday\":8,\"chargeLimit\":{{ states("input_number.charge_limit_set") | int }}}]}" http://your.ip.here.x:8080/servlet/rest/chargebox/currentlimit/'
### Templates to convert units and set separate sensors from attributes.
template:
- sensor:
- unique_id: 'laddbox_currentlimit'
name: 'Laddbegränsning'
icon: mdi:flash-circle
unit_of_measurement: 'A'
state_class: measurement
state: >
{% set state = state_attr('sensor.laddbox', 'currentLimit') | round(0) %}
{% if state >= 0 %}
{{state}}
{% else %}
0
{% endif %}
Then I added an automation to execute the shell_command when the input_number changed.
- id: '1632384423797'
alias: Set charge limit
description: ''
trigger:
- platform: state
entity_id: input_number.charge_limit_set
condition: []
action:
- service: shell_command.laddbox_set_charge_limit
mode: single
My box isnt up and running yet but I’m going to install the GNM3D-RS485 energy-meter. And as I understand the wallbox read values from this. Is it possible to get them into HA as well?
Hi!
I am not familiar with the Garo energy meter but based on the specs it looks like it is having modbus interface over RS485 rather than a wifi or network interface like the wallbox. It will probably require you to connect some more hardware/interface to extract data from the meter. Modbus - Home Assistant (home-assistant.io)
I assume you’re installing the GNM3D meter to be used for load balancing hardwired to the master GLB. In this case you can access the a couple of the values from the meter. Specifically the values presented in the Garo webGUI.
As a total HA noob…
Can this snippet just be added to config.yaml and i should be able to get the values from my load balancing meter?
I have the GNM3D in my main fuse box.
I have mainly used Domoticz for the past years and just now looking into HA.
Vad jag förstår så är inte detta energimätaren för lastbalansering, utan den energimätaren som sitter internt i Garo boxen. Hur man kommer åt lastbalanseringen har jag inte lyckats klura ut.
Hasse
The bad news is that the value for “phasesXInstpower” reports as 0 as long as they are below 1
and as 1 between 1-2 and so on.
The same issue with “apperentPower”.
“phaseXcurrent” I’ll get the correct value x 10. → 151 = 15,1A
The values I get from “phaseXInstPower” is more or less useless to me, so I ended up doing the math
P =U*I.
I now this isn’t 100% correct but closer than what I get out of the box.
- unique_id: 'lastbalanserare_phase1InstPower'
name: 'Aktuell förbrukning fas 1'
icon: mdi:resistor
unit_of_measurement: 'kW'
state_class: measurement
state: >
{% set state = state_attr('sensor.lastbalanserare', 'phase1Current')*230/10000 | round(1) %}
{% if state >= 0 %}
{{state}}
{% else %}
0
{% endif %}
I did this in a new yaml-file and included it in configuration.yaml.
I’m on software 1.3.1 BUT my setup consists of two GLB (1 master, 1 slave) and a LBM. I can assure you that the data collected on this url is the same data as can be read on the LBM itself. Example output below. I get no response on “:8080/servlet/rest/chargebox/meterinfo/EXTERNAL” with my setup.
Lots of great information and a working solution, just what I was seeking.
But a somewhat none HA related question, do anyone know how I get the GARO to stay on a private network with no internet access?
I do not see any reason for the box to connect to internet, I just want to keep it local. But when I switch it to a local network with no internet access it goes back to access point mod after some 10 minutes like it say in dialog when I do the change. Anyone figured out how it detect this, and how to trick it to say connected?
I’ve done according to specificaions on github, yet I get an error in HA stating:
Integration error: garo_chargebox - Integration ‘garo_chargebox’ not found.
Any ideas? Also - any input on what to change/add to get data from a dual charger?
Also check the logs if you get any error related to the rest sensor.
For dual charges i would assume you would get some more or different output from the chargebox which might cause the error or require you to set up the “mother” sensor in a bit different way.
When i look at my output file i can see two sub sections in the structure, maincharger and twincharger http://[chargebox_ip]:8080/servlet/rest/chargebox/status
I have updated the yaml package file on github to enable you to extend for twinCharger.
For double port box/twinCharger:
First add the attribute twinCharger in the mother sensor, then copy the mainCharger unique template sensors and set them up to extract values from twinCharger too :).