How can i get One-Wire Temp-Sensors to Openhab the best way?

But with this sonoff i need 230v power on the sensor?

Yes, the Sonoff is powered by AC voltage… No need for power adpators
or batteries…

Hi…i am a new user here. As per my knowledge the 1wire OH binding requires you to operate a 1wire server.So you would probably be “out of software” if you went the USB dongle path.There’s also alternative solutions. Some zWave devices allow for attaching 1wire temp sensors, and I read about someone to use a Pokeys57E with Modbus binding instead of a Pi to connect several 1 wire lines.

printed circuit assembly services

I myself bought a intel nuc
On the server i have a couple of Virtual machines running. In one of my VMs I run a owserver with the usb onewire. Install the software and point openhab to the IP of the VM.

The main reason I use a server with Vms is:

  1. openhab is running in a Vm --> which is a running system I wont touch (except the upgrades of OH2) and im easily able to make backups
    And secondly there are a lot of additional software “products” I need / or want eg. owserver, squeezebox, owncloud, and so on which I can add as an additional VM

If cabling is no problem, one pi as server reading temperatures using owfs or digitemp with either usb dongle or rpi 1wire expansion card.
Like suggested above its really easy to create a script that sends values using mqtt. I’d be happy to share mine if anyone is interested.

Another thing to consider when it comes to cabling, if you have spare Ethernet wallsockets, you can use those to carry the 1 wire data.

Regards s

Hi, I’m working on a raspberry with Openhabian. I’m waiting (it will take looong!) from Aliexpress a set of sensors and would like to handle them inside OH2 via MQTT.
Do I need to install mysensor librarie and serial binding to make them work?

By now its only a test installation so I could temporary use PI GPO, but later on an ESP module would be better i think

You have several options, depending on the sensors you’ve bought.
One easy way for ESP8266 is the ESPEasy firmware, mosquitto broker and MQTT binding.
On the ESPEasy firmware the MQTT support for openHAB is built in, the supported sensors are:

1 Like

Ok i get this thanks.
And if I want To use gpio To have Cabled sensors is mqtt necessary?

There is no “yes” or “no” to this question: it depends all on the sensors you have (or intend to buy).

Has anyone installed 1-wire sensors all over the house and reading out with a raspi? How long are your wires from raspi to sensor? Do you have 2 wires (parasitic) or 4 wires (with power)?

Hopping from sensor to sensor or directly from raspi to each sensor directly?

I think i can´t use it in my house, because of the long distances and i have directly wires from a central point to each sensor place.

Don’t think raspi, think 1-wire master, which in most cases is either a separate board or a USB adapter.
With power you will have 3, not 4 wires.
In regards to distance and topology - take a look into this application note from Maxim/Dallas.


When I’ll get my order I’ll test cable lenght because I’m itnerested too in having sensor connected without using wifi

As partially discussed in my previous post, I use:

5m isn´t that much.

If i would put cables inside my house, i would be around 150m or more when i go from sensor to sensor. If i make it directly from one central point with direct cable to each sensor, then it will be about 10-15m for each sensor. Maybe on some sensors a maximum of about 20m.


You asked what others use, so I told you. :slight_smile:

If however you read Maxim app note 148 linked above, you’d find out how to implement cable lengths of up to 200m with simple driver circuits, and 500m with more active compensation.

No problem, i didn´t want to say a bad word. I will have a look at the document.

But until i have time to install some wires, i bought xiaomi mi temp & humidity sensors. Working very good so far. And the biggest surprise was, all 6 sensors show the nearly exact same temperature/humidity, so they are good calibrated and i can compare the values.

I have a setup like you’re searching for. A complete KNX-Setup and using the two free lines for 1-Wire.
I’ve attached a usb dongle for connecting 1-Wire to my pi.

It works for my temperature sensors with some hooks. You can’t guarantee that sensors will answer each time you are asking for their value. So you’ll have a log full of error messages.
In my case it’s ok.

Then I tried to connect a humidity sensor and that failed because of the 2 lines and the long distances. It seems that there is not enough power on the line.

Now for humidity I’ve started to use Z-Wave components. They are available with wired power supply so you don’t have to change batteries. And the best thing: Z-Wave works better the more devices you have.