Using Home Assistant as a bridge to transmit inverter data to IAMMETER

Premise

Using Home Assistant as a bridge to transmit inverter data to IAMMETER.

HA-inverter-iammeter

You may have a question: since you've already integrated with Home Assistant, why push the data to IAMMETER? The majority of Home Assistant users are tech enthusiasts who prefer to keep data as local as possible rather than in the cloud. IAMMETER focuses on energy management, providing a wealth of reports and analytical tools for energy consumption. This document is just an idea, an attempt to explore more ways to utilize IAMMETER.

This tutorial outlines a method for bridging the data from Goodwe's inverter to IAMMETER using Home Assistant. It comprises three steps:

  1. Retrieve the data of Goodwe's inverter through Home Assistant.

  2. Apply for a virtual meter from IAMMETER-cloud.

  3. Upload the data obtained in step 1 to the virtual meter in IAMMETER.

 

Retrieve the data of Goodwe's inverter through Home Assistant.

Sensor Definition in Home assistant

we use this integration to request the data from goodwe`s inverter.

Sensor definition

GoodweIndex
"pv_power","ppv"1
"house_consumption",2
"active_power",3
"battery_soc",4
"e_day",5
"e_total",6
"meter_e_total_exp",7
"meter_e_total_imp",8
"e_bat_charge_total",9
"e_bat_discharge_total",10

Map 7-parameters to the virtual meter of IAMMETER

The virtual meter provides a 3-phase electricity meter data interface.

When monitoring a solar PV system in IAMMETER, we need to obtain these 7-parameters:

  1. solar inverter output power

  2. total Kwh generation of the inverter

  3. grid power

  4. total grid consumption(Kwh)

  5. total grid exported energy(Kwh)

  6. total battery charging (Kwh)

  7. total battery discharging (Kwh)

We need to map these sensors in HA to the three-phase data interface (seven parameters) of the virtual meter.

The correspondence is as follows (The correspondence is as follows (The numbers in the table are the index values of the GoodWe sensor listed in the above table).

 phase A (Inverter)phase B (Grid)phase C (AC storage)
power13battery power
Forward Kwh689
Reverse Kwh 710

The battery power is not listed in the sensor, but it can be calculated using this formula.

 sensorvalueindex 
 house_consumption5kw2 
 pv_power10kw1 
 active_power3kw3exporting
 battery power10-5-3=2kw{1}-{2}-{3}charging

 

Apply for a virtual meter from IAMMETER-cloud

Regarding the virtual meter

The virtual meter is our latest attempt, and users can use this to integrate other energy monitoring devices (smart meters, inverters) into IAMMETER-cloud.

You need to have an account of IAMMETER firstly, Regarding the Virtual meter of IAMMETER

Apply for a virtual meter

image-20240124093300622 change the Data Source to "PushApi" and save image-20240124095458969

Save.

image-20240124095537070

A 'trial SN' has appeared; this is the SN of the virtual meter.

image-20240124095851393

 

 

Add the virtual meter into IAMMETER

click "New Place" image-20240124101230225 Input the "trail SN" ,and click "save" image-20240124101730280 click Meters -> my -> Edit image-20240124102646437 change the Type to "Three phase" , and save. image-20240124102754092

 

Configure the virtual meter

then click My Places -> my -> Edit image-20240124102116074

 

The virtual meter is a 3-phase meter, with each phase corresponding to Goodwe inverter's solar generation, grid meter, and battery storage, respectively.

Phase A: solar generation

Phase B: grid meter

Phase C: battery storage

Therefore, we need to configure the three-phase settings in the IAMMETER system as follows:

SNType
SN_aInverter
SN_bGrid
SN_cAC Storage

image-20240124102939966 Click "save" to save this configuration.

 

Upload the data obtained in step 1 to the virtual meter in IAMMETER

 

After fetch 7-parameters from goodwe`s inverter, Home assistant use this API to upload the data of the virtual meter to IAMMETER.

 

To use this integration, add the following lines to your configuration.yaml file:

xxxxxxxxxx
# Example configuration.yaml entry
rest_command:
# Three phase meter
  my_meter3:
    url: http://open.iammeter.com/api/V1/sensor/UploadSensor
    method: POST
    headers:
    #   authorization: !secret rest_headers_secret
      accept: "application/json, text/html"
      user-agent: 'Mozilla/5.0 {{ useragent }}'
    content_type: 'application/json; charset=utf-8'
    # verify_ssl: true
    payload: >
      {
        "method": "uploadsn",
        "mac": "112233445566",
        "version": "1.02",
        "server": "em",
        "SN": "your_sn",
        "Datas": [
          [
            220,
            0,
            {{ states('sensor.pv_power') | float }},
            {{ (states('sensor.e_total') | float }},
            0,
            50,
            1
          ],
          [
            220,
            0,
            {{ states('sensor.active_power') | float }},
            {{ (states('sensor.meter_e_total_imp') | float }},
            {{ (states('sensor.meter_e_total_exp') | float }},
            50,
            1
          ],
          [
            220,
            0,
            {{ (states('sensor.pv_power') | float - (states('sensor.house_consumption') | float -(states('sensor.active_power') | float }},
            {{ (states('sensor.e_bat_charge_total') | float }},
            {{ (states('sensor.e_bat_discharge_total') | float }},
            50,
            1
          ]
        ]
      }
automation:
  - id: '3666938222668'
    alias: "Post Sensor Data"
    description: ''
    trigger:
      platform: time_pattern
      seconds: 59
    condition: []
    action:
    - service: rest_command.my_meter
    mode: single

your_sn: iammeter cloud creat the sn

sensor.xxx: Change to the actual name of your sensor

 

Reference

Monitor your solar PV system in Home Assistant

Four ways to integrate the Electricity Usage Monitor (IAMMETER) into the home assistant

Use IAMMETER`s energy meter in Home assistant


Thread Status
0
245
1
0
0

Sort replies by:
Looks like you are new here. Register for free, learn and contribute.