sponsortoken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJldmNjLmlvIiwic3ViIjoibWlsdmVydCIsImV4cCI6MTgzMDE5MzIwMCwiaWF0IjoxNzM1NTg1MjAwLCJzcmMiOiJnaCJ9._K23QsA15DIHRjujwH8rnFZyloSw1RPIeIS4W5WLFGE

log: error
levels:
  tariff: trace

interval: 30s

vehicles:
  - name: car
    type: custom
    title: id4
    capacity: 79 # kWh
    soc:
      source: mqtt
      topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/charging/batteryStatus/currentSOC_pct
    range:
      source: mqtt
      topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/fuelStatus/rangeStatus/primaryEngine/remainingRange_km
    odometer:
      source: mqtt
      topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/measurements/odometerStatus/odometer
    climater:
      source: go
      vm: shared
      script: |
        remoteClimateState != "off"
      in:
        - name: remoteClimateState
          type: string
          config:
            source: mqtt
            topic: weconnect/0/vehicles/WVGZZZE2ZPE051949/domains/climatisation/climatisationStatus/climatisationState


chargers:
  - name: wallbox
    type: easee
    user: simon+easee@milvert.com
    password: X7#aEzjlEysBgl
    charger: EHCNF485

circuits:
  - name: main # if there is only one circuit defined the name needs to be 'main'
    title: 'main circuit' # name for the UI (not implemented in UI yet)
    maxCurrent: 20
    maxPower: 10000
    meter: my_grid # optiona

loadpoints:
  - title: Garage
    charger: wallbox
    vehicle: car
    circuit: main
    mode: pv
    phases: 3
    enable:
      threshold: 0
      delay: 15s
    disable:
      threshold: 500
      delay:
        2m

site:
  title: Hemma
  meters:
    pv:
      - pv
    grid: my_grid

meters:
  - name: pv
    type: custom
    power:
      source: mqtt
      topic: inverter/measure/active_power
      # jq: .value
    energy:
      source: mqtt
      topic: inverter/calculated/accumulated_yield_energy
      timeout: 60s
    currents:
      - source: mqtt
        topic: inverter/measure/phase_A_current
        timeout: 60s
        #  jq: .value
      - source: mqtt
        topic: inverter/measure/phase_B_current
        timeout: 60s
        # jq: .value
      - source: mqtt
        topic: inverter/measure/phase_C_current
        timeout: 60s

  - name: my_grid
    type: custom
    power:
      source: calc
      add:
       - source: mqtt
         topic: dsmr/reading/electricity_currently_returned
         scale: -1000
         timeout: 30s
       - source: mqtt
         topic: dsmr/reading/electricity_currently_delivered
         scale: 1000
         timeout: 30s
    energy:
      source: calc
      add:
       - source: mqtt
         topic: dsmr/reading/electricity_returned_1
         scale: 0.001
         timeout: 30s
       - source: mqtt
         topic: dsmr/reading/electricity_delivered_1
         scale: -0.001
         timeout: 30s

    currents:
      - source: mqtt
        topic: dsmr/reading/phase_power_current_l1
        timeout: 30s
      - source: mqtt
        topic: dsmr/reading/phase_power_current_l2
        timeout: 30s
      - source: mqtt
        topic: dsmr/reading/phase_power_current_l1
        timeout: 30s


influx:
  url: http://influx:8086
  database: Car
  token: H7m068KDh84kcmmkz3fy-dEsKoeYv90rnNXIidPZoBy240Jzdbr2uDtGveiuDz4rGK4jmMI8J00zVwgIBYJxXA==
  org: milvert

mqtt:
  broker: mqtt:1883
  user: simon
  password: bajsa123
  topic: evcc
