Clooos / Bubble-Card

Bubble Card is a minimalist card collection for Home Assistant with a nice pop-up touch.
MIT License
1.46k stars 41 forks source link

Pop up card header (entity to display) does not update #372

Closed alexanderlindstrom closed 3 months ago

alexanderlindstrom commented 5 months ago

Describe the bug Once the pop up card has loaded the header value never updates unless I reload page.

To Reproduce Steps to reproduce the behavior: Add any entity to display to header in a pop up card Change state of entity Update is not reflected in header

Expected behavior Value updated

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Thank you! 🍻

Clooos commented 5 months ago

Hi, I've just released a new version that should fix that issue 🤞

https://github.com/Clooos/Bubble-Card/releases/tag/v1.7.0

alexanderlindstrom commented 5 months ago

Reopening this since it seem to persist after update...

Clooos commented 4 months ago

I've just tried and it seems that this is fixed now.

https://github.com/Clooos/Bubble-Card/releases/tag/v1.7.1

alexanderlindstrom commented 4 months ago

Afraid not. Updated to latest, still same issue. See screenshot, arrow point to same sensor value, it's a temperature sensor. Screenshot_20240220-092910~2

Clooos commented 4 months ago

Could you try to do the same with a light instead of a temperature sensor? Then open/close that light then tell me if it works that way, this is what I've did for my testing.

alexanderlindstrom commented 4 months ago

Yes. Works fine with light. Updates instantly.

Clooos commented 4 months ago

Thanks, I will take a closer look at this issue.

alexanderlindstrom commented 4 months ago

I wonder if it could be that a user input perhaps "forces" a state update frontend, but I have no base for that claim. 😅

Clooos commented 4 months ago

No, the state change even if you toggle that light with Google Home. But I'm on it.

Clooos commented 4 months ago

I've just tried with a temperature sensor and this working on my side. Have you changed anything related to the recorder: in your configuration.yaml?

alexanderlindstrom commented 4 months ago

I have not done anything witht he recorder in config.

I am however not sure if this issue is constant or only under certain conditions. I will do some more testing on my own to see what conditions will make the header not update.

Clooos commented 4 months ago

Thanks, that would help me understanding what is happening here 🙂

alexanderlindstrom commented 4 months ago

I cannot reproduce it now, and every sensor update some to work fine. I have seen much improvement since the update. The screenshot was from this morning, so apperently it does happen from time to time, but perhaps it's just some edge case based on whatever. I think you shouldn't troubleshoot this any further. I will open a new issue if I notice some kind of pattern or if the issue gets more prevelent. Closing this as is.

alexanderlindstrom commented 4 months ago

Just as I posted that comment, I opened the app again (after about 5 minutes not having it open) and the sensor values werw out of sync. Maybe it could be an issue where the frontend does not have focus? Because the next update of the sensor value worked when I had the app open...

Clooos commented 4 months ago

Interesting, I might know what is happening here!

Clooos commented 4 months ago

This should be fixed now!

https://github.com/Clooos/Bubble-Card/releases/tag/v1.7.2

alexanderlindstrom commented 4 months ago

I've just updated. Will do some testing. Then close this issue. Good job

alexanderlindstrom commented 4 months ago

I hate to open this again. But I noticed it still occurs, this time I navigated from energy dashbord and the values were out if sync.

So I had the dashboard with the bubble card loaded, switched to energy dashboard, didn't use the app for 10 minutes, opened the app and navigated back to dashboard with bubble card.

Clooos commented 4 months ago

Don't worry, I was not sure that it was perfectly fixed. But I should have found a new way to fix that 🤞

alexanderlindstrom commented 4 months ago

The more I think about it. The issue now seems to be exclusivly when I go to other parts of GUI then back to dashboard with bubble card. I hope that helps

sayam93 commented 3 months ago

The state for the pop-up header doesn't update properly.

The lights sensor correctly shows "All Off" but when I tap the button to open the pop-up card, the pop up header shows "1 On" for the same sensor.

RPReplay_Final1711792941

Same with the temperature sensor for "Systems"

RPReplay_Final1711793996

My code for the swipeable row containing "Lights" and "Systems" buttons:

