Skip to content

Sensor device class docs #5219

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

Merged
merged 8 commits into from
May 1, 2018
Merged

Conversation

OttoWinter
Copy link
Member

@OttoWinter OttoWinter commented Apr 21, 2018

Description:

To make the frontend icon package a lot smaller, sensors should in most cases now report their icon via device_class(if the device class is common). See home-assistant/core#14010, home-assistant/frontend#1115 and home-assistant/frontend#1100

Pull request in home-assistant (if applicable): home-assistant/core#14010

Device Class Icons Screenshot

The page includes a screenshot of all supported device classes. If new device classes are added, this screenshot should also be updated. Use this configuration and setup the new device class template sensors to do so:

sensor:
  - platform: template
    sensors:
      empty:
        friendly_name: Empty device_class
        value_template: 0
      battery:
        friendly_name: device_class battery
        value_template: 70
        unit_of_measurement: '%'
        device_class: battery
      humidity:
        friendly_name: device_class humidity
        value_template: 77
        unit_of_measurement: '%'
        device_class: humidity
      temperature:
        friendly_name: device_class temperature
        value_template: 12.2
        unit_of_measurement: °C
        device_class: temperature

group:
  sensor_device_classes:
    name: Sensor Device Classes
    entities:
      - sensor.empty
      - sensor.battery
      - sensor.humidity
      - sensor.temperature

Checklist:

  • Branch: Fixes, changes and adjustments should be created against current. New documentation for platforms/components and features should go to next.
  • The documentation follow the standards.


Home Assistant currently supports a wide range of sensors. They are able to display information which are provides by Home Assistant directly, are gathered from web services, and, of course, physical devices. Please check the sidebar for a full list of supported sensor platforms.

### {% linkable_title Device Class %}
Copy link
Member Author

Choose a reason for hiding this comment

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

The configuration variables generator is pointing device_class options to /components/%{component}/#device_class, so there needs to be a title here for the link to work.

https://github.com/home-assistant/home-assistant.github.io/blob/7bfe31cbac81b23764066ed41a8d988384a78f01/plugins/configuration.rb#L5

@OttoWinter OttoWinter mentioned this pull request Apr 26, 2018
2 tasks
@@ -71,9 +71,10 @@ homeassistant:

### {% linkable_title Device Class %}

Device class is currently supported by the following platforms:
Device class is currently supported by the following domains:
Copy link
Member Author

Choose a reason for hiding this comment

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

Just wondering: I do understand the difference between platforms (sensor.mqtt for example) and components (sensor) - or at least I think I do.

But I've also heard the term "domain" a couple of times. Is a domain the same thing as component or rather the name of a component? Which one is preferred to be used?

Copy link
Member

Choose a reason for hiding this comment

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

I think that we should avoid using domain here. In the user documentation we should stick to "component" and "platform".

Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

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

🐦

@fabaff fabaff merged commit 76b908b into home-assistant:next May 1, 2018
Danielhiversen added a commit that referenced this pull request May 3, 2018
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

Successfully merging this pull request may close these issues.

2 participants