-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Publish a JSON version of the plan #1288
base: main
Are you sure you want to change the base?
Conversation
The bit I haven't done yet is the split slots (is that where there's a charge and a discharge in the same time slot?) |
Example JSON output:
|
Things I think could be improved:
|
That's brilliant @magicmonkey , very much follows the sort of idea I had for the structured JSON output. A few suggestions:
Would give a way to handle split modes and also the ability to link the limit to the individual modes whereas at the moment the limit is only for one, so if in a 30 minute slot predbat is both charging and discharging, the limit is a bit meaningless
|
Thanks @gcoan , I've implemented some of those suggestions:
I still haven't dug into the splits logic, but I'll have a look at that when I get a chance. |
Also, I missed the actual "publish the entity" bit earlier, I've added that back in now. Oops! |
Updated example of a slot:
|
Great idea :) BTW: The span thing is just to merge multiple rows of the same (e.g. charge or discharge) together for visual purposes. Maybe the JSON can just ignore that? |
Agreed, I think I've removed that logic now. |
Excellent, thanks @magicmonkey be interested to see what @pacemaker82 makes of using this in the Predbat table card Agree about not including the HML, these are really display thresholds so shouldn't be in the JSON. How does the state structure now look with multiple Predbat activities in the same slot? |
I haven't figured that bit out yet (hence the PR still being draft); in the HTML version, the logic is based on the |
... also I don't (yet!) have an export tariff so I'll have to fake the data somehow to get it into a state to test it ... |
Just put a rates_export in apps.yaml https://springfall2008.github.io/batpred/energy-rates/#rate-bands-to-manually-configure-energy-rates e.g. rates_export:
- rate: 15 or rates_export:
- start: "00:00:00"
end: "07:00:00"
rate: 5
- start: "07:00:00"
end: "00:00:00"
rate: 25 If you want something more interesting to look at |
Just a quick note - I've not had a chance yet to look at the last remaining bit of this (the split slots), but I still intend to do that soon (maybe this week), apologies for the radio-silence! |
I've attempted to replicate the "split" logic, although I'm failing to trigger any splits even with various export rate values. As a result, I've not made the JSON represent the split, only the mode label. If I can make a split, then I'll make it into a richer structure. |
How did you get on with this, does it do what you want and should I merge the change? Just wondering if it should go into an attribute under plan_html rather than creating a new entity? |
I've fiddled with various config settings, but I can't get predbat to decide to export at all. I'm trying to avoid this turning into a support thread, so I'll keep playing with settings, there must be something I've set which makes it not want to export... |
I've finally found the setting I was missing! I can now cause the split logic - I'll have a go at confirming the JSON structure. I have no opinion about it being an attribute under plan_html, I'll switch it over to that. |
I've rebased the branch onto
|
This is based on the
publish_html_plan
method, but it makes aplan_json
entity with only the data.