(20/12/2024, 20:56:14)Ives a écrit : Pourrais tu poster ta dernière version de script ?
Moi j'ai ça, mais tu viens de me donner l'idée de me baser sur le TIC uniquement.
Actuellement il faut autant de script que de tarifs (donc 6 ici) parce que je n'arrive pas à passer une variable de la condition à l'action..
Si tu y arrives alors c'est reductible en 1 seul script qui s'executera à chaque changement de TIC du TE (0 à 10) et tous les cas seraient pris automatiquement.
Code :
alias: Tempo Rouge HP
description: ""
triggers:
- at: "06:00:00"
variables:
tariff: Rouge HP
trigger: time
conditions:
- condition: or
conditions:
- condition: state
entity_id: sensor.rte_tempo_prochaine_couleur
state: Rouge
- condition: and
conditions:
- condition: state
entity_id: sensor.rte_tempo_couleur_actuelle
state: Rouge
- condition: state
entity_id: sensor.rte_tempo_prochaine_couleur
state: unavailable
actions:
- target:
entity_id: select.energy_total_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_ecs_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_ecs_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_ecs_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_ecs_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lt_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lt_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lt_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lt_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lumieres_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lumieres_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lumieres_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_lumieres_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_prises_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_prises_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_prises_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_prises_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_groupesfroid_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_groupesfroid_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_groupesfroid_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_groupesfroid_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrocuisine_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrocuisine_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrocuisine_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrocuisine_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrobuanderie_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrobuanderie_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrobuanderie_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_electrobuanderie_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffage_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffage_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffage_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffage_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagevmc_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagevmc_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagevmc_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagevmc_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagesdb_usage_daily
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagesdb_usage_weekly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagesdb_usage_monthly
data:
option: "{{ tariff }}"
action: select.select_option
- target:
entity_id: select.energy_total_chauffagesdb_usage_yearly
data:
option: "{{ tariff }}"
action: select.select_option
- action: input_number.set_value
target:
entity_id: input_number.tarif_actuel_tempo
data:
value: "{{ states('input_number.electricite_general_cout_kwh_rouge_hp') }}"
- action: input_text.set_value
target:
entity_id: input_text.tarif_actuel_tempo_texte
data:
value: "{{ tariff }}"
mode: single