ottopaulsen / node-red-contrib-power-saver

A Node-RED node to saver money by turning off when the power is most expensive
Other
71 stars 17 forks source link

Suggestion - dynamic "hours on" #123

Closed stenkarlsen closed 1 year ago

stenkarlsen commented 2 years ago

This might already be possible, but i dont know how, so I will assume its not.

I would love to have the possibility to set the hours on by another dynamic value. As I find it difficult to explain how, I will try to explain a use case.

My car tells me that there are 420 minutes left until fully charged today. I therefore want to charge on the 7 cheapest hours. Tomorrow it may say 120 minutes. Then I want to charge the 2 cheapest hours. If this becomes possible, it would also be fantastic to be able to say a maximum of X hours.

I can also imagine that it is possible to use this with the water heater, for those with full control on how long its active without any use, and log the number of showers etc.

ottopaulsen commented 2 years ago

If you know the number of hours you want toe Lowest Price to turn on, you can do this by using dynamic config. Just send the hoursOn value before the period starts.

stenkarlsen commented 2 years ago

Ahh, there it is. I tried it out, but cant get it to work. I only get; "Payload has no data" and "TypeError: Cannot destructure property 'priceData' of 'getPriceData(...)' as it is null."

Do you have any examples on how to use it?

ottopaulsen commented 2 years ago

Please show me the message you are sending to the node, as well as the output on output 3 when you sent prices to the node.

stenkarlsen commented 1 year ago

Everything looks great, but it is the "Just send the hoursOn value before the period starts." that i an not getting. I send a simple expression { "hoursOn": 4} with an inject node atm just to get how this works, but what do you mean when you say "before the period starts"? I figured I could let everything work as it is today, convert my "sensor.id_4_pro_performance_remaining_charging_time" to hours, and replan once I connect my car. Possible?

stenkarlsen commented 1 year ago

Seems I found my answer here: https://github.com/ottopaulsen/node-red-contrib-power-saver/issues/59

Sorry for wasting your time! Your work is awesome!