evcc-io / evcc

Sonne tanken β˜€οΈπŸš˜
https://evcc.io
MIT License
3.44k stars 634 forks source link

some evcc.yaml data are not used and others are coming maybe from database #12589

Closed amtssp closed 7 months ago

amtssp commented 7 months ago

Describe the bug

I have a evcc.yaml but I also tried to use the UI configuration. The issue is that now only some of the configuration from the yaml is used. If I in the yaml file change the title in the site section and restart evcc - this change does not reflect on the webpage. But if I in the yaml file change title under the loadpoints section - these changes will be shown on the webpage.

I don't know if this is related, but if I use the UI configuration and change site title thee, it will show on the front page, but this does not change the yaml file - is that the correct behavior. I would have thought that the UI configuration would write to the yaml file?

Notice I use a not-fully working dummy charger - as I haven't fully integrated my charger yet - but it allows evcc to run. I don't think it has anything to do with this issue. evcc_issue

Steps to reproduce

  1. Start evcc: evcc -c /home/tc/evcc.yaml
  2. Notice the site title on the webpage
  3. Change site title using the UI configurator and save
  4. stop evcc
  5. edit /home/tc/evcc.yaml - changing title in the site section and try also change title in the loadpoint section - save file
  6. stat evcc: evcc -c /home/tc/evcc.yaml
  7. Notice that only title under loadpoints are changed whereas the site title is not changed ...

Configuration details

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

log: debug
levels:
  cache: error

# unique installation id
plant: 2b73f895a7b0cf7769a7059e78bd84229ba5a52ebc502d7ce4002bc62cab9da4

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

meters:
- type: template
  template: sonnenbatterie 
  usage: grid  
  host: 192.168.0.110  
  port:   
  name: grid1
- type: template
  template: sonnenbatterie 
  usage: pv  
  host: 192.168.0.110  
  port:   
  name: pv2
- type: template
  template: sonnenbatterie 
  usage: battery  
  host: 192.168.0.110  
  port:   
  name: battery3
- type: template
  template: sonnenbatterie 
  usage: battery  
  host: 192.168.0.110  
  port:   
  capacity: 7.5  
  token: ********************  
  name: battery4

site:
  title: Huset_no2
  meters:
    grid: grid1
    pv:
    - pv2
    battery:
    - battery3
#   - battery4

loadpoints:
  - title: Carport_venstre
    charger: charger
    meter: grid1
    mode: pv
    soc:
      estimate: false
#    resetOnDisconnect: true
  - title: Carport_hoejre
    charger: charger
    meter: grid1
    mode: pv
    soc:
      estimate: false
#    resetOnDisconnect: true

chargers:
  - name: charger
    type: custom
    enable:
      source: js
      script: |
        false
    enabled:
      source: http
      uri: http://localhost:7070/api/state
      jq: .loadpoints[0].enabled
    status:
      source: http
      uri: http://localhost:7070/api/state
      jq: .loadpoints[0].status
    maxcurrent:
      source: js
      script: |
        16ew3

# tariffs are the fixed or variable tariffs
tariffs:
  currency: DKK # three letter ISO-4217 currency code (default EUR)
  grid:
    # either static grid price (or price zones)
#    type: fixed
#    price: 0.294 # EUR/kWh
#    zones:
#      - days: Mon-Fri
#        hours: 2-5
#        price: 0.2 # EUR/kWh
#      - days: Sat,Sun
#        price: 0.15 # EUR/kWh

    type: energinet # Energinet using the price in DKK
    region: dk1 # or dk2
    charges: 1.45 # optional, additional charges per kWh
    # tax: # optional, additional tax (0.1 for 10%)

Log details

