Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SofarSolar Values incorrect, but correct values via Modbus proxy #18630

Closed
2 tasks done
Studhey opened this issue Feb 6, 2025 · 1 comment
Closed
2 tasks done

SofarSolar Values incorrect, but correct values via Modbus proxy #18630

Studhey opened this issue Feb 6, 2025 · 1 comment

Comments

@Studhey
Copy link

Studhey commented Feb 6, 2025

Describe the bug

Hello,

I have since today a strange behaivour. I´m using the modbus Proxy to connect ioBroker modbus adapter to read some values. These values do all look fine. But in evcc all (SOC and amps look ok) values seems to be random (see log) The values from the wallbox seem ok.

I deleted the MQTT values and I first thought it might be that the configuration was not fully applied to use Modbus, I change to that yesterday.
However I restarted evcc, deleted the container and also "evcc migrate --reset".

Steps to reproduce

...

Configuration details

Konfiguration (/etc/evcc.yaml):

# open evcc at http://evcc.local:7070
network:
  schema: http
  host: evcc.local # .local suffix announces the hostname on MDNS
  port: 7070

# mqtt message broker
mqtt:
  broker: 172.27.1.10:1884
  topic: evcc # root topic for publishing, set empty to disable publishing
  # clientid: foo
  user: *****
  password: *****

log: info
levels:
  cache: error

# unique installation id
plant: *****

interval: 30s # control cycle interval

sponsortoken: *****




# sponsors can set telemetry: true to enable anonymous data aggregation
# see https://github.com/evcc-io/evcc/discussions/4554
telemetry: false

chargers:
- type: template
  template: alfen 
  id: 1  
  host: 172.27.1.182  
  port: 502  
  modbus: tcpip  
  name: wallbox2

vehicles:
- type: template
  template: vw 
  title: Tiguan  
  user: *****
  password: *****
  vin: *****
  capacity: 11  
  timeout: 10s  
  name: Tiguan
  icon: tractor # Icon in der Benutzeroberfläche (optional)
  phases: 1 # Die maximale Anzahl der Phasen welche genutzt werden können (optional)
  cache: 15m # Zeitintervall nach dem Daten erneut vom Fahrzeug abgefragt werden (optional)
  mode: PV # Möglich sind Off, Now, MinPV und PV, oder leer wenn keiner definiert werden soll (optional)
  minCurrent: 6 # Definiert die minimale Stromstärke pro angeschlossener Phase mit welcher das Fahrzeug geladen werden soll (optional)
  maxCurrent: 16 # Definiert die maximale Stromstärke pro angeschlossener Phase mit welcher das Fahrzeug geladen werden soll (optional)
  identifiers: # Kann meist erst später eingetragen werden, siehe: https://docs.evcc.io/docs/features/vehicle (optional)
  priority: # Priorität des Ladepunktes oder Fahrzeugs in Relation zu anderen Ladepunkten oder Fahrzeugen für die Zuweisung von PV-Energie (optional)

- name: MG
  type: template
  template: mg2mqtt
  title: MG 4
  user: *****
  timeout: 1h
  vin: *****
  capacity: 64 # Akkukapazität in kWh (optional)
  icon: car # Icon in der Benutzeroberfläche (optional)
  phases: 3 # Die maximale Anzahl der Phasen welche genutzt werden können (optional)
  mode: PV # Möglich sind Off, Now, MinPV und PV, oder leer wenn keiner definiert werden soll (optional)
  minCurrent: 6 # Definiert die minimale Stromstärke pro angeschlossener Phase mit welcher das Fahrzeug geladen werden soll (optional)
  maxCurrent: 16 # Definiert die maximale Stromstärke pro angeschlossener Phase mit welcher das Fahrzeug geladen werden soll (optional)
  identifiers: # Kann meist erst später eingetragen werden, siehe: https://docs.evcc.io/docs/features/vehicle (optional)
  priority: # Priorität des Ladepunktes oder Fahrzeugs in Relation zu anderen Ladepunkten oder Fahrzeugen für die Zuweisung von PV-Energie (optional)

