home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.2k stars 31.16k forks source link

Squeezebox not registering "on" state of players #129396

Open vsessink opened 1 month ago

vsessink commented 1 month ago

The problem

An automation that has:

device_id: 3f819e04342a60596f45436c4dca5f66
domain: media_player
entity_id: db52653070f44e76ffb519ecbfa87a65
type: turned_on
trigger: device

never triggers, while type: turned_off does work as expected.

What version of Home Assistant Core has the issue?

core-2024.10.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Squeezebox

Link to integration documentation on our website

https://www.home-assistant.io/integrations/squeezebox

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @rajlaud, @pssc, @petes-uk, mind taking a look at this issue as it has been labeled with an integration (squeezebox) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `squeezebox` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign squeezebox` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


squeezebox documentation squeezebox source (message by IssueLinks)

rajlaud commented 1 month ago

Does the player show up as on in the media player card on the front end? Or in the States tab under Developer Tools?

vsessink commented 1 month ago

Indeed, they (I have three of them) show up, I can see their state changing (off to on, or on to off). As said, the "on to off" state change just works, it's the other way around that seems to malfunction.

I also tried the state change with additional check ("turned on or off", AND "is on"), but that didn't work either. Seems there is something wrong with the "on" state change.

peteS-UK commented 1 month ago

I think it's to do with the fact that the squeezeboxes don't often report their state as On. They tend to say "playing" or "paused" for example rather than on. I just use the state moving from Off - i.e. to anything - as the On trigger...

 - entity_id:
      - media_player.den
    from: "off"
    trigger: state
vsessink commented 1 month ago

So you're saying there's no "on", but only "playing" or "paused"?

peteS-UK commented 1 month ago

I'm not sure what circumstances you get On, but you can get playing, paused, idle as well I think. Hence, I just go with it moving from Off and then I don't care what it moves to as its trigger. Is using the "it's no longer off" approach going to cause you a problem?

vsessink commented 1 month ago

I myself did work around the turned_on by using type: playing, which is just as good to turn on a speaker, so it's not causing a problem so much for me. But shouldn't "no longer off" be the same as turned_on? Because the latter is what the GUI presents. Could any of you please look into the code and see if turned_on is there - at all? And if turned_on isn't there, the very state shouldn't be selectable in HA.