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
72.65k stars 30.41k forks source link

mpd got disconnect issue since updating to 2021.1.* #46031

Closed saury closed 3 years ago

saury commented 3 years ago

The problem

After updating to 2021.*, my media_player.fdaapd(mpd) keeps disconnecting after HA started for several minutes. And by triggering from dev tools in panel, the service call always return: Can not send command to disconnected client. The mpd service is setup by forked-daapd. It works great before for a long period. And got correct port 6600 configured.

What is version of Home Assistant Core has the issue?

core-2021.2.0

What was the last working version of Home Assistant Core?

core-2020.12.2

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

mpd

Link to integration documentation on our website

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

Example YAML snippet

# Put your YAML below this line
media_player:
  - platform: mpd
    name: fdaapd
    host: 192.168.31.188

Anything in the logs that might be useful for us?

# Put your logs below this line
WARNING: Updating mpd media_player took longer than the scheduled update interval 0:00:10

And the following warning msg got massive occurrences in HA log: WARNING: Updating mpd media_player took longer than the scheduled update interval 0:00:10

probot-home-assistant[bot] commented 3 years ago

mpd documentation mpd source (message by IssueLinks)

namaoke commented 3 years ago

I have the same problem, rolling back to version core-2020.12.2 solves the problem, problem starts with version 2021.1.x

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

namaoke commented 3 years ago

I tried the current version of home-assistant and the problem is not solved!!!! I had to rollback again to version core-2020.12.2!!! Does someome has an idea to solve??

saury commented 3 years ago

Seems very few people are using this integration. Updated to latest version for both owntone-server and HA but still got this issue. Have to update to 2021.* as several repos in HACS got min version of HA required. Controlling play/pause by using shell command for currently as a workaround.

namaoke commented 3 years ago

Dear Saury, could you share an example of your workaround, Controlling play/pause by using shell command. I also update to owntone-server and still facing this problem.

saury commented 3 years ago

Attached a simple example.

# configuration.yaml

# binary sensor for getting the status of player
binary_sensor:
  - platform: command_line
    name: statusofplayer
    command: 'curl localhost:3689/api/player | grep ''state": "play'' > nul && (echo "play") || (echo "pause")'
    payload_on: "play"
    payload_off: "pause"

# switch for controlling player on/off
switch:
  - platform: template
      switches:
        fm:
          value_template: "{{ is_state('binary_sensor.statusofplayer', 'on')"
          turn_on:
            - service: shell_command.play
          turn_off:
            - service: shell_command.pause

# commands  
shell_command:
  # I do play/pause by exec bash in my pi server
  # play: ssh pi@192.168.31.188 /home/pi/play
  # pause: ssh pi@192.168.31.188 /home/pi/pause
  # You can try exec directly, not sure if they will work, may get some auth issue
  # PS. you should change the playlist id according to your own situation
  play: curl -X POST localhost:3689/api/queue/items/add?uris=library:playlist:12&shuffle=false&clear=true&playback=start
  pause: curl -X PUT localhost:3689/api/player/pause
namaoke commented 3 years ago

Thanks for your quick response, I will try it out, on next rainy day

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.