Using Target Rate sensors #284
Replies: 9 comments 12 replies
-
Hi there. You just need your automation to look at your target rate sensor and look at the state. When the state is on, this will be the discovered cheap periods. This way you don't need to look at extracting the times. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply @BottlecapDave. I see now how I can set up an automation with a trigger when the state of my target rate sensor changes to "on". The problem is that I want my batteries to charge during the selected cheap periods by connecting to my LuxPower inverter and changing the charge settings there. I don't have any way that I can just switch the charge "on" and "off", which would be ideal with this trigger. I need to set the start and end times for the charge. I guess maybe I could just set the start time to the current time (although I'm not sure how I do that?) so charging would start immediately and the end time to an hour later, then when the sensor state changes to "off" I can change the times to stop the charging. Guess it might work... Do you know of a simpler way? |
Beta Was this translation helpful? Give feedback.
-
OK, this is what I've come up with. To start charge:
And the to stop charge:
The actions work fine as I can test them by running that part of the automation. Not sure how / if I can test the triggers or conditions. Does it look like they will do the job? Reluctant to test tonight as there is some serious plunge pricing that I don't want to miss! |
Beta Was this translation helpful? Give feedback.
-
No, I was just using this:
...when I was getting the error |
Beta Was this translation helpful? Give feedback.
-
Still get the same error with that code.
Do you not get that error with visual editor? For me, I can only get it to be accepted by the editor if I also use "condition" as per my original snippets. The code is just a little bit longer and I think it will do what I want. Will test it tonight. |
Beta Was this translation helpful? Give feedback.
-
Thanks, that is accepted and what comes up in the visual editor after saving the code makes sense also. Running the "on" automation to test toggles the charge enable switch to "on" and running the off automation toggles it to off. I wouldn't have expected running the on automation to change the charge enable to "on" as the conditions for the trigger (cheapest 2 half hour slots between 00:00 and 08:00) are not currently met, but I guess that using "run" to test the automation maybe just runs the actions, regardless of whether the triggers are met? Is there a way to display the state of the entity "binary_sensor.octopus_energy_target_one_hour_intermittent_night_time_charge_between_midnight_and_eight" to check if it is currently on or off? |
Beta Was this translation helpful? Give feedback.
-
@BottlecapDave automation ran smoothly last night, now I can start making things more complicated! Thanks again for your help. |
Beta Was this translation helpful? Give feedback.
-
This is slightly off topic but the in the same area... What I want to do is turn on certain appliances when there is plunge pricing:
This does the job. But the issue is that these appliances will stay on when the rates become positive again. I could write another automation that was basically the same, substituting "below" for "above" and "on" for "off". This would then turn them off when the prices became positive. But it would mean that they would basically always be turned off when prices were above 0 and this automation would over-ride others trying to turn the appliances on. So I want an automation that will only switch off the devices when the rate changes from negative to positive - not just whenever it is positive. I've had a few goes with repeat statements with no luck. What is the correct code / routine? A target sensor that just detected when prices were below 0 would work perfectly as that could toggle the switch, but you always seem to have to put intervals / times into the target rate sensors. So I want an automation that will only switch off the devices when the rate changes from negative to positive - not just whenever it is positive. I've had a few goes with repeat statements with no luck. What is the correct code / routine? |
Beta Was this translation helpful? Give feedback.
-
can i ask a question on the same theme what it does expose is timer slots where numeric value can be inserted . is there a way to parse the start and stop times from your target listed in the attributes into another automation to set the charge times say once a day ?. |
Beta Was this translation helpful? Give feedback.
-
Please bear with me, I'm on a steep learning curve just now.
I want to charge my batteries during the cheapest 2 1/2 hours periods between 00:00 and 08:00
Have set up a target rate sensor to check for the 2 cheapest periods. It's working fine as I can see the entity with the correct times chosen in the attributes. I just don't know what syntax to use to put the start and end times into an automation to set my charge start and finish times.
These are the attributes:
Beta Was this translation helpful? Give feedback.
All reactions