PV / Solar Excess Optimizer: Auto-control appliances (wallbox, dish washer, heatpump, ...) based on excess solar power

Hi there,

i´m testing this pretty cool Blueprint and have a question to understand the logic of it.
I have a standard micro-converter. 1600W IN / 600W/800W out…

When will the appliances start?

My appliance “Schreibtischlampe” is starting when the LOAD POWER (Grid) is 180W / EXPORT-POWER = 0W and the PV-POWER is 120-200W.

It´s own consumption in Watt is 8W. I don´t have EXCESS!

I use this configuration without battery.

alias: pv_excess_schreibtischlampe
description: ""
use_blueprint:
  path: inventocasa/pv_excess_control.yaml
  input:
    automation_id: pv_excess_schreibtischlampe
    pv_power: sensor.pv_power_gesamt_bkw_1_und_2
    appliance_switch: light.schreibtischlampe_buro
    appliance_switch_interval: 1
    actual_power: sensor.schreibtischlampe_buro_power
    min_home_battery_level: 0
    load_power: sensor.power_vom_netz_watt
    export_power: sensor.power_ins_netz_watt
    defined_current: 6
    appliance_priority: 2

Do i need the Combined Import/Export Power for my setup or is the behavior normal?

What i expected: Only start the appliances (ON…) when there is Excess.

Thanks!

Hello everyone,

is there a way to stop pyscript from spamming my logbook?
It creates entries every 10 seconds! :smirk:

Thank you for this Blueprint!
I have been testing with a simple smartplug and this works as expected.
However when i want to add my smart dishwasher using the Home Connect ALT integration it does not work as expected. I see the following errors in the logging

This error originated from a custom integration.

Logger: custom_components.pyscript.file.pv_excess_control.on_time
Source: custom_components/pyscript/eval.py:1941
integration: Pyscript Python scripting (documentation, issues)
First occurred: May 26, 2024 at 13:34:16 (3391 occurrences)
Last logged: 16:22:17

[button.011090388881000357_start_pause (Prio 1)] Appliance state (=2024-05-25T15:10:11.931062+00:00) is neither ON nor OFF. Assuming OFF state.
Cannot switch on appliance: Service "button.turn_on" does not exist.
[button.011090388881000357_start_pause (Prio 1)] Appliance state (=unavailable) is neither ON nor OFF. Assuming OFF state.
num=unavailable is not a valid number between 0 and 1000000: could not convert string to float: 'unavailable'
Could not update Export/PV history!: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

The entity i use in the blueprint is:
button.011090388881000357_start_pause
This entity becomes available when i enable remote start on the dishwasher. This is as expected. And is a safety feature of the manufacturer.

I suspect i need a switch entity in the blueprint. Is there a way to “convert” the button to a switch? Or am i missing something in the configuratoin of the blueprint?
Any help is appreciated

I can’t be the only one annoyed by this :sweat_smile:

Hey, it seems that i needed the import/export combined power sensor.
Everything works like a charm…

Hi, isn´t it possible to remove the logger in configuration.yaml?

The entries in the logbook are generated by the pyscript integration:

But I can’t find a way to disable them for the PV Excess script only.

Logbook or recorder exclusions in the configuration.yaml only work with entity IDs.

1 Like

Help with my setup

I only get many of the same log items in my logboek

