MYPV integration started

Hi. Well I have finally arrange it to my needs.
It works just fine.
Thanks for your advise/help.

P.S.

alias: ElwaON
description: ElwaUpdate
trigger:

  • platform: state
    entity_id:
    • sensor.vxxout
      condition:
  • condition: sun
    after: sunrise
    before: sunset
    action:
  • if:
    • condition: numeric_state
      entity_id: sensor.vxxout
      above: “800”
      then:
    • service: rest_command.update_elwa_power
      data:
      power: >-
      {{ (((states(‘sensor.vxxout’) | float -800 )* 3 +
      states(‘sensor.elwaxx_power’) | float)) * 0.25 }}
      else:
    • service: rest_command.update_elwa_power
      data:
      power: 0
      mode: single

Hallo. Anybody get this error?

This error originated from a custom integration.

Logger: custom_components.mypv.sensor
Source: custom_components/mypv/sensor.py:65
Integration: MyPV AC-THOR and ELWA (documentation)
First occurred: 21:47:34 (153 occurrences)
Last logged: 22:12:56

‘power_act’

Had to integrate a new condition (its for updating the right amount of Power to the Elwa) - for the newer Readers its already included “upstairs”.

  - platform: state
    entity_id:
      - sensor.master_battery_discharge

every time the state of my battery is changing the whole script is running so the Flow´s of the Power on witch the Elwa is driven is waaaayy moore Smooth:

no clue here… (error in HA or in the Elwa itself)?maybe there are some configuration datas missing?https://community.home-assistant.io/t/mypv-integation-started/395584/42?u=sleepymaxx

I have send one email to MYPV…maybe they know something.

so the error occurs in your elwa … so how are your configurations on your elwa… ?

I’m not sure is on the Elwa. Still searching…and asking.

I just disable the integration the error is not showing anymore. Looks like is on the integration.

Basically I can use the Elwa without the integration. I just reported here to check if is only me or is a wide error.

I once had a similar problem with another sensor in a template… mostly i found out (for me) the major problem of sensors, templates and so on are when there are missing some parts in the definiton and the ordening of the sensor or the template… so i would check if there are all definitons for your sensors actual and acting right…
at mine it was the ordening of unique id + device class + unit of measurement + state class…

so i recommend to look for the right sensor-configurations…
But really this is only a option from The Glass Bowl of a noobie…

All looks ok. I’m still searching.

rest:
  - resource: "http://192.168.XXX.XXX/data.jsn"
    scan_interval: 10
    sensor:
      - name: "ELWAXX_Power"
        value_template: "{{ value_json.power }}"
        unit_of_measurement: "W"
      - name: "ELWAXX_TEMP"
        value_template: "{{ value_json.temp1 / 10 }}"
        unit_of_measurement: "°C"
      - name: "ELWAXX_Tagret"
        value_template: "{{ value_json.ww1target / 10 }}"
        unit_of_measurement: "°C"

At soon I found the issue…I will post it.

oh… im not thinking so… you have to add much more information to your sensor only with the additional informations of your sensor HA is able to sort your data correct and use your data in the right way.
i really recommend to upddate your sensors definitons by adding some lines like:

    sensor:
      - name: "xxx"
        unique_id: "xxx"
        value_template: "xxx"
        device_class: xxx
        unit_of_measurement: "xxxx"
        state_class: xxx

i know it´s work to look out for the right categories of your sensors but in your case i think it would be better… :wink:

Thanks. I give a try.

I have made a bit better automation for the Elwa to not activate the stages two fast ( clicking the relays too fast ). It send the calculate power with delay 10 seconds. Also the minimum power is adjusted to 200w.

alias: ElwaUpdate
description: ElwaUpdate
trigger:

  • platform: state
    entity_id:
    • sensor.vxxout
      condition:
  • condition: numeric_state
    entity_id: sensor.vxxout
    above: “1000”
    action:
  • choose:
    • conditions:
      • condition: numeric_state
        entity_id: sensor.vxxout
        above: “1000”
        sequence:
      • service: rest_command.update_elwa_power
        data_template:
        power: >-
        {%- set calculated_power = (((states(‘sensor.vxxout’) | float -
        1000) * 3 + states(‘sensor.elwaxx_power’) | float)) * 0.23 -%}
        {{ calculated_power if calculated_power >= 200 else 0 }}
      • delay: “00:00:10”
      • service: rest_command.update_elwa_power
        data_template:
        power: “{{ states(‘sensor.vxxout’) | float }}”
    • conditions:
      • condition: numeric_state
        entity_id: sensor.vxxout
        below: “1000”
        sequence:
      • service: rest_command.update_elwa_power
        data_template:
        power: 0
        default:
        mode: single

p.s. Works extreme good like this with clouds like this.

I have implemente your “simple” automation from Jan. 18, which works really nice except for the flaws of fast switching that you already mentioned.

When I went through your new “advanced” automation, I struggle to understand why you set the power to the max available power ( I assume that is sensor.vxxout) after the 10 second delay.
Could you explain the reason behind this?

To avoid clicking the relays like crazy in Elwa.

P.S. Here is one updated version.

