IATkachenko / HA-SleepAsAndroid

Sleep As Android integration for Home Assistant
Apache License 2.0
165 stars 25 forks source link

Configuration not saved #25

Closed bartsmit closed 2 years ago

bartsmit commented 2 years ago

General information

Home Assistant

2021.11.1: Installation method (according to instructions): [X] Operating System [ ] Container [ ] Supervised [ ] Core

Integration

Installation method: [X] HACS [ ] manual from release [ ] manual from git Integration version: v1.4.0 Root topic: SleepAsAndroid

Application settings

topic: bartfp3 [ X] I can see MQTT messages from application at MQTT-server

How it works now?

Configuration changes in name and/or topic are submitted. The integration reports success but values do not change from defaults.

What do you expect?

Values change to strings entered

Steps to reproduce

  1. Integration
  2. SleepAsAndroid
  3. Configure
  4. Submit

    Debug log

    2021-11-08 20:14:59 WARNING (SyncWorker_3) [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

    Additional information

    This is part of troubleshooting why the integration does not create a device for the app. MQTT explorer shows events being published to the broker. Home Assistant is able to read another sensor over MQTT.

IATkachenko commented 2 years ago

@bartsmit, hello.

You have to restart HA after changing settings of integration. It have no ability (yet) to update settings/subscription on the fly.

If you need help with troubleshooting why the integration does not create a device for the app, increase log level to debug and feel free to open issue about it: I'll try to help.

At DEBUG level you will be able to see something like:

2021-11-08 23:16:53 INFO (MainThread) [custom_components.sleep_as_android] Setting up a15d13437777a9fff6f989fa09388817 
...
2021-11-08 23:16:54 DEBUG (MainThread) [custom_components.sleep_as_android] Subscribing to 'SleepAsAndroid/+' (generated from 'SleepAsAndroid/%%%device%%%')

and got a bit more information about process, that explains what exact topic(s) integration is using for waiting for events.

bartsmit commented 2 years ago

Thanks @IATkachenko. I will get some more troubleshooting time tomorrow and feedback on my findings.

IATkachenko commented 2 years ago

Thanks @IATkachenko. I will get some more troubleshooting time tomorrow and feedback on my findings.

From original report I see missconfiguration: root topic (topic template) does not match topic settings in application. Try something like: topic template SleepAsAndroid/bartfp3 (or SleepAsAndroid/%%%device%%% if you are going to track several devices) + topic in the application SleepAsAndroid/bartfp3

bartsmit commented 2 years ago

Hi @IATkachenko,

I found the issue - my HA MQTT had no read access to the SleepAsAndroid topic on the broker. The device popped right in after I changed it. Sorry for the hassle.