2024-05-28 12:22:16.250 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time got time trigger, running action (kwargs = {'trigger_type': 'time', 'trigger_time': datetime.datetime(2024, 5, 28, 12, 22, 16, 245653)})
2024-05-28 12:22:16.250 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time time_next = 2024-05-28 12:22:26.245653, now = 2024-05-28 12:22:16.250553
2024-05-28 12:22:16.251 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time waiting for 9.9951 secs
2024-05-28 12:22:16.266 DEBUG (MainThread) [custom_components.pyscript.eval] file.pv_excess_control.on_time: calling on_time(, {'trigger_type': 'time', 'trigger_time': datetime.datetime(2024, 5, 28, 12, 22, 16, 245653)})
2024-05-28 12:22:16.425 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time got time trigger, running action (kwargs = {'trigger_type': 'time', 'trigger_time': datetime.datetime(2024, 5, 28, 12, 22, 16, 423652)})
2024-05-28 12:22:16.426 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time time_next = 2024-05-28 12:22:26.423652, now = 2024-05-28 12:22:16.426245
2024-05-28 12:22:16.426 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time waiting for 9.99741 secs
2024-05-28 12:22:16.430 DEBUG (MainThread) [custom_components.pyscript.eval] file.pv_excess_control.on_time: calling on_time(, {'trigger_type': 'time', 'trigger_time': datetime.datetime(2024, 5, 28, 12, 22, 16, 423652)})
2024-05-28 12:22:17.104 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time got time trigger, running action (kwargs = {'trigger_type': 'time', 'trigger_time': datetime.datetime(2024, 5, 28, 12, 22, 17, 103568)})
2024-05-28 12:22:17.105 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time time_next = 2024-05-28 12:22:27.103568, now = 2024-05-28 12:22:17.104925
2024-05-28 12:22:17.105 DEBUG (MainThread) [custom_components.pyscript.trigger] trigger file.pv_excess_control.on_time waiting for 9.99864 secs

But nothing happens with my applicance?

Any help is more than welcome (I use the latest versions of all)

My automation yaml files is like this:

alias: Zwembad Warmtepomp PV excess optimizer
description: ""
use_blueprint:
  path: InventoCasa/pv_excess_control.yaml
  input:
    automation_id: "74075083"
    pv_power: sensor.actueel_zonnepanelen_opbrengst
    export_power: sensor.electricity_meter_energieproductie
    load_power: sensor.actueel_huis_gebruik
    home_battery_level: sensor.sessy_de7j_state_of_charge
    solar_production_forecast: sensor.solcast_pv_forecast_forecast_remaining_today
    actual_power: sensor.zwembad_total_power
    appliance_switch: input_boolean.zwembad_verwarming
    home_battery_capacity: 5

I think your automation_id has to be the same with alias

EDIT: Check → PV / Solar Excess Optimizer: Auto-control appliances (wallbox, dish washer, heatpump, ...) based on excess solar power - #70 by InventoCasa

2 Likes

Check !!!

That did the trick

1 Like

wow … as the solcast integration is dead/deleted … what forecast method do you use for

solar_production_forecast: sensor.solcast_pv_forecast_forecast_remaining_today

and how happy are you with it?

For now other users saved the work and keeping on with the solcast integration. Fingers crossed the api will not change to soon…

I use forecast.solar, it work fine.
I never used solcast as I’m out of its coverage area.

Hello,

I am testing this Blueprint, I made my frist automation but something is not working.

Calculated average excess power based on >> solar power - load power <<: 0 W

I use two sensors :

  • PW Power : sensor.envoy_consommation_electrique_actuelle, current state: 1.551 kW
  • Combined Import/Export Power : sensor.envoy_production_d_electricite_actuelle, current state : 0.512 kW

So the calculated excess power should not be null.

Can someone help me, please ?

Hi Juergen, me again :slight_smile:
Could you please post the full entry for your sensor.new_charge_current_int is a template sensor?

Is this in templates.yaml? so:

  • sensor:
    ?

I created the sensor as template helper.



using the template from above.

1 Like

I have the exact same problem.

Was this ever solved for you over the last year? :sweat_smile:

Hi, first I would like to thank for this great Automation :clap:

any chance to implement 3-Phase to 1-Phase switching and vice versa?
Would be a great feature for a Wallbox.

1 Like

The issue is solved. Just update the script.

1 Like

Hello @Maik7 :slight_smile:
I’m so happy, I can see that your 2 pull requests have been merged!

  1. So there is no more issue with the dynamic priority?
    We can use a template to define the priority in the automation and dynamicaly modify this priority, and then execute in the same script the PV automation to refresh with “service: automation.trigger” , right?

  2. About the priority >1000:

You documented the priority adding:

If the priority is greater than 1000 this appliance will be switched on, even if the excess power is not sufficient for 100% of the needed power

Can you please precise the behaviour when prio > 1000 ?
Is the appliance ON while the solar panel produce 50% of the needed power? and then it is turned off? or is it different?
Also is it possible to modify the percentage??

Thank you so much :slight_smile:

1 Like