loadpoints:
- title: Garage
  charger: wallbox2
  mode: pv

site:
  title: Mein Zuhause
  meters:
    #grid: grid1
    #battery: battery1
    #pv: pv1
    grid: my_grid
    battery: my_battery
    pv: my_pv


meters:
  - name: my_grid
    type: template
    template: sofarsolar
    usage: grid
    modbus: tcpip
    id: 1
    host: 172.27.1.190
    port: 502


  - name: my_pv
    type: template
    template: sofarsolar
    usage: pv
    modbus: tcpip
    id: 1
    host: 172.27.1.190
    port: 502

  - name: my_battery
    type: template
    template: sofarsolar
    usage: battery
    modbus: tcpip
    id: 1
    host: 172.27.1.190
    port: 502


#- type: custom
#  power:
#    source: mqtt
#    topic: ME3000SP/state/grid_power
#    timeout: 10s
#    scale: -1
#  energy:
#    source: http
#    uri: http://172.27.1.10:8087/getPlainValue/1-0:1_8_0__255.value
#  name: grid1

#- type: custom
#  name: battery1
#  power:
#    source: mqtt
#    topic:  ME3000SP/state/battery_power
#    timeout: 10s
#    scale: -1
#  soc:
#    source: mqtt
#    topic: ME3000SP/state/batterySOC
#    timeout: 10s

#- type: custom
#  name: pv1
#  power: 
#    source: mqtt
#    topic: ME3000SP/state/solarPV
#    timeout: 10s

modbusproxy:
  - port: 502
    uri: 172.27.1.190:502


tariffs:
  currency: EUR
  grid: # price using energy from the grid
    type: fixed
    price: 0.335 # EUR/kWh start 8.1.25 (39,7 - 15%)
  feedin: # price for feeding solar energy to the grid
    type: fixed
    price: 0.078 # EUR/kWh


influx:
  url: http://172.27.1.241:8086
  database: evcc # InfluxDB v2.x uses term `bucket` but for compatibility still named `database` here
  token: *****
  org: org

Version: `0.133.0`

Log details

