-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
иногда значания недоступны #13
Comments
добавил wait_template посмотрю как будет работать sequence:
- alias: electricity day
sequence:
- wait_template: "{{ has_value('sensor.pesc_electricity_day') }}"
- if:
- condition: template
value_template: >-
{{ states('input_text.electricity_day')|int >=
(states('sensor.pesc_electricity_day')|int -1) and
states('input_text.electricity_day')|int <=
(states('sensor.pesc_electricity_day')|int +200) }}
then:
- service: pesc.update_value
target:
entity_id: sensor.pesc_electricity_day
data:
value: "{{ states( 'input_text.electricity_day' ) | int }}"
- alias: electricity night
sequence:
- wait_template: "{{ has_value('sensor.pesc_electricity_night') }}"
- if:
- condition: template
value_template: >-
{{ states('input_text.electricity_night')|int >=
(states('sensor.pesc_electricity_night')|int -1) and
states('input_text.electricity_night')|int <=
(states('sensor.pesc_electricity_night')|int +100) }}
then:
- service: pesc.update_value
target:
entity_id: sensor.pesc_electricity_night
data:
value: "{{ states( 'input_text.electricity_night' ) | int }}"
- alias: water cold
sequence:
- wait_template: "{{ has_value('sensor.pesc_water_cold') }}"
- if:
- condition: template
value_template: >-
{{ states('input_text.water_cold')|int >=
(states('sensor.pesc_water_cold')|int -1) and
states('input_text.water_cold')|int <=
(states('sensor.pesc_water_cold')|int +5) }}
then:
- service: pesc.update_value
target:
entity_id: sensor.pesc_water_cold
data:
value: "{{ states( 'input_text.water_cold' ) | int }}"
- alias: water hot
sequence:
- wait_template: "{{ has_value('sensor.pesc_water_hot') }}"
- if:
- condition: template
value_template: >-
{{ states('input_text.water_hot')|int >=
(states('sensor.pesc_water_hot')|int -1) and
states('input_text.water_hot')|int <=
(states('sensor.pesc_water_hot')|int +5) }}
then:
- service: pesc.update_value
target:
entity_id: sensor.pesc_water_hot
data:
value: "{{ states('input_text.water_hot')|int }}" |
dentra
added a commit
that referenced
this issue
Jul 25, 2024
в мастере |
по поводу того что возможно иногда некоторые сенсоры недоступны, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
я использую следующий скрипт и он иногда фэйлится:
Error: In 'template' condition: ValueError: Template error: int got invalid input 'unavailable' when rendering template '{{ states('input_text.electricity_night')|int >= (states('sensor.pesc_electricity_night')|int -1) and states('input_text.electricity_night')|int <= (states('sensor.pesc_electricity_night')|int +100) }}' but no default was specified
первый блок отрабатывает всегда, а вот последующие иногда фэйлятся
дело точно не в
input_text.*
думаю если вставить задержку между блоками будет работать стабильнее
вобще хотелось бы все показания одной транзакцией отправлять
The text was updated successfully, but these errors were encountered: