Dont update states on offline devices

My log-file is growing everytime i turn off the main switch on my Yamaha receiver.
I think HA try to scan state.

I tried to add some rows for logger: but it doesn´t fix the problem.

Is there any way to tell HA to stop update state on offline devices ?

log-file -> https://pastebin.com/TEzCcQih

Does this apply to your situation?

If you specify host manually, you must enable network standby on your receiver, or else startup of Home Assistant will hang if you have your receiver switched off.

If you want to keep it off, or the delay doesn’t bother you, you’re going to have to edit the source (or submit an issue to the devs so they will do it for you). If you want to edit your install, I can see something that might work:

  1. Copy the yamaha Python file: /home/hass/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/yamaha.py to the following folder inside your .homeassistant config directory (creating parent directories as needed): <hass config dir>/custom_components/media_player/
  2. Replace line 113 with the following code (assuming your code looks just like this):
        try:
            self._play_status = self._receiver.play_status()
        except:
            _LOGGER.warning("Failed to get player status")

This should log a shorter warning (if you configure warnings) instead of the stack trace. If you don’t want a message at all, replace the last line with the word pass

  1. Restart Home Assistant

That should be it, but I don’t have a yamaha receiver to test on. Note that by copying to the custom_component you are overriding the built-in component. New updates to hass will not wipe out your fix this way, but you also won’t receive any changes to the yamaha component either (not that there are many).

Thanks…
i tried that on 2 different setup ( ubuntu and RPI ) and both stop flooding the log i think :wink: