-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Companion App & Sidebar Items? #130
Comments
Hi @majorsl, |
I hope it's ok if I piggyback off this - I've set up the custom sidebar and all works perfectly on Desktop. But for some reason nothing has changed in the android companion app (2024.7.3-full) (no new items, no name-changes, no reordering, nothing). I've tried deleting and re-adding the server, logging out and re-adding the server, changing the server, clearing the app cache, closing and reopening the app, changing the custom-sidebar version number in configuration.yaml. I don't know what there is left to do ^^ any ideas? |
Wait a second - I just tried one other thing. I had this in my sidebar-config.yaml:
after removing it, the sidebar loads correctly in the Android companion app. Any idea how I can move the app configuration to the bottom? |
Actually, would you mind sharing your working config? I still can't get it to work on my Android. |
|
Hi @loocd, I don't see any issue with this config that would make the App to break: - item: external-app-configuration
match: "data-panel"
bottom: true The only thing is that it would not do anything (at least on my Home Assistant instance). In my case the Configuration is named Just to let you both know how hard is the caching of Home Assistant. I was using the By the way, this is my config so you can see how I moved the config to the bottom: ---
title: My Home
sidebar_editable: false
order:
- item: overview
name: Dashboard
order: 0
- item: deconZ
order: 1
- item: ESPHome
order: 2
- item: HACS
notification: |
[[[
const outdatedHacsEntities = Object.values(entities.update).filter(
(entity) => entity.platform === 'hacs' && is_state(entity.entity_id, 'on')
);
return outdatedHacsEntities.length || '';
]]]
order: 3
- item: logbook
order: 4
- new_item: true
item: Integrations
href: "/config/integrations"
icon: mdi:puzzle
order: 5
- new_item: true
item: Automations
href: "/config/automation"
icon: mdi:robot
order: 6
- new_item: true
item: Nginx Proxy Manager
href: http://xxx.xxx.xxx.xxx
target: _blank
icon: mdi:arrow-decision
order: 7
- new_item: true
item: Backups
href: "/hassio/backups"
icon: mdi:backup-restore
order: 8
- item: developer-tools
match: data-panel
bottom: true
order: 9
- item: studio code
bottom: true
- item: terminal
bottom: true
- item: settings
bottom: true
- item: energy
hide: true
- item: map
hide: true
- item: calendar
hide: true
- item: phpMyAdmin
hide: true
- item: media
hide: true
- item: history
hide: true And this is how it is rendered on desktop and on the Android Companion App:
|
By the way. Try this, I tried on my Android App and it is working, it is loading the https://community.home-assistant.io/t/clear-cache-android-companion-browser-app/527851/4 Edit: I spoke too soon, in my case this it what happens. I think that I just need to have two configs at the same time if I don't want to log out and log in again 😕 |
Good to follow this: home-assistant/android#2460 |
Solved the cache issue. Follow these steps:
That's all, cache is gone. It is loading the new config all the time, even after closing the App and opening it again 😃 Anyway, I hope that they solve this in some moment with a native button. |
This is all super helpful, I can't wait to get home and try it. My only issue is that I'm trying to adjust the sidebar to remove the Media items for certain users because it includes security cameras that they don't need access to. I doubt I'm going to either get their phones or give them instructions to clear the cache. I may just have to be hopeful that eventually the cache refreshes on its own. |
@elchininet Caching doesn't seem to be an issue for me. As soon as I add the code block mentioned above it goes back to the original sidebar. And as soon as I remove the code block it loads my own config again. My issue is with figuring out how to move the app-configuration menu to the bottom - not the config option. I tried loading it up in the remote dev tools - but for some reason nothing is loading up: as you got the dev-tools to work: could you maybe help me figure out what the identifier of the app-configuration menu? data-panel would be ideal |
Got it, never saw that sidebar item before
Is that screenshot from your desktop Chrome? It doesn't look like as mine. It is important that you enable dev debugging, most probably what is happening is that you are getting an error. With that error I would be able to figure it out what is happening. It is hard to reproduce it from my side because that means logging out from one of my devices and logging in again with a non-admin account, something that I would rather avoid 🙃 |
@loocd, |
@loocd, |
So, my Sidebar (finally) updated today. I updated to HA 2024.9.1 from 2024.8.3. As often happens with a new version, I'm informed that "a new version of the frontend is available" and a reload button. This appears to have cleared whatever caching was happening. Is there perhaps a way to force this from HA without having to wait for a major update? |
Unfortunatelly, there is no native way to do that, clearing the App cache doesn't clean the WebView cache. That is what was requested in the Github issue. 🙁 |
Hi @loocd, Folks, closing this issue. |
I'm sorry, but I can't confirm - it seems I'm still getting the issue when adding
the entire sidebar-config is ignored on mobile and defaults are restored. Could be a caching issue, but so far any changes were always applied immediately on re-opening the app and this is still true for other changes. So caching seems unlikely. What does work (as you suggested) is changing to
This doesn't put the item at the bottom, but it also doesn't break the rest. and just for sake of completeness, this is still the way to go so that the item gets targeted:
|
That is weird, just reading the code (because I have not tested it) the fix should be enough if the
I suggested something easier, removing the match parameter and use the exact text: - item: "app configuration"
bottom: true I'm going to logout of the App and login again with a non-admin user just to check with Chrome dev tools if I can spot the error. Regards |
Hi @loocd, This is with my normal configuration adding the code that was giving trouble to you: As you can see in the next screenshot, the plugin complains through warnings about not able to match any sidebar item named And this is adding what I recommended before: - item: "app configuration"
bottom: true As you can see, there are no warnings anymore complaning about "app configuration": You are clearly suffering from an app caching issue and you are not loading the new version of the plugin. I recommend you to try to clean your WebView cache, or use the code that I recommeded that will not fail even with the previous version (or keep using the one that you are using right now matching Regards |
I installed custom-sidebar with a very simple configuration to test: hiding the media and energy items.
On a web browser, it works perfectly. On the Android Companion App it doesn't seem to hide them. Is this a limitation of HA and how it talks to the companion apps or do I need to add a specific device configuration to my yaml?
The text was updated successfully, but these errors were encountered: