Gnaget2 / Car-Heater-Package

Control your car engine heater with Home Assistant
10 stars 7 forks source link

Starting the wrong time? #2

Closed Alealvag closed 5 years ago

Alealvag commented 5 years ago

I have changed the temperature on one of the automations to below 12. And it is supposed to run for 2h before my leaving time.

I have set the leaving time to 7:00 and I can see that the automation "heater_plus_12" starts but it starts at 4:00 not at 5:00 like I thought it would.

My config part for this automation looks like this:

`entity_id: sensor.netatmo_entre_temperature below: '12'

What am I doing wrong or not understanding?

Alealvag commented 5 years ago

image

Gnaget2 commented 5 years ago

Yes. This is because of a problem/issue running Hassio on a rpi3. For some reason I don’t know you get GMT time and not +1 as the system otherwise use (in my case) so had to change the value.

So if running a system where you get proper time just add 3600 on all calculations

Alealvag commented 5 years ago

Yes, I figured that out too :)

If I test this line it gives me UTC time + whatever seconds I add. So it isn't using my local time, it is actually 2h wrong for me at least.

'{{ ((now().strftime("%s") | int + xxx ) | timestamp_custom("%H:%M")) ==

So I changed the first part to this and it gives me correct local time + whatever seconds i add :)

'{{ ((as_timestamp(now())|int + xxx)|timestamp_custom("%H:%M")) ==

I have only tested one of the automations but it ran fine on friday morning.

Regards

Andreas