Closed Perfect-Web closed 3 months ago
hi, can you please post a screenshot of you weather entity from the developer tools section?
from the stacktrace it looks as if the configured weather entity does not expose state
.
entities:
- weather.forecast_home
- var.protected_senzor_temperatura_exterior
card:
type: custom:clock-weather-card
entity: weather.forecast_home
weather_icon_type: fill
locale: ro-RO
temperature_sensor_template: >-
{{ redacted }}
any updates on this ?
i was not yet able to reproduce the problem. looking at the code it looks as if the 'hass' object within the card is not being set. the 'hass' object is normally set by the host (home-assistant). https://developers.home-assistant.io/docs/frontend/data/
do you have a setup / level of customization which could explain this scenario?
@pkissling it appears to happen when i add it into a stack-in-card
type: custom:stack-in-card
mode: vertical
cards:
- type: custom:card-templater
entities:
- weather.forecast_home
- var.protected_senzor_temperatura_exterior
card:
type: custom:clock-weather-card
entity: weather.forecast_home
weather_icon_type: fill
show_humidity: true
humidity_sensor_template: ....
i was able to reproduce the problem using card:custom-templater
. it appears as if the card does some manipulation to the hass
object (replacing templated values), which causes the hass
object to be undefined
for some time during initial rendering of clock-weather-card.
i'm afraid, there is nothing i can do from clock-weather-card
side expect asking you to create an issue in the custom-templater
repository. clock-weather-card
relies on hass
object to be available consistently.
@pkissling then maybe make humidity_sensor
and temperature_sensor
a template so that there is no need to use the card:custom-templater
at all
@pkissling then maybe make
humidity_sensor
andtemperature_sensor
a template so that there is no need to use thecard:custom-templater
at all
i don't quite understand whay you mean. can you please elaborate?
@pkissling so the 2 params humidity_sensor
and temperature_sensor
in my situation need to be templated (because they are dynamic)
for example
humidity_sensor_template: >-
{% set sensors = expand(area_entities('exterior')|reject('in',
integration_entities('group')))|selectattr('attributes.device_class',
'eq', 'humidity')|map(attribute='entity_id')|list %} {{ sensors[0] if
sensors|count > 0}}
temperature_sensor_template: >-
{% set sensors = expand(area_entities('exterior')|reject('in',
integration_entities('group')))|selectattr('attributes.device_class',
'eq', 'temperature')|map(attribute='entity_id')|list %} {{ sensors[0] if
sensors|count > 0}}
now i see. please create a dedicated feature request if you would like to see this feature being implemented at some point.
fur the time being, you could also create a dedicated sensor which contains this templating logic. this way, you would not require card:custom-templater
at all. you could just expose the new sensor to clock-weather-card
Checklist:
Release with the issue: latest
Last working release (if known):
Browser and Operating System:
Description of problem:
Javascript errors shown in the web inspector (if applicable):
Additional information: