#EV Charging Automation
1 messages · Page 1 of 1 (latest)
holy shit we have a complicated operation going on here
indeed should i just spend a grand on a proper charger might be less hassle
i was hearing about node red but that caused a headache in trying to work out
my inital thought is that this is super complicated and you have somehow written yourself into a corner
ahhh ok, do you have another better way to do what im looking for?
so you have something telling you when you should charge by telegram?
so at the moment im switching the relay on and off manually based on the energy rates and the maximum charge i want on the vehicle as i heard its not sensible to max out the charge on it.
i thought in my lack on knowledge on ha i wonder if i could "automate" this by telling HA i want 90% charge for 9am tomorrow and it look at the rates and switch the relay on and off accordingly
i am sure it can be done
so your working out how much charge you need, which is how many slots, then you work out the cheapest slots between now and deadline. then switch on for them
this btw is a "long running automation" which in general is not recommended. in case something goes wrong and it gets stuck or HA restarts or something.
yes so my prices change every 30 mins and its a 2kwh charger so every 30 mins it should be giving 1kwh into the car
so if i wanted to add 3kwh to the car it would find 30 mins at the cheapest level and start and stop on each one unitl its charge target is reached
best not look at my HA you would be very unhappy im sure ive broken many rules
you may need to compensate for charging efficiency too
yeah that seems more right
so, a suggestion for a simple solution whilst working on a better one would be to just switch the charger on when its below X threshold and off when its above y threshold (or z hours to deadline)
i had that through bottlecapdave the issue is the percentages
it would charge to 100% everyday which i dont always want or need
something like this?
can you see the cars battery state?
yep
if you can see your car battery state then just dont switch on when its above a threshold
can add a condition that the switch on needs car to be <80% for example
but is their a way to simply vary that threshold? as an example mon-fri im driving around town that sort of thing just want 40/50% charge and then if im going for a road trip on a saturday friday evening i want it to charge to 100%. thats why i was looking at the telegram side of things
yeah you could make it a helper then just add that as a slider on your dashboard
i am so novice to ha didnt even know that was a thing!! the other check is to make sure its charging im guessing that can just be a check after 3 mins or so and if not cycle relay
alot of cars have the ability to set a limit too?
it does but its awful and unreliable, they have already had a few customers return vehicles due to its buggyness
something like this to make and set
Yes!!!!
then you can make a condition with template something like this
{{ states('sensor.car_current_battery')|float < states('input_number.car_charging_limit')|flaot }}
so if battery is less than limit the condition returns true
got that, how do i get it onto dashboard?
entity: input_number.ev_charge_limit
features_position: bottom
vertical: true
hide_state: false
show_entity_picture: false
features:
- style: slider
type: numeric-input
grid_options:
columns: 12
rows: 3
make a custom card and paste that in
you can adjust as needed but it gives you a starting point
thank you so much, ok so one step closer
i now have my current script:
alias: EV-Charge
description: ""
triggers:
- trigger: state
entity_id:- binary_sensor.octopus_energy_target_ev_charge
from: "off"
to: "on"
conditions:
- binary_sensor.octopus_energy_target_ev_charge
- condition: numeric_state
entity_id: sensor.octopus_energy_electricity_18k0173475_2400000037705_current_rate
below: 0.3
actions: - action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.driveway_power_switch - wait_for_trigger:
- trigger: state
entity_id:- binary_sensor.octopus_energy_target_ev_charge
from: "on"
to: "off"
- binary_sensor.octopus_energy_target_ev_charge
- trigger: state
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.driveway_power_switch
mode: single
need to modify that i guess
use triple grave around code
To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
for long stuff that becomes a file its fine but for shorter stuff we need formatting as code to be readable in discord
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.octopus_energy_target_ev_charge
from: "off"
to: "on"
conditions:
- condition: numeric_state
entity_id: sensor.octopus_energy_electricity_18k0173475_2400000037705_current_rate
below: 0.3
actions:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.driveway_power_switch
- wait_for_trigger:
- trigger: state
entity_id:
- binary_sensor.octopus_energy_target_ev_charge
from: "on"
to: "off"
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.driveway_power_switch
mode: single
so sorry!
no worries
ok so we want to make 2 changes
first you want to add the condition so this doesnt run when its above the charge limit
as demonstated above but with the right entity names
would that be within my wait for trigger?
no on the main automation
we need to add stuff to the wait for too
but 1 thing at a time
the change to the main automation condition means that if the car is above the limit this automation does not run therefore it doesnt turn on the switch
sensor.battery is under the renault integration and under the car name Baby Blue
cool doesnt matter what integration its under as long as you have the right entity name
once you have that condition in then within the wait for trigger you want to add a 2nd trigger that turns it off once its hit the limit
so would be numeric entity change and entity x is above entity y (the limit entity)
this means if its over the limit the switch doesnt come on and if it hits the limit whilst its switched on then it switches off
hopefully that makes sense?
sounds good sort of makes sense 🙂
so under and if numeric state {{ states('sensor.battery')|float < states('input_number.EV_Charge_Limit')|flaot }}
moment
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.octopus_energy_target_ev_charge
from: "off"
to: "on"
conditions:
- condition: numeric_state
entity_id: sensor.octopus_energy_electricity_18k0173475_2400000037705_current_rate
below: 0.3
- condition: template
value_template: " {{ states('sensor.battery')|float < states('input_number.EV_Charge_Limit')|flaot }}"
actions:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.driveway_power_switch
- wait_for_trigger:
- trigger: state
entity_id:
- binary_sensor.octopus_energy_target_ev_charge
from: "on"
to: "off"
- trigger: numeric_state
entity_id:
- sensor.battery
above: input_number.EV_Charge_Limit
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.driveway_power_switch
mode: single
like this
wow thank you so much! 🙂 ok so last little thing, could i set the percentage slider from a QR code or NFC tag, thinking of wife approval factor
have you used tag automations before?
make an automation that triggers off the tag then use the input_number.set_value action to set
thats number.set
you want input_number.set
yaml of the action would be
action: input_number.set_value
metadata: {}
data:
value: 80
target:
entity_id: input_number.EV_Charge_Limit
thank you! you got paypal happy to pay for your time this evening its been most helpful!
no thank you, consider subbbing to ha cloud to support the project though
thank you again! i think i need to find the idiots guide to ha
once you learn how things work and what all the tools are and how they fit together it will get easier
if you do decide to get a smarter charger i recomend looking at hypervolt btw. theres a HACS integration that works nicely and it works very well with plenty of options. it also supports some of the smart tarrif stuff.
wicked great advise thank you! my problem is its a cheap car and used for local journeys trying to see if i can survive with the granny charger atm