tc@raspberrypi:~ evcc -c /home/tc/evcc.yaml --log debug
[main  ] INFO 2024/03/01 14:56:26 evcc 0.124.6
[main  ] INFO 2024/03/01 14:56:26 using config file: /home/tc/evcc.yaml
[main  ] INFO 2024/03/01 14:56:26 starting ui and api at :7070
[db    ] INFO 2024/03/01 14:56:26 using sqlite database: /home/tc/.evcc/evcc.db
[site  ] WARN 2024/03/01 14:56:27 battery configured but residualPower is missing or <= 0 (add residualPower: 100 to site), see https://docs.evcc.io/en/docs/reference/configuration/site#residualpower
[site  ] INFO 2024/03/01 14:56:27 site config:
[site  ] INFO 2024/03/01 14:56:27   meters:      grid βœ“ pv βœ“ battery βœ“
[site  ] INFO 2024/03/01 14:56:27     grid:      power βœ“ energy βœ— currents βœ—
[site  ] INFO 2024/03/01 14:56:27     pv 1:      power βœ“ energy βœ— currents βœ—
[site  ] INFO 2024/03/01 14:56:27     battery 1: power βœ“ energy βœ— currents βœ— soc βœ“ capacity βœ—
[site  ] INFO 2024/03/01 14:56:27   vehicles:
[site  ] INFO 2024/03/01 14:56:27     vehicle 1: range βœ— finish βœ— status βœ— climate βœ— wakeup βœ—
[lp-1  ] INFO 2024/03/01 14:56:27 loadpoint 1:
[lp-1  ] INFO 2024/03/01 14:56:27   mode:        pv
[lp-1  ] INFO 2024/03/01 14:56:27   charger:     power βœ— energy βœ— currents βœ— phases βœ— wakeup βœ—
[lp-1  ] INFO 2024/03/01 14:56:27   meters:      charge βœ“
[lp-1  ] INFO 2024/03/01 14:56:27     charge:    power βœ“ energy βœ— currents βœ—
[lp-2  ] INFO 2024/03/01 14:56:27 loadpoint 2:
[lp-2  ] INFO 2024/03/01 14:56:27   mode:        pv
[lp-2  ] INFO 2024/03/01 14:56:27   charger:     power βœ— energy βœ— currents βœ— phases βœ— wakeup βœ—
[lp-2  ] INFO 2024/03/01 14:56:27   meters:      charge βœ“
[lp-2  ] INFO 2024/03/01 14:56:27     charge:    power βœ“ energy βœ— currents βœ—
[site  ] DEBUG 2024/03/01 14:56:27 set buffer soc: 60
[site  ] DEBUG 2024/03/01 14:56:27 set buffer start soc: 75
[site  ] DEBUG 2024/03/01 14:56:27 set priority soc: 30
[site  ] DEBUG 2024/03/01 14:56:27 set battery discharge control: false
[lp-1  ] DEBUG 2024/03/01 14:56:27 set smart cost limit: 1.9
[lp-1  ] DEBUG 2024/03/01 14:56:27 phase timer inactive
[lp-1  ] DEBUG 2024/03/01 14:56:27 pv timer inactive
[lp-1  ] ERROR 2024/03/01 14:56:27 charger: Get "http://localhost:7070/api/state": dial tcp [::1]:7070: connect: connection refused
[lp-2  ] DEBUG 2024/03/01 14:56:27 set smart cost limit: 1.9
[lp-2  ] DEBUG 2024/03/01 14:56:27 phase timer inactive
[lp-2  ] DEBUG 2024/03/01 14:56:27 pv timer inactive
[lp-2  ] ERROR 2024/03/01 14:56:27 charger: Get "http://localhost:7070/api/state": dial tcp [::1]:7070: connect: connection refused
[site  ] DEBUG 2024/03/01 14:56:27 ----
[lp-1  ] DEBUG 2024/03/01 14:56:27 charge power: 30W
[lp-2  ] DEBUG 2024/03/01 14:56:27 charge power: 30W
[site  ] DEBUG 2024/03/01 14:56:27 pv power: 352W
[site  ] DEBUG 2024/03/01 14:56:27 battery soc: 61%
[site  ] DEBUG 2024/03/01 14:56:27 battery power: -82W
[site  ] DEBUG 2024/03/01 14:56:27 grid meter: 30W
[site  ] DEBUG 2024/03/01 14:56:27 site power: -52W
[lp-1  ] ERROR 2024/03/01 14:56:27 charger: invalid status: <nil>

What type of operating system are you running?

Linux

Version

evcc version 0.124.6

andig commented 7 months ago

The issue is that now only some of the configuration from the yaml is used.

Which ones are unused? We will remove them from evcc.dist.yaml. Cleaning your local config is out of scope and we need to avoid hard compatibility breaks.

I would have thought that the UI configuration would write to the yaml file?

That's not the case.

andig commented 7 months ago

Happy to look at the feedback, feel free to comment below.