type: custom:swipe-card
parameters:
  iOSEdgeSwipeDetection: true
  spacebetween: 8
  keyboard:
    enabled: true
    onlyInViewport: true
cards:
  - square: false
    type: grid
    cards:
      - type: custom:button-card
        name: Climate
        icon: mdi:fan
        entity: sensor.temp
        tap_action:
          action: navigate
          navigation_path: '#climate'
        show_state: true
        show_label: false
        styles:
          grid:
            - grid-template-areas: '"i n" "i s"'
            - grid-template-columns: 20px;
          icon:
            - width: 24px
            - color: '#008DDA'
          card:
            - margin: 0
            - border-radius: 30px
            - padding: 0px 5px 0px 0px
          name:
            - justify-self: start
            - font-size: 12px
            - font-weight: 500
            - padding-left: 6px
          state:
            - justify-self: start
            - font-size: 12px
            - padding-left: 6px
            - opacity: '0.7'
      - type: custom:button-card
        name: Lights
        icon: mdi:lightbulb
        entity: sensor.lights_sensor
        tap_action:
          action: navigate
          navigation_path: '#lights'
        show_state: true
        show_label: false
        styles:
          grid:
            - grid-template-areas: '"i n" "i s"'
            - grid-template-columns: 20px;
          icon:
            - width: 24px
            - color: '#FCDC2A'
          card:
            - margin: 0
            - border-radius: 30px
            - padding: 0px 5px 0px 0px
          name:
            - justify-self: start
            - font-size: 12px
            - font-weight: 500
            - padding-left: 6px
          state:
            - justify-self: start
            - font-size: 12px
            - padding-left: 6px
            - opacity: '0.7'
      - type: custom:button-card
        name: Security
        icon: mdi:lock
        entity: sensor.security_state
        tap_action:
          action: navigate
          navigation_path: '#security'
        show_state: true
        show_label: false
        styles:
          grid:
            - grid-template-areas: '"i n" "i s"'
            - grid-template-columns: 20px;
          icon:
            - width: 24px
            - color: '#41C9E2'
          card:
            - margin: 0
            - border-radius: 30px
            - padding: 0px 5px 0px 2px
          name:
            - justify-self: start
            - font-size: 12px
            - font-weight: 500
            - padding-left: 6px
          state:
            - justify-self: start
            - font-size: 12px
            - padding-left: 6px
            - opacity: '0.7'
      - type: custom:button-card
        name: Systems
        icon: mdi:desktop-classic
        entity: sensor.system_monitor_processor_temperature
        tap_action:
          action: navigate
          navigation_path: '#pi'
        show_state: true
        show_label: false
        styles:
          grid:
            - grid-template-areas: '"i n" "i s"'
            - grid-template-columns: 20px;
          icon:
            - width: 24px
            - color: '#FBA834'
          card:
            - margin: 0
            - border-radius: 30px
            - padding: 0px 5px 0px 2px
          name:
            - justify-self: start
            - font-size: 12px
            - font-weight: 500
            - padding-left: 6px
          state:
            - justify-self: start
            - font-size: 12px
            - padding-left: 6px
            - opacity: '0.7'
    columns: 4

My template code the Lights sensor:

{% set lights = [
    states.switch.bed_lights_back_lights,
    states.switch.bed_lights_bedside_lights,
    states.switch.room_lights_2g_local_switch_1,
    states.switch.room_lights_2g_local_switch_2,
    states.switch.bathroom_2g_local_switch_1,
    states.switch.mirror_mirror
] %}
{% set count = lights | selectattr('state', 'eq', 'on') | list | count %}
{% if count == 0 %}
  All Off
{% elif count == lights | count %}
  All On
{% else %}
  {{ count }} On 
{% endif %}

P.S. I did not access other parts of the GUI before tapping the "Lights" or "Systems" button to access the pop up cards.

Clooos commented 3 months ago

Hi, this issue should be finally fixed in the v2 beta! Can you confirm this?

Here is the link to the full changelog: https://github.com/Clooos/Bubble-Card/releases/tag/v2.0.0-beta.1

sayam93 commented 3 months ago

works now!

Clooos commented 3 months ago

Yeah, finally! 😀

alexanderlindstrom commented 3 months ago

I can second that confirmation. Seem to work fine so far.

2.0 is a fantastic update overall 👍🏻