Merci beaucoup je vais essayer ça ce soir !
Voilà j’ai remis la main sur un backup et un exemple de config shedule_state. Depuis l’utilisation de la carte j’ai optimisé un peu la complexité maisl’idée est là quand même.
A noter que ça utilise les ancres yaml afin d’éviter de réécrire plein de fois la même chose
- platform: schedule_state
name: Consigne SdBH
refresh: &label_refresh_consigne "0:05:00"
default_state: &label_state_defauteco "{{ states('input_number.consigne_eco') }}"
extra_attributes:
unit_of_measurement: "°C"
events:
#semaine
- start: "06:30"
end: &label_sdbmaxend1_week "9:30"
state: &label_state_sdb "{{ states('input_number.consigne_sdb') }}"
condition:
- &label_cond_joursemaine
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- start: *label_sdbmaxend1_week
end: "11:00"
state: &label_state_confort "{{ states('input_number.consigne_confort') }}"
condition:
- *label_cond_joursemaine
#samedi
- start: &label_sdbmaxend1_sat "7:30"
end: "10:30"
state: *label_state_sdb
condition:
- &label_cond_samedi
condition: time
weekday: sat
- start: *label_sdbmaxend1_sat
end: "11:30"
state: *label_state_confort
condition:
- *label_cond_samedi
#dimanche
- start: &label_sdbmaxend1_sun "8:00"
end: "11:00"
state: *label_state_sdb
condition:
- &label_cond_dimanche
condition: time
weekday: sun
- start: *label_sdbmaxend1_sun
end: "12:00"
state: *label_state_confort
condition:
- *label_cond_dimanche
#vendredi samedi dimanche
- start: "19:30"
end: "21:30"
state: *label_state_sdb
condition:
- condition: time
weekday:
- fri
- sat
- sun
#absences
- &label_evt_abs
state: &label_state_defautabs "{{ states('input_number.consigne_absence') }}"
condition:
- &label_cond_retour_above24
condition: numeric_state
entity_id: sensor.duree_avant_retour
above: 24
#eté
- &label_evt_ete
state: "{{ state_attr('input_number.consigne_sdb','max') }}"
condition:
- &label_cond_chauffage_off
condition: state
entity_id: switch.activation_chauffage
state: "off"
########################################
- platform: schedule_state
name: Consigne SdBB
refresh: *label_refresh_consigne
default_state: *label_state_defautabs
extra_attributes:
unit_of_measurement: "°C"
events:
- state: "{{ states('sensor.consigne_sdbh') }}"
condition:
- *label_cond_invites_on
#Absence et été
- *label_evt_abs
- *label_evt_ete
########################################
- platform: schedule_state
name: Consigne RDC
refresh: *label_refresh_consigne
default_state: *label_state_defauteco
allow_wrap: true
extra_attributes:
unit_of_measurement: "°C"
events:
#semaine
- start: "07:00"
end: &label_step_rdcweek1 "09:00"
state: *label_state_confort
condition:
- *label_cond_joursemaine
- start: *label_step_rdcweek1
end: &label_periode_travail_retour "17:30"
state: &label_state_confort_macherie >-
{% if is_state('input_number.boost_chauffage','active') %}
{{ states('input_number.consigne_sdb') }}
{% elif is_state('calendar.macherie','on') %}
{{ states('input_number.consigne_confort') |float(0) + states('input_number.consigne_macherie')|float(0) }}
{% else %}
{{ states('input_number.consigne_confort') }}
{% endif %}
condition:
- *label_cond_joursemaine
- &label_cond_presence
condition: or
conditions:
- *label_cond_jourpresence
- &label_cond_menage_on
condition: state
entity_id: calendar.menage
state: "on"
- &label_cond_occupants_above
condition: numeric_state
entity_id: zone.home
above: "0.5"
- start: *label_periode_travail_retour
end: "22:00"
state: *label_state_confort_macherie
condition:
- *label_cond_joursemaine
- *label_cond_retour_below24
- &label_cond_audodo_off
condition: state
entity_id: input_boolean.au_dodo
state: "off"
#samedi
- start: "08:00"
end: "23:30"
state: *label_state_confort_macherie
condition:
- *label_cond_audodo_off
- *label_cond_samedi
#dimanche
- start: "08:30"
end: "23:00"
state: *label_state_confort_macherie
condition:
- *label_cond_audodo_off
- *label_cond_dimanche
#Absence et été
- *label_evt_abs
- *label_evt_ete
########################################
- platform: schedule_state
name: Consigne SaM
refresh: *label_refresh_consigne
default_state: "{{ states('sensor.consigne_rdc') }}"
extra_attributes:
unit_of_measurement: "°C"
over_head: 1
events:
- start: "08:00"
end: "10:00"
state: >-
{{ states('sensor.consigne_rdc')| float(default=0) + state_attr('sensor.consigne_sam','over_head')| float(default=0) }}
condition:
- *label_cond_jourpresence
- condition: state
entity_id: calendar.teletravail
state: "on"
Bonjour,
j’ai cette erreur quelqu’un peut me venir en aide
2025-12-12 15:18:48.791323 ERROR Error: ===== 'schedule_parser' instantiation ===================================
2025-12-12 15:18:48.792188 ERROR Error: AppInstantiationError: Failed to create object for 'schedule_parser'
2025-12-12 15:18:48.796747 ERROR Error: MissingAppClass: schedule_parser does not have a class named 'ScheduleParser'
2025-12-12 15:18:48.797431 ERROR Error: Module path: apps/schedule_parser/__init__.py
2025-12-12 15:18:48.801541 ERROR Error: ===========================================================================
Salut,
Tu as installé le fichier python ? Configuré correctement ? Redémarré HA ?
Oui j’ai tous vérifié 3 fois même reinstaller appdeamon, je ne vois pas d’ou cela viens du tous
As-tu créé un premier schedule_state ? Fonctionne-t-il ?
As-tu bien mis le fichier apps.yaml à jour avec le bon fichier (celui qui contient ton schedule_state) pour appdaemon ?
Là sans plus d’éléments de ta config, je vise au hasard …
mon fichier apps.yaml
---
hello_world:
module: hello
class: HelloWorld
schedule_parser:
module: schedule_parser
class: ScheduleParser
config_file: /homeasistant/configuration.yaml
secrets_file: /homeassistant/secrets.yaml
mon fichier config pour test
- platform: schedule_state
name: "test chauf"
default_state: "eco"
events:
- start: "08:00"
end: "10:00"
state: "confort"
condition:
- condition: time
weekday: [mon, tue, wed, thu, fri]
- start: "18:00"
end: "23:00"
state: "boost"
La config
est bien directement dans ce fichier là configuration.yaml?
Fais voir ton entité sensor.test_chauf depuis les outils dev
oui mais il faut juste ce fichier j’ai mis les deux autres aussi peut etre la mon erreur
uniquement le python, le reste ne sert pas
Là comme ça j’ai l’impression que appdaemon ne le trouve pas
j’ai supprimer les 2 fichiers et plus l’erreur mais une autre
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
Add-on: AppDaemon
Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
Add-on version: 0.17.13
You are running the latest version of this add-on.
System: Home Assistant OS 17.0.rc1 (aarch64 / raspberrypi5-64)
Home Assistant Core: 2025.12.2
Home Assistant Supervisor: 2025.12.3
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
Log level is set to INFO
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-appdaemon: starting
s6-rc: info: service init-appdaemon successfully started
s6-rc: info: service appdaemon: starting
s6-rc: info: service appdaemon successfully started
s6-rc: info: service legacy-services: starting
[17:02:02] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
2025-12-12 17:02:14.331780 INFO AppDaemon: ------------------------------------------------------------
2025-12-12 17:02:14.332311 INFO AppDaemon: AppDaemon Version 4.5.12 starting
2025-12-12 17:02:14.332548 INFO AppDaemon: ------------------------------------------------------------
2025-12-12 17:02:14.332747 INFO AppDaemon: Python version is 3.12.12
2025-12-12 17:02:14.333019 INFO AppDaemon: Configuration read from: /config/appdaemon.yaml
2025-12-12 17:02:14.334422 INFO AppDaemon: Using /config/apps as app_dir
2025-12-12 17:02:14.337366 INFO AppDaemon: Loading built-in plugin 'HASS' using 'HassPlugin' from 'appdaemon.plugins.hass.hassplugin'
2025-12-12 17:02:14.338208 INFO HASS: HASS Plugin initialization complete
2025-12-12 17:02:14.338836 INFO AppDaemon: Initializing HTTP
2025-12-12 17:02:14.339872 INFO AppDaemon: Using 'ws' for event stream
2025-12-12 17:02:14.345516 INFO AppDaemon: Starting API
2025-12-12 17:02:14.349823 INFO AppDaemon: Starting Admin Interface
2025-12-12 17:02:14.350570 INFO AppDaemon: Starting Dashboards
2025-12-12 17:02:14.359692 INFO AppDaemon: Scheduler running in realtime
2025-12-12 17:02:14.363672 INFO AppDaemon: Starting apps with 2 worker threads. Apps will all be assigned threads and pinned to them.
2025-12-12 17:02:14.380830 INFO AppDaemon: Running on port 5050
2025-12-12 17:02:14.383122 INFO AppDaemon: Waiting for plugins to be ready
2025-12-12 17:02:14.399134 INFO HASS: Connected to Home Assistant 2025.12.2 with aiohttp websocket
2025-12-12 17:02:14.404902 INFO HASS: Authenticated to Home Assistant 2025.12.2
2025-12-12 17:02:14.411032 INFO HASS: Waiting for Home Assistant to start
2025-12-12 17:02:14.428209 INFO AppDaemon: All plugins ready
2025-12-12 17:02:14.582479 INFO HASS: Completed initialization in 227ms
2025-12-12 17:02:14.664097 INFO AppDaemon: Starting apps: ['hello_world', 'schedule_parser']
2025-12-12 17:02:14.681303 INFO AppDaemon: Calling initialize() for hello_world
2025-12-12 17:02:14.792285 INFO hello_world: Hello from AppDaemon
2025-12-12 17:02:14.794849 INFO hello_world: You are now ready to run Apps!
2025-12-12 17:02:14.799433 INFO AppDaemon: Calling initialize() for schedule_parser
2025-12-12 17:02:14.802797 INFO schedule_parser: Schedule Parser - Initialization...
2025-12-12 17:02:14.810986 ERROR schedule_parser: Configuration file not found: /homeasistant/configuration.yaml
2025-12-12 17:02:14.810986 ERROR schedule_parser: Configuration file not found: /homeasistant/configuration.yaml
Tu es certain ? Tu fais des includes ?
Tu as une copie d’écran du fichier et son contenu ?
Vu, il manque des lettres homeasSistant, bon ceci dit, ça sera pas suffisant
2025-12-12 17:51:38.267795 INFO schedule_parser: Starting parsing of /homeassistant/configuration.yaml...
2025-12-12 17:51:38.282348 ERROR schedule_parser: ===== ScheduleParser.parse_schedules for schedule_parser ================
2025-12-12 17:51:38.283746 ERROR schedule_parser: SchedulerCallbackFail: Scheduled callback failed for app 'schedule_parser'
2025-12-12 17:51:38.283996 ERROR schedule_parser: kwargs: {
2025-12-12 17:51:38.284103 ERROR schedule_parser: "__thread_id": "thread-1"
2025-12-12 17:51:38.284195 ERROR schedule_parser: }
2025-12-12 17:51:38.285741 ERROR schedule_parser: ValueError: automations.yaml is not a valid yaml file
2025-12-12 17:51:38.287425 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/appdaemon/threads.py", line 1092, in safe_callback
2025-12-12 17:51:38.288431 ERROR schedule_parser: funcref()
2025-12-12 17:51:38.288673 ERROR schedule_parser: File "/config/apps/schedule_parser/schedule_parser.py", line 70, in parse_schedules
2025-12-12 17:51:38.289463 ERROR schedule_parser: config = yaml.safe_load(raw_config) or {}
2025-12-12 17:51:38.289571 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.289654 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/__init__.py", line 125, in safe_load
2025-12-12 17:51:38.289731 ERROR schedule_parser: return load(stream, SafeLoader)
2025-12-12 17:51:38.289806 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.289881 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/__init__.py", line 81, in load
2025-12-12 17:51:38.289954 ERROR schedule_parser: return loader.get_single_data()
2025-12-12 17:51:38.290025 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.290099 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 51, in get_single_data
2025-12-12 17:51:38.290172 ERROR schedule_parser: return self.construct_document(node)
2025-12-12 17:51:38.290250 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.290324 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 60, in construct_document
2025-12-12 17:51:38.290607 ERROR schedule_parser: for dummy in generator:
2025-12-12 17:51:38.290807 ERROR schedule_parser: ^^^^^^^^^
2025-12-12 17:51:38.291006 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 413, in construct_yaml_map
2025-12-12 17:51:38.291217 ERROR schedule_parser: value = self.construct_mapping(node)
2025-12-12 17:51:38.291470 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.291698 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 218, in construct_mapping
2025-12-12 17:51:38.291915 ERROR schedule_parser: return super().construct_mapping(node, deep=deep)
2025-12-12 17:51:38.292268 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.292524 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 143, in construct_mapping
2025-12-12 17:51:38.292668 ERROR schedule_parser: value = self.construct_object(value_node, deep=deep)
2025-12-12 17:51:38.293427 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.293559 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 100, in construct_object
2025-12-12 17:51:38.293639 ERROR schedule_parser: data = constructor(self, node)
2025-12-12 17:51:38.293713 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:51:38.293786 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 995, in _include_yaml
2025-12-12 17:51:38.293859 ERROR schedule_parser: raise ValueError("{} is not a valid yaml file".format(filename))
2025-12-12 17:51:38.293935 ERROR schedule_parser: ===========================================================================
2025-12-12 17:52:28.269888 INFO schedule_parser: Starting parsing of /homeassistant/configuration.yaml...
2025-12-12 17:52:28.282849 ERROR schedule_parser: ===== ScheduleParser.parse_schedules for schedule_parser ================
2025-12-12 17:52:28.283175 ERROR schedule_parser: SchedulerCallbackFail: Scheduled callback failed for app 'schedule_parser'
2025-12-12 17:52:28.283460 ERROR schedule_parser: kwargs: {
2025-12-12 17:52:28.283617 ERROR schedule_parser: "__thread_id": "thread-1"
2025-12-12 17:52:28.283772 ERROR schedule_parser: }
2025-12-12 17:52:28.284176 ERROR schedule_parser: ValueError: automations.yaml is not a valid yaml file
2025-12-12 17:52:28.285096 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/appdaemon/threads.py", line 1092, in safe_callback
2025-12-12 17:52:28.285998 ERROR schedule_parser: funcref()
2025-12-12 17:52:28.286177 ERROR schedule_parser: File "/config/apps/schedule_parser/schedule_parser.py", line 70, in parse_schedules
2025-12-12 17:52:28.286349 ERROR schedule_parser: config = yaml.safe_load(raw_config) or {}
2025-12-12 17:52:28.286592 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.286797 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/__init__.py", line 125, in safe_load
2025-12-12 17:52:28.286998 ERROR schedule_parser: return load(stream, SafeLoader)
2025-12-12 17:52:28.287202 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.288397 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/__init__.py", line 81, in load
2025-12-12 17:52:28.288528 ERROR schedule_parser: return loader.get_single_data()
2025-12-12 17:52:28.288607 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.288685 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 51, in get_single_data
2025-12-12 17:52:28.288761 ERROR schedule_parser: return self.construct_document(node)
2025-12-12 17:52:28.288835 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.288909 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 60, in construct_document
2025-12-12 17:52:28.288981 ERROR schedule_parser: for dummy in generator:
2025-12-12 17:52:28.289053 ERROR schedule_parser: ^^^^^^^^^
2025-12-12 17:52:28.289125 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 413, in construct_yaml_map
2025-12-12 17:52:28.289196 ERROR schedule_parser: value = self.construct_mapping(node)
2025-12-12 17:52:28.289268 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.289454 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 218, in construct_mapping
2025-12-12 17:52:28.289589 ERROR schedule_parser: return super().construct_mapping(node, deep=deep)
2025-12-12 17:52:28.289730 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.289876 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 143, in construct_mapping
2025-12-12 17:52:28.290020 ERROR schedule_parser: value = self.construct_object(value_node, deep=deep)
2025-12-12 17:52:28.290163 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.290309 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/yaml/constructor.py", line 100, in construct_object
2025-12-12 17:52:28.290518 ERROR schedule_parser: data = constructor(self, node)
2025-12-12 17:52:28.291365 ERROR schedule_parser: ^^^^^^^^^^^^^^^^^^^^^^^
2025-12-12 17:52:28.291521 ERROR schedule_parser: File "/usr/lib/python3.12/site-packages/appdaemon/utils.py", line 995, in _include_yaml
2025-12-12 17:52:28.291603 ERROR schedule_parser: raise ValueError("{} is not a valid yaml file".format(filename))
2025-12-12 17:52:28.291682 ERROR schedule_parser: ===========================================================================
Bien vu l’erreur viens de la doc
J’ai poussé une nouvelle version du python qui doit marcher dans ton cas (avec des insultes dans les logs)
2025-12-12 17:58:03.507928 WARNING schedule_parser: Error loading global YAML (likely due to !include/secrets): automations.yaml is not a valid yaml file. Attempting extraction of sensor section...
2025-12-12 17:58:03.512899 ERROR schedule_parser: Sensor block #6 unreadable, skipped: while parsing a block mapping
in "<unicode string>", line 1, column 1:
sensor:
^
expected <block end>, but found '<block mapping start>'
in "<unicode string>", line 4, column 5:
sensor:
^
2025-12-12 17:58:03.516001 ERROR schedule_parser: Sensor block #10 unreadable, skipped: while parsing a block mapping
in "<unicode string>", line 1, column 1:
sensor:
^
expected <block end>, but found '<block mapping start>'
in "<unicode string>", line 4, column 5:
sensor:
^
2025-12-12 17:58:03.542411 INFO schedule_parser: Sensor 'sensor.schedule_test_chauf': 7 events - Unit: ''
2025-12-12 17:58:03.543507 INFO schedule_parser: Parsing completed: 1/1 sensors processed successfully
2025-12-12 17:58:53.500237 INFO schedule_parser: Starting parsing of /homeassistant/configuration.yaml...
2025-12-12 17:58:53.516226 WARNING schedule_parser: Error loading global YAML (likely due to !include/secrets): automations.yaml is not a valid yaml file. Attempting extraction of sensor section...
2025-12-12 17:58:53.522195 ERROR schedule_parser: Sensor block #6 unreadable, skipped: while parsing a block mapping
in "<unicode string>", line 1, column 1:
sensor:
^
expected <block end>, but found '<block mapping start>'
in "<unicode string>", line 4, column 5:
sensor:
^
2025-12-12 17:58:53.526211 ERROR schedule_parser: Sensor block #10 unreadable, skipped: while parsing a block mapping
in "<unicode string>", line 1, column 1:
sensor:
^
expected <block end>, but found '<block mapping start>'
in "<unicode string>", line 4, column 5:
sensor:
^
2025-12-12 17:58:53.549302 INFO schedule_parser: Sensor 'sensor.schedule_test_chauf': 7 events - Unit: ''
2025-12-12 17:58:53.550601 INFO schedule_parser: Parsing completed: 1/1 sensors processed successfully
et doc corrigée aussi
Parsing plus propre également, version dispo schedule-state-card/apps/schedule_parser/schedule_parser.py at main · Pulpyyyy/schedule-state-card · GitHub



