Hassio and onewire id

Is there a way to configure DS18B20 with hassio?
I’ve looked at:


and I’ve looked also in this forum founding something like that:

  • platform: onewire
    names:
    28-021581d014ff: “temp 1”
    28-031581f3c8ff: “temp 2”

but with hassio I can’t mount the devices… how can I find the id and configure it with hassio?

You have to add dtoverlay=w1-gpio at the end of the config.txt file on the SD card using your PC . You cant edit it in Hass.io.

Do you if there is a way to find sensors connected to GPIO 4?
I’ve used 2nd raspberry with raspbian installed and I’ve got id from there but still it doesn’t work :frowning:

my code is like this:

sensor:
  - platform: onewire
    names:
      28-000008d633be: temp

I’m using Hassio and i didn’t add dtoveraly=w1-gpio - when I’m adding that line to config.txt my device doesn’t start (I mean Home Assistant doesnt boot)

you can use ssh to hassio and check what devices are connected on /sys/bus/w1/devices/

try to remove 28-000008d633be: temp from your config and add flag to config.txt. After reboot you should see reading from sensors on home assistant main screen.

I thought there is no root via SSH on hass.io? How can you edit files in /boot/?
Or did you speak of this way?

you do not need root to check /sys/bus/w1/devices/. You can do that using standard ssh addon from official store.
In order to edit files in /boot you need to insert SD card to PC and it should be accessible from there.

1 Like

Sometimes I think to complicated :wink: Took my old Ubuntu Laptop and edited the file there. Thanks!

I’ve had it with Hassio and trying to set up DS18B20 sensors. I carefully followed the instructions here ‘https://home-assistant.io/components/sensor.onewire/’ but kept getting sensors.yaml errors. I have wasted hours on this trivia.
There is very little help online for setting this up. I think the writers of the component instructions assume everyone is competent at installing these components. With real examples in context it would be easier.
For example: from the component page -
sensor:

  • platform: onewire
    names:
    some_id: your name

is ‘some_id’ any old ID and why my name ‘Fred Bloggs!’
Trial and error again and again!!!

I’m seriously thinking of migrating to node-red

I’m not pretty sure what’s exactly your problem, but of course you can see my real config:

- platform: onewire
  names:
  10-0008043c9374: Living Room

“some_id” is the ID of your sensor “your name” is the name you want to see in the frontend

Hi, Thanks for your reply.
I found the problem…apparently the sensor can only be connected to one specific I/O pin on the pi: GPIO 4
Is that correct???
I had already allocated GPIO 4 to an output for a relay so I was connecting the data wire to a different GPIO pin and was getting errors constantly. Having to constantly reboot to test.

I did get a bit frustrated with it. :slight_smile: but eventually got it working. I am sticking with HA!

Many thanks for your message

Dominic

1 Like

What does the link: “Don’t use the mount_dir option.” on https://www.home-assistant.io/components/sensor.onewire/ mean? We don’t have to mount the directory? Then how will the config.txt file be edited?

1 Like

Can someone please isntruct us how to setup this on hassio on Raspberry Pi3?
I’m able to SSH to my PI, but how should I edit /mnt/boot/config.txt?
when I SSH to my PI I and navigate to mnt folder I see it is empty.
Should I create boot folder and in it add config.txt file?

This is missing in docs.

I recently made a blog post about this as the docs were a bit lacking and it took me some time to find out what to do.
http://inspectmygadgets.com/adding-temp-sensors-to-raspberry-pi-with-hass-io/

3 Likes

Similar issues, I’m new to hassbian, coming from autohab2, I’ve been using these onewire dallas sensors for about a year now. confirming, I have the dtoverlay=w1_gpio set in config and can see the devices in /sys/devices/w1_bus_master1/28* I have 5 listed and all sensing temperature. When I add to configuration.yaml

sensor:
 -platform: onewire
   names:
    28-000007810d18: Sensor1
    28-0417837fe5ff: Sensor2
    28-041783c434ff: Sensor3
    28-0517907b10ff: Sensor4
    28-051790c0c4ff: Sensor5

I get some errors in the log “Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 27, column 9” which maps the “names:”

no success referencing the problem and very help from the logs as you can see. other than just loading a fresh image, the only other thing I have done is add two Sony devices hassbian auto discovered, otherwise my setup is out of the the box. any insight is appreciated

I have tried commenting out the last 4 devices leaving only the one with no luck, same error. I was able to add a system temp so I know something works :slight_smile:

sensor:
  - platform: command_line
    name: Raspberry Pi Temp
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(1) }}'

The main driver I have moving to HA is a scheduler I can manage from the ui like you would a thermostat. I have a radiant flooring system I’ve installed trying to centralize thermostat and temperature control with multiple sensors. anyway, any like I said any insight is appreciated

The problem with this is your syntax. The issue I found was with the hyphen you placed before platform: command_line

I’ve still not got this to work although what I’ve mentioned has removed the error you were getting.