[site ] DEBUG 2025/02/06 15:35:22 ----
[lp-1 ] DEBUG 2025/02/06 15:35:22 charge power: 0W
[lp-1 ] DEBUG 2025/02/06 15:35:22 charge currents: [0 0 0]A
[site ] DEBUG 2025/02/06 15:35:22 grid power: 152696W
[site ] DEBUG 2025/02/06 15:35:22 pv 1 power: 1W
[site ] DEBUG 2025/02/06 15:35:22 battery 1 power: -0W
[site ] DEBUG 2025/02/06 15:35:23 battery 1 soc: 18%
[site ] DEBUG 2025/02/06 15:35:23 grid currents: [0.06 0 0]A
[site ] DEBUG 2025/02/06 15:35:23 site power: 152796W
[lp-1 ] DEBUG 2025/02/06 15:35:23 charge total import: 7139.764kWh
[lp-1 ] DEBUG 2025/02/06 15:35:23 charger status: A
[site ] DEBUG 2025/02/06 15:35:52 ----
[lp-1 ] DEBUG 2025/02/06 15:35:52 charge power: 0W
[lp-1 ] DEBUG 2025/02/06 15:35:52 charge currents: [0 0 0]A
[site ] DEBUG 2025/02/06 15:35:52 grid power: 143521W
[site ] DEBUG 2025/02/06 15:35:52 battery 1 power: -0W
[site ] DEBUG 2025/02/06 15:35:52 pv 1 power: 1W
[site ] DEBUG 2025/02/06 15:35:53 battery 1 soc: 18%
[site ] DEBUG 2025/02/06 15:35:53 grid currents: [0.06 0 0]A
[site ] DEBUG 2025/02/06 15:35:53 site power: 143621W
[lp-1 ] DEBUG 2025/02/06 15:35:53 charge total import: 7139.764kWh
[lp-1 ] DEBUG 2025/02/06 15:35:53 charger status: A
[site ] DEBUG 2025/02/06 15:36:22 ----
[lp-1 ] DEBUG 2025/02/06 15:36:22 charge power: 0W
[lp-1 ] DEBUG 2025/02/06 15:36:22 charge currents: [0 0 0]A
[site ] DEBUG 2025/02/06 15:36:22 grid power: 142210W
[site ] DEBUG 2025/02/06 15:36:22 pv 1 power: 1W
[site ] DEBUG 2025/02/06 15:36:22 battery 1 power: -0W
[site ] DEBUG 2025/02/06 15:36:23 battery 1 soc: 18%
[site ] DEBUG 2025/02/06 15:36:23 grid currents: [0.06 0 0]A
[site ] DEBUG 2025/02/06 15:36:23 site power: 142310W
[lp-1 ] DEBUG 2025/02/06 15:36:23 charge total import: 7139.764kWh
[lp-1 ] DEBUG 2025/02/06 15:36:23 charger status: A
[site ] DEBUG 2025/02/06 15:36:52 ----
[lp-1 ] DEBUG 2025/02/06 15:36:52 charge power: 0W
[lp-1 ] DEBUG 2025/02/06 15:36:52 charge currents: [0 0 0]A
[site ] DEBUG 2025/02/06 15:36:52 pv 1 power: 1W
[site ] DEBUG 2025/02/06 15:36:52 battery 1 power: -0W
[site ] DEBUG 2025/02/06 15:36:52 grid power: 142210W
[site ] DEBUG 2025/02/06 15:36:53 battery 1 soc: 18%
[site ] DEBUG 2025/02/06 15:36:53 grid currents: [0.06 0 0]A
[site ] DEBUG 2025/02/06 15:36:53 site power: 142310W
[lp-1 ] DEBUG 2025/02/06 15:36:53 charge total import: 7139.764kWh
[lp-1 ] DEBUG 2025/02/06 15:36:53 charger status: A
[site ] DEBUG 2025/02/06 15:37:22 ----
[lp-1 ] DEBUG 2025/02/06 15:37:22 charge power: 0W
[lp-1 ] DEBUG 2025/02/06 15:37:22 charge currents: [0 0 0]A
[site ] DEBUG 2025/02/06 15:37:22 grid power: 142866W
[site ] DEBUG 2025/02/06 15:37:22 pv 1 power: 1W
[site ] DEBUG 2025/02/06 15:37:22 battery 1 power: -0W
[site ] DEBUG 2025/02/06 15:37:23 battery 1 soc: 18%
[site ] DEBUG 2025/02/06 15:37:23 grid currents: [0.06 0 0]A
[site ] DEBUG 2025/02/06 15:37:23 site power: 142966W
[lp-1 ] DEBUG 2025/02/06 15:37:23 charge total import: 7139.764kWh
[lp-1 ] DEBUG 2025/02/06 15:37:23 charger status: A


