Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup failed for sleep_as_android: Integration not found. #13

Closed
hACKrus opened this issue Aug 16, 2021 · 13 comments
Closed

Setup failed for sleep_as_android: Integration not found. #13

hACKrus opened this issue Aug 16, 2021 · 13 comments
Labels
bug Something isn't working CI CI issues

Comments

@hACKrus
Copy link

hACKrus commented Aug 16, 2021

After update to version 1.2.4 getting such error in logs:

Logger: homeassistant.setup
Source: setup.py:173
First occurred: 1:42:57 PM (1 occurrences)
Last logged: 1:42:57 PM

Setup failed for sleep_as_android: Integration not found.

In Integrations menu:

image

If delete Integration - new will not presented in Add menu.

Sleep sensor exists, but with state: unavailable.

Revert to v1.2.3 fix the problem.

@mikhail5555
Copy link

I also was looking at this, i think i found the reason, for the release no sleep_as_android.zip file is provided.

@IATkachenko
Copy link
Owner

oops... it was manual release so CI tools don't create archive... sorry.

@IATkachenko
Copy link
Owner

Archive was added to release. Is it OK now?

@IATkachenko IATkachenko added bug Something isn't working CI CI issues labels Aug 16, 2021
@IATkachenko IATkachenko pinned this issue Aug 16, 2021
@mikhail5555
Copy link

[custom_components.hacs] <Integration IATkachenko/HA-SleepAsAndroid> Download of sleep_as_android.zip completed

Seems indeed fixed! Thanks!

I'm kinda dissapointed in Hacs since it reported no error at all, it just failed to create a component in /config/custom_component/sleep_as_android, so was kinda annoying to debug.

@mikhail5555
Copy link

You might also want to add it to the v2.0.0 beta (If you want people to be able to test it)

@IATkachenko
Copy link
Owner

@mikhail5555, good point, thank you.

@IATkachenko IATkachenko unpinned this issue Aug 18, 2021
@hACKrus
Copy link
Author

hACKrus commented Aug 26, 2021

Same problem happened again in 1.3.1. Downgrade to 1.3.0 solve the issue.

@IATkachenko
Copy link
Owner

IATkachenko commented Aug 26, 2021

@hACKrus, could you post a log while upgrading 1.3.0->1.3.1 / restarting after upgrade?
sleep_as_android.zip is attached to release, so there should not be any problem with this.
Have no issues in my test environment while upgrading or reinstalling 1.3.1 via HACS

@IATkachenko IATkachenko reopened this Aug 26, 2021
@hACKrus
Copy link
Author

hACKrus commented Aug 26, 2021

Absolutely none information in logs except usual:
2021-08-26 18:49:39 WARNING (SyncWorker_6) [homeassistant.loader] We found a custom integration sleep_as_android which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Reproduction is same:

  • Update 1.3.0 to 1.3.1
  • Reboot HA
  • Sensor is grey and unavailable, start sleep on phone doesn't reported.

However, after delete and reconfiguration of integration with intermediate reboots - sensor started to work.

@IATkachenko
Copy link
Owner

IATkachenko commented Aug 26, 2021

Could you add

logger:
  default: warning
  logs:
    custom_components: debug
    custom_components.sleep_as_android: debug

to configuration.yaml and try again?
It should tell us something at DEBUG level...

IATkachenko added a commit that referenced this issue Aug 26, 2021
There was some problem related to integration installation via HACS in #13. It is comfortable to have prepared configuration for tests.
@hACKrus
Copy link
Author

hACKrus commented Aug 27, 2021

2021-08-27 10:13:11 INFO (MainThread) [custom_components.sleep_as_android] Setting up c768a795373a474cffbed334508d21d0
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] device_name_from_entity_id: entity_id='SleepAsAndroid_eugen'
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] add_configured_entities: creating sensor with name eugen
2021-08-27 10:13:11 INFO (MainThread) [custom_components.sleep_as_android] New device! Let's create sensor for eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] Creating sensor with name eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] async_setup_entry: adding configured entities is finished.
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] Going to subscribe to root topic.
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] Subscribing to 'SleepAsAndroid/+' (generated from 'SleepAsAndroid/%%%device%%%')
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] My identifiers is {('sleep_as_android', 'SleepAsAndroid_eugen')}
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] My identifiers is {('sleep_as_android', 'SleepAsAndroid_eugen')}
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] My device id is edb088e4efa6683b7e0a31f623ed5b73
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] create_entity_id: my name is SleepAsAndroid, device name is eugen
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android] Subscribing to root topic is done!
2021-08-27 10:13:11 DEBUG (MainThread) [custom_components.sleep_as_android.sensor] async_setup_entry is finished

Just after reboot:
image

Same sensor after sleep tracking:
image

So, may be it's just cosmetic issue.

@IATkachenko
Copy link
Owner

All goes well: after restarting HA: we don't know anything about tracking state and waiting for MQTT message with report from application.
I may set something like "unknown", but "unavailable" is a some sort of standard for HA sensor if state is not known (and HA is know how to work with this: icon is gray and HA knows that sensor have no real data).
Also we could not ask application about sleep tracking state.
Save state between restart is no good idea too (just because we may miss some reports from application while restart and report wrong state).

So, "unavailable" state after restart is normal.

@hACKrus
Copy link
Author

hACKrus commented Aug 27, 2021

Ok, many thanks for explanation.

Issue can be closed.

IATkachenko added a commit that referenced this issue Sep 3, 2021
There was some problem related to integration installation via HACS in #13. It is comfortable to have prepared configuration for tests.
IATkachenko added a commit that referenced this issue Sep 3, 2021
There was some problem related to integration installation via HACS in #13. It is comfortable to have prepared configuration for tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI CI issues
Projects
None yet
Development

No branches or pull requests

3 participants