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

TypeError: null is not an object #40

Open
Mariusthvdb opened this issue Jan 4, 2021 · 18 comments
Open

TypeError: null is not an object #40

Mariusthvdb opened this issue Jan 4, 2021 · 18 comments

Comments

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jan 4, 2021

getting this error in Safari:

Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'this._wrappedElement.shadowRoot.querySelector')

and Chrome:

Uncaught (in promise) TypeError: Cannot read property 'querySelector' of null
    at HTMLElement._updateElement (secondaryinfo-entity-row.js?v=0.4:38)

on a perfectly correctly performing config:

      - type: custom:secondaryinfo-entity-row
        entity: input_number.home_theater_lux
        secondary_info: >
          Mean living: [[ sensor.mean_living_lux.state ]] lx
      - entity: binary_sensor.home_theater_lux_input
        secondary_info: last-changed

Schermafbeelding 2021-01-04 om 17 33 42

there are no none objects in this config, as the image proves. Dont know if this started recently tbh, my setup is

HA OS 2020.12.2
secondaryinfo-entity-row: 0.4

thought it might have been the .state suffix in the template, so took that out.

      - type: custom:secondaryinfo-entity-row
        entity: input_number.home_theater_lux
        secondary_info: >
          Mean living: [[ sensor.mean_living_lux ]] lx

oddly enough, the frontend remains correct, and the error stays.... using this on multiple entities in the config.

@Mariusthvdb
Copy link
Contributor Author

still very much alive, meanwhile on HA OS 2021.1.5.

Would anything else be needed to have a look/debug this?

@Mariusthvdb
Copy link
Contributor Author

please check this, it is still happening.
meanwhile 2021.3.4

@ildar170975
Copy link

I have same errors.
2021.3.4

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented May 8, 2021

just keeping this alive, error persists on 2021.5/2021.6

@emufan
Copy link

emufan commented Jul 12, 2021

Same here on 2021.7.1

@Mariusthvdb
Copy link
Contributor Author

not using this anymore, I moved to

      - type: custom:slider-entity-row
        entity: input_number.home_theater_lux
        secondary_info: true
        card_mod:
          style:
            hui-generic-entity-row$: |
              .secondary::after {
                content: "Mean living: {{states('sensor.mean_living_lux')}} lx"
                }

@emufan
Copy link

emufan commented Jul 16, 2021

@Mariusthvdb Didn't get that yet.

a. According to custom:slider-entity-row, there is no attribute secondary_info.
b. If I want to use this in a standard entity row, secondary_info=true will not work as well.
c, Here, you are only appending and not replacing, aren't you?

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Jul 16, 2021

I used this before on a regular input_number entity. However, that has an issue with the decimal .0 which I really dont like, so I replaced all my cards with input_number to use the custom:slider-entity-row.

I guess you didnt try it, because if you would have, you could have seen it does work with the secondary_info: true. As a matter of fact, this is what the master himself suggested I do...

Schermafbeelding 2021-07-16 om 10 15 44

without secondary_info line:
Schermafbeelding 2021-07-16 om 10 19 53

@emufan
Copy link

emufan commented Jul 16, 2021

You are right. Didn't test it, because, as I need a normal entity row, I only checked, where the secondary_info=true came from and din't find it anywhere. And it is not working for standard row and then your work-arround is only appending and working in this special situation around the entity-row from Thomas and not for other places of this secondaryinfo-entity-row. Right? At least, I was only able to append, without further investigation of hiding the standard content, coming from entity-id, last-changed, last-updated, last-triggered, etc.

My question was only, because I wondered, if there is such an easy true=empty way everywhere, as in your example.

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Jul 16, 2021

as said, not using the secondaryinfo-entity-row any longer. Also, I showed above the card_mod works on a regular entity input_number. It works on any entity:

      - entity: person.marijn
        secondary_info: true
        card_mod:
          style:
            hui-generic-entity-row$: |
              .secondary::after {
                content: "Mean living: {{states('sensor.mean_living_lux')}} lx"
                }

Schermafbeelding 2021-07-16 om 14 12 12

for the undocumented trick on secondary_info: true, see https://community.home-assistant.io/t/card-mod-add-css-styles-to-any-lovelace-card/120744/1729

@emufan
Copy link

emufan commented Jul 16, 2021

O.k. Thank you. It's not working here. Cannot save this with secondary_info: true and only get a lot of LovelaceUI-errors instead. But perhaps, this is another problem. Will have this trick in mind for the future.

@Mariusthvdb
Copy link
Contributor Author

You did install card-mod? Because that would be the only reason for this not to work?

@emufan
Copy link

emufan commented Jul 17, 2021

No, not the case. But have a look in card_mod-thread in the forum. There is something wrong (with the syntax check) in the editor. With secondary_info: tru or abc or whatever, it is working now, but most of the cases not with true.

@Mariusthvdb
Copy link
Contributor Author

well, what can I say. How can you even start to complain about a card-mod mod not working, if you haven't installed it.....

it works fine, I any config I use it for, as demonstrated. I don't use the editor, so am not bothered with that, using Yaml config.
The solution was provided to me by Thomas himself, so Id rather call it an undocumented feature, not a hack.

@emufan
Copy link

emufan commented Jul 17, 2021

Did you read anything? The "no" was the answer about "Because that would be the only reason for this not to work?". Of yource it is installed. Thought that should be clear. And where did I complain caord_mod? You will not see any word in this direction above. FYI: Ildar_Gabdullin sees the same error. So don't blame me here. And did you wrote, that you do not use the editor? No. So let's stop the discussion here, because, a I have written, it is not related to this card,

And by the way, as I have written before. The errors are not related to card_mod, but only the editor. Even without card_mod code or card_mod, you have the error, if you use "true/false" instead of any other text. Perhaps this help other one, who are facing the same problem as well.

@Mariusthvdb
Copy link
Contributor Author

Sure, whatever. You keep changing the subject, so I fear it’s not much use to others.

If this really was only about the editor, and in no way to this card (your words) , you have been writing off topic from the start ….

@emufan
Copy link

emufan commented Jul 17, 2021

not using this anymore, I moved to

This was the start of the off-topic. I tried to stop this topic more than once and din't change the topic. The subject was, that you startet an off-topic solution, which is currently only working by chance in your situation, without editor, etc. All the rest was root-cause analysis and not the change of any furether subject.

PLONK

@chemelli74
Copy link

Hi, any update on this by any chance ?

Simone

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

4 participants