[my_pv ] TRACE 2025/02/06 15:38:23 modbus: send 01 4d 00 00 00 06 01 03 02 1c 00 02
[my_pv ] TRACE 2025/02/06 15:38:23 modbus: recv 01 4d 00 00 00 07 01 03 04 00 00 76 4c
[my_battery] TRACE 2025/02/06 15:38:23 modbus: send 01 4e 00 00 00 06 01 03 02 10 00 01
[my_battery] TRACE 2025/02/06 15:38:23 modbus: recv 01 4e 00 00 00 05 01 03 02 00 12
[my_grid] TRACE 2025/02/06 15:38:23 modbus: send 01 4f 00 00 00 06 01 03 02 0b 00 01
[my_grid] TRACE 2025/02/06 15:38:23 modbus: recv 01 4f 00 00 00 05 01 03 02 00 00
[my_grid] TRACE 2025/02/06 15:38:23 modbus: send 01 50 00 00 00 06 01 03 02 20 00 02
[my_grid] TRACE 2025/02/06 15:38:23 modbus: recv 01 50 00 00 00 07 01 03 04 00 00 12 c6
[my_grid] TRACE 2025/02/06 15:38:52 modbus: send 01 57 00 00 00 06 01 03 02 12 00 02
[my_grid] TRACE 2025/02/06 15:38:52 modbus: recv 01 57 00 00 00 07 01 03 04 ff 1b 01 21
[my_grid] TRACE 2025/02/06 15:38:52 modbus: send 01 58 00 00 00 06 01 03 02 07 00 01
[my_grid] TRACE 2025/02/06 15:38:52 modbus: recv 01 58 00 00 00 05 01 03 02 00 06
[my_battery] TRACE 2025/02/06 15:38:52 modbus: send 01 59 00 00 00 06 01 03 02 0d 00 01
[my_battery] TRACE 2025/02/06 15:38:52 modbus: recv 01 59 00 00 00 05 01 03 02 00 00
[my_pv ] TRACE 2025/02/06 15:38:52 modbus: send 01 5a 00 00 00 06 01 03 02 15 00 01
[my_pv ] TRACE 2025/02/06 15:38:52 modbus: recv 01 5a 00 00 00 05 01 03 02 00 3c
[my_grid] TRACE 2025/02/06 15:38:52 modbus: send 01 5b 00 00 00 06 01 03 02 09 00 01
[my_grid] TRACE 2025/02/06 15:38:53 modbus: recv 01 5b 00 00 00 05 01 03 02 00 00
[my_battery] TRACE 2025/02/06 15:38:53 modbus: send 01 5c 00 00 00 06 01 03 02 10 00 01
[my_battery] TRACE 2025/02/06 15:38:53 modbus: recv 01 5c 00 00 00 05 01 03 02 00 12
[my_pv ] TRACE 2025/02/06 15:38:53 modbus: send 01 5d 00 00 00 06 01 03 02 1c 00 02
[my_pv ] TRACE 2025/02/06 15:38:53 modbus: recv 01 5d 00 00 00 07 01 03 04 00 00 76 4c
[my_grid] TRACE 2025/02/06 15:38:53 modbus: send 01 5e 00 00 00 06 01 03 02 0b 00 01
[my_grid] TRACE 2025/02/06 15:38:53 modbus: recv 01 5e 00 00 00 05 01 03 02 00 00
[my_grid] TRACE 2025/02/06 15:38:53 modbus: send 01 5f 00 00 00 06 01 03 02 20 00 02
[my_grid] TRACE 2025/02/06 15:38:53 modbus: recv 01 5f 00 00 00 07 01 03 04 00 00 12 c6
[my_pv ] TRACE 2025/02/06 15:39:22 modbus: send 01 66 00 00 00 06 01 03 02 15 00 01
[my_pv ] TRACE 2025/02/06 15:39:22 modbus: recv 01 66 00 00 00 05 01 03 02 00 3e
[my_pv ] TRACE 2025/02/06 15:39:22 modbus: send 01 67 00 00 00 06 01 03 02 1c 00 02
[my_pv ] TRACE 2025/02/06 15:39:22 modbus: recv 01 67 00 00 00 07 01 03 04 00 00 76 4c
[my_battery] TRACE 2025/02/06 15:39:22 modbus: send 01 68 00 00 00 06 01 03 02 0d 00 01
[my_battery] TRACE 2025/02/06 15:39:22 modbus: recv 01 68 00 00 00 05 01 03 02 00 00
[my_grid] TRACE 2025/02/06 15:39:22 modbus: send 01 69 00 00 00 06 01 03 02 12 00 02
[my_grid] TRACE 2025/02/06 15:39:22 modbus: recv 01 69 00 00 00 07 01 03 04 ff 2c 01 13
[my_grid] TRACE 2025/02/06 15:39:22 modbus: send 01 6a 00 00 00 06 01 03 02 07 00 01
[my_grid] TRACE 2025/02/06 15:39:23 modbus: recv 01 6a 00 00 00 05 01 03 02 00 06
[my_battery] TRACE 2025/02/06 15:39:23 modbus: send 01 6b 00 00 00 06 01 03 02 10 00 01
[my_battery] TRACE 2025/02/06 15:39:23 modbus: recv 01 6b 00 00 00 05 01 03 02 00 12
[my_grid] TRACE 2025/02/06 15:39:23 modbus: send 01 6c 00 00 00 06 01 03 02 09 00 01
[my_grid] TRACE 2025/02/06 15:39:23 modbus: recv 01 6c 00 00 00 05 01 03 02 00 00
[my_grid] TRACE 2025/02/06 15:39:23 modbus: send 01 6d 00 00 00 06 01 03 02 0b 00 01
[my_grid] TRACE 2025/02/06 15:39:23 modbus: recv 01 6d 00 00 00 05 01 03 02 00 00
[my_grid] TRACE 2025/02/06 15:39:23 modbus: send 01 6e 00 00 00 06 01 03 02 20 00 02
[my_grid] TRACE 2025/02/06 15:39:23 modbus: recv 01 6e 00 00 00 07 01 03 04 00 00 12 c6
[my_grid] TRACE 2025/02/06 15:39:52 modbus: send 01 74 00 00 00 06 01 03 02 12 00 02
[my_grid] TRACE 2025/02/06 15:39:52 modbus: recv 01 74 00 00 00 07 01 03 04 ff 20 01 21
[my_grid] TRACE 2025/02/06 15:39:52 modbus: send 01 75 00 00 00 06 01 03 02 07 00 01
[my_grid] TRACE 2025/02/06 15:39:52 modbus: recv 01 75 00 00 00 05 01 03 02 00 06
[my_pv ] TRACE 2025/02/06 15:39:52 modbus: send 01 76 00 00 00 06 01 03 02 15 00 01
[my_pv ] TRACE 2025/02/06 15:39:52 modbus: recv 01 76 00 00 00 05 01 03 02 00 40
[my_battery] TRACE 2025/02/06 15:39:52 modbus: send 01 77 00 00 00 06 01 03 02 0d 00 01
[my_battery] TRACE 2025/02/06 15:39:52 modbus: recv 01 77 00 00 00 05 01 03 02 00 00
[my_grid] TRACE 2025/02/06 15:39:52 modbus: send 01 78 00 00 00 06 01 03 02 09 00 01
[my_grid] TRACE 2025/02/06 15:39:53 modbus: recv 01 78 00 00 00 05 01 03 02 00 00
[my_pv ] TRACE 2025/02/06 15:39:53 modbus: send 01 79 00 00 00 06 01 03 02 1c 00 02

What type of operating system or environment does evcc run on?

Docker container

External automation

  • I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.

Nightly build

  • I have verified that the issue is reproducible with the latest nightly build

Version

0.133.0

@Studhey
Copy link
Author

Studhey commented Feb 6, 2025

I have tested it deactivating the modbus proxy, but no sucess.

I changed my configuration to take all values from ioBroker, even ioBroker gets them through the evcc modbus proxy, it does work for now.

  - type: custom
    power:
      source: http
      uri: http://172.27.1.10:8087/getPlainValue/modbus.1.holdingRegisters.40531_grid_power
      scale: -1
    energy:
      source: http
      uri: http://172.27.1.10:8087/getPlainValue/1-0:1_8_0__255.value
    name: grid_http

  - type: custom
    name: battery_http
    power:
      source: http
      uri: http://172.27.1.10:8087/getPlainValue/modbus.1.holdingRegisters.40526_batt_charge_discharge_power
      scale: -1
    soc:
      source: http
      uri: http://172.27.1.10:8087/getPlainValue/modbus.1.holdingRegisters.40529_batt_soc

  - type: custom
    name: pv_http
    power: 
      source: http
      uri: http://172.27.1.10:8087/getPlainValue/modbus.1.holdingRegisters.40534_pv_power_gen

@evcc-io evcc-io locked and limited conversation to collaborators Feb 7, 2025
@andig andig converted this issue into discussion #18654 Feb 7, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant