Skip to content
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

adding highest price schedule? or help to turn over low to high? #203

Open
Tijntert opened this issue May 17, 2024 · 3 comments
Open

adding highest price schedule? or help to turn over low to high? #203

Tijntert opened this issue May 17, 2024 · 3 comments

Comments

@Tijntert
Copy link

Tijntert commented May 17, 2024

Hey,
I was wondering if a highest price schedule, or even better picking several highest separate hours is coming?

Thx

@CirruZZ
Copy link

CirruZZ commented May 19, 2024

Check the documentation here
https://powersaver.no/nodes/ps-strategy-lowest-price.html#highest-price

@Tijntert
Copy link
Author

Check the documentation here https://powersaver.no/nodes/ps-strategy-lowest-price.html#highest-price

Super! Thx...
Searched and searched, but didn't find anything...

:D

@Jalle19
Copy link

Jalle19 commented Jun 28, 2024

If anyone needs an actual schedule with the highest prices (i.e. inverted output values are not enough) then you can pass the schedule to a function node with this:

msg.payload.schedule = msg.payload.schedule.map((s) => {
    s.value = !s.value;
    return s;
});

msg.payload.hours = msg.payload.hours.map((h) => {
    h.onOff = !h.onOff;
    return h;
});

return msg;

and then connect that node to a schedule merger node to create a new schedule with inverted values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants