fix: check entity availability
This commit is contained in:
@@ -1757,12 +1757,16 @@ action:
|
|||||||
message: "{{ time }}"
|
message: "{{ time }}"
|
||||||
|
|
||||||
##### NSPanel boot init - Humidity #####
|
##### NSPanel boot init - Humidity #####
|
||||||
- delay:
|
- if:
|
||||||
milliseconds: "{{ delay_value }}"
|
- condition: template
|
||||||
- service: "{{ command_text_printf }}"
|
value_template: '{{ humidity is match "sensor." and states(humidity).state != "unavailable" }}'
|
||||||
data:
|
then:
|
||||||
component: home.humidity_state
|
- delay:
|
||||||
message: "{{ states(humidity) |round(0) }}%"
|
milliseconds: "{{ delay_value }}"
|
||||||
|
- service: "{{ command_text_printf }}"
|
||||||
|
data:
|
||||||
|
component: home.humidity_state
|
||||||
|
message: "{{ states(humidity) |round(0) }}%"
|
||||||
|
|
||||||
##### NSPanel boot init - Hotwater #####
|
##### NSPanel boot init - Hotwater #####
|
||||||
- if:
|
- if:
|
||||||
@@ -1784,9 +1788,10 @@ action:
|
|||||||
##### NSPanel boot init - Outdoor Temp #####
|
##### NSPanel boot init - Outdoor Temp #####
|
||||||
- variables:
|
- variables:
|
||||||
outdoor_temp: >-
|
outdoor_temp: >-
|
||||||
{%- if outdoortemp is match "sensor." -%} {{ states(outdoortemp) |round(0) }}
|
{%- if outdoortemp is match "sensor." and states(hotwatertemp).state != "unavailable" -%} {{ states(outdoortemp) |round(0) }}
|
||||||
{%- elif weather == "Default" -%} {{state_attr(ha_weather,"temperature") | round(0)}}
|
{%- elif weather == "Default" and state_attr(ha_weather, "temperature") != None -%} {{state_attr(ha_weather,"temperature") | round(0)}}
|
||||||
{%- elif weather == "AccuWeather" -%} {{state_attr(accuweather_value,"temperature") | round(0)}}
|
{%- elif weather == "AccuWeather" and state_attr(accuweather_value, "temperature") != None -%} {{state_attr(accuweather_value,"temperature") | round(0)}}
|
||||||
|
{%- else -%} 0
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
- delay:
|
- delay:
|
||||||
milliseconds: "{{ delay_value }}"
|
milliseconds: "{{ delay_value }}"
|
||||||
@@ -3094,17 +3099,21 @@ action:
|
|||||||
message: "{{ time }}"
|
message: "{{ time }}"
|
||||||
|
|
||||||
##### NSPanel Humidity #####
|
##### NSPanel Humidity #####
|
||||||
- delay:
|
- if:
|
||||||
milliseconds: "{{ delay_value }}"
|
- condition: template
|
||||||
- service: "{{ command_text_printf }}"
|
value_template: '{{ humidity is match "sensor." and states(humidity).state != "unavailable" }}'
|
||||||
data:
|
then:
|
||||||
component: home.humidity_state
|
- delay:
|
||||||
message: "{{ states(humidity) |round(0) }}%"
|
milliseconds: "{{ delay_value }}"
|
||||||
|
- service: "{{ command_text_printf }}"
|
||||||
|
data:
|
||||||
|
component: home.humidity_state
|
||||||
|
message: "{{ states(humidity) |round(0) }}%"
|
||||||
|
|
||||||
##### NSPanel Hotwater #####
|
##### NSPanel Hotwater #####
|
||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ hotwatertemp is match "sensor." }}'
|
value_template: '{{ hotwatertemp is match "sensor." and states(hotwatertemp).state != "unavailable" }}'
|
||||||
then:
|
then:
|
||||||
- delay:
|
- delay:
|
||||||
milliseconds: "{{ delay_value }}"
|
milliseconds: "{{ delay_value }}"
|
||||||
@@ -3121,9 +3130,10 @@ action:
|
|||||||
##### NSPanel Outdoor Temp #####
|
##### NSPanel Outdoor Temp #####
|
||||||
- variables:
|
- variables:
|
||||||
outdoor_temp: >-
|
outdoor_temp: >-
|
||||||
{%- if outdoortemp is match "sensor." -%} {{ states(outdoortemp) |round(0) }}
|
{%- if outdoortemp is match "sensor." and states(hotwatertemp).state != "unavailable" -%} {{ states(outdoortemp) |round(0) }}
|
||||||
{%- elif weather == "Default" -%} {{state_attr(ha_weather,"temperature") | round(0)}}
|
{%- elif weather == "Default" and state_attr(ha_weather, "temperature") != None -%} {{state_attr(ha_weather,"temperature") | round(0)}}
|
||||||
{%- elif weather == "AccuWeather" -%} {{state_attr(accuweather_value,"temperature") | round(0)}}
|
{%- elif weather == "AccuWeather" and state_attr(accuweather_value, "temperature") != None -%} {{state_attr(accuweather_value,"temperature") | round(0)}}
|
||||||
|
{%- else -%} 0
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
- delay:
|
- delay:
|
||||||
milliseconds: "{{ delay_value }}"
|
milliseconds: "{{ delay_value }}"
|
||||||
@@ -4461,9 +4471,10 @@ action:
|
|||||||
- variables:
|
- variables:
|
||||||
hvac_mode: "{{ states(climate) }}"
|
hvac_mode: "{{ states(climate) }}"
|
||||||
outdoor_temp: >-
|
outdoor_temp: >-
|
||||||
{%- if outdoortemp is match "sensor." -%} {{ states(outdoortemp) |round(0) }}
|
{%- if outdoortemp is match "sensor." and states(hotwatertemp).state != "unavailable" -%} {{ states(outdoortemp) |round(0) }}
|
||||||
{%- elif weather == "Default" -%} {{state_attr(ha_weather,"temperature") | round(0)}}
|
{%- elif weather == "Default" and state_attr(ha_weather, "temperature") != None -%} {{state_attr(ha_weather,"temperature") | round(0)}}
|
||||||
{%- elif weather == "AccuWeather" -%} {{state_attr(accuweather_value,"temperature") | round(0)}}
|
{%- elif weather == "AccuWeather" and state_attr(accuweather_value, "temperature") != None -%} {{state_attr(accuweather_value,"temperature") | round(0)}}
|
||||||
|
{%- else -%} 0
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
heating_state: >-
|
heating_state: >-
|
||||||
{%- if hvac_mode == "off" -%} {{ off_mui }}
|
{%- if hvac_mode == "off" -%} {{ off_mui }}
|
||||||
|
|||||||
Reference in New Issue
Block a user