artem-sedykh / mini-climate-card

Minimalistic climate card for Home Assistant Lovelace UI
MIT License
262 stars 19 forks source link

Invisible when casting #80

Open TomaszDom opened 2 years ago

TomaszDom commented 2 years ago

Mini climate card is invisible when the view is cast, at least to my Google Nest Hub 2nd Gen. All other cards show up correctly.

      - type: custom:mini-climate
        entity: climate.lazienka_grzejnik
        target_temperature:
          step: 0.5
        secondary_info: hvac-mode
        indicators:
          valve:
            icon: mdi:valve
            unit: '%'
            round: 1
            source:
              entity: sensor.lazienka_grzejnik_position
          preset_mode:
            icon: mdi:car-cruise-control
            source:
              attribute: preset_mode
        icon: mdi:radiator
        fan_mode:
          hide: 'on'
          active: false
          icon: mdi:none
          disabled: true
        buttons:
          preset_mode:
            type: dropdown
            location: main
            icon: mdi:thermometer
            state:
              attribute: preset_mode
            active: state => state !== 'none'
            source:
              eco: Eco
              comfort: Comfort
              boost: Boost
              manual: Manual
            change_action: >
              (selected, state, entity) => this.call_service('climate',
              'set_preset_mode', { entity_id: entity.entity_id, preset_mode:
              selected })
      - type: custom:mini-climate
        entity: climate.salon
        target_temperature:
          step: 0.5
        secondary_info: hvac-mode
        indicators:
          valve_left:
            icon: mdi:valve
            unit: '%'
            round: 1
            source:
              entity: sensor.salon_lewy_position
          valve_right:
            icon: mdi:valve
            unit: '%'
            round: 1
            source:
              entity: sensor.salon_prawy_position
          preset_mode:
            icon: mdi:car-cruise-control
            source:
              attribute: preset_mode
        icon: mdi:radiator
        fan_mode:
          hide: 'on'
          active: false
          icon: mdi:none
          disabled: true
        buttons:
          preset_mode:
            type: dropdown
            location: main
            icon: mdi:thermometer
            state:
              attribute: preset_mode
            active: state => state !== 'none'
            source:
              eco: Eco
              comfort: Comfort
              boost: Boost
              manual: Manual
            change_action: >
              (selected, state, entity) => this.call_service('climate',
              'set_preset_mode', { entity_id: entity.entity_id, preset_mode:
              selected })
      - type: custom:mini-climate
        entity: climate.sypialnia
        target_temperature:
          step: 0.5
        secondary_info: hvac-mode
        indicators:
          valve_left:
            icon: mdi:valve
            unit: '%'
            round: 1
            source:
              entity: sensor.sypialnia_lewy_position
          valve_right:
            icon: mdi:valve
            unit: '%'
            round: 1
            source:
              entity: sensor.sypialnia_prawy_position
          preset_mode:
            icon: mdi:car-cruise-control
            source:
              attribute: preset_mode
        icon: mdi:radiator
        fan_mode:
          hide: 'on'
          active: false
          icon: mdi:none
          disabled: true
        buttons:
          preset_mode:
            type: dropdown
            location: main
            icon: mdi:thermometer
            state:
              attribute: preset_mode
            active: state => state !== 'none'
            source:
              eco: Eco
              comfort: Comfort
              boost: Boost
              manual: Manual
            change_action: >
              (selected, state, entity) => this.call_service('climate',
              'set_preset_mode', { entity_id: entity.entity_id, preset_mode:
              selected })

20220503_114919

screenshot

I'm running Home Assistant 2022.4.7 with mini-climate-card v2.1.1.

regevbr commented 2 years ago

I never tried to cast my HA before. I wanted to check what I can do but the cast feature is completely messed up (at least for me) and sadly I have no way to debug why that happens to you... If anyone with the tech skills and a proper device to cast to can have a look I will happily assist

TomaszDom commented 2 years ago

By messed up do you mean you get a white screen? I also have this problem, I work around it by first casting a much simpler view, waiting a few seconds and then casting the target view (as an automation of course).

regevbr commented 2 years ago

I spent a good amount of time reading through the blogs and forums and the conclusion is always that no one can reliably get custom cards to work... There is no proper way to debug the cast (even if I did manage to cast it) so sadly I will have to leave this issue unresolved (unless someone is willing to take care of it)

swiergot commented 2 years ago

From https://cast.home-assistant.io/faq.html:

WHY DO SOME CUSTOM CARDS NOT WORK?

Some custom cards rely on things that are only available in the normal Home Assistant interface. This requires an update by the custom card developer.

If you're a custom card developer: the most common mistake is that LitElement is extracted from an element that is not available on the page.

Does it mean anything to you?

regevbr commented 2 years ago

It does, I read it before, still, sadly, I don't know why it does not work :-( All the lit elements I rely on come repacked into this card, I don't rely on them coming from HA

Ovidiu1973 commented 1 year ago

Great card, I have started using it, but when I try to cast on a Google Nest Hub (2nd Gen), the cards are not showing up

I have the same issue.

P.S. Other customs cards are Ok.

HA-screen Cast-Screen

regevbr commented 1 year ago

a PR is more than welcome, I don't know how to handle that

Ovidiu1973 commented 1 year ago

sorry, I'm a beginner in HA, what means PR ? yaml code ? To simulate the error you need to use https://cast.home-assistant.io/ and to have NabuCassa or cloud-enable thru (Cloudflare). You can cast on any compatible device with, same error (not casting the cards) also on a TV (LG)

regevbr commented 1 year ago

PR = github pull request. Meaning if someone can find the issue and fix it, I will check the fix and release a new version. Sadly, I don't have the capacity or the knowledge to fix that issue