Skip to content

Add blog post about new sensor state classes#1023

Merged
emontnemery merged 8 commits intohome-assistant:masterfrom
emontnemery:state_class_total_blog
Aug 16, 2021
Merged

Add blog post about new sensor state classes#1023
emontnemery merged 8 commits intohome-assistant:masterfrom
emontnemery:state_class_total_blog

Conversation

@emontnemery
Copy link
Copy Markdown
Contributor

@emontnemery emontnemery commented Aug 12, 2021

Proposed change

Add blog post about new sensor state classes

Background in home-assistant/core#54523

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Removed stale or deprecated documentation

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

emontnemery and others added 2 commits August 12, 2021 15:44
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Tom Brien <TomBrien@users.noreply.github.com>
If the sensor's state class is `STATE_CLASS_TOTAL`, the last_reset attribute can
optionally be set to gain manual control of meter cycles; each time last_reset changes
the corresponding value is used as the zero-point when calculating `sum` statistics.
If last_reset is not set, the sensor's value when it was first added is used as the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"first added" -> when looking at the examples it looks like it uses the last state as the zero-point, not the first state.

If last_reset is not set, the sensor's value when it was first added is used as the
zero-point when calculating `sum` statistics.

Example of `STATE_CLASS_TOTAL` without last_reset:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are great examples and shouldn't be in a blog post but in the docs instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they can be both here and in the docs?

emontnemery and others added 2 commits August 13, 2021 12:37
Co-authored-by: Franck Nijhof <git@frenck.dev>
@jbouwh
Copy link
Copy Markdown
Contributor

jbouwh commented Aug 15, 2021

This page needs an update as well:
https://developers.home-assistant.io/docs/core/entity/sensor/
The state_class documentation for the MQTT sensor needs an update as well as it states only 'measurement' is a valid payload.
https://www.home-assistant.io/integrations/sensor.mqtt/

frenck
frenck previously approved these changes Aug 16, 2021
@emontnemery emontnemery merged commit 7cf756d into home-assistant:master Aug 16, 2021
@fsaris
Copy link
Copy Markdown

fsaris commented Aug 17, 2021

Isn't this merged to early as it's not part of a official release yet. And it Doesn't tell that's available as of version 2021.9.0

@ludeeus
Copy link
Copy Markdown
Member

ludeeus commented Aug 17, 2021

Everything on the dev documentation site should reflect the current state of the development branches.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants