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

KNX Group Monitorn History Data #92

Closed
chrisch80 opened this issue Aug 3, 2023 · 7 comments
Closed

KNX Group Monitorn History Data #92

chrisch80 opened this issue Aug 3, 2023 · 7 comments

Comments

@chrisch80
Copy link

Is it possible to have a longer history in the KNX group monitor view?
Is this data stored in a DB and can bei accessed somehow?

@farmio
Copy link
Member

farmio commented Aug 3, 2023

Hi 👋!
Yes, it is possible to adjust that in the integration configurations "communication settings" menu.

The data is stored in memory.
Since 2023.8 it's also written to a file, but only when the integration unloads - to be able to restore history data after eg. a restart.

@chrisch80
Copy link
Author

Cool, thanks
Do you have some proposal how to store it in a db or could this be added as feature in the future?

@farmio
Copy link
Member

farmio commented Aug 5, 2023

There are no plans to do so currently. What would be the usecase for that?

It was initially built to only write to disk on shutdown - with RaspberryPi SD-Card installations in mind. This feature should not stress these cards more than necessary.

@chrisch80
Copy link
Author

I would like to montior the KNX-BUS with own scripts, but maybe it is better to fully integrate it in HomeAssistant.

@farmio
Copy link
Member

farmio commented Aug 5, 2023

Aha. Tbh this sounds a little bit out of scope for the HA KNX integration.

But anyway, I don't think you'd need a database for that. You can just use the same websocket endpoint we use for the group monitor to get live data and process it in your script. See https://github.com/home-assistant/core/blob/f0abea48a6aef5c8f35770f36df5a47488ed3df6/homeassistant/components/knx/websocket.py#L163
Be aware, that this is not considered a public API currently and may be subject of change in future releases.

You could of course also just use an xknx instance in your script and have a separate connection providing callbacks to your logic.

From Home Assistant it may be doable using HA Events (knx_event) - depending on what you actually want to monitor.

@chrisch80
Copy link
Author

cool thx

@rvk
Copy link

rvk commented Aug 13, 2023

+1 for this feature, and I'll provide a standard use case.

Many visualization products for KNX have the data logging feature. It's used to diagnose intermittent problems that can't be reproduced while integrator is on-site.

For this, data survivability is critical, but timing of the writes is not. I think good solution for both considerations would be to have default behaviour as it is, but to add disk writing frequency as configurable option. Could you consider adding this?

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

No branches or pull requests

3 participants