Gnaget2 / Car-Heater-Package

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

check every hour instead of just 02:00 #17

Open pellle87 opened 2 years ago

pellle87 commented 2 years ago

So current code says:

# activates the automations that will trigger the heater depending on temp if the function is activated
  - alias: "heater enabled"
    initial_state: true
    trigger:
      platform: time
      at: 02:00
    condition:
       - condition: state
         entity_id: input_boolean.heaterstatus
         state: 'on'
    action:
      service: homeassistant.turn_on
      entity_id: automation.heater_minus_20, automation.heater_minus_10, automation.heater_plus_1, automation.heater_plus_5

Wouldnt it be possible to change it like this:

# activates the automations that will trigger the heater depending on temp if the function is activated
  - alias: "heater enabled"
    initial_state: true
    trigger:
      platform: time_pattern
      Hours: '/1'
    condition:
       - condition: state
         entity_id: input_boolean.heaterstatus
         state: 'on'
    action:
      service: homeassistant.turn_on
      entity_id: automation.heater_minus_20, automation.heater_minus_10, automation.heater_plus_1, automation.heater_plus_5

So that it checks every hour? i would want that because usally i got heater set on 07:30 and then i go and drop off kids - go home work and has set the heater time to 16:00 but the heater hasnt started (obviously) Or am i thinking wrong here?

Gnaget2 commented 2 years ago

The triggers are checking every 5 min

the above functions is “turning on” the triggers at 02:00 just so that they don’t use resources 24/7

if you want to you can change so they never turn off by removing that part. on row 205 and 206. 157 and 158, 108 and 109, 59 and 60

rowing above rows will have the automations be on all the time checking the departure time