Giter Site home page Giter Site logo

Comments (10)

pkissling avatar pkissling commented on May 23, 2024

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.
image

from clock-weather-card.

Perfect-Web avatar Perfect-Web commented on May 23, 2024

image
image

    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 }}

from clock-weather-card.

Perfect-Web avatar Perfect-Web commented on May 23, 2024

any updates on this ?

from clock-weather-card.

pkissling avatar pkissling commented on May 23, 2024

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?

from clock-weather-card.

Perfect-Web avatar Perfect-Web commented on May 23, 2024

@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: ....

from clock-weather-card.

pkissling avatar pkissling commented on May 23, 2024

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.

from clock-weather-card.

Perfect-Web avatar Perfect-Web commented on May 23, 2024

@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

from clock-weather-card.

pkissling avatar pkissling commented on May 23, 2024

@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

i don't quite understand whay you mean. can you please elaborate?

from clock-weather-card.

Perfect-Web avatar Perfect-Web commented on May 23, 2024

@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}}

from clock-weather-card.

pkissling avatar pkissling commented on May 23, 2024

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

from clock-weather-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.