Skip to content

Sensors quickly become unavailable after HA restart #10

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

Open
BarneyHam opened this issue Oct 13, 2024 · 13 comments
Open

Sensors quickly become unavailable after HA restart #10

BarneyHam opened this issue Oct 13, 2024 · 13 comments

Comments

@BarneyHam
Copy link

Hi - i am loving the integration.

I would love help with getting the sensors to be responsive.

I am able to connect to the Altitude, and send it commands etc. However, the sensors are unavailable/not being updated on the dashboard - and I'd love to be able to know what read what the current source is etc. I can change the source using the remote.send command... but tht source sensor doesn't update (even though the source changes). Same with volume etc.

Any help would be hugely appreciated.

@binarylogic
Copy link
Owner

binarylogic commented Oct 13, 2024

Hey @BarneyHam , would love for you to help if you're willing. What firmware version are you running on your Altitude? I'm running 4.4.0, which is currently the latest. The sensors are working with my machine (see below). I followed the protocol specification here.

Keep in mind that sensors are pushed to the client upon connection, and as they change thereafter. So if there is anything preventing your Altitude from communicating with Home Assistant it will not receive the sensor updates. I am willing to bet that's what's happening.

Screenshot 2024-10-13 at 1 39 08 PM

@BarneyHam
Copy link
Author

Thank you.

Yes - firmware is 4.4.0.

So... I have discovered that I am getting responses on all the sensors except the source - which reads as "Unknown" (see below). The rest are changing as I make adjustments... but if I change the source, it stays as unknown? [But I can change the source.. both directly, and using the remote command through HA].

SCR-20241013-trbz

@binarylogic
Copy link
Owner

Got it. Then it seems like we aren't loading the sources properly upon connection. See this line. During my testing I noticed, at times, that all of the sources would not be sent. There are a couple of things we could do:

  1. Provide 2 sensors -- source and source_index. The latter would always be set, and it would be an integer. The former would depend on loading all of the sources properly.
  2. If the source index does not exist, we could attempt to reload the sources and try again.

The source_index should be very reliable though since it does not depend on mapping.

@BarneyHam
Copy link
Author

Yes - I'd be happy to just rely on an integer source_index, if that helps - I know separately what integer would map to which source.

@BarneyHam
Copy link
Author

BarneyHam commented Oct 17, 2024

Hi @binarylogic !

Would it be possible to give a timeframe for when you might be able to look at implementing the 2 sensor solution? I realise you will be really busy, and everything you are doing on this great integration is for the benefit of others... so that's not a chase. Just asking so I can plan for the HA installation I am doing. THANK YOU!

@binarylogic
Copy link
Owner

Hi @BarneyHam, I'll try to find time in the next week or so. I have a few other things that I want to improve. If you want it now, it should be relatively easy to add. You can basically copy what's going on with the other sensors.

@BarneyHam
Copy link
Author

Thank @binarylogic. I did try myself to figure it out from the raw code, but I'm afraid I got a bit lost! I'll wait for your update. Thank you.

@BarneyHam
Copy link
Author

Hi @binarylogic - so sorry to sound like I’m chasing, but do you know when you might be able to create the source index sensor? It will be hugely valuable for the HA installation I’m putting in right now. Realise you are doing this entirely to help others - like me! Thank you!!

@BarneyHam
Copy link
Author

Hi @binarylogic - would hugely appreciate an update on whether you think you'll be able to get to this update to include a more stable source_index sensor. It's not something I can see how to add to the code myself :( And just need to know if I need to try to find a different solution to the installation needs. Thank you so much. Barney

@binarylogic
Copy link
Owner

Hi @BarneyHam, apologies, this has been an extremely busy week. I will take care of this tomorrow morning.

@BarneyHam
Copy link
Author

Thank you, @binarylogic, I do appreciate you helping here so much.

@BarneyHam
Copy link
Author

Hi @binarylogic - I am guessing that setting up a source_index sensor isn't as straightforward as hoped.

My only other thought, given that presets seem to be reading correctly, is to create presets to match each source (duplicating standard set up), and then use the preset sensor as an indicator of the source. If there are any other solutions you can suggest please let me know.

@conrad-nash
Copy link

This should now be resolved in the new version and I believe can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants