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

Expose detailed status to HomeAssistant #127

Closed
CoMPaTech opened this issue Mar 4, 2020 · 5 comments
Closed

Expose detailed status to HomeAssistant #127

CoMPaTech opened this issue Mar 4, 2020 · 5 comments

Comments

@CoMPaTech
Copy link

Is your feature request related to a problem? Please describe.
Unless I overlooked it in my dev window (I've got a generous lot of entities), I didn't spot a status for room_assistant itself (I do see my bluetooth devices). As sometimes the PI0w's are unavailable (wifi intermission) or out of memory, or maybe just unplugged one to vacuum (heaven forbids), I'm not sure if tracking is accurate. While I could set-up monitoring in various ways, exposing a list of active nodes will surely help spotting issues easily.

Describe the solution you'd like
Add a room_assistant device with attributes describing each cluster node. Not yet looked at your code but adding a sensor.room_assistant or something similar with some attributes like:

device |  state | attributes
sensor.room_assistant | [on/off] | last change # last mqtt message?
 | | nodes: ["livingroom","kitchen"] # i.e. the nodenames in a list, actively updated
 | | leader: ["kitchen"]

Describe alternatives you've considered
Adding 'tracked by node' to each tracked device, but that will be cluttering (though useful when debugging, but you can just subscribe to mqtt for that)

Adding nodes as separate sensors, but not sure (besides showing things) if it would be useful in the long run (i.e. sensor.ra_kitchen with attributes like devices_tracked: 3, last_updated

Additional context

@mKeRix
Copy link
Owner

mKeRix commented Mar 4, 2020

Good idea! Should be useful for understanding the tracking history and some issues. Building on your suggestion above and my understanding of how Home Assistant entities should be used nowadays I would think adding two sensors makes sense: sensor.room_assistant_cluster_size with the count as state and the nodes in the attributes and sensor.room_assistant_cluster_leader with the current leader as state.

@CoMPaTech
Copy link
Author

That indeed sounds great!

@Alfiegerner
Copy link
Contributor

Great idea, this would definitely be very useful disgusting issues - I had an situation where my quorum wasn't reached due to varied reasons and I couldn't figure it out.

@mKeRix mKeRix closed this as completed in b8249e8 May 2, 2020
github-actions bot pushed a commit that referenced this issue May 2, 2020
# [2.5.0](v2.4.0...v2.5.0) (2020-05-02)

### Bug Fixes

* **bluetooth-low-energy:** log warnings from BLE adapter ([dccbce5](dccbce5))
* set leader status to none if not picked yet ([8025011](8025011))
* **cluster:** log leader election events on all nodes ([ab87ef5](ab87ef5))

### Features

* **home-assistant:** add support for MQTT device trackers ([3e50cd3](3e50cd3)), closes [#183](#183)
* add Docker healthchecks ([a8cffec](a8cffec))
* add sensors for cluster state ([b8249e8](b8249e8)), closes [#127](#127)
@github-actions
Copy link

github-actions bot commented May 2, 2020

🎉 This issue has been resolved in version 2.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mKeRix
Copy link
Owner

mKeRix commented May 2, 2020

Quick side note: the sensors I suggested above are now registered per instance, i.e. you will have two new sensors for each instance in your cluster. Decided to go that route because it's much easier to find split cluster issues this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants