home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.6k stars 310 forks source link

Controll Center Widgets do not reflect current state #3174

Open Glow91 opened 1 week ago

Glow91 commented 1 week ago

Model Name: iPhone 12 Pro Software Version: 18.0 App version: 2024.9.4 (2024.905)

Home Assistant Core Version 2024.11.2

Describe the bug If some Lights or Switches has been added to the Control Center for Quick Access, the State of these Entities will not be reflected correctly what make them nearly useless. So ist possible (almost the case) the Control Center Shows me the Office Light is turned on but it isn't. Try to toggle the Light to see the result will end in an inverted behavior of the light. It is shown as Off in Control Center but is Turned on, a additional Tab causes it to be shown as On but it is Off

To Reproduce Add some Lights to the Control Center, toggle them from different Sources eg Turn on via a Switch or an Automation. Then look to the Control Center while Toggling, you will see that you don't see any change 😄

Expected behavior The current state of the selected Entity will be shown and will be also updated in real time. If this is not Possible this feature is nearly useless.

Screenshots Tricky to show this in a Screenshot. In case it would help I can try to capture a short clip. Let me know please :)

bgoncal commented 1 week ago

Please check the current testflight beta if you have time, in there it will reflect the correct state for most cases. Although it wont reflect realtime state in case you change your light through another way, to reflect it realtime we would need to implement push notifications (since its the only way apple allows to remotely refresh control states) and since we have a cap of 500 notifications per day, this would be not enough to most users with several lights on their homes.

Current workaround, you can create an automation that updates controls through push notification command (update_widgets), but dont forget the limit mentioned above: https://companion.home-assistant.io/docs/notifications/notification-commands

bgoncal commented 1 week ago

Automation example:


alias: Update widgets quando algumas luzes mudarem
description: ""
triggers:
  - trigger: state
    entity_id:
      - light.kitchen_lightstrip
      - light.kitchen_spots
      - light.tv_rack_lights
      - switch.arvore_de_natal
      - cover.living_room_curtain
      - light.elements_4eb4
conditions: []
actions:
  - action: notify.mobile_app_bruno_s_iphone
    metadata: {}
    data:
      message: update_widgets
mode: single
Glow91 commented 1 week ago

Thx for the quick response. I will test the beta next days and give some feedback 👍🏻

Glow91 commented 1 week ago

@bgoncal I need an TestFlight Invitation to get access to the Beta. Can you provide an invitation code or is there an other way to get the Beta?

bgoncal commented 1 week ago

Out beta is public: https://testflight.apple.com/join/1AlPbnLZ

Glow91 commented 1 week ago

It seems to be a little bit better but also not perfect. Yesterday I had an scenario were some lights has been turned off and after ~1h later the control center widgets always showed the „old“ state.

One question about the notifications, you wrote something about a cap of 500 notifications a day, the documentation says 40-70 per 24h?

Are these notification limits also for Push Notifications or only for these update ones?

bgoncal commented 1 week ago

Can you link me to this doc you mentioned? The limit is 500 push notifications per day

Glow91 commented 1 week ago

In the Dokumentation you provided: https://companion.home-assistant.io/docs/notifications/notification-commands

image

Glow91 commented 1 week ago

My intention was to update the widget via automation every 4 minutes. This makes 360 per day so there are still 140 open for other stuff.

bgoncal commented 1 week ago

Oh, now I get what you mean, yeah it won't work, Apple restricts this, but when this doc was written it had widgets in mind, not sure about controls, give it a try meanwhile I'll check the possibilities