Thanks @zauberertz for your work on integrating the mypv elwa-e system into the homeassistant.
I can now read every metric except for power. The identity is displayed but it does not contain a value.
Have I configured something incorrectly here, or is this a bug?
let me contribute my findings to integrate the MY-PV WiFi Meter. Reference to product: my-PV
The MY-PV WiFi smart meter can be accessed via modbus. Therefor you need to do the following:
Add modbus: !include modbus.yaml to your configutation.yaml
Populate the modbus.yaml file with the values you need. Additional values are listed in the data sheet on the my-pv wifi meter product page. Additional explanation of the config below in the config:
modbus.yaml
# Config modbus MYPV-Meter
- name: "MYPV-Meter"
type: tcp
host: 10.2.0.50 #IP of your smart meter
port: 502
retry_on_empty: true
sensors:
# raw data from MYPV Smart Meter
# Combinded value cross phases L1 L2 L3
- name: "MYPV-Meter Sum W"
unique_id: mypv_sum_w
count: 2 # length of the register --> product data sheet
data_type: int32 # required for accurate values
scale: -1 #adjust scale if you have other requirements e.g. custom brakets --> see product manual
address: 32 #address of the reister(DEC)
unit_of_measurement: W
state_class: measurement
scan_interval: 10 #in Seconds
# forward = EK
- name: "MYPV-Meter Sum EK kWh"
unique_id: mypv_sum_EK_kwh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 34
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
# reverse = VK
- name: "MYPV-Meter Sum VK kWh"
unique_id: mypv_sum_VK_kwh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 36
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
#*******************************************
# Values phase L1 = phase A
#*******************************************
# Watt - = from grid, + = to grid
- name: "MYPV-Meter L1 W"
unique_id: mypv_meter_l1_w_n
count: 2
data_type: int32
scale: -1
address: 2
unit_of_measurement: W
state_class: measurement
scan_interval: 10
# kWh Counter to grid forward
- name: "MYPV-Meter L1 to grid kWh"
unique_id: mypv_meter_l1_tog_kWh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 4
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
# kWh Counter from grid VK
- name: "MYPV-Meter L1 VK kWh"
unique_id: mypv_meter_l1_vk_kWh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 6
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
#*******************************************
# Values Phase L2 = Phase B
#*******************************************
# Watt - = from grid, + = to grid
- name: "MYPV-Meter L2 W"
unique_id: mypv_meter_l2_w
count: 2
data_type: int32
scale: -1
address: 12
unit_of_measurement: W
state_class: measurement
scan_interval: 10
# kWh Counter to grid
- name: "MYPV-Meter L2 to grid kWh"
unique_id: mypv_meter_l2_tog_kWh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 14
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
# kWh Counter from grid VK
- name: "MYPV-Meter L2 VK kWh"
unique_id: mypv_meter_l2_vk_kWh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 16
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
#*******************************************
# Values Phase L3 = Phase C
#*******************************************
# Watt - = from grid, + = to grid
- name: "MYPV-Meter L3 W"
unique_id: mypv_meter_l3_w
count: 2
data_type: int32
scale: -1
address: 22
unit_of_measurement: W
state_class: measurement
scan_interval: 10
# kWh Counter to grid
- name: "MYPV-Meter L3 to grid kWh"
unique_id: mypv_meter_l3_tog_kWh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 24
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
# kWh Counter from grid VK
- name: "MYPV-Meter L3 VK kWh"
unique_id: mypv_meter_l3_vk_kWh_n
count: 2
data_type: int32
precision: 2
scale: 0.00125
address: 26
unit_of_measurement: kWh
state_class: total_increasing
scan_interval: 1800
In “Settings → Services & Devices → Helpers” configure two counters for the kwh IN and OUT
hi Christoph,
If you want to steer your ELWA-E from HA, you can either do that with Modbus TCP or via a REST http command. It super easy but you need to request the documentation to the MyPV team as they don’t want to publish it openly.
Works perfectly on my system. Just one line of code creating the rest command in the configuration.yaml file and one automation that sends the power value that can be used to the ELWA-E device via the command.
Personally im interested in Steering my today installed Elwa2 per EDL21 Data - not by the data provided by the PV-Inverter (reason in my home there is a kaskading Electro system installed)
so i want to use only acess Energy if there is on on the Z1 Power meter…
How are you exactly steering your Elwa-E … any help would be welcome because im not very good in English and way worse in programming…
Thanks in advance…
Hey, that means you are using this integration from zauberertz to monitor the water temperature and use this information to start and stop heating and set the power (0-3500)?
Basically I’m planning to purchase the AC ELWA 2 and I do like to set a base temperature (let’s say 50°C) and if there is a PV-surplus it should start heating (up to let’s say 65°C).
Is the MYPV supporting such an idea?
The how would be then an automation in HA which is basically checking the temperature and if there are certain trigger (need to think about those) the automation will start a python script which is then calculating and setting the power by http set or modbus and switching it on, or off the other way around of course.
On this im interested… my way till now is a little bit from the other side: First i thougt the zauberertz integration will do the trick. But it´s only good for reading out the monitoring data, not for writing down the work models for the AC-Elwa2.
So i followed the hints in the woods(here in this thread). Long story short right now im getting the data that i wish for my HA right out of the AC-Elwa2 by some lines in my configuration.yaml - per rest command:
i had to create a helper to measure the exessive Power in watts (which is transported to the grid)
“stromverkauf nach WP-Zaehler”
this helper is getting it´s data from my sensor.smart_meter_negative_active_energy_total_2 (which is in my upper Post the [z1] meter
i have also made an automation to steer my AC-Elwa 2 automaically from my exessive Power
i had to integrate the template to compensate the changing amount of the power by sun + due to the using of my AC-ELWA 2. Also i created a condition where the battery of our house is overwatched so im not consuming battery energy. Also there is a function integrated where my ELWAe2 is completely shutting down (when there is no surplus electric engergy going away from my house and when its after sunset and bevore sunrise)
Plus in my opinion ist better to loose another 0.05 of the energy bevore importing it form the grid / or using the Battery power… (the whole template is normally updating all 5 minutes[-not really its updating when the state of the “sensor.smart_meter_negative_active_energy_total_2” is changing-])
have fun alltogehter…sorry for bad english
Finally edited on 2024.01
hey, thx for the detailed description.
I just need to wait until the AC ELWA 2 is delivered and the I’ll provide feedback how I solved it using your experience!
hi @Wondolone, not exactly. I just did a rest command that gathers the data.jsn content and parses it in 3 sensors.
AC ELWA E is similar in the code as AC ELWA 2, but I believe the latter has a bit more functionalities and abilities to be steered. ELWA E allows only to be enabled or disabled and accepts as input the desired power. It will warm the water up to the desired temperature which is set with physical button on the device. You can nevertheless read it’s temperature but you do not need to steer anything else than the power.
Request their documentation to play with it, for now, they have not allowed me to share it further.
/control.html?power=n while (n) ist the [user/HA/..] /the amount of used energy in your ELWA 0....-3500
/control.html?pid_power=n **Post edited because of way better explanation by **
[pid_power VS power]( https://community.home-assistant.io/t/mypv-integation-started/395584/83?u=sleepymaxx )
[PID](https://en.wikipedia.org/wiki/Proportional%E2%80%93integral%E2%80%93derivative_controller)
/control.html?boost=n while (n) is only 0 or 1 / start or stop the Boost function
so if you want not to go aprupt in very high amounts in power change… better use the /control.html?pid_power=n option (to shut down set it on 0 to let the elwa steer slowly down… )
Thanks for the details. I got my elwa connected all looks ok.
I have one question, maybe you can provide me some help.
I got shelly 3em as a energy meter for my system, the shelly on solar power give me negative readings, so my question is how you manage to make it work?
I try to figure how but somehow I can’t
And one more, in case we like to make the power of Elwa to change dynamic ( with the changes of solar power ) you have any suggestion?
Hi sleepmax,
thanks for sharing your YAML code here.
I got all the sensor infos via the rest-api from my AC-Elwa 2.
But unfortunately I am not able to submit commands.
Even directly from my WEB browser the command:
http://my-acelwa2/control.html?boost={{ 1 }}
...
responds with: "404 page not found".
Do you have any hints for me
Found my mistake.
To control the AC-Elwa via http, it is necessary to set in "Steuerungseinstellungen>Ansteuerungstyp to http.
In my case it was set to Kostal.
But I will leave it with Kostal, so that my Kostal is still able to control the Elwa2
you have to get negative readings … only with these you are able to figure out how much energy you are spending to the grid… so i would make a template to calculate how much energy you are exporting and take this for steering my elwa
I got my sensors working. Now I got + readings on solar production. My question is how can I control the power of Elwa when the solar power change?
I mean on your code I can see that you check the state of two sensor but somehow i’m not coding master.
I have one sensor show the surplus from my solar.
I can control manual the elwa on/off/power change and all the readings.