home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.44k stars 30.32k forks source link

Feature request to add support for tank percentage to mopeka #87122

Closed Next9999 closed 1 year ago

Next9999 commented 1 year ago

The problem

Tks for adding the Integrates [Mopeka] sensor,,, very nice for MotorHome But How to get the %.. we are only seeing Tank Level in mm

What version of Home Assistant Core has the issue?

Home Assistant 2023.2.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Mopeka

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (mopeka) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `mopeka` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign mopeka` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


mopeka documentation mopeka source (message by IssueLinks)

jpettitt commented 1 year ago

The tank level in mm conversion to % is pretty easy to do in a template if you know your tank size. It's a simple conversion for vertical tanks. For large horizontal residential tanks it gets a bit more complex becasue a mm of propane at the top or bottom of the horizontal cylinder is a lot less than a mm of propane in the middle.

fhornrudd commented 1 year ago

Both the old Custom Component and the ESPHome components included a few common tank sizes and a custom tank size. All calculations for percent were just (x-min)/(max-min) so not really adapted for horizontal tanks.

Mopeka in their app include a few more: Vertical: 20, 30, 40, 100 lb; 120 gal Horizontal: 120, 150, 250, 500, 1000 gal Arbitrary: select horizontal/vertical and enter height

For those larger residential horizontal cylindrical tanks with hemi-heads you get equations with arccos like shown here: Horizontal Tank Example It would probably be fairly easy to build this out if the common dimensions were known for the different horizontal tank sizes.

fhornrudd commented 1 year ago

500 gal propane tank Mopeka reading to percent.xlsx Here is an example calculation for taking the reading from Mopeka and converting to an accurate volume percent for a horizontal tank. I used the 0.25” thickness from my home 500 gallon tank and other dimensions from Typical Tank Dimensions

bdraco commented 1 year ago

It should be pretty simple to make a template sensor to convert the level to a percentage using that example above 👍

bdraco commented 1 year ago

Thank you for reaching out. We use GitHub for tracking issues, not for providing support or tracking feature requests.

If you want to suggest a feature, you should try our Community Forum: Feature Requests.

If you have additional questions, feel free to join our Discord chat server.

Thanks! 👍