1Wire

From Domoticz
Revision as of 11:01, 30 November 2022 by Walter vl (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

1-Wire is a device communications bus system designed by Dallas Semiconductor Corp. that provides low-speed (16.3 kbit/s) data, signaling, and power over a single conductor.

Domoticz supports 1-Wire devices directly connected to the gpio of the Raspberry Pi or Windows system with serial adapter that runs Domoticz.

Setup

Windows

First Stop Domoticz

Download and install the OneWireDomoticzServiceInstaller.msi from here

With a serial adapter, update the OneWireDomoticzServiceConfig.xml in the OneWireDomoticzService installation directory (usually C:\Program Files (x86)\Domoticz\OneWireDomoticzService), with this content (update adapter name and COM port with your values), and restart the service :

<OneWireDomoticzServiceConfig>
  <adapter name="{DS9097U_DS948X}" port="COM1"/>
</OneWireDomoticzServiceConfig>

Supported adapter names are : {DS9097E}, {DS9097U_DS948X}, {DS9490}, NetAdapter

USB DS9490 adapter should be auto discovered, it doesn't need the OneWireDomoticzServiceConfig.xml file.

Restart Domoticz

Linux

There are two methods to use 1-Wire devices

w1-gpio/w1-therm

Follow this guide to connect and install 1-Wire support
How to Setup 1-Wire

When the above is working, do not forget to include the two modules in /etc/modules, otherwise after the next reboot it is not working anymore.

sudo vi /etc/modules


Add the following two modules (on separate lines):

w1-gpio
w1-therm

Restart domoticz, and 1-wire support should now be detected, and you are able to add a new hardware device (1-Wire)


Note: When using GPIO, set OWFS Path to nothing. After adding 1-wire (system) the sensors will eventually show up in the log.

OWFS

Follow this guide to connect and install OWFS - 1-Wire support
How to Setup OWFS

Make sure everything works as it should by checking the contents of the 1wire folder or by reading a sensor: (Change path according to your sensor id)

cat /mnt/1wire/10.F6877C010800/temperature


Restart domoticz, and 1-wire support should now be detected, and you are able to add a new hardware device (1-Wire)

Note: to be detected by Domoticz, the 1-wire filesystem must be mounted as /mnt/1wire

Disable 1-wire

Add this line to crontab (sudo crontab -e):
@reboot sudo rmmod w1_gpio

Add 1-Wire Hardware Gateway

After 1-wire system is working on your system you can add id to Domoticz:

Go to menu Setup -> Hardware

Select type: 1-Wire (system)

Enter a Name eg: 1-Wire

OWFS Path: Enter path starting with /mnt/1wire Leave empty when using w1-gpio/w1-therm method!!

Modify Sensor and switch Poll Periods to your need.

Click on Add to add the Hardware. Domoticz will create the connected 1-Wire devices.

They will show up in the devices list (menu Setup -> Devices) and need to be activated in domoticz (click on green arrow) to be shown in the devices tabs (switches, temperature etc).