evcc-io / docs

evcc documentation
https://docs.evcc.io/
MIT License
39 stars 125 forks source link

Plugin examples are missing context #664

Open rhuss opened 2 weeks ago

rhuss commented 2 weeks ago

I'm a first time user of EVCC trying to set it up by using the documentation only. My setup is a bit special, as I have already added my equipment to my monitoring stack a long time ago, and every data is available via MQTT (published every 5 minutes or so).

So, my main task is to configure the MQTT plugin. While there are some nice sections in plugin.md to explain the basics, I'm still struggling how to add the mqtt meter configuration to the overall evcc.yaml. I.e. currently I'm getting an error [main ] FATAL 2024/11/11 10:11:12 While parsing config: yaml: line 37: mapping values are not allowed in this context with the corresponding part looking like:

meters:
# Grid Meter
- name: imsys
  type: custom
    source: mqtt
    topic: home/current/imsys/chn2/raw
    timeout: 10s
    scale: 0.001
# PV Meter
- name: sb4000
  type: custom
    source: mqtt
    topic: home/current/pv
    jq: '.power'
    timeout: 10s
    scale: 1

I will get over this, but I have difficulty finding an example of how custom plugins are specified in the meters: section, especially the proper indentation. It would be super helpful if all examples in the plugins showed subconfiguration, the full path, and how it is included in evcc.yaml (i.e. in which position in the overall schema it can be added)

E.g.

instead of having

source: mqtt
topic: mbmd/sdm1-1/Power
timeout: 30s # don't accept values older than timeout
scale: 0.001 # floating point factor applied to result, e.g. for Wh to kWh conversion

It would be much more helpful also to know where to put that part. E.g., something like

meters:
- name: my-converter
  type: custom
    source: mqtt
    topic: mbmd/sdm1-1/Power
    timeout: 30s # don't accept values older than timeout
    scale: 0.001 # floating point factor applied to result, e.g. for Wh to kWh conversion

Or whatever the correct syntax is. This applies to all examples. It's not much work, but it's super helpful for starters like me.