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
Device, nor entity created in HA #9
Comments
@rplevka, hello. I cant se any "Got message ... " in log (must be at DEBUG level), so integration don't get messages from MQTT => could not detect device. I'll check it on fresh installation. |
so I enabled the debug logging level for the integration and restarted HASS just to find the mentioned messages in the log...and suddenly, even the device got created. Weird. I'm not aware of any changes to the config. Also i tried to restart HASS server several times. |
What was exact actions order while your first attempt?
Right? However, something went wrong: new device should be created immediately after step 5. I'll check the integration installation on fresh HA installation to debug it. |
I believe those were exactly the steps, yeah - I was following the instructions - 1 thing i made differently - I used different topic structure at first:
after that i noticed the integration works with the root topic, so i switched to Anyway, I've tried to restart HASS several times without any success. It almost looks like it started to work after I enabled debug logging output, which is probably just a correlation. |
Reconfiguration (without removing the integration) is not supported in correct way now, so it may affect too. OK, now it work and you may use the Integration. And I'll check the installation process: may be I have bug in installation mechanism... |
thanks for your prompt reply! |
so I think the issue is here. I changed my topic structure to make the unique device part the last level: I used the previous structure as I also use notify&fitness app + tasker mqtt to publish heart rate data from my wristband: Just curious, whether using |
Integration logic is to create device for every subtopic: if your family have several devices, then use single root topic for the sleep data and subtopic per device to create devices with names of subtopics. So, it need Your variant is reasonable too: phone device may provide a lot of data and it is OK to group data by device. In this case subscription should be: May be we should have option in configuration dialogue to choose more comfortable way. |
maybe a feature request, but I could imagine something like a jinja template to delimit the subtopic part to be taken for a device name, e.g.
|
Now we may use %%%device%%% macro for integration to get device name from different parts of MQTT topic. Old root_topic configuration option will be replaced by old_root_topic_value/%%%device%%% template. Have no breaking changes, but have a lot of changes in code, so it should be v2.0.0 release. Fixes #9, #8 *** * refactor: move mqtt topic to own property, replace root_topic It is a property by meaning, that should be generated from config. * refactor(sensor): move adding of previous configured entities to own function It is not related to subscription to root topic * feat: added device_macro This constant contain macro for getting position from topic * wip: fix cycle imports and sensor name * wip: process new message if we have sensor * refactor: make parameters of async_setup private to avoid "variable is not used" PyCharm warning * refactor(SleepAsAndroidInstance): turn list of sensors to Dict and add method for getting sensor by it's name * feat(SleepAsAndroidSensor): add model to device info. Model is MQTT to point out that it is MQTT integration. * wip: added todo * doc: add typehint for second parameter of subscribe_root_topic * feat: add critical message if we can't subscribe to topic * refactor: add more debug messages * style: added blank line after function definition * test(docker): add event sender * fix(sensor): use integration prefix in default sensor name * fix(instance): use correct message in get_sensor KeyError exception * feat(updating): update to new version * feat: allow empty old options * fix: skip error while creating new device * style(instance): remove extra blank lines * refactor(instance): remove unused import * doc: update documentation * doc: add topic_template description
General information
Integration
Integration version: v1.2.0
HASS version: 2021.3.4
Root topic: SleepAsAndroid
Application settings
configured Sleep as android to use
SleepAsAndroid/roman
topictopic:
How it works now?
The events are published by Sleep app to the broker and I can read them using mqtt client,
However, the HASS integration doesn't create any device nor entity.
What do you expect?
Device and entity that would collect the events and states from the mqtt topic
Steps to reproduce
I followed all the steps as described in readme
Debug log
I can see logs like:
Additional information
just wanted to say hi and thank you for the integration
The text was updated successfully, but these errors were encountered: