I am trying to create a node red flow on Home assistant that will do the following
Check battery % of car
Check current electricity cost
Based on the above 2 turn on the car charger
Then switch off the car charger if current cost or batter % goes out of a predefined range
Somthing like the following
If battery% < 20 and current cost < 0.15 turn on charger, if either of those become not turn switch off charger
If battery% >=20 & 0<=50 and current cost <=0.05 turn on charger, if either of those become not turn switch off charger
If current cost <0 turn on charger, if above 0 turn off charger
I think I can get the battery % out using poll state & use switch node to define what to do when the battery % is a certain amount but I'm not sure how to combine 2 different if statements for different entities.
I also can't work out how to switch a device on/off like in home assistant, can anyone shed some light?