-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Zappi support, Optimiser occasionally runs continuously #269
Comments
Hmmmm, Pv_opt is occasionally failing to load consumption data from sensor.solis_house_load. It strictly doesn't need it, it loads both power and energy and will use power in preference of energy. It might be a generic problem with Beta-9 you are running as I only download the energy sensors, however I think your energy sensor is not correct in config.yaml (so it has nothing to fall back on if power isn't working right) can you attach that file please? |
Note: from tomorrow I'm on hols for the week, will pick this up again on my return. |
@stevebuk1 voila! |
Try commenting out all of these lines in config.yaml: id_consumption_today: sensor.{device_name}_consumption_today The first entry is incorrect for the Solax modbus integration - it should be sensor.solis_house_load_today. I don't think that is the cause of the problems tho as Pv_opt seems to recognise that its not found and instead revert to the system default. I think the cause of the problem is the 2nd and 3rd entries when a call is made through Appdeamon to load the consumption history in W . Its clear from #270 that some systems struggle to get it done with 10seconds and I suspect loading consumption as W is a significant size. Here, the system defaults appear deliberately set to entities that don't exist, and if this happens the system reverts to using kWh, which it then converts to W. I suspect loading kWh history is significantly smaller but perhaps slightly less accurate. Try it and post a log please. |
@stevebuk1 voila! It looks like its working, although my read only 'off' keeps flicking back over to on, similarly choosing Zappi from the dropdown box, but not sure how much of a difference they make. Also not sure I understand the "current setting forced discharge" is that right? |
re the readonly setting, if you want Pv_opt to start up in readonly mode, find this line in config.yaml:
and change false to true. The EV charger control is the beginnings of support for EVs. If you have a Zappi and its seen as part of the house load, then you'll need to set this to Zappi otherwise the consumption history that Pv_opt uses to predict your use will include the EV charging data. If your Zappi is outside of the house load (i.e on its own Henley block) you can leave it set to None. If you do have a Zappi that is seen as part of the house load and/or are on IOG let me know as I have a mature Beta that supports IOG i.e will pick up any extra cheap slots and prevent the house battery discharging when the EV is charging. It also includes all the code for setting the default for the EV selector correctly. |
Apologies I've got myself confused. You were running the Beta release of Pv_opt before (v3.16.0-Beta-9) but your latest logs show its changed back to the main production release (v3.15.5). Was this deliberate? |
Yep we have a zappi and are on IOG !
From: stevebuk1 ***@***.***>
Sent: 02 October 2024 13:35
To: fboundy/pv_opt ***@***.***>
Cc: pbcjh10 ***@***.***>; Author ***@***.***>
Subject: Re: [fboundy/pv_opt] Entity not avaliable: pvopt_opt_cost, pvopt_base_cost (Issue #269)
re the readonly setting, if you want Pv_opt to start up in readonly mode, find this line in config.yaml:
read_only: false # If true the inverter will not be controlled
and change false to true.
The EV charger control is the beginnings of support for EVs. If you have a Zappi and its seen as part of the house load, then you'll need to set this to Zappi otherwise the consumption history that Pv_opt uses to predict your use will include the EV charging data. If your Zappi is outside of the house load (i.e on its own Henley block) you can leave it set to None.
If you do have a Zappi that is seen as part of the house load and/or are on IOG let me know as I have a mature Beta that supports IOG i.e will pick up any extra cheap slots and prevent the house battery discharging when the EV is charging.
—
Reply to this email directly, view it on GitHub <#269 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AE3A5ETLAGUGQGCM7XMXJALZZPR55AVCNFSM6AAAAABPB3MNY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBYGUZTCNJRGA> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AE3A5EW7YYAWP2I2XHZFPKLZZPR55A5CNFSM6AAAAABPB3MNY2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUOLYMTM.gif> Message ID: ***@***.*** ***@***.***> >
|
No!
From: stevebuk1 ***@***.***>
Sent: 02 October 2024 13:59
To: fboundy/pv_opt ***@***.***>
Cc: pbcjh10 ***@***.***>; Author ***@***.***>
Subject: Re: [fboundy/pv_opt] Entity not avaliable: pvopt_opt_cost, pvopt_base_cost (Issue #269)
Apologies I've got myself confused. You were running the Beta release of Pv_opt before (v3.16.0-Beta-9) but your latest logs show its changed back to the main production release (v3.15.5). Was this deliberate?
—
Reply to this email directly, view it on GitHub <#269 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AE3A5EXK4RQ5RAE2N2CNOY3ZZPUZXAVCNFSM6AAAAABPB3MNY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBYGU4DIMRSGQ> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AE3A5EULVIFGMXXXVEGXPA3ZZPUZXA5CNFSM6AAAAABPB3MNY2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUOL3TSA.gif> Message ID: ***@***.*** ***@***.***> >
|
Apologies I got myself confused. You are already running v3.16.0-Beta-9 and are on IOG. In which case, take a look at the config.yaml here: Add the section called "EV parameters" to your own config.yaml - this will ensure Zappi is selected on each startup. I'll post later on with some additional lines to add to config.yaml which will enable addtional logging, then I can have a look at your forced discharge question. |
Near the top of your config.yaml file there is the following line:
Change false to true. In the user area, add the following line: debug_categories: W Once you see a charge/discharge plan that doesnt make sense, attach Pv_opt.log. |
So I re-downloaded files after the beta 9 confusion above and now its failing again. Although i've fixed the Zappi default as you suggested. I've just tried to tweak it to correct the sensor to be this one; id_consumption_today: sensor.solis_house_load_today but having it correct or commented out didn't seem to make a difference. I attach logs and my yaml! ![image](https://github.com/user-attachments/assets/040f9d9c-63ab- pv_optc.log |
Hi, I think its just the case that now that debug is set true, there is just so much logging the system takes forever. Beta-9 contains a logging filter so we can see the little bits we need to.
into to your config.yaml. Unless you really need it, I'd also comment out the last 13 lines in config.yaml, i.e. all this text:
|
So I had a bit of time to try and look at this again. I still have the entity not avaliable sensor.pvopt_status error. I played with things a bit and did a few reboots and now it seems to have randomly sprung to live. I attach the latest bits including config.yaml error(5).log The charging plan is like this; I want to check your thoughts on it. Surely what I want (in the cloudy weather today) is accumulate solar today, perhaps with a discharge just prior to 13:00. But then after that, its nearly evening, I dont want it to dump the battery to grid just after. It should surely hold onto the this (or atleast provide it to house load) rather than discharge to grid? Is it trying to be too clever? Or is this a settings problem in terms of charge and discharge thresholds? |
A dump at some point early evening is usual (Pv_opt doesnt tend to delay it to the very last slots unless those slots save you more money than earlier slots), but I'd agree a discharge to 23% doesnt look right, especially when it thinks its still going to be at 22% at 23:00. The next day, your car charging plan lasts till 7am, so the 6:30-7am charge slot is at cheap rate, but I would have expected Pv_opt have a continuous charging slot from 23:30 to 07:00 rather than a car hold for 23:00 to 6:30, then a charge. I think the problem is the setting of ev_part_of_house_load in config.yaml. At the moment, when you charge your car, does the car charging drain the house battery? If it doesn't, then you need to change this line:
to this:
i.e. uncomment the line. As it is, EV charge consumption is being substracted from house consumption which is going to give you almost zero house consumption at the points the car was historically charging, which would explain the forecast of a 23% battery at 17:30 but still at 22% at 23:00. This would explain most of the strange behaviour. Could you also change:
to
as without that the line *** edits - corrected a few times and explanations. |
Upon further inspection I don't think this is the problem as Pv_opt isnt finding any Zappi consumption sensors (or any Zappi entities at all for that matter). This is the cause of the entries in error.log, but setting ev_part_of_house_load = False will correct that as consumption data isnt needed. I'll take a longer look at what is going on from the logs you've provided, but a Pv_opt.log with debug= true will help immensely as it includes a printout of the expected energy flows, pricing, SOC and car charging expectations for each half hour slot making diagnosis of most problems easy. |
Thanks - sorry I'd re-copied bits in from your sample above as somewhere I'd introduced a formatting error. I have the zappi integration set up with 4 devices and 75 entities. Where can I see which ones pvopt is looking for? I attach a new pv_opt where you can see its failing to find sensors. |
For Zappi consumption, PV_opt looks for all entities of type "sensor" that have "zappi" and also "charge_added_session" in the name. If it finds these it will report them as follows:
(the ***** bit is the redacted personal details that is the Zappi S/N etc) |
Thanks for the new logs. Your house consumption data has some extremely weird figures in it, its around 4W(!) all night and then literally zero after 5pm. We need to fix this first before doing anything else. You are logging from the right sensor (sensor.solis_house_load_today) so it must be the data that it is reading from it. In config.yaml, can you change:
to
which will add power consumption logging. Just run one interation (10 mins or so) and post the new pv_opt.log. That will allow me to see what the 7 day consumption history is. |
Voila! Another odd charging plan with only charging between 05:30 and 7? Is it getting confused on history IOG charging sessions (and ignoring the obvious 23:30-05:30 session? |
Thanks! So, Pv_opt expects sensor.solis_house_load_today to be reporting kWh, so it increments all day and resets to 0 at midnight. It is what the house consumes, irrespective of whether the grid is supplying it or the battery is supplying it. Your sensor.solis_house_load_today is reporting very low values overnight with no increments, its resetting itself regularly, and consistently reports no increments from 4.30pm to 11.30pm. I don't think its the right sensor. Below is an image from my own system that shows two days history from sensor.solis_house_load_today and also sensor.solis_grid_import_today. The first day shows an EV charging day and the 2nd shows a non-EV charging day. If we take the 2nd day, you can see that the grid sensor is showing the battery being charged overnight and then it stops incrementing as the battery takes over,. sensor.solis_house_load_today reports the house consumption for the entire 24 hour period. You'll need to locate the two sensors that show this behaviour otherwise Pv_opt isnt going to work. Post a screenshot when you've found them and we can then change the names over in config.yaml so Pv_opt can find them. |
To assist with the above and also the Zappi issue, I'll do a Beta-10 this evening that will do some additional power consumption logging and also log any/all Zappi sensors. |
Was about to say the same. I think they've fitted the Solis CT clamp on backwards, as your grid export looks more like your grid import. That will also probably sort out house_load_today as well. Its easily done, as the Solis CT clamp arrow points the opposite direction to almost everyone elses CT clamp arrow!! |
As promised here is a Beta-10 release which adds logging of the kWh sensor on each optimiser run and also will log all entities with "zappi" in the name on startup to see if we can find the Zappi consumption sensor. Just copy over your existing pv_opt.py, Appdeamon will automatically restart PV_opt. |
Yes I think you've deduced the issue correctly. You probably copied config.yaml from the repo at some point and lost your changes that we made to remove the consumption sensors in W, which on some systems are so big they don't get read in the 10 seconds that AppDaemon allows. Your kWh consumption sensors seem to be making good sense now. The only concern is the bar chart has a bar called "Loadrate" that is showing in excess of 35,000kWh. It should be set to a sensor that reads in W (power), not kWh (energy), mine is set to sensor.solis_house_load. The same problem is in your "Solar Forecasts versus Actual" chart.
No, if |
On your dashboard, go into edit mode, click on the 3 vertical dots on the right hand side and then click "raw configuration editor": Then change the entry at what should be at line 24 to what your entity name is in your screengrab above. Be patient with this editor, its very slow, don't hold down any delete keys! |
Apologies, thats the standard production dashboard. I've editted my post above to say change it to whatever yours is called in "Solis Inverter House load". To find the actual name, click on the 'gear' icon. |
For you, Line 24 should read Everyones entity names are different so the dashboards supplied tend to need editting. |
I havent needed to adjust much. I have no export tariff so discharging is off for me. I've changed "Solcast Confidence Level" from 50% to 40%, as I find mine mostly underestimates my solar, and have upped "Load Margin" from 10% to 20% as I have a 12kWh battery and a 10kWH average daily consumption, so I'd like a fuller battery to deal with the randomness we switch the oven on at. Other than that I left everything else unchanged. I think until we subtract your 2nd Zappi from the house load your plans won't make much sense, but you can always turn "Use Consumption History" to Off and set an average kWh per day until PV_opt supports multiple chargers. I too started with 5kWh and have since added another US2000C and then a US5000C to increase capacity to my current level. If I get an ASHP I'll be adding more! |
Is there a specific setting that will force charge the battery, or atleast make the system think about charging battery whenever we get a cheap IOG block? For example - battery currently empty (well 20% which is limit), just plugged in car and its 7p until 4pm. I'd like the battery to go "oh hey, crap solar today lets top up". |
That didn't look right. It should pick up the cheap slots as you say. Can
you post a log?
…On Sun, 3 Nov 2024, 12:42 pbcjh10, ***@***.***> wrote:
Is there a specific setting that will force charge the battery, or atleast
make the system think about charging battery whenever we get a cheap IOG
block?
For example - battery currently empty (well 20% which is limit), just
plugged in car and its 7p until 4pm. I'd like the battery to go "oh hey,
crap solar today lets top up".
Is this a generic problem or a setting I can tweak? or is it because I
have cyclic discharge off? Like whenever its got a <= car sign here, why's
it not also topping up the battery?
image.png (view on web)
<https://github.com/user-attachments/assets/82ff4632-692d-4814-a2be-b34ef038c1c8>
—
Reply to this email directly, view it on GitHub
<#269 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASVRJMCP6AH6BNKR4MMSZH3Z6YK2XAVCNFSM6AAAAABPB3MNY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGQYTINJUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
With the power consumption logging we had enabled, unfortunately the log files only stretch back an hour or so. However, most of the testing on Pv-opt has been done with car plugins after 5pm and I suspect the problem is that reloads of the slot prices on a morning / early afternoon plugin don't go far enough in advance to create a decent charge plan (Pv_opt was originally written around Agile where prices don't become available until 4pm). Its either that or the recent algorithm changes that Octopus have made in the last week - charge plans now update regularly. I've recently changed the code to load car slots every 10 minutes rather than just on plugin (and thats working as these are the "<= Car" entries you are seeing) but the prices fed to house battery charge planning are only reloaded on car plugin and will take 20 minutes to become active (delays added to ensure Octopus recalculations have time to complete). I've created 17.0-Beta-13 with additional logging to try and get to the bottom of root cause. Overwrite your local files with these: https://github.com/stevebuk1/pv_opt/blob/dev/apps/pv_opt/pv_opt.py and then please change the "debug_categories" entry in config.yaml to the following:
|
Thanks Steve, I've done as you suggested and attach logs, I gave it 36hrs or so to see what happened. main.log Still weird and not charging up despite a plug in IOG charge from 18:30 today. |
Unfortunately despite the reduction in logging text, the 3 logs provided just stretch back to 1pm today rather than covering the 36 hours. In those logs, you've plugged the car in around 16:53 and it scheduled charging until 17:00pm, then again at 18:30pm. Pv_opt hasnt picked up the really short 7 minutes due to the way it searches for car slots - I've now fixed that and that is under test. The image you've provided shows Pv_opt has correctly picked up the 18:30 slot and intends to charge. The log runs out at 17:11, did it not charge at 18:30? I note you've still got "Use Consumption History" turned on - turn it off and set a daily consumption with the slider that will appear. This should then mean Pv_opt has a more accurate idea of what your house is going to consume rather than being corrupted due to it not subtracting your 2nd Zappi load. I think its worth increasing your log size and also generating 10 historic logs rather than the default 3. To do this, find your Appdaemon.yaml file and edit to include the two extra lines "log_generations" and "log_size" as below. Don't change any other lines - the below is from my system and may be different on yours. Make sure both entries are perfectly aligned with the entry
|
Well here you go! Left it running for a good while! pv_opt7.log Question remains why its ending charge at 05:30 ? I edited my dashboard Solis House Load Total - I presume thats supposed to be today? Rather than all time? Any thoughts? |
Can you grab the pv_opt.log for your 12:10 scrrengrab please?
…On Tue, 12 Nov 2024, 12:11 pbcjh10, ***@***.***> wrote:
And another weird one; Battery is at baseline empty, on a cheap rate, but
no plans to charge, despite naff all solar predicted.
image.png (view on web)
<https://github.com/user-attachments/assets/3fbe1795-f385-4696-a611-96d4bf6c2d3a>
—
Reply to this email directly, view it on GitHub
<#269 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASVRJMBAI4WICPF7L724WYD2AHWARAVCNFSM6AAAAABPB3MNY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZQGM3TAMRYHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
These should cover it I think? |
Yes that covers it. For completeness can you attach config.yaml as well. I'll take a longer look through that and all the logs you've provided, but I can see three immediate issues:
I'll look at 1 and 2 and any others I find, in the interim please fix 3) by downloading the following .py files: Be careful not to overwrite your config.yaml! |
Ahha yes thats probably it. Here's config.yaml |
My guess that the continuous optimisation is because one of the entities that appDaemon is monitoring for its state change is changing - triggering a new optimisation. This is all the entities listed in DEFAULT_CONFIG. The list is saved as Been there done that. |
I'd realised this was a thing when adding a fix for #265 in this commit. stevebuk1@f9981da There must be an errant entity being updated thats lying around somewhere...... |
I have now updated Pv_opt to deal with multiple Zappis. The entity names have to have the word "zappi" in the name somewhere so please rename the four zappi entities ( "plug_status" and "charge_added_session", for each Zappi) to include this. All consumption sensors are autodetected and summed together, which should mean the consumption history reported by Pv_opt will just be of the house load, which is what you need for house battery charge plans based on historic consumption. If found the logfile will report something like:
(the ***** are redacted Zappi S/Ns that Pv_opt will automatically do for logging, so the two sensors above are actually different) All plug status sensors are searched for, if there is more than one it will simply assume the first. (This means Pv_opt continues to work as is for users with single Zappis).
(The ******* are serial numbers that PV_opt redacts automatically, but the log will print the zzzzzz S/N as you'll need to know which one its chosen. If you upload the log here please manually delete it). If its picked up the wrong sensor, you'll need to tell it the right one in config.yaml by setting id_zappi_plug_status to the Zappi thats connected to IOG, something like the following:
On startup the log will then confirm the entity has been mapped correctly:
New files here: Probably best to just update the files, wait until Pv_opt cycles to idle and post the log, I can check things have been detected correctly. I havent yet tracked down the bug that causes Pv_opt to cycle continuously. *** edit: version is 3.19.0-Beta-16. |
Version on the file links in the last post is now 3.19-0-Beta-17, but otherwise the rest applies. |
Running pv_opt on a HA Green.
Set up eventually!
Solis inverter, Pyton tech batteries.
Using Solax modbus where I have 169 entities.
However, I have a dashboard error and my dashboard never displays a PV Opt Result.
pv_opt.log
main.log
error.log
This is the dashboard:
The text was updated successfully, but these errors were encountered: