Hi everyone,
I would like to submit a problem related to “dirty” values when recharging an electric car via a GALI column. This column has no native integration, but exposes API via REST.
via REST I then create a “gali_line_power” sensor which indicates the instantaneous consumption in W during recharging:
rest:
resource: http://x.y.z.k/index.json?btn=X
scan_interval: 60
sensor:
- name: "Gali line power"
value_template: "{{ value_json['pnet']}}"
device_class: power
unit_of_measurement: W
state_class: measurement
Since the column is in the BOX and the internet line sometimes goes down, I created a “gali_line_power_fixed” sensor that mitigates this problem:
- platform: template
sensors:
gali_line_power_fixed:
friendly_name: "gali line power fixed"
unit_of_measurement: 'W'
device_class: power
value_template: "{{ states('sensor.gali_line_power') | default(0) }}"
Now through the integration platform I calculate the energy absorbed during recharging [KWh] and enter it in the energy dashboard
- platform: integration
source: sensor.gali_line_power_fixed
name: Consumo Energetico Gali
unit_prefix: k
round: 2
Now the problems begin:
every time i start a new charge there comes an energy spike which is completely off the charts and you can see it in the screenshot.
practically the energy consumed suddenly rises to high values when in reality it is much lower.
In addition to the dashboard where the calculation error is very visible, I also have some sensors that add up the various home and garage lines, also calculating consumption by time slot.
All sensors related to energy consumption go up with that peak as they add up
now my question is: what could be causing this error?
how could I have a debug to rebuild the values?
The read rest value is constant and has no peaks. sometimes it goes to 0 if the internet line is not available, but it happens very rarely.
many thanks
Lorenzo