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

Article needs 'clarity' - specifically "Configuration Variables" #32666

Open
bearhntr opened this issue May 9, 2024 · 7 comments
Open

Article needs 'clarity' - specifically "Configuration Variables" #32666

bearhntr opened this issue May 9, 2024 · 7 comments
Assignees

Comments

@bearhntr
Copy link

bearhntr commented May 9, 2024

Feedback

I am trying to use this to keep an eye on the DB size. Your variable unit_of_measurement does not indicate what choices are available B, KB, MB, GB, etc. (and if they are case sensitive). I have put in B, KB, MB and GB as choices - saved and restarted. I get the same value for each (I have it set to show 3 decimal places) and it never changes.

Also, I am using the DB which installs with HomeAssistant (I am going to assume that it is SQLite) - but might be helpful if this was specifically called out (rather than this):

SQLite
If you are using the recorder integration then you don’t need to specify the location of the database. For all other cases, add sqlite:////path/to/database.db as Database URL.

Just think it makes it a little easier, as not everyone is HA 'genius' level.

URL

https://www.home-assistant.io/integrations/sql/

Version

2024.5.2

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented May 9, 2024

Hey there @gjohansson-ST, @dougiteixeira, mind taking a look at this feedback as it has been labeled with an integration (sql) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of sql can trigger bot actions by commenting:

  • @home-assistant close Closes the feedback.
  • @home-assistant rename Awesome new title Renames the feedback.
  • @home-assistant reopen Reopen the feedback.
  • @home-assistant unassign sql Removes the current integration label and assignees on the feedback, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information) to the feedback.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information) on the feedback.

@gjohansson-ST
Copy link
Member

I think on point 2 I think we can make that clearer that if you haven't done anything it uses the recorder db. So I think that's good feedback.

On point 1 I'm not sure I get it. It gives a user an opportuniy to collect whatever info they want directly from the DB. Then the user needs to know what he's collecting and thereby setting the right UoM.
To use conversions you also need to set an appropriate device class and then you can change the UoM on the entity it creates. On the sql config you need to set the native UoM from whatever you're collecting.

It is a bit of an advanced integration so one needs to know what he's doing to use it.
If you want to monitor a db size perhaps filesize is a better option.

@bearhntr
Copy link
Author

bearhntr commented May 9, 2024

I agree that UoM (should make sense) but as I stated I have put in B, KB, MB and GB - and the value never seems to change. Always shows 126.## (even after setting to 3 decimal points). Once place it shows 2 places, the other it shows 3.

image

image

Notice I have it set to B (bytes) and the DB is way larger than 126.84 bytes.

@bearhntr
Copy link
Author

bearhntr commented May 9, 2024

image

@bearhntr
Copy link
Author

bearhntr commented May 9, 2024

I currently have 2 HA instances. The one which is shown above is my working one that has been up for 2+ years. I am building out a new one - which is currently using the 'pre-built-in' DB.

@gjohansson-ST
Copy link
Member

But as that query returns MB why do you write B as UoM?

You need to set the UoM that the query returns. Not what you maybe want to see in the UI.
Also if you don't set an appropriate device class it's not possible to convert (which is an UI option on the entity). The integration itself doesn't do conversions.

@bearhntr
Copy link
Author

bearhntr commented May 9, 2024

But as that query returns MB why do you write B as UoM?

You need to set the UoM that the query returns. Not what you maybe want to see in the UI. Also if you don't set an appropriate device class it's not possible to convert (which is an UI option on the entity). The integration itself doesn't do conversions.

I am looking at that query - how/where does it 'specify' MB as the value? I am not tying to 'thick'. But also looking at the other one on my new HA (which uses the SQLite built-in DB - which in the documentation also does not "State" it is MB (one could deduce that perhaps looking at the formula used).

image

My quandary which lead to the query is....on my brand new HA installation which has been up about a month. Has had 1.000 as the DB Size value since day 3 when I added the SQL Integration. It has never changed at all (no matter if it is B, KB, MB, GB) it just shows 1.000 (and the measurement after that changes to what I have put in, B, KB, MB, GB).

image

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

2 participants