evcc-io / evcc

Sonne tanken ☀️🚘
https://evcc.io
MIT License
3.47k stars 639 forks source link

Solarwatt: Parse error in case of a battery defect #14528

Closed thumm closed 3 months ago

thumm commented 3 months ago

Describe the bug

If the solarwatt battery is not working (in my case because of a battery damage), the URL endpoint used in evcc to get the SOC value returns a null value. This situation is not handled in the evcc code with following error log entries

[site ] ERROR 2024/06/23 18:20:21 battery 1 soc: strconv.ParseFloat: parsing "<nil>": invalid syntax

Steps to reproduce

  1. Damage your battery :-) (no, don't do that)
  2. Look at the evcc log

Configuration details

...

meters:
  - name: grid1
    type: template
    template: solarwatt
    usage: grid
    host: <Solarwatt energy manager URL>
  - name: pv2
    type: template
    template: solarwatt
    usage: pv
    host: <Solarwatt energy manager URL>
  - name: battery3
    type: template
    template: solarwatt
    usage: battery
    host: <Solarwatt energy manager URL>

...

Log details

[main  ] INFO 2024/06/23 18:19:48 evcc 0.126.2
[main  ] INFO 2024/06/23 18:19:48 using config file: /etc/evcc.yaml
[main  ] INFO 2024/06/23 18:19:48 starting ui and api at :7070
[db    ] INFO 2024/06/23 18:19:48 using sqlite database: /root/.evcc/evcc.db
[mqtt  ] INFO 2024/06/23 18:19:48 connecting evcc-239835967 at tcp://192.168.19.2:1883
[site  ] INFO 2024/06/23 18:19:50 site config:
[site  ] INFO 2024/06/23 18:19:50   meters:      grid ✓ pv ✓ battery ✓
[site  ] INFO 2024/06/23 18:19:50     grid:      power ✓ energy ✓ currents ✗
[site  ] INFO 2024/06/23 18:19:50     pv 1:      power ✓ energy ✓ currents ✗
[site  ] INFO 2024/06/23 18:19:50     battery 1: power ✓ energy ✓ currents ✗ soc ✓ capacity ✗
[site  ] INFO 2024/06/23 18:19:50   vehicles:
[site  ] INFO 2024/06/23 18:19:50     vehicle 1: range ✓ finish ✗ status ✓ climate ✗ wakeup ✓
[lp-1  ] INFO 2024/06/23 18:19:50 loadpoint 1:
[lp-1  ] INFO 2024/06/23 18:19:50   mode:        pv
[lp-1  ] INFO 2024/06/23 18:19:50   charger:     power ✓ energy ✓ currents ✓ phases ✓ wakeup ✗
[lp-1  ] INFO 2024/06/23 18:19:50   meters:      charge ✓
[lp-1  ] INFO 2024/06/23 18:19:50     charge:    power ✓ energy ✓ currents ✓
[lp-1  ] INFO 2024/06/23 18:19:50 vehicle updated: unknown -> BMW 320e
[main  ] INFO 2024/06/23 18:19:50 new version available: 0.127.2
[site  ] ERROR 2024/06/23 18:19:51 battery 1 soc: strconv.ParseFloat: parsing "<nil>": invalid syntax
[lp-1  ] INFO 2024/06/23 18:19:52 car connected
[lp-1  ] INFO 2024/06/23 18:19:52 start charging ->
[site  ] ERROR 2024/06/23 18:20:21 battery 1 soc: strconv.ParseFloat: parsing "<nil>": invalid syntax
[site  ] ERROR 2024/06/23 18:20:51 battery 1 soc: strconv.ParseFloat: parsing "<nil>": invalid syntax

What type of operating system are you running?

Docker container

Version

0.127.2

andig commented 3 months ago

@thumm could you please share a trace log or really the actual HTTP response? Is it only soc that fails? What does

evcc charger

say?