nielsfaber / scheduler-component

Custom component for HA that enables the creation of scheduler entities
GNU General Public License v3.0
622 stars 40 forks source link

[issue] not start scheduler after restart (with condition) #299

Closed devildant closed 9 months ago

devildant commented 10 months ago

Hello,

when i restart Home assistant the schedules no longer run, all my schedules have conditions on device trackers, and after a reboot, despite the change in status of the device tracker, the schedules are no longer activated.

to return to normal use I have to deactivate them via the card, and reactivate them (to fix this temporarily, I created an automation which when starting home assistant deactivates the schedules and reactivates them)

ps: thank you for this planner, great job

apas2 commented 9 months ago

hello same here but i dont manage to refresh it could you show your automation please ?

devildant commented 9 months ago

hello same here but i dont manage to refresh it could you show your automation please ?

yes if you want, i juste change switch on/off to run service scheduler

alias: 0001-Schedule-Action-Reload-Chauffage
description: ""
trigger: []
condition: []
action:
  - service: scheduler.run_action
    data:
      entity_id: switch.schedule_chauffage_salon_absent
  - service: scheduler.run_action
    data:
      entity_id: switch.schedule_chauffage_salon_present
  - service: scheduler.run_action
    data:
      entity_id: switch.schedule_chauffage_chambre_absent
  - service: scheduler.run_action
    data:
      entity_id: switch.schedule_chauffage_chambre_present
  - service: scheduler.run_action
    data:
      entity_id: switch.schedule_chauffage_salle_de_bain_absent
  - service: scheduler.run_action
    data:
      entity_id: switch.schedule_chauffage_salle_de_bain_present
mode: single
apas2 commented 9 months ago

Many thank I ll check it out. Missing feature 🥺

Le sam. 28 oct. 2023, 15:22, devildant @.***> a écrit :

hello same here but i dont manage to refresh it could you show your automation please ?

yes if you want, i juste change switch on/off to run service scheduler

alias: 0001-Schedule-Action-Reload-Chauffage description: "" trigger: [] condition: [] action:

  • service: scheduler.run_action data: entity_id: switch.schedule_chauffage_salon_absent
  • service: scheduler.run_action data: entity_id: switch.schedule_chauffage_salon_present
  • service: scheduler.run_action data: entity_id: switch.schedule_chauffage_chambre_absent
  • service: scheduler.run_action data: entity_id: switch.schedule_chauffage_chambre_present
  • service: scheduler.run_action data: entity_id: switch.schedule_chauffage_salle_de_bain_absent
  • service: scheduler.run_action data: entity_id: switch.schedule_chauffage_salle_de_bain_present mode: single

— Reply to this email directly, view it on GitHub https://github.com/nielsfaber/scheduler-component/issues/299#issuecomment-1783808694, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIQMOJBGEK4CU2B6O2D44ILYBUBJFAVCNFSM6AAAAAA6MOZLSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTHAYDQNRZGQ . You are receiving this because you commented.Message ID: @.***>

apas2 commented 9 months ago

thanks it works nearly: on restart HA thermostat is set to his defaut value (9.9) trying to reload does nothing BUT if i make manually thermostat on "none" AND AFTER that run the refresh...it works ! refresh_start

apas2 commented 9 months ago

i think i understand: scheduler uses (in this cases) presets orders, say now should be 'comfort' at start/restart if thermostat is on 'comfort' BUT the temp is changed anyhow > it reads comfort > it is ok > no change (even if target temp is not the official setted in comfort) so reload does not change the value but if set to another preset ('none') and next refresh with a 'call service' IT WORKS... changing temp and get a wrong consigne while a preset mode is selected can exist when changing it mannually or in the preset of the climate. so erasing the preset seems to keep good values at start:

    ....
min_temp: 6
    max_temp: 24
    ac_mode: false
    # reglage par defaut
    # target_temp: 9.9
    # hysteresis
...

in this conditions, may be without additionnal script ? hope it helps

nielsfaber commented 9 months ago

I don’t agree with the bug that is reported here. Restarting HA should not cause your climate or device tracker entities to lose their prior state. Hence there should not be any action required by scheduler upon restart.

apas2 commented 9 months ago

sorry it seems to happen really (at least when defaut temp is set INTO climade def): refresh_start_comment