philipflesher / stormaudio-isp-hass

Home Assistant integration for Storm Audio ISP series sound processors
0 stars 0 forks source link

start and shutdown sequence #1

Closed csaa1411 closed 1 week ago

csaa1411 commented 1 month ago

I am using this home assitant integration for my Stormaudio ISP and it is working almost perfectly! Thanks for the great work!

An issue I stumbled accross recently is a somehow arkward behaviour of the integration when turning on and off the ISP via Home Assistant mediaplayer. The integration sends a sequence of multiple commands to the ISP.

Turn on sequence: ON-OFF-ON Turn off sequence: OFF-ON-OFF

Based on this behaviour my ISP struggeled to turn off several times and got stuck in an undefined state: the power-led turned from green to red although the display still remained on. Switching on and off via Stormaudio's own iOS app doesn't cause problems resp. is the solution when the ISP got stuck.

I would highly appreciate if someone could look into this issue as I unfortunately don't have any coding skills.

Thanks in advance! Jürgen

philipflesher commented 3 weeks ago

@csaa1411 -- glad you're getting some use out of it, or almost getting use out of it, in spite of the issue. :)

Can you give me a little more info about what you mean by "turning on and off the ISP via Home Assistant mediaplayer?" Maybe a step by step on how you set it up and what you're using within the UI to turn it on and off?

csaa1411 commented 2 weeks ago

@philipflesher sorry for my late reply (was on vacation) and thank you for taking care of my issue! The integration was set up using HACS a few months ago and I first didn't realize the mentioned behaviour using the "standard" mediaplyer card that comes with HA. I briefely started to use mushroom cards for my HA visualization and since then I am aware of the issue.

I enclosed 2 screen-recodings showing what happens when I turn on and off my Stormaudio processor in HA, maybe that helps.

https://github.com/user-attachments/assets/eb94bd79-c1e5-40b9-b0ea-656c64c58d4d https://github.com/user-attachments/assets/8031a825-632d-4583-99a7-40223111e10d

Thank you!!!

philipflesher commented 2 weeks ago

I believe what actually happens when you use the built-in media player control in HA is that the integration is sending the "off" or "on" command to the ISP only once. However, the UI flickers back and forth between on-off-on or off-on-off. I haven't yet decided whether this is a bug in the integration due to some change in HA, or whether this has always been the case and I never noticed it.

But it would be good to know if you can make the problem manifest if you wait for the ISP to fully initialize or fully shut down before you attempt another transition. In other words, if you press "on" and then press "off" before the ISP has fully initialized, does this cause the ISP to get into the stuck position you mentioned? Or vice versa: does pressing "on" before the ISP has fully shut down cause it to get into a bad state?

Another question for you: what power off mode is the ISP set to right now? There is the "soft off" setting that allows the ISP to wait in a more "warm" state that allows for fast boots, and an "off" state that puts the ISP in a deeper sleep that takes longer to wake up from. I use the "soft off" setting to allow for a fast on, and I'm curious if you use the same.

csaa1411 commented 1 week ago

@philipflesher My Stormaudio ISP is configured for "network standby" (thus for enabling IP control), it is not in "fastboot" mode. I tried to reproduce the issue of getting stuck while booting/ shutdown but (gladly) didn't get in that state again. Pressing "on" or "off" during initializiation or shutdown had no negative effect.

philipflesher commented 1 week ago

Okay, given this is not reproducible now, I am going to close it. But please reopen if you see the "stuck" behavior again.

Meanwhile, you could ask HA devs for a transitioning state for entities going between on and off, or between any states. IMO this is a significant missing feature from HA. If we had this, we could avoid having entities appear to waffle between states as they are transitioning.

philipflesher commented 1 week ago

Final comment, in case helpful for you or others who find this in the future. I ended up not using the media player entity at all for controlling the ISP, and instead created my own template buttons that use the detailed_state attribute. See here for the way these are set. Values are on, off, initializing, shutting down.

My template button sets the template button as "unavailable" whenever the two transitioning states are occurring. This makes the interface feel more responsive and correct.