Skip to content
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

Secondary info does not appear immediately #30

Open
queimadus opened this issue May 31, 2020 · 6 comments
Open

Secondary info does not appear immediately #30

queimadus opened this issue May 31, 2020 · 6 comments

Comments

@queimadus
Copy link

This seems to coincide with the home assistant 0.110 update (currently on 0.110.4).
It takes a few ticks to _updateElement for the information to update.

Screen Recording 2020-05-31 at 12 27 27 mov

Error details:

secondaryinfo-entity-row.js:39 Uncaught (in promise) TypeError: Cannot read property 'shadowRoot' of null
    at HTMLElement._updateElement (secondaryinfo-entity-row.js:39)

Screenshot 2020-05-31 at 12 10 30

@cstotts
Copy link

cstotts commented Jun 11, 2020

I get the following error in my frontend until I reload at least once.

It also shows this on my mobile device.

r.setConfig is not a function entity: lock.front_door name: Front Door secondary_info: >- <b style="[[ if(lock.front_door.state == "locked","color:green","color:red") ]]">[[ {entity}.attributes.lock_status ]]</b> type: 'custom:secondaryinfo-entity-row'

I'm wondering if this is the same issue or not...

@Ndrinta
Copy link

Ndrinta commented Jun 14, 2020

Same here!

r.setConfig is not a function
bla bla bla...

Takes a few seconds to get the value.
To be fair it's a tricky one because the secondary_info entity it's a template sensor getting his state from another history_stat sensor. Fair enough that takes a sec to update but the real problem for me it's the error! It's unbearable. A giant red square in the middle of you home...

Card

entities:
  - entity: climate.furnace
    hold_action:
      action: more-info
    secondary_info: 'Active for [[ sensor.furnace_on_time ]] '
    tap_action:
      action: navigate
      navigation_path: /lovelace/furnace
    type: 'custom:secondaryinfo-entity-row'
    state_color: true
type: entities

Sensors

  - platform: history_stats
    name: Furnace ON time raw
    entity_id: sensor.furnace_operation_mode
    state: 'Heating'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    duration:
      hours: 24

  - platform: template
    sensors:
      furnace_on_time:
        friendly_name: Furnace ON time
        value_template: >-
          {{ state_attr('sensor.furnace_on_time_raw', 'value') }}

Happy to share more if can help!

@dfigus
Copy link

dfigus commented Aug 14, 2020

Any idea what's the issue here? The error Cannot read property 'shadowRoot' of null is still here and in case it occurs the card stays empty (not just missing secondary info). Sometimes it takes a couple of reloads until it's correctly displayed.

@snakuzzo
Copy link

snakuzzo commented Aug 14, 2020

Have you updated card-tools to latest version (11) ?

@dfigus
Copy link

dfigus commented Aug 18, 2020

Yes, I'm currently running the latest version 11 (reported as 2.1.2 in the console). The error did also occur with the previous version. Sometimes the result of this._wrappedElement.shadowRoot.querySelector("hui-generic-entity-row") is null and the chained usage of shadowRoot.querySelector(".secondary") fails. I also tried to dig into this by myself, but without luck as I'm not a JS developer.

@snakuzzo
Copy link

snakuzzo commented Aug 18, 2020

I confirm....card is working, but I have this error on Chrome console...

image

and details...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants