I tried both, but I don’t recall that I got Gnaget’s to work.
Comming from the old plain 433Mhz Nexa environment HA is a challenge. The heater script that I had in Nexahome (aka Easyhome by Henrik Kjell) was in many ways far more advanced than anything I have seen in HA. For this to work in HA I thinkt that we need a modified Generic Thermostat integration. The GT has some of the fundamentals, as monitoring outdoor temp and controlling a switch, but for the engine heater we need a timer rather than the indoor target temp as the agent for turning it of.
Just trying to handle it by a plain automation will not work.
On the requirement list:
be able to set a number of standard departure times weekdays and hh:mm (morning to office, afternoon for various activites etc)
random/ad hoc departure, both as delta (in 1h, in 2h) or as hh:mm with a choice of run-time
This is great!! Så jäkla grymt!
I will have to implement this to my car today also the cold have come to Sweden again
One thing that I have is i do have a xiaomi temp sensor in my car so could there be a cut off if temp is more than a set max temp and if there is no temp from the sensor it falls back to the calculation?
possibility to create scheduled departures for regular activities (like various evening activities - morning departures gone with Covid19)
possibility to have at least one ad-hoc upcomming planned departure, like shopping @ 14:30 today
possibility to start now (and leave any time within 2hrs)
I have not yet implemented the dynamic runtime on the ad-hoc time based setting, but that should only require an input_number helper, currently I will rely on the default 2hr max automation.
Some kind of countdown timer would also be nice…
The concept will be put to test as the chill closes in, but for the last week or so it has got milder rather than colder so testing conditions are not going my way :-/
It’s for now based on a wemos D1 mini sending interior temps via wifi/mqtt, every 2 minutes.
I have ordered a sonos S55 for car heater outlet, and these solutions look quite nice… However, i would also like an auto turn off, for example if i want to use the car on a sunday afternoon i would want to turn heater on, and then the outlet would be active for maybe three hours. Or perhaps three hours OR until car leaves, whatever comes first?
I also wonder how these templates handle departure time, do they turn off at set departure time or the classic 30 minutes later?
Most solutions found here will turn off heater at intended departuer time.
I modified the solution that I chose to not turn off the heater, but selected to have a independet automation that monitors the car heter switch - if/when it turns “on”, then kick in, but delay for whatever period you prefer, in my case 2h, and then turn off everything.
From my point of view I could not see the benefit of turning off the heater as part of the start script, I mean, what is the problem with having power on in the outlet as long as the car is gone?
I do this at 22:00 every evening, and have it’s SUPER USEFUL. I have three checks that go every night. First run all year round and that is if the garage door is closed or not. If temp is below 5 outside it also checks if heater is plugged in and the car parked in the garage.I turn the plug on, wait 1sec, check load and then turn off. If load was < 5 I send notification to myself. All three saved me a lot last winter - probably will the one that is coming as well.
Getting unknown with Calculated start time. So when I paste the template into HA template for testing. I get this error. UndefinedError: ‘str object’ has no attribute ‘strftime’ . I have tested each of the sensors that are used to calculate this time and all of those are working. Any ideas would be great.
- platform: template
sensors:
car_heater_start_time:
friendly_name: 'Calculated start time'
icon_template: mdi:clock
value_template: >
{% if states.sensor.car_heater_departure_time.state is defined %}
{% if ((states('sensor.car_heater_run_time')|float) > 0) %}
{{ strptime(((as_timestamp('1970-01-01 ' ~ states('sensor.car_heater_departure_time')) - (states('sensor.car_heater_run_time')|float *3600))|timestamp_local), '%Y-%m-%d %H:%M:%S').strftime("%H:%M") }}
{%else%}
Never
{%endif%}
{% else %}
waiting for sensors
{% endif%}