core: Since 0.115 Kodi goes "unavailable" state if turned off when HA restarts

The problem

Since upgrading to 0.115, removing the YAML configuration and using the auto-discovered kodi hosts, All hosts go to the unavailable state if kodi is not running (Or the Machine is not running).

While a device is unavailable, it cannot be interacted with or powered on with WOL via Lovelace or Google Home (Unsure about Alexa as I dont have one) - The only way I can see to power on the device is to run the automation manually via a web browser.

Google Home sees the device as “offline” and a status “Not responding”. or when trying to interact by voice, the assistant says “Sorry, it looks like the DEVICENAME isn’t available right now”

My 3 HTPC’s all run LibreELEC and shut down when not in use to save power. They are turned on using WOL and turned off using the Kodi API

Startup Automation:

- alias: 'Turn Lounge TV On'
  trigger:
    platform: device
    device_id: 4f124c62f92e11ea9c0e877eebff12d6
    domain: kodi
    entity_id: media_player.lounge_tv
    type: turn_on
  action:
    - service: wake_on_lan.send_magic_packet
      data:
        mac: 00:22:4D:54:BA:2B
        broadcast_address: 255.255.255.255

Shutdown Automation:

- alias: 'Turn Lounge TV Off'
  trigger:
    platform: device
    device_id: 4f124c62f92e11ea9c0e877eebff12d6
    domain: kodi
    entity_id: media_player.lounge_tv
    type: turn_off
  action:
    - service: kodi.call_method
      data:
        entity_id: media_player.lounge_tv
        method: System.Shutdown

Environment

arch x86_64
chassis desktop
dev false
docker true
docker_version 19.03.12
hassio true
host_os Debian GNU/Linux 10 (buster)
installation_type Home Assistant Supervised
os_name Linux
os_version 4.19.0-10-amd64
python_version 3.8.5
supervisor 245
timezone Pacific/Auckland
version 0.115.2
virtualenv false
  • Home Assistant Core release with the issue: 0.115.x
  • Last working Home Assistant Core release (if known): 0.114.4
  • Operating environment (OS/Container/Supervised/Core): Supervised
  • Integration causing this issue: Kodi
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/kodi/

Problem-relevant configuration.yaml

N/A Since moving to discovered component instead of YAML-defined


Traceback/Error logs


Additional information

It would be good if there were a configuration option to specify if this device is an appliance or running as an app - If app Show unavailable state, if appliance, show off state

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (15 by maintainers)

Most upvoted comments

@OnFreund

if self.hass.state == CoreState.running: _start_websocket else hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STARTED, _start_websocket)