Gh61 / lovelace-hue-like-light-card

This card provides a Hue-like way to control your lights in Home Assistant.
GNU Lesser General Public License v2.1
161 stars 12 forks source link

Card becoming invisible #27

Closed JortvanSchijndel closed 1 year ago

JortvanSchijndel commented 1 year ago

Hi, I really like the card! But recently it stopped working :( When I create the card it will not show everything but if I add the card again in the dashboard it will show both of the cards on the device I created them on. But if I open for example another tab some of the cards aren't there :( see screenshot Screenshot_2 Please help!

Gh61 commented 1 year ago

I'll look into this. What version of HA are you on?

JortvanSchijndel commented 1 year ago

The newest,

JortvanSchijndel commented 1 year ago

Screenshot_3 I missclicked and accidentally closed it sry :P

Gh61 commented 1 year ago

I just tested the newest version and i don't have any issues on my own. Do you have any errors in console view of your browser? (You can open it typicaly by F12 or Ctrl+Shift+I)

Also there can be some error in configuration. Can you post configuration for your cards? If I understand correctly, sometimes you see only half of your light-cards. The first missing (according to screenshot) is bijkeuken. Maybe there's something off with it. So please post at least configuration for this.

JortvanSchijndel commented 1 year ago

https://github.com/Gh61/lovelace-hue-like-light-card/assets/63785276/b193c579-7b45-450a-bc4a-7692f95f5f3c I have made a video so it's more clear This is my card-config

cards:
  - type: custom:layout-card
    layout_type: custom:horizontal-layout
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:mushroom-chips-card
            chips:
              - type: entity
                entity: person.
            alignment: start
          - type: custom:mushroom-chips-card
            chips:
              - type: entity
                entity: person.jort_van_schijndel
            alignment: start
            card_mod:
              style: |
                ha-card {
                right: 40px;
                }
          - type: custom:digital-clock
            locale: nl
            card_mod:
              style: |
                ha-card {
                margin: 0px -100px 0px -100px;
                }
          - type: custom:mushroom-chips-card
            chips:
              - type: entity
                entity: person.
            alignment: end
            card_mod:
              style: |
                ha-card {
                left: 40px;
                }
          - type: custom:mushroom-chips-card
            chips:
              - type: entity
                entity: person.
            alignment: end
    layout:
      width: 250
  - type: custom:hue-like-light-card
    title: Gamekamer
    entities:
      - light.ledstrip_gamekamer
      - light.lsc_moodlight_rgb_cct
      - light.lamp_gamekamer
    icon: mdi:controller
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Overloop
    entities:
      - light.overloop_links_1
      - light.overloop_links_2
      - light.overloop_3
      - light.overloop_4
    icon: mdi:stairs
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Woonkamer
    entities:
      - light.woonkamer_rechts_1
      - light.woonkamer_rechts_2
      - light.woonkamer_rechts_3
      - light.woonkamer_rechts_4
      - light.woonkamer_rechts_5
      - light.links_1
      - light.links_2
      - light.links_3
      - light.links_4
      - light.links_5
      - light.hanglamp_boven
      - light.hanglamp_onder
    icon: mdi:sofa
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Entree
    entities:
      - light.entree_1
      - light.entree_2
      - light.entree_wandlamp_1
      - light.entree_wandlamp_2
      - light.gardarobe
    icon: mdi:door
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Keuken
    entities:
      - light.keuken_1
      - light.keuken_2
      - light.keuken_3
      - light.keukenblad_4
      - light.keukenblad_2
      - light.ledstrip_keuken
      - light.keukenblad
      - light.keukenblad_3
      - light.keukeneiland_koken
      - light.keukeneiland_lades
      - light.keukenkasten_1
      - light.keukenkasten_2
      - light.keukenkasten_3
      - light.keukenkasten_4
      - light.keukenwand_led
      - light.luedd_smart_gu10_5w_2200_4000k_rgb_22
      - light.keukenwand_rechts
    icon: mdi:sofa
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: bijkeuken
    entities:
      - light.bijkeuken_1
      - light.bijkeuken_2
      - light.bijkeuken_3
      - light.bijkeuken_4
    icon: mdi:washing-machine
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Werkkamer
    entities:
      - light.werkkamer_1
      - light.werkkamer_2
      - light.werkkamer_3
      - light.werkkamer_4
    icon: mdi:monitor
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Slaapkamer
    entities:
      - light.t1
      - light.t2
      - light.t3
      - light.t5
      - light.slaapkamer_t5
      - light.slaapkamer_wastafel_1
      - light.slaapkamer_wastafel_2
      - light.bad_1
      - light.bad_2
      - light.bad_3
      - light.bad_4
      - light.slaapkamer_bed_1
      - light.slaapkamer_bed_2
      - light.slaapkamer_douche_1
      - light.slaapkamer_douche_2
    icon: mdi:bed
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Tuinkamer
    entities:
      - light.tuinkamer_bar
      - light.tuinkamer_bar_2
      - light.tuinkamerwand_boven
      - light.tuinkamerwand_onder
      - light.tuinkamer_plafond_1
      - light.tuinkamer_plafond_2
      - light.tuinkamer_keuken_1
      - light.tuinkamerkeuken
    icon: mdi:sofa
    onClickAction: hue-screen
    offClickAction: hue-screen
  - type: custom:hue-like-light-card
    title: Sauna
    entities:
      - light.sauna_wand_2
      - light.sauna_wandlamp_1
      - light.led_sauna
    icon: mdi:fire
    onClickAction: hue-screen
    offClickAction: hue-screen
Gh61 commented 1 year ago

Thank you for the video and the config. It's very weird behaviour. The config seems ok. I suspected the vertical-stack card could be the reason causing this behaviour, but it's probably not, as I have tested it myself.

Please take a look at the console logs (as I'd mentioned in the previous comment).

Other than that, I think it can be one of these problems:

JortvanSchijndel commented 1 year ago

I use Tuya for my lightbulbs and in the livingroom (woonkamer) I use Philips Hue. I found out that sometimes it is switching between no error to error. When it changes to error there comes a message in de console see video.

https://github.com/Gh61/lovelace-hue-like-light-card/assets/63785276/170d5562-0930-4312-b483-389c1c26e4ca

https://github.com/Gh61/lovelace-hue-like-light-card/assets/63785276/9453e79a-8c72-4f50-8b55-768bd958d4aa

Gh61 commented 1 year ago

Thank you, I see two error messages, I'll try to fix them. Do you have any light that doesn't have the option to change brightness?

JortvanSchijndel commented 1 year ago

All the lights have brightness, color & white balance control

Gh61 commented 1 year ago

Oh.

Can you please try to isolate the problem? To do so, try removing components/cards from your config step by step. At first please try to remove custom:layout-card from this vertical stack card. Then ensure, the error is still there, then continue to remove mutiple hue-cards (always ensuring, that the error is still present), maybe you can get single hue-card with error, then you can try to remove some light from it.

This way we could find the part, that is causing the error. Sorry for bothering you with this, but your configuration is pretty big and I cannot create the error on my side.

JortvanSchijndel commented 1 year ago

Ok, I don't know how but I started OBS and recorded that I delete all my cards too see if I can create 1 card that has the error. Then I accidentally hit save and needed to create the whole card again and then it worked! I have no clue what was wrong with the config but I'am happy that it is fixed!

Gh61 commented 1 year ago

I'm glad, that the issue is solved.

JortvanSchijndel commented 1 year ago

Hi, The problem is back :( I closed my temporary vm that is running home assistant and then restarted in too make more progress to my new dashboard and it happend again! Screenshot_5 So before the restart I created the card just as normal with layout-card, vertical stack and mushroom and then it worked really good! But after the restart it just broke

And the switch is offset in the hue-screen Screenshot_6

Gh61 commented 1 year ago

The title and switch offset is due to new version of HA, where header of dialog has been changed. I have already fixed this, it will be in the next release (in a few days I hope).

JortvanSchijndel commented 1 year ago

Cool but I don't know how to fix the card not displaying it is really weird Here a screenshot of the console I don't know if it is a new error or if it is the same as before image

Gh61 commented 1 year ago

These are the same errors as in previous video.

Attributes of some entity cannot be read. I can try to fix it blindly, but entity without attributes will not work either. I have a suspision, that you have some light entity which is unavailable or is simply not providing attributes.

It's odd, that after some time it started working (maybe it's not always in this invalid state).

Gh61 commented 1 year ago

Or these attributes are simply not passed to hue-card, because of some interference, as stated earlier.

You can still try to isolate the issue.

JortvanSchijndel commented 1 year ago

Hey, I have a fix I think! In one of the first video I showed that when I create the card again, both cards show up! So I installed Browsermod and used the popup card to add the second card and make it invisible. So now there is 1 normal card in a vertical stack and layout-card and there is 1 card invisible in a browser-mod card. I hope that this is a long-time solution :)

Gh61 commented 1 year ago

If that's working for you, I'm glad.