yes, normally nothing should be started when there is not enough PV excess.
I suspect that you did not pass the correct measurement for the Load Power or some of the other crucial sensors.
Do not use the combined import/export sensor when you have a hybrid inverter with battery. Otherwise the script cannot detect when your battery is discharging to compensate for a load.
If that was not the problem: You can also show an excerpt of the debug log so that I can help you finding the problem. If you set the log level to debug (according to instructions in the first post), you should see a lot of debug messages in your Home Assistant Logfile.
1+2: Thanks for the info, I will consider implementing this at some point to make the calculations more precise.
3: Within the code, I already have a little fixed correction which could be made configurable through the blueprint. However at the moment, I am waiting for user reports if this is really something which needs to be made configurable (since the blueprint is growing and growing, I try to keep it still not overloaded with configuration options)
5: The forecast is updated everytime the solcast sensor is updated; if you use the standard settings when installing the solcast integration, you should be out-of-request around noon. While this does not seem to be a big problem (the forecast from noon is then used for the rest of the day), I could include a small hint in the blueprint regarding this pitfall.
6: Yes, such an implementation is definitely coming. I will make it universally usable, so that you can pass a sensor, and define a number “target” for this. So for pool pumps you could pass the runtime of the current day, and as target you could set 4 for 4 hours. Another example: For EVs, you can pass the battery level, and set a target of e.g. 50, which then means “charge to EV always to at least 50% regardless of solar power.”
7: I guess such an approximation of the excess power could simply be made based on the solar forecast. Seems like a few users have this situation, that they cannot export to grid (or only export a fixed amount). I will think about implementing an approximation based on solar forecast for this situation.
Simple question. How do you calculate * Solcast today remaining forecast?
It seems very tricky since you only have 12hr / 24hr , curent and next hr forecasts.
Hi everyone.
installation and so on went ok so far, but…
what i have to enter here:
Automation name
**[IMPORTANT]
This field must contain the same name/entity_id you defined for this automation.
The name must be unique!
You can check your automation entity ID by clicking on the three dots in the top right corner of your automation editor and selecting info → settings. **
When i click on the “dots” there is no “info…”
Do i have to create an automation first? I thought this script creates automations.?
@GregEdge No, the python script only uses the sensor. It does not poll the Solcast API, that is done within the Solcast integration itself (or manually, if you disabled auto polling when setting up the Solcast integration)
Thanks for your input_number update bro.
I now created an automatisation with your blueprint using a Helper Switch (that runs the service keba.enable / disable) and an input_number to set the current.
For my input_helper I created an automatisation:
Edit: Check my next post for possible solition
alias: PVKeba CurrentÄnderung
description: startet den Dienst Keba.SetCurrent nach Wertänderung der Helper Variable
trigger:
- platform: state
entity_id:
- input_number.kebacurrent
condition: []
action:
- service: keba.set_current
data:
current:
"[object Object]": null
mode: single
Everytime I change in yaml, it gets back to object object null.
What is wrong here?
The original keba.setcurrent (without my varaible) looks like this:
Atleast it stays saved in the automatisation (no object object stuff). And I can perform this service without any error.
So hopefully everything works if I plug my car tomorrow.
Is there any need to create an automatisation to check if a car is connectedfor activating / deactivating the car loading automatisation?
Im not sure if its a problem if I run keba.enable / keba.disable without any reason (e.g. when no car is connected to the box)
Thanks.
But float (0) rounds to 0 decimal places, doesnt it?
I think your Script Returns atleast 1 decimal char for setting the load Power in A.
So I should use float(1), or Just float(If possible)?
Have i misconfigured something to cause these errors?
’ Logger: custom_components.pyscript.file.pv_excess_control.on_time
Source: custom_components/pyscript/trigger.py:1268
Integration: Pyscript Python scripting (documentation, issues)
First occurred: April 16, 2023 at 4:56:00 PM (483 occurrences)
Last logged: 7:03:00 AM
Exception in <file.pv_excess_control.on_time> line 195: if home_battery_level >= PvExcessControl.min_home_battery_level or not self._force_charge_battery(): ^ TypeError: ‘>=’ not supported between instances of ‘NoneType’ and ‘float’
Exception in <file.pv_excess_control.on_time> line 428: for a_id, e in dict(sorted(PvExcessControl.instances.items(), key=lambda item: item[1][‘priority’])): ^ ValueError: too many values to unpack (expected 2) ’
Could this be caused because the integration I use to get the data is via modbus and occassionally tcpip times out so the entities are not populated or get null or not available?
Yes, the first error is caused by None values for battery_level. If that happens only sporadically with your modbus connection, then it is nothing to worry about, since the script will run in the background every minute.
The second error is a bug which occurs when your remaining solar excess is just enough to charge the home battery to the specified level. I just pushed a little bugfix to the repo to solve this.
Hey hey
Im afraid I got a big issue.
Yesterday I did setup the Blueprint for my wallbox, as discussed here.
Today after pluging my car I found out it isnt working.
It looks like it turns on the charger, but doesnt set a charging.current. (On off is hard to determine, because there is lot of sunpower today)
But also none of my other automatisations work (which worked perfectly fine so far).
Im kinda sure they also worked after I manually updated the blueprint and the python file.
So im quite sure, last change before my automatisation didnt work anymore was setting up the Wallbox blueprint.
I tried following:
Execute all automatisations
Delete Wallbox Blueprint and execute all other automatisations
Restart the complete HomeAssistant
But still nothing is working here.
Is there anything I possibly made wrong?
Or what do you need to find a bug possibly?
Here is what I have:
I got 10 automatisations from your blueprint:
my LaptopCharger (prio2)
8x aquarium heaters (all prio3)
and an infrared heater (prio4)
all of them use shelly plugs, so basically all created automatisations are the same.
e.g. for a heater:
in addition to this I created an helper (input_boolean) for every automatisation to turn it on and off, in case I need the device run no matter how much PV power is produced.
Again this is basically same for all devices:
alias: PVSteckdoseHeizer21Schalter
description: Schaltet PV Steuerung für Heizer 2.1 ein und aus
trigger:
- platform: state
entity_id:
- input_boolean.schalterpvsteckdoseheizer21
to: "on"
id: SchalterAn
- platform: state
entity_id:
- input_boolean.schalterpvsteckdoseheizer21
to: "off"
id: SchalterAus
condition: []
action:
- if:
- condition: trigger
id: SchalterAn
then:
- service: automation.turn_on
data: {}
target:
entity_id: automation.pvsteckdoseheizer21
else:
- service: automation.turn_off
data:
stop_actions: true
target:
entity_id: automation.pvsteckdoseheizer21
- type: turn_on
device_id: 2dd6712df8d10d0ea7ed2893c3bf8048
entity_id: switch.shellyplugheizer21
domain: switch
mode: single
Ofcourse all these booleans are true, and all the blueprint automatisations are active.
every automation in Home Assistant can easily be turned on/off via the lovelace dashboard. Just add the automation entity to your dashboard.
You can find the debug logs in the standard home assistant logfile (if you set the loglevel of the python script to debug beforehand, according to the installation instructions in the first post)