Just a side note, you will see this error overnight sometimes, don’t worry if you do as its looking for these values to run the automation, but obviously no solar is available.
As Henrik has mentioned you can set another automation to turn water heater on or off at sunset / sunrise, time based automation or a switch on your dashboard so you can manually control it. Disabling/Enabling you blueprint automation works fine. I only find and a few others that making any changes to the blueprint once its running kills pyscript. I now opt to disable the automation, delete it and redo it with the settings I want, save, run the automation and then enable it. Works well for the moment.
Well, for me it simply re-enables the automation after a “force charge” for the EV (i.e. dumping the battery into the car if I know there’s going to be enough solar in the day to charge it back up). If I left the PV automation on it would turn off the charger at 6am…
To ensure my ‘off peak’ automation fires through the night I found that disabling the Excess PV automation at the start of the off peak period and re-enabling it again afterwards gives me the desired effect
@InventoCasa Yesterday was a really sunny day and I was producing around 5Kw, with a full battery and exporting around 4Kw to the grid but the system still did not turn on the water heater. I checked the sensors and all the values looked be correct to make the system turn on. Here is my config do you have any suggestions?
@spencerralph you have to take a look at your Home Assistant logs / the Home Assistant logfile. If you setup the script according to instructions, there should be a lot of debug logs from the script which will tell you why your water heater is not being switched on.
Whilst the indentation is not correct. So sorry Henrik & Spencer, about the position of the logger key. That was how I have it in my setup, on a steep learning curve on this one for sure.
If you look at your image, the power is in kW, what the script wants is the entity id in W.
I dont have a hybrid inverter but have a growatt offgrid inverter, that has the sensors for both kW and W so you will have to look and pick the correct one, or you will have to create a helper to convert from kW to W
Looked and all my sensors are in KW, so the conversion may be the only why forward, One QQ would the Conversion method change all my sensors to Watts, i just wanted to change the ones i use for the script
Ok then you have to look at the option mentioned. No it will create new sensor’s for the script.
Just be careful when altering your config.yaml file.
So let’s look at the following.
Does your /config/configuration.yaml file have this line?
sensor: !include sensors.yaml
If you do see the above line then check if you have a file called.
sensors.yaml
If the above file is there then at the bottom of the sensors.yaml file add the following.
### Making new sensor kW to W - Solar
- platform: template
sensors:
solar_in_watts:
friendly_name: "Solar Power In Watt"
unit_of_measurement: "W"
value_template: "{{ states('sensor.nwctcjc06d_all_pv_wattage')|float * 1000 }}"
Double check the indentations and if your value template sensor above is correct.
Once you save it go to > Developer Tools > Click on CHECK CONFIGURATION you should not get any errors, if you do go back to the file and recheck, double check and correct.
Restart HA
Goto Settings > Devices & Services > Entities > in the search bar copy and paste this without the
quotes “sensor.solar_in_watts” you will see the sensor has been created select it and you will now
see that your kW is displayed in W
8.This is the sensor sensor.solar_in_watts you will now use in the Script for PV Power.