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.
nevermind, just did it here thanks to your advices.
Add this to your configuration.yaml file
rest:
- resource: "http://XXX.XXX.XXX.XXX/data.jsn"
# scan_interval: 10
sensor:
- name: "MyPV Current power usage"
value_template: "{{ value_json.power }}"
unit_of_measurement: "W"
- name: "Hot Water Current temperature"
value_template: "{{ value_json.temp1 / 10 }}"
unit_of_measurement: "°C"
- name: "Hot Water MyPV Target temperature"
value_template: "{{ value_json.ww1target / 10 }}"
unit_of_measurement: "°C"
Hi together, reading all time by…
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.
Does that make sense?
thx in advance
Christoph
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:
rest:
- resource: "http://xxx.xxx.xxx.xxx/data.jsn"
scan_interval: 10
sensor:
- name: "MyPV Stromverbrauch aktuell"
unique_id: "mypv_stromverbrauch_aktuell"
value_template: "{{ value_json.power_elwa2 }}"
device_class: energy
unit_of_measurement: "W"
state_class: total_increasing
- name: "Trinkwasser Temperatur unten"
unique_id: "trinkwassertemperatur_unten"
value_template: "{{ value_json.temp1 / 10 }}"
device_class: temperature
unit_of_measurement: "°C"
- name: "Trinkwasser Temperatur Oben"
unique_id: "trinkwassertemperatur_oben"
value_template: "{{ value_json.temp2 / 10 }}"
device_class: temperature
unit_of_measurement: "°C"
rest_command:
update_elwa_power:
url: "http://xxx.xxx.xxx.xxx/control.html?power={{ power }}"
update_elwa_pid:
url: "http://xxx.xxx.xxx.xxx/control.html?pid_power={{ pid_power }}"
update_elwa_boost:
url: "http://xxx.xxx.xxx.xxx/control.html?boost={{ 1 }}"
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
description: ElwaUpdate
trigger:
- platform: state
entity_id:
- sensor.smart_meter_negative_active_energy_total_2
- platform: state
entity_id:
- sensor.master_battery_discharge
condition:
- condition: sun
after: sunrise
before: sunset
action:
- if:
- condition: numeric_state
entity_id: sensor.stromverkauf_nach_wp_zaehler
above: "4"
- condition: numeric_state
entity_id: sensor.master_battery_discharge
below: "0.1"
then:
- service: rest_command.update_elwa_power
data:
power: >-
{{ (((states('sensor.stromverkauf_nach_wp_zaehler') | float -4 )* 40
+ states('sensor.elwa_e_2_mypv_stromverbrauch_aktuell') | float)) *
0.9 }}
else:
- service: rest_command.update_elwa_power
data:
power: 0
mode: single
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!
thx!
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?
Thanks in advance.
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
template:
- sensor:
- name: "your_name"
unique_id: "your_uniqe_id"
device_class: "energy"
icon: "mdi:your_mdi"
state_class: "total_increasing"
unit_of_measurement: "kWh"
state: > {{ states('sensor.yourshellysensor') | float *-1 | float }}
after that you take this sensor to steer your elwa.
right your elwa will only be steerable by one input
Thanks for your respond.
Now I see what was missing from my setup.
Thank you.
That here I know. I got from MYPV the info about the elwa and the http.
Thank you
Hi sleepymax.
Can you please help a bit here?
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.
Thanks in advance.
P.S. Basicaly what you do here…(?).
power: >-
{{ (((states('sensor.stromverkauf_nach_wp_zaehler') | float -4 )* 36
+ states('sensor.elwa_e_2_mypv_stromverbrauch_aktuell') | float)) *
0.95 }}
Here is my yaml
alias: ElwaON
description: ElwaON
trigger:
- platform: state
entity_id:- sensor.vxxout
condition:
- sensor.vxxout
- condition: sun
after: sunrise
before: sunset
action: - if:
- condition: numeric_state
entity_id: sensor.vxxout
above: 800 - condition: numeric_state
entity_id: sensor.vxxin
below: 0.1
then: - service: rest_command.update_elwa_power
data:
power: >-
{{ (((states(‘sensor.vxxout’) | float -4 )* 36 +
states(‘sensor.elwaxx_power’) | float)) * 0.95 }}
else: - service: rest_command.update_elwa_power
data:
power: 0
mode: single
- condition: numeric_state
What that means:
)* 36 +
- 0.95
Sorry for the trouble…I start with HA last month…A lot to learn.
Im not really anything more than you only try and error!
for MOST people and for most installed scripts it would be the simplest method to only take your surplus from your mysolar and put this into your elwa
power: >-
{{ (((states('sensor.stromverkauf_nach_wp_zaehler') | float -4 )* 36
+ states('sensor.elwa_e_2_mypv_stromverbrauch_aktuell') | float)) *
0.95 }}
this is only for calculating the amount of Power on which MY Elwa should run. (On our house there are special engery calculating and measuring devices installed due to our Heatpump) please look here: https://community.home-assistant.io/t/mypv-integation-started/395584/24?u=sleepymaxx
IN short i will only run my elwa on the amount of power which is going to the Grid AFTER all other house consumers, and after my Heapump is also satisfied.
Also i have installed a house Battery which should no be unloaded by my Elwa
So here i go for explaining my sensors and the idea of this template:
sensor.stromverkauf_nach_wp_zaehler
i take the actual power which is going from my house outwards to the grid
-4
i subtrahate 4 amounts of this measured amount (so i dont activate the ELWA too early) and this “4” is the same amount witch has to be the minium to start as condition of my numeric state of my activating script
* 36
i calculate the output how much watts should my elwa consume
+ states
sensor.elwa_e_2_mypv_stromverbrauch_aktuell
the calculated amount of energy for the next period has to be added to the actual amount of energy which is going through the elwa in the actual period (otherwise there will be to less energy going through the elwa and too much to the grid in the next period)
* 0.95
the now new calculated amount of power should be redueced a little bit, so if there is a little cloud or a consumer in my house starts it will not take engery from my battery or the grid!
- service: rest_command.update_elwa_power
this will push the explained amount of power to my elwa
* 0.95 / * 36 / - 4
so feel free to experiment with the calculating parts of your template… i think its depending on your house/installation/battery/waterboiler/using… what best calculating points you have. (i figured it out by controlling my history graph)
PS: please look out! my first script should go into your configuration.yaml
my second script is a automation!
THANK YOU.
Now is all clear.
I will check it at soon we have some sun
alias: ElwaON
description: ElwaUpdate
trigger:
- platform: state
entity_id:- sensor.vxxout
condition:
- sensor.vxxout
- condition: sun
after: sunrise
before: sunset
action: - if:
- condition: numeric_state
entity_id: sensor.vxxout
above: “4”
then: - service: rest_command.update_elwa_power
data:
power: >-
{{ (((states(‘sensor.vxxout’) | float -4 )* 40 +
states(‘sensor.elwaxx_power’) | float)) * 0.9 }}
else: - service: rest_command.update_elwa_power
data:
power: 0
mode: single
- condition: numeric_state