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.72k stars 30.45k forks source link

Android TV - HA 2022.2.1 is not migrated androidtv yaml settings after upgrade #65659

Closed SAOPP closed 2 years ago

SAOPP commented 2 years ago

The problem

Hi!

In HA 2022.2.1 update, in breaking changes section, about androidtv integration, it was said that the settings are transferred automatically from the yaml file after upgrade, but in my case it dind't happened, what's wrong and who can confirm this?

image

In descovery section I see three discovered devices, but, when I clicking to one of it and opens the add window - the integration is not detected the ip address of the discovered device (I mean, I know all my ips, but it's just interesting, 'coz it's look like correct detection of my yaml file androidtv settings, 'coz one of my three devices is offline right now, and discivering mode can't detect it right now)... It's a correct behaviour?

image

What version of Home Assistant Core has the issue?

core-2022.2.1

What was the last working version of Home Assistant Core?

core-2021.12.10

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Android TV

Link to integration documentation on our website

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

Example YAML snippet

- platform: androidtv
    name: bedroom_xiaomi_mi_tv
    host: 192.168.1.13
    apps:
      com.megogo.application: "Megogo"
      com.mitv.tvhome.atv: "Android TV Launcher"
  - platform: androidtv
    name: kitchen_xiaomi_mi_stick
    host: 192.168.1.14
    apps:
      com.megogo.application: "Megogo"
  - platform: androidtv
    name: hall_xiaomi_mi_box
    host: 192.168.1.15
    apps:
      com.megogo.application: "Megogo"
      com.mitv.tvhome.atv: "Android TV Launcher"

Anything in the logs that might be useful for us?

Nothing in logs about my yaml setting of it.

Additional information

No response

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

androidtv documentation androidtv source (message by IssueLinks)

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

Hey there @jefflirion, @ollo69, mind taking a look at this issue as it has been labeled with an integration (androidtv) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

SAOPP commented 2 years ago

Btw, I manually added this devices through the gui, and they pulled themselves into place, but again the question is - this how it should have happened when migrating from yaml to gui? Thanks.

calisro commented 2 years ago

Which was offline? The Spacing on your

- platform: androidtv
    name: bedroom_xiaomi_mi_tv
    host: 192.168.1.13
    apps:
      com.megogo.application: "Megogo"
      com.mitv.tvhome.atv: "Android TV Launcher"

Was off. Just an observation.

hillbicks commented 2 years ago

I can report this as well, but with a slightly different scenario, maybe even a completely different bug altogether. The previous version allowed for a scan_interval setting in the yaml. This option is now completely missing from the gui setup and can't be added manually neither. The documentation still mentions this option as well.

Or did I miss something? Neither the breaking change section in the announcement, nor the pull request mention scan_interval though.

calisro commented 2 years ago

@hillbicks

https://community.home-assistant.io/t/2022-2-lets-start-streamlining/387648/484?u=calisro

add sensor

 - platform: uptime
alias: AndroidTv Scans
description: ''
trigger:
  - platform: time_pattern
    seconds: /2
condition:
  - condition: state
    entity_id: automation.androidtv_scans
    state: 0
    attribute: current
  - condition: template
    value_template: '{{ ( now() - states(''sensor.uptime'')|as_datetime ).seconds > 90 }}'
action:
  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id:
        - media_player.xxxxxx
hillbicks commented 2 years ago

Huh, well, that should do it. Thanks for pointing that out. I'll just do it with two nodes in node red.

SAOPP commented 2 years ago

Which was offline? The Spacing on your

- platform: androidtv
    name: bedroom_xiaomi_mi_tv
    host: 192.168.1.13
    apps:
      com.megogo.application: "Megogo"
      com.mitv.tvhome.atv: "Android TV Launcher"

Was off. Just an observation.

Yep, this tv was in offline, and two consoles in on.

jwelvaert commented 2 years ago

I have 3 Fire TV devices and only 1 was pulled in automatically. The other 2 have been auto discovered but when I try to configure them it always says "Failed to connect". I've tried auto and firetv options but neither work. I removed the manual YAML from my media_player config.

calisro commented 2 years ago

@jwelvaert Might be nice to see the original yaml and logs.

jwelvaert commented 2 years ago

@jwelvaert Might be nice to see the original yaml and logs.

- platform: androidtv
  name: Exercise Room Fire TV
  device_class: firetv
  host: 192.168.1.84

- platform: androidtv
  name: Office Fire TV
  device_class: firetv
  host: 192.168.1.85

Here is the log

Logger: homeassistant.components.androidtv.config_flow
Source: components/androidtv/config_flow.py:123
Integration: Android TV ([documentation](https://www.home-assistant.io/integrations/androidtv), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+androidtv%22))
First occurred: 2:08:12 PM (2 occurrences)
Last logged: 2:08:26 PM

Could not connect to Fire TV device at 192.168.1.84:5555 using Python ADB implementation with adbkey='/config/.storage/androidtv_adbkey'

Logger: androidtv.adb_manager.adb_manager_async
Source: /usr/local/lib/python3.9/site-packages/androidtv/adb_manager/adb_manager_async.py:284
First occurred: 2:08:26 PM (1 occurrences)
Last logged: 2:08:26 PM

Couldn't connect to 192.168.1.84:5555. AdbTimeoutError: Timeout: read 0 of 24 bytes (transport_timeout_s = 1.0, read_timeout_s = 10.0)

Logger: androidtv.adb_manager.adb_manager_async
Source: /usr/local/lib/python3.9/site-packages/androidtv/adb_manager/adb_manager_async.py:269
First occurred: 2:08:12 PM (1 occurrences)
Last logged: 2:08:12 PM

Couldn't connect to 192.168.1.84:5555. ConnectionResetError: Connection reset by peer
SAOPP commented 2 years ago

Interesting, I never set the device_class to devices, maybe your trouble affiliated with it, but it's just a my minds right now.

SAOPP commented 2 years ago

Actually, it looks like you need to accept the connection at tv side... Maybe something wrong with previously adbkey.

jwelvaert commented 2 years ago

Well I turned off ADB Debugging and Apps from unknown sources, restarted Fire TV, reenabled debugging and Apps and it worked first time on both of sticks. Maybe just restarting Fire TV would have worked? I never got a pop up message to accept the connection on either one.

bcutter commented 2 years ago

Needed to reconfigure it as well (popped up as "new discovered device"), that's not what to expect when reading

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.
NotSoFunnyClown commented 2 years ago

So the YAML config is only useable for one time migration to GUI only? I use this integration too and changes in config YAML have no effect. The log just says:

Host [...] already configured. This yaml configuration has already been imported. Please remove it

Would be nice to have a YAML config beside the GUI for easy mass import/changes of apps.

ollo69 commented 2 years ago

Would be nice to have a YAML config beside the GUI for easy mass import/changes of apps.

If you want re-import YAML just delete integration and reboot HA. Keep in mind that in next HA mayor release YAML import for this integration has been removed.

github-actions[bot] commented 2 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.