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
73.45k stars 30.69k forks source link

Panasonic Viera does not load if TV is switched off on HA starup #4147

Closed arsaboo closed 7 years ago

arsaboo commented 8 years ago

Home Assistant release (hass --version): 0.31.1

Python release (python3 --version): 3.4.2

Component/platform: Panasonic Viera

Description of problem: I have a Panasonic Viera TV that is added to HA using:

  - platform: panasonic_viera
    host: 192.168.2.129
    port: 55000
    name: Panasonic Viera TV

The TV only works with HA if it is turned on when HA starts. If I start HA when the TV is switched off, I get the error:

[homeassistant.components.media_player.panasonic_viera] Panasonic Viera TV is not available at 192.168.2.129:55000

and then the TV is not added to media_player even after it is turned on. I don't know the solution, but it seems like this code block is the culprit. HA only adds the device if it is able to communicate with it on startup.

Expected: HA should add the TV when it is turned on for the first time after the TV is switched on.

outrun0506 commented 8 years ago

I'm seeing the Same Behavior for my Viera. Is any on able to switch the channels on the Viera throw Home Assistant?

homesmarty commented 7 years ago

I'm also seeing this issue, and it can be pretty annoying that after a restart of HASS with TV off none of the automations involving the TV work.

Is there a way to force HASS to add the TV without checking if it is on / online?

Landrash commented 7 years ago

Hopefully something similar like this could be implemented into this component.

magas0 commented 7 years ago

I created a PR #4888 to remove the return False from the setup function. This is what was preventing it from being added in the current logic. Otherwise, the connection attempt could be removed and make it like the Samsung TV code which just checks for a valid config.

If this is ok, I could try adding more functionality for the Panasonic Viera TV in another PR.