diff --git a/source/_components/binary_sensor.command_line.markdown b/source/_components/binary_sensor.command_line.markdown index 75af57029da..a5e1502f578 100644 --- a/source/_components/binary_sensor.command_line.markdown +++ b/source/_components/binary_sensor.command_line.markdown @@ -29,7 +29,7 @@ Configuration variables: - **command** (*Required*): The action to take to get the value. - **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used. -- **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. +- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON". - **payload_off** (*Optional*): The payload that represents disabled state. Default is "OFF". - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. @@ -48,7 +48,7 @@ binary_sensor: - platform: command_line command: netstat -na | find "33322" | find /c "LISTENING" > nul && (echo "Running") || (echo "Not running") name: 'sickragerunning' - sensor_class: moving + device_class: moving payload_on: "Running" payload_off: "Not running" ``` @@ -62,7 +62,7 @@ binary_sensor: - platform: command_line command: 'ping -c 1 rasplex.local | grep "1 received" | wc -l' name: 'is_rasplex_online' - sensor_class: connectivity + device_class: connectivity payload_on: 1 payload_off: 0 ``` @@ -74,7 +74,7 @@ binary_sensor: platform: command_line name: Printer command: ping -W 1 -c 1 192.168.1.10 > /dev/null 2>&1 && echo success || echo fail - sensor_class: connectivity + device_class: connectivity payload_on: "success" payload_off: "fail" ``` diff --git a/source/_components/binary_sensor.enocean.markdown b/source/_components/binary_sensor.enocean.markdown index 4ca424290fc..be54e444700 100644 --- a/source/_components/binary_sensor.enocean.markdown +++ b/source/_components/binary_sensor.enocean.markdown @@ -28,4 +28,4 @@ Configuration variables: - **id** (*Required*): The ID of the device. This is the 4 bytes long number written on the dimmer. - **name** (*Optional*): An identifier for the switch in the frontend. -- **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. +- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. diff --git a/source/_components/binary_sensor.markdown b/source/_components/binary_sensor.markdown index 4da25f56736..15ea82af662 100644 --- a/source/_components/binary_sensor.markdown +++ b/source/_components/binary_sensor.markdown @@ -13,7 +13,7 @@ Binary sensors are gathering information about state of switches, contacts, pins Knowing that there are only two states allows Home Assistant to represent the sensor better in the frontend. -Most binary sensors support the `sensor_class:` which let you specify the type of your sensor. The following types are supported: +Most binary sensors support the `device_class:` which let you specify the type of your sensor. The following types are supported: - **None**: Generic on/off - **cold**: On means cold (or too cold) diff --git a/source/_components/binary_sensor.mqtt.markdown b/source/_components/binary_sensor.mqtt.markdown index e701a556c4f..2cec66a0533 100644 --- a/source/_components/binary_sensor.mqtt.markdown +++ b/source/_components/binary_sensor.mqtt.markdown @@ -32,7 +32,7 @@ Configuration variables: - **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0. - **payload_on** (*Optional*): The payload that represents on state. Default is "ON". - **payload_off** (*Optional*): The payload that represents state. Default is "OFF". -- **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. +- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of a sensor manually: @@ -52,7 +52,7 @@ binary_sensor: qos: 0 payload_on: "1" payload_off: "0" - sensor_class: opening + device_class: opening value_template: '{% raw %}{{ value.x }}{% endraw %}' ``` diff --git a/source/_components/binary_sensor.rest.markdown b/source/_components/binary_sensor.rest.markdown index 9ee605dad67..dba62fee4aa 100644 --- a/source/_components/binary_sensor.rest.markdown +++ b/source/_components/binary_sensor.rest.markdown @@ -52,7 +52,7 @@ Configuration variables: - **resource** (*Required*): The resource or endpoint that contains the value. - **method** (*Optional*): The method of the request. Default is GET. - **name** (*Optional*): Name of the REST binary sensor. -- **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. +- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. - **payload** (*Optional*): The payload to send with a POST request. Usually formed as a dictionary. - **verify_ssl** (*Optional*): Verify the certification of the endpoint. Default to True. @@ -80,7 +80,7 @@ binary_sensor: resource: http://192.168.0.5/digital/9 method: GET name: Light - sensor_class: light + device_class: light value_template: {% raw %}'{{ value_json.return_value }}'{% endraw %} ``` diff --git a/source/_components/binary_sensor.template.markdown b/source/_components/binary_sensor.template.markdown index 02cacfe1466..87b6310c10f 100644 --- a/source/_components/binary_sensor.template.markdown +++ b/source/_components/binary_sensor.template.markdown @@ -29,7 +29,7 @@ Configuration variables: - **sensors** array (*Required*): List of your sensors. - **friendly_name** (*Optional*): Name to use in the Frontend. - - **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. + - **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. - **entity_id** (*Optional*): Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state. @@ -48,7 +48,7 @@ sensor: furnace_on: value_template: {% raw %}{{ states.sensor.furnace.state > 2.5 }}{% endraw %} friendly_name: 'Furnace Running - sensor_class: heat + device_class: heat ``` ### {% linkable_title Switch as sensor %} @@ -61,10 +61,10 @@ binary_sensor: sensors: movement: value_template: {% raw %}"{{ states.switch.movement.state == 'on' }}"{% endraw %} - sensor_class: motion + device_class: motion door: value_template: {% raw %}"{{ states.switch.door.state == 'on' }}"{% endraw %} - sensor_class: opening + device_class: opening ``` @@ -78,7 +78,7 @@ binary_sensor: sensors: co: friendly_name: 'CO' - sensor_class: 'gas' + device_class: 'gas' value_template: {% raw %}>- {%- if is_state("sensor.bedroom_co_status", "Ok") and is_state("sensor.kitchen_co_status", "Ok") diff --git a/source/_components/binary_sensor.trend.markdown b/source/_components/binary_sensor.trend.markdown index f4b8c799efe..15f49c2a2fc 100644 --- a/source/_components/binary_sensor.trend.markdown +++ b/source/_components/binary_sensor.trend.markdown @@ -30,7 +30,7 @@ Configuration variables: - **sensors** array (*Required*): List of your sensors. - **friendly_name** (*Optional*): Name to use in the Frontend. - - **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. + - **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. - **entity_id** (*Required*): The entity that this sensor tracks. - **attribute** (*Optional*): The attribute of the entity that this sensor tracks. If no attribute is specified then the sensor will track the state. - **invert** (*Optional*): Invert the result (so `true` means descending rather than ascending) @@ -50,7 +50,7 @@ binary_sensor: temperature_up: friendly_name: 'Temp increasing' entity_id: sensor.skylight_temperature - sensor_class: heat + device_class: heat ``` And this one indicates `true` if the temperature is falling: @@ -62,6 +62,6 @@ binary_sensor: temperature_down: friendly_name: 'Temp decreasing' entity_id: sensor.skylight_temperature - sensor_class: cold + device_class: cold invert: Yes ``` diff --git a/source/_components/mqtt.markdown b/source/_components/mqtt.markdown index f0d6cdb249f..3f61f6ac6d8 100644 --- a/source/_components/mqtt.markdown +++ b/source/_components/mqtt.markdown @@ -217,7 +217,7 @@ mqtt: discovery_prefix: homeassistant ``` -A motion detection device for your garden would sent its configuration as JSON payload `{"name": "garden", "sensor_class": "motion"}` to the topic `homeassistant/binary_sensor/garden/config`. After the first message to `config`, then the MQTT messages sent to `state`, eg. `homeassistant/binary_sensor/garden/state`, will update the state in Home Assistant. +A motion detection device for your garden would sent its configuration as JSON payload `{"name": "garden", "device_class": "motion"}` to the topic `homeassistant/binary_sensor/garden/config`. After the first message to `config`, then the MQTT messages sent to `state`, eg. `homeassistant/binary_sensor/garden/state`, will update the state in Home Assistant. ## {% linkable_title Logging %}