
* Sets front matter defaults * Removes default front matter from section templates/pages * Removes default front matter from addon pages * Removes default front matter from integration pages * Removes default front matter from posts * Removes default front matter from docs pages * Removes default front matter from other pages * Fixes blog category pages
3.8 KiB
title, description, logo, ha_category, ha_release, ha_iot_class, redirect_from
title | description | logo | ha_category | ha_release | ha_iot_class | redirect_from | ||
---|---|---|---|---|---|---|---|---|
One wire Sensor | Instructions on how to integrate One wire (1-wire) sensors into Home Assistant. | onewire.png |
|
0.12 | Local Polling |
|
The onewire
platform supports sensors which are using the One wire (1-wire) bus for communication.
Supported devices:
- DS18B20
- DS18S20
- DS1822
- DS1825
- DS28EA00 temperature sensors
- DS2406/TAI-8570 Temperature and pressure sensor made by AAG
- DS2438/B1-R1-A Temperature, pressure and humidity sensor by AAG
The 1-Wire bus can be connected directly to the IO pins of Raspberry Pi or using dedicated interface adapter (e.g DS9490R).
Raspberry Pi setup
In order to setup 1-Wire support on Raspberry Pi, you'll need to edit /boot/config.txt
following this documentation.
To edit /boot/config.txt
on Hass.io use this documentation to enable SSH and edit /mnt/boot/config.txt
via vi
.
Interface adapter setup
owfs
When an interface adapter is used, sensors can be accessed on Linux hosts via owfs 1-Wire file system. When using an interface adapter and the owfs, the mount_dir
option must be configured to correspond a directory, where owfs device tree has been mounted.
Units with multiple sensors
This platform works with devices with multiple sensors which will cause a discontinuity in recorded values. Existing devices will receive a new ID and therefore show up as new devices. If you wish to maintain continuity it can be resolved in the database by renaming the old devices to the new names.
Connect to your database using the instructions from Database section. Check the names of sensors:
SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 10;
Alter the names of sensors using the following examples:
UPDATE states SET entity_id='sensor.<sensor_name>_temperature' WHERE entity_id LIKE 'sensor.<sensor_name>%' AND attributes LIKE '%\u00b0C%';
UPDATE states SET entity_id='sensor.<sensor_name>_pressure' WHERE entity_id LIKE 'sensor.<sensor_name>%' AND attributes LIKE '%mb%';
UPDATE states SET entity_id='sensor.<sensor_name>_humidity' WHERE entity_id LIKE 'sensor.<sensor_name>%' AND attributes LIKE '%%%' ESCAPE '';
Remember to replace <sensor_name>
with the actual name of the sensor as seen in the SELECT
query.
Configuration
To enable One wire sensors in your installation, add the following to your configuration.yaml
file:
# Example configuration.yaml entry
sensor:
- platform: onewire
{% configuration %} names: description: ID and friendly name of your sensors. required: false type: string mount_dir: description: Location of device tree if owfs driver used. required: false type: string {% endconfiguration %}
Configuration Example
When onewire
is added to Home Assistant, it will generate an ID for the sensor. You can specify a friendly name for the sensor with the name configuration option.
# Named sensor configuration.yaml entry
sensor:
- platform: onewire
names:
GENERATED_ID: FRIENDLY_NAME