Components Home Assistant "Sensor”

3 minutes of reading
Proconductor: Home Assistant Community
Availability: included in thepersonale HUB Home Assistant
Category: software
Type: components Home Assistant
Implementation difficulties: dependent on the sensor platform used

The "sensor" component di Home Assistant is used to define, in configuration, one or more sensors present in the profirst home automation.

These sensors can provide real readings (physical sensors) as well as fictitious, derivative (virtual sensors). If you are not familiar with these concepts, it is good to read first carefully the page dedicated to "sensors in home automation"

The component "sensor"Of Home Assistant enables the user to configure - starting from the list of sensors natively supported by Home Assistant - various sensors which will, as usual, communicate among them and with the components (actuators, devices) defined in home automation.

Such sensors can also be used as "trigger”In the automations that are defined on theHUB personal.

Classes of sensors

Sensors defined by this component can be displayed on the interface of Home Assistant (and therefore categorized) with different classes of icons. This happens through an ad hoc configuration within the "customize" section.

The available classes are:

  • none: generic sensor. This rappresets the default and does not require ad hoc configuration.
  • battery: a percentage of remaining battery.
  • humidity: a percentage arappresist relative humidity.
  • illuminance: the current level of luminosity in a given environment.
  • temperature: temperature (in degrees centigrade or fahrenheit.

These classes are rappsign in with the following icons:

Home Assistant - Component icons Sensor

Examples of platforms connected to the component

Home Assistant it's a world evolving, then publish a complete list of platforms on this page appeligible for the component "Sensor"It would make no sense.

However, it is useful to list, among the platforms dedicated to the sensors and configurable through the component described on this page, some of the best known, in order to give an idea of ​​which sensors can be implemented.

MQTT Sensor Platform

The "MQTT" component of Home Assistant enable theHUB registration and publication of topics MQTT, useful when defining switches, lights and other components in home automation. We'll talk more about it here.

However, MQTT is also useful when it comes to surveying readings by MQTT sensors (for example, a thermal sensor Sonoff TH-16 / 10-TH updated to firmware Sonoff-Tasmota), and it is here that the platform intervenes “MQTT Sensor Platform"

Through a trivial configuration of the type:

  - platform: mqtt
    name: "Temperatura Sala"
    state_topic: "tele/Sonoff/SENSOR"
    unit_of_measurement: "°C"
    qos: 1
    value_template: "{{ value_json.AM2301.Temperature }}"

it is possible to have aentity thermal sensor which reads, through registration to the MQTT topic "tele /Sonoff/SENSOR”The temperature read by that sensor.

Daikin AC Platform

If you have a Daikin air conditioner (models BRP069A41, 42, 43, 45), you can use its sensors (internal and external) as home automation sensors via the "Daikin AC" platform.

The configuration, as in the case of MQTT Sensor Platform, it's trivial:

  - platform: daikin
      - inside_temperature
      - outside_temperature

World Tides Sensor Platform

Maybe you own a beach house and you want it a bilge pump starts automatically with the change of tide, or simply you are gods appsuf champions and you want to monitor the state of the tides directly in home automation.
Everyone has the profor your own reasons! 🙂

Through the platform "Word Tides Sensor"It is very simple: it will be sufficient to register on the site (thus obtaining an API key) and configure, at Home Assistant, an item similar to the following:

  - platform: worldtidesinfo
    api_key: LA_TUA_CHIAVE_API

Obviously the reference to the longitude and latitude of the location to be monitored will come directly from the main configuration of Home Assistant (See this page), as far as this platform allows to indicate different coordinates from those present in the configuration.

Arduino Sensor Platform

In case you are an expert of Arduino and the DIY, analogue contacts can be used of one or more Arduino boards in order to integrate them as sensors through the platform "Arduino Sensor"

These sensors are able to receive values ​​from 0 to 1024.

The banal configuration is the following:

  platform: arduino
      name: Door switch
      name: Brightness

The six pins of the Arduino UNO are registered by A0 at A5.

The platforms appeligible for the component "Sensor” they are many, these are just a few examples.
For the complete list, log in This Page and consult the column on the right.

Home Assistant Official LogoATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Home Assistant, for any doubt, question, information on the specific merit of these components.

Please comment below