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

Remove special case for % scaling in sensor cards #10476

Merged
merged 1 commit into from Dec 2, 2021

Conversation

CarlosGS
Copy link
Contributor

@CarlosGS CarlosGS commented Oct 30, 2021

Proposed change

There was a special case for % units, that assumed the min and max values would be 0-100%. This impaired the effectiveness of the sensor cards for that specific unit, causing the visualization to be a flat line (see #9522 #9532).

This PR allows to treat all sensors equally, without having to consider special cases (i.e. manual workarounds for normalization in humidity sensors, sensors with negative percent values, or values greater than 100, etc).
Hence providing the expected normalized graphs unless limits are manually specified.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

@balloob balloob merged commit 60ce805 into home-assistant:dev Dec 2, 2021
@balloob
Copy link
Member

balloob commented Dec 2, 2021

I don’t agree with this PR but it looks like I’m the only one 🤷

If you’re talking about impairing the effectiveness, now you don’t know anything about the value. You see a line, it’s going up or down and it’s relative, but you don’t know that value ?

Now the reason I did merge it is that % sensors can be more than 100% in certain cases and in that case the limits didn’t work correctly.

@CarlosGS
Copy link
Contributor Author

CarlosGS commented Dec 2, 2021

That is a good point. Though a slightly a different view, in that the scale is missing from the visualization.
For example, I find very useful information in the variability (i.e. trends of each sensor for the last three days) combined with the "last" value that is already printed in the graphs. Hadn't really thought of other setups that would need to fix the scale ends, but they can still do that manually for any kind of sensor.

Maybe there could be an extra option to label the graph's axes. Personally I do like the current simplicity. Consider too that clicking on the graphs already brings up the detailed, labeled axis view for each sensor.

Also note the docs update home-assistant/home-assistant.io#20077 to match this change. And thanks kindly for all you do 😊

@balloob
Copy link
Member

balloob commented Dec 2, 2021

You're welcome! And thank you for your contribution.

balloob added a commit that referenced this pull request Dec 3, 2021
* Fix thingktalk dialog (#10600)

* Add picture uploader to area (#10544)

* Update image-cropper-dialog.ts

* WebRTC fix for Safari (#10602)

* Update MDI to v6.5.95 (#10618)

* Remove deprecated icons (#10622)

* Improve startup experience by removing AppBar skeleton (#10569)

* Correct ZHA LQI sort in device children dialog (#10616)

* Remove add-on store tab (#10624)

* Add markers-updated to ha-locations-editor (#10601)

* Use ha-form for onboarding-create-user (#10604)

* Fix datatable checkbox width (#10631)

* Move updates (#10626)

* Add correct button label to "no_state" statistics fix dialog (#10628)

* Update Lovelace Cast app ID (#10592)

* Cast fixes (#10598)

* Remove customize UI (#10632)

* Show updates on dashboard for dev (#10637)

* Area Card (#10141)

Co-authored-by: Philip Allgaier <mail@spacegaier.de>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Bumped version to 20211117.0

* Fix back button color (#10650)

* Fix active tab (#10654)

* Remove ha-alert actionText (#10646)

* Use ha-formfield around backup checkbox (#10653)

* Simplify launch screen svg (#10643)

* Always render groups/areas in a single column (#10655)

* Send error message to sender (#10660)

* Add frequency device class for sensor (#10621)

* Fix color over slotted image in ha-alert (#10652)

* Make ha-chip-set slot-able (#10647)

* Remove core note on update page (#10661)

* Add iconColor to ha-config-navigation entries (#10658)

* Use white for icons with backgound (#10672)

* Fix color overlay in ha-alert content (#10674)

* Add scenes and scripts as buttons in footer of area cards (#10673)

* Add scenes and scripts as chips in footer of area cards

* Remove unused chips config type

* Update src/panels/lovelace/common/generate-lovelace-config.ts

Co-authored-by: Zack Barett <arnett.zackary@gmail.com>

* Fix typing

Co-authored-by: Zack Barett <arnett.zackary@gmail.com>

* Fix dark main-content and split gallery demo (#10675)

* Make "Show more" show everything starting from yesterday (#10533)

* Use component to ensure relative-time in Glance card gets updated (#10666)

* Limit setting up supervisor subscriptions to the supervisor panel (#10680)

* Remove first part of the update description (#10669)

* Fixing typo in #10626 (#10686)

* Bumped version to 20211123.0

* Update background colors of navigation icons (#10691)

* Render update card on add-on page (#10681)

* Fix addon slug (#10693)

* Improve device information when via device is unknown (#10685)

* Don't make button disabled on error (#10699)

* Use app-header-text-color (#10711)

* Finish up config changes (#10710)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fix typo on config page + adjust icon color (#10713)

* Add ha-faded (#10651)

* Use `ha-icon-button` in `ha-icon-overflow-menu` (#10692)

* Prevent errors in `more-info-climate` if no modes are provided despite support flags (#10694)

* Make "Energy distribution today" translatable (#10696)

* Default to yaml editing when there are multiple states in condition (#10481)

* Filter out disabled entities in the statistics dev tools (#10677)

* Convert cover UI to Lit + ensure proper tilt rendering (#10671)

* Fixed ellipsis usage on graph legend entries. (#10707)

* Ensure required translations are loaded in safe-mode (#10709)

* Ensure markdown card input is a string (#10705)

* Fix chip text color variable overrides (#10722)

* Ensure `conditional` rows getting `state_color` value (#10708)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fixed invalid hour handling in AMPM mode (#10717)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Installation type property during onboarding was misspelled (#10721)

* Dashboard tweaks (#10729)

* Tweak how scenes behave in generated lovelace (#10730)

* Bumped version to 20211130.0

* Improve hls stream view error handling (#10714)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Move companion app config from sidebar to configuration dashboard (#10733)

* Move companion app config from sidebar to configuration dashboard

* Remove translation refrence

* Fix typo (#10734)

* Revert 10711 (#10736)

* Use backend for day month stats in energy dashboard (#10728)

* Handle 0 updates and show back on supervisor panels (#10744)

* Hide ha-icon-next if narrow (#10746)

* Change the area of scenes in editor (#10731)

* Fix faded element in change log (#10737)

* Updated text (#10747)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Focus Add-ons & Backups in config panel when clicking Supervisor in sidebar (#10745)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Add SmartStart/QR scan support for Z-Wave JS (#10726)

* Show disabled entity names on the device page (#10743)

* Show disabled entity names on the device page

* Update src/panels/config/devices/device-detail/ha-device-entities-card.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Bumped version to 20211201.0

* Fix pointer/more-info inconsistencies for entity rows (#10025)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Make graph colors themable (#10698)

* Use puzzle for addons and blur entries on click (#10755)

* Fix create backup checkbox (#10756)

* Use unit system definitions for weather units (#10657)

* handle ha-radio and ha-checkbox in ha-formfield (#10759)

* Fix SU sidebar issues (#10757)

* Use add-ons for mobile header (#10760)

* Hide updates for dev as well (#10761)

* Remove thingtalk cleanup create new automation dialog (#10748)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Add missing translation (#10769)

* Update hui-graph-header-footer.ts (#10476)

* Group entities in area card by domain (#10767)

* Group entities in area card by domain

* Update hui-area-card.ts

* Update

* Add background color when no image

* Add camera support

* exclude unavailable states

* Update hui-area-card.ts

* Use chips for button rows (#10770)

* Bumped version to 20211202.0

* Show add devices fab on devices page for ZJS (#10771)

* Add default icons for button entities (#10774)

* Remove handling of the supervisor panel from the sidebar (#10773)

* Tweak ZJS dashboard (#10772)

* Guard for non numeric states (#10775)

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Use correct styling for cloud certificate dialog (#10782)

* Allow overriding device class (#10777)

* Restore flex alignment for select and input-select rows (#10783)

* Add support for local only users (#10784)

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Differentiate between assigned and targeting scene/automations/script (#10781)

* Add provisioned device overview to zwave js (#10785)

* Use groupBy (#10786)

* Ensure we always have an active theme name (fixes dark theme issues) (#10780)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* safari doesnt support overflow-wrap: anywhere

* Fix entity marker (#10787)

* Bumped version to 20211203.0

Co-authored-by: Allen Porter <allen@thebends.org>
Co-authored-by: Michael Irigoyen <michael@irigoyen.dev>
Co-authored-by: Lasse Rosenow <10547444+LasseRosenow@users.noreply.github.com>
Co-authored-by: David F. Mulcahey <david.mulcahey@me.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Philip Allgaier <mail@spacegaier.de>
Co-authored-by: Zack Barett <arnett.zackary@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Laszlo Magyar <lmagyar1973@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Nathan Orick <cnathanorick@gmail.com>
Co-authored-by: Luca Cavalli <lcavalli@users.noreply.github.com>
Co-authored-by: amitfin <amittein@gmail.com>
Co-authored-by: Matthias de Baat <hello@matthiasdebaat.com>
Co-authored-by: rianadon <ryanadolf123@gmail.com>
Co-authored-by: Carlos Garcia Saura <CarlosGS@users.noreply.github.com>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sensor not rendering humidity sensor graph line correctly
5 participants