alias: ElwaUpdate
description: ElwaUpdate
trigger:

  • platform: state
    entity_id: sensor.vxxout
    condition:
  • condition: numeric_state
    entity_id: sensor.vxxout
    above: “1000”
  • condition: template
    value_template: “{{ is_state(‘input_boolean.elwa_update_running’, ‘off’) }}”
    action:
  • service: input_boolean.turn_on
    target:
    entity_id: input_boolean.elwa_update_running
    data: {}
  • choose:
    • conditions:
      • condition: numeric_state
        entity_id: sensor.vxxout
        above: “1000”
        sequence:
      • service: rest_command.update_elwa_power
        data_template:
        power: >-
        {%- set calculated_power = (((states(‘sensor.vxxout’) | float -
        1000) * 3 + states(‘sensor.elwaxx_power’) | float)) * 0.23 -%}
        {{ calculated_power if calculated_power >= 200 else 0 }}
      • delay: “00:00:15”
      • service: rest_command.update_elwa_power
        data_template:
        power: “{{ states(‘sensor.vxxout’) | float }}”
    • conditions:
      • condition: numeric_state
        entity_id: sensor.vxxout
        below: “1000”
        sequence:
      • service: rest_command.update_elwa_power
        data_template:
        power: 0
  • service: input_boolean.turn_off
    target:
    entity_id: input_boolean.elwa_update_running
    data: {}
    mode: single

In my last version you get error… ELWA is all ready running. In this version is fixed with the …input_boolean

You have to add in YAML config…
input_boolean:
elwa_update_running:
name: “Elwa Update Running”
initial: off

Enjoy

Okay, I understand. Do you have ELWA or ELWA 2? I use ELWA 2 and it says : “continously variable” power settings (without steps, german “stufenlos”).

I am not sitting in the basement all the time when I work on my automation but I have to test it at some point. So far (maybe because of low solar power) I only heard the “on” clicking relays. I am not sure if there is another relay for a higher power setting.
To find out if there are multiple “hardware power levels” I emailed them.

My automation is a bit different, but apparently also does the job even with clouds or the heat pump switching on to prepare the water for heating.

Basically I specify:

home_buffer

  • buffer power for changes of home consumption (say 200 W)

heater_consumption_ratio

  • ELWA excess power consumption ratio (e.g. 80%)

minimum_battery_level

  • minimum state of charge of my battery (e.g. 95%)

And add sliders to my dashboard for control.
Then I calculate:

elwa_power_set= (grid_export_power - home_buffer + elwa_power_measurement) * heater_consumption_ratio

Last I set this value (ELWA power setting) and add a delay of 10 seconds. Otherwise, the ELWA measurement is not yet there and as you said, it can change rapidly if a cloud passes by.

I avoid setting the ELWA power to 100% of my excess power, because the slightest cloud will then lead to a shutdown (–> Relay clicking) if solar power reduces due clouds and grid export becomes negative.

alias: ELWA simple Automation ratio
description: ELWA simple automation https://community.home-assistant.io/t/mypv->integation-started/395584/40 von showup Jan. 18 2024
trigger:

  • platform: state
    entity_id:
    • sensor.grid_export_power
      condition:
  • condition: sun
    before: sunset
    after: sunrise
    action:
  • if:
    • condition: numeric_state
      entity_id: sensor.grid_export_power
      above: input_number.home_buffer
    • condition: numeric_state
      entity_id: sensor.battery_state_of_charge
      above: input_number.minimum_battery_level
    • condition: sun
      before: sunset
      after: sunrise
  • then:
    #Calculate ELWA Power setting
    - service: input_number.set_value
    data_template:
    entity_id: input_number.elwa_power_set
    value: >
    {%- set calculatedPower= (states(‘sensor.grid_export_power’) |
    float(0) - states('input_number.home_buffer)|float(0) +
    states(‘sensor.elwa_power_measurement’) | float(0) ) *
    states(‘input_number.heater_consumption_ratio’)|float(0) / 100 -%}
    # negative fallback:
    ‘{{ calculatedPower if calculatedPower > 0 else 0 }}’
    - service: rest_command.update_elwa_power
    data:
    power: “{{ states(‘input_number.elwa_power_set’)|float(0) }}”
    - delay:
    hours: 0
    minutes: 0
    seconds: 5
    milliseconds: 0
  • else:
    - service: input_number.set_value
    data_template:
    entity_id: input_number.elwa_power_set
    value: “{{ 0 }}”
    - service: rest_command.update_elwa_power
    data:
    power: “{{ 0 }}”
    mode: single

Have you (or anyone else here) figured out if you can change the max. Power for the device via a http command rather than the Web-Interface of the ELWA?

I would probably use PID Control = 1 but limit the max. power according to the current solar production if possible.

You can add a limit in your automation…

power: >-
{%- set calculated_power = (((states(‘sensor.vxxout’) | float - 1000) * 3 + states(‘sensor.elwaxx_power’) | float)) * 0.23 -%}
{{ min(calculated_power if calculated_power >= 200 else 0, 3000) }}

This modification ensures that the calculated power value is not greater than 3000. If calculated_power exceeds 3000, it will be capped at 3000.

The upper limit is a good point :+1: Even though my solar panels will unlikely ever exceed 3000 W excess power.

i would recommed to all the ELWA (1)! users to use the
/control.html?pid_power=n
command in order to reduce the clicking of the Elwa because inside there is a “older” Relay working.
By using the pid_power you only add the amount of power you will (steering must be a little different and your config must be rewritten)! because of the pid power output but you will have a much more smoth graph and you will not have the clicking!
https://community.home-assistant.io/t/mypv-integation-started/395584/30?u=sleepymaxx

Hi Sleepymaxx.
So automation must change, and the rest_command must change.

Can you give us an example please?