WIP: Replacing onewire with an owserver-based library

@MatthiasU has a link to the repository where his work is in the third post of this thread.

Below is a sanitized version of the One Wire section from my configuration.yaml. I had my owserver setup long before on another computer. I would suggest using owserver in your configuration if you can, as in the past I have found the OWFS to not be as reliable and to have more issue than OWserver. If it is on the same computer you can use localhost as the host name. Port 4304 is the default port if you have not set one up for owserver.

I do have a handful of family 28 temperature sensors (DS18B20+) that auto configure. I have set friendly names for them in customize.yaml. This can be done in the web interface under Configuration > Customizations. Then set the Name for each sensor.

However to make the unknown one wire sensors work I am using NodeRed with MQTT to make this work. Thus you will see for each sensor or switch:

- platform: mqtt

in the configuration file. I added the Home Assistant MQTT integration for this under Configuration > Integrations.
I will post a sanitized version of my NodeRed configuration below the one wire configuration.

In any case I hope this helps get you on the right track, but if you have any more questions just ask.
Frederick

From configuration.yaml.

# One Wire
sensor:
  - platform: onewire
    host: server-running-owserver
    port: 4304
  - platform: mqtt
    name: "Greenhouse Dew Point"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/dew_point"
    icon: mdi:water
    unit_of_measurement: '°C'
  - platform: mqtt
    name: "Greenhouse Humidex"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/humidex"
    unit_of_measurement: '°C'
    icon: mdi:coolant-temperature
  - platform: mqtt
    name: "Greenhouse Heat Index"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/heat_index"
    unit_of_measurement: '°C'
    icon: mdi:thermometer-lines
  - platform: mqtt
    name: "Greenhouse Humidity"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/humidity"
    unit_of_measurement: '%'
    icon: mdi:water-percent
  - platform: mqtt
    name: "Greenhouse Light"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/light"
    unit_of_measurement: 'lm'
    icon: mdi:theme-light-dark
  - platform: mqtt
    name: "Greenhouse Temperature @ plant level"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/temperature"
    unit_of_measurement: '°C'
  - platform: mqtt
    name: "Greenhouse Barometer"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/pressure"
    unit_of_measurement: 'mbar'
    icon: mdi:arrow-up-down-bold
  - platform: mqtt
    name: "GH Alarm LED"
    state_topic: "7E.xxxxxxxxxxxx/EDS0068/LED/state"
    icon: mdi:led-on
switch:
  - platform: mqtt
    name: "HB Relay 1"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.0"
    command_topic: "29.xxxxxxxxxxxx/PIO.0"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "HB Relay 2"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.1"
    command_topic: "29.xxxxxxxxxxxx/PIO.1"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "HB Relay 3"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.2"
    command_topic: "29.xxxxxxxxxxxx/PIO.2"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "HB Relay 4"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.3"
    command_topic: "29.xxxxxxxxxxxx/PIO.3"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "HB Relay 5"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.4"
    command_topic: "29.xxxxxxxxxxxx/PIO.4"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "HB Relay 6"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.5"
    command_topic: "29.xxxxxxxxxxxx/PIO.5"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "HB Relay 7"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.6"
    command_topic: "29.xxxxxxxxxxxx/PIO.6"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "HB Relay 8"
    device:
      manufacturer: "Hobby Boards"
      model: "8CIO8-R1-A"
      identifiers: "29.xxxxxxxxxxxx"
      name: "hobby_boards__8_io_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.7"
    command_topic: "29.xxxxxxxxxxxx/PIO.7"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 1"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.0"
    command_topic: "29.xxxxxxxxxxxx/PIO.0"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 2"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.1"
    command_topic: "29.xxxxxxxxxxxx/PIO.1"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 3"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.2"
    command_topic: "29.xxxxxxxxxxxx/PIO.2"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 4"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.3"
    command_topic: "29.xxxxxxxxxxxx/PIO.3"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 5"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.4"
    command_topic: "29.xxxxxxxxxxxx/PIO.4"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 6"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.5"
    command_topic: "29.xxxxxxxxxxxx/PIO.5"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 7"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.6"
    command_topic: "29.xxxxxxxxxxxx/PIO.6"
    payload_on: 1
    payload_off: 0
    retain: true
  - platform: mqtt
    name: "Denkovi Relay 8"
    device:
      manufacturer: "Denkovi"
      model: "DAE-8RELAYS-1WIRE"
      identifiers: "29.45640C00000"
      name: "denkovi_8relays_board_1"
    state_topic: "29.xxxxxxxxxxxx/PIO.7"
    command_topic: "29.xxxxxxxxxxxx/PIO.7"
    payload_on: 1
    payload_off: 0
    retain: true

First a screenshot of the NodeRed Configuration then the exported configuration.

The top section in the screen shot is for the sensors. The inject nodes query OWserver for the sensor reading which is send via the MQTT out node to the HA MQTT server. In between msg.retain is set to true and one binary sensor state is converted from 1 or 0 to On and Off.

In the bottom section the MQTT in nodes subscribe to the topic for the one wire devices we want to control. This is the send to the OWserver node.

Here is the exported configuration from NodeRed. You can create a new flow then import this into it in NodeRed to give you a head start on building your flow.

[
    {
        "id": "39173a0d.ce859e",
        "type": "tab",
        "label": "Owserver",
        "disabled": false,
        "info": ""
    },
    {
        "id": "74e9cfc0.ba6408",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Humidex",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/humidex",
        "payload": "",
        "payloadType": "str",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 150,
        "y": 220,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "b8b7ea5b.cc057",
        "type": "change",
        "z": "39173a0d.ce859e",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "retain",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1040,
        "y": 280,
        "wires": [
            [
                "1b4d15b6.0b6cca",
                "27f383a7.d7a38c"
            ]
        ]
    },
    {
        "id": "e2b6112d.0de5a",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Dew Point",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/dew_point",
        "payload": "",
        "payloadType": "str",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 150,
        "y": 180,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "1b4d15b6.0b6cca",
        "type": "mqtt out",
        "z": "39173a0d.ce859e",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "broker": "f1bedc54.aad908",
        "x": 1250,
        "y": 260,
        "wires": []
    },
    {
        "id": "27f383a7.d7a38c",
        "type": "debug",
        "z": "39173a0d.ce859e",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 1270,
        "y": 180,
        "wires": []
    },
    {
        "id": "d70f815d.ee7068",
        "type": "owfs",
        "z": "39173a0d.ce859e",
        "name": "Ubuntuserver - read",
        "uncached": false,
        "mode": "read",
        "host": "localhost",
        "port": "3333",
        "paths": [],
        "x": 540,
        "y": 160,
        "wires": [
            [
                "8625ddc7.56f2c8"
            ]
        ]
    },
    {
        "id": "43acf816.d2a408",
        "type": "mqtt in",
        "z": "39173a0d.ce859e",
        "name": "Hobby Boards 8 channel I/O board",
        "topic": "29.xxxxxxxxxxxx/#",
        "qos": "0",
        "datatype": "auto",
        "broker": "f1bedc54.aad908",
        "x": 200,
        "y": 360,
        "wires": [
            [
                "f7691044.2db148"
            ]
        ]
    },
    {
        "id": "54d440d0.ee496",
        "type": "debug",
        "z": "39173a0d.ce859e",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 1030,
        "y": 360,
        "wires": []
    },
    {
        "id": "eedc1057.bd241",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Humidity",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/humidity",
        "payload": "",
        "payloadType": "str",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 150,
        "y": 140,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "a3ad6cbd.7bb9a",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Light",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/light",
        "payload": "",
        "payloadType": "str",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 130,
        "y": 100,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "25a2d39e.9cd78c",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Temperature @ plant level",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/temperature",
        "payload": "",
        "payloadType": "str",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 200,
        "y": 20,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "eb1afcd4.946038",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Barometer",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/pressure",
        "payload": "",
        "payloadType": "date",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 150,
        "y": 60,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "5f54febf.7cd",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Heat Index",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/heat_index",
        "payload": "",
        "payloadType": "date",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 150,
        "y": 260,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "9bf3943b.d752e8",
        "type": "inject",
        "z": "39173a0d.ce859e",
        "name": "Greenhouse Environmental Sensor Alarm LED",
        "topic": "7E.xxxxxxxxxxxx/EDS0068/LED/state",
        "payload": "",
        "payloadType": "date",
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "x": 220,
        "y": 300,
        "wires": [
            [
                "d70f815d.ee7068"
            ]
        ]
    },
    {
        "id": "8625ddc7.56f2c8",
        "type": "switch",
        "z": "39173a0d.ce859e",
        "name": "Binary inputs sort",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "7E.xxxxxxxxxxxx/EDS0068/LED/state",
                "vt": "str"
            },
            {
                "t": "neq",
                "v": "7E.xxxxxxxxxxxx/EDS0068/LED/state",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 770,
        "y": 160,
        "wires": [
            [
                "e7db45fd.eebcd"
            ],
            [
                "b8b7ea5b.cc057"
            ]
        ]
    },
    {
        "id": "e7db45fd.eebcd",
        "type": "change",
        "z": "39173a0d.ce859e",
        "name": "1 to On and 0 to Off",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "1",
                "fromt": "num",
                "to": "On",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "0",
                "fromt": "num",
                "to": "Off",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 770,
        "y": 260,
        "wires": [
            [
                "b8b7ea5b.cc057"
            ]
        ]
    },
    {
        "id": "30501bdb.ca641c",
        "type": "owfs",
        "z": "39173a0d.ce859e",
        "name": "OWserver - write",
        "uncached": false,
        "mode": "write",
        "host": "server-running-owserver",
        "port": "4304",
        "paths": [],
        "x": 900,
        "y": 480,
        "wires": [
            []
        ]
    },
    {
        "id": "dbf43cef.d02ea8",
        "type": "change",
        "z": "39173a0d.ce859e",
        "name": "\t29.xxxxxxxxxxxx/PIO.0",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "29.xxxxxxxxxxxx/PIO.0",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 170,
        "y": 500,
        "wires": [
            [
                "f7691044.2db148"
            ]
        ]
    },
    {
        "id": "45243106.cf0758",
        "type": "mqtt in",
        "z": "39173a0d.ce859e",
        "name": "Denkovi 8 Channel Relay Board",
        "topic": "29.xxxxxxxxxxxx/#",
        "qos": "2",
        "datatype": "auto",
        "broker": "f1bedc54.aad908",
        "x": 190,
        "y": 420,
        "wires": [
            [
                "f7691044.2db148"
            ]
        ]
    },
    {
        "id": "f7691044.2db148",
        "type": "change",
        "z": "39173a0d.ce859e",
        "name": "set msg.retain",
        "rules": [
            {
                "t": "set",
                "p": "retain",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 640,
        "y": 480,
        "wires": [
            [
                "30501bdb.ca641c",
                "54d440d0.ee496"
            ]
        ]
    },
    {
        "id": "f1bedc54.aad908",
        "type": "mqtt-broker",
        "z": "",
        "name": "owserver",
        "broker": "home-assistant-hostname",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": false,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    }
]
1 Like

ahoj @frederickjh so does DS2408 work via GPIO PI4 on HA or not?
I can’t find the answer anywhere

I have 20 DS18B20 they work perfectly but I can’t set the switch and binary sensor on DS2408

possibly some manual on node red

according to config I can see that it works for you

@brano1990 I setup my DS2408 long before the support was added to the HA onewire integration. However I know that support for the DS2408 is disabled by default in the onewire integration.

Some sensors are disabled by default to avoid overloading the bus. These can be activated by opening the integrations page in your configuration, listing your 1-Wire integration devices and updating the entity.

I would try this first.

You can also check in /sys/bus/w1/devices to see if your DS2408 is listed. See the Raspberry Pi Tutorial Series: 1-Wire DS18B20 Sensor for how to test one wire devices. They are just checking the temperature by cat-ing the device. With the switches you can echo 1 > //sys/bus/w1/devices/serialnumber/path/to/the/switch to turn it on echo 0 into it to turn in off.

I am not running on a raspberry pi, but an old computer I had laying around. Not sure that you need to setup owserver, but if you do you can use sudo apt install owserver.

@brano1990 Not sure if you are trying to do this with the onewire integration or with nodered and the mosquitto mqtt broker.

If you are using mosquitto, then look to see if you are using version 2.0+. The default for authentication has changed compared to 1.* versions. Previously with versions 1.* one could with the default settings start the mosquitto broker so that anyone could connect to it. In versions 2.0+ you have to setup authentication before it will start. So it could be that the mosquitto mqtt broker is not starting and that is why your onewire devices are not working.

One needs to at least add the following to the mosquitto configuration file

allow_anonymous true
listener 1883

to continue using mosquitto without authentication so that it will start. Here is a link to the mosquitto documentation about Migrating from 1.x to 2.0 that explains the options.

finally we managed to run owserver on Home Assistant Supervised on a Raspberry Pi with Debian 10

OWSERVER “integration in HA”
I can’t create a switch / sensor entity
DS2408 and DS18b20

but in Node Red I have a problem when I put a retry interval of 0.01 s, owfs error / read cycles

I’m looking for an error that I have to read on binary sensors (ds2408), at least 50ms

if i can read 50ms on 10pcs ds2408 i probably won’t need a mosquito

I need it mainly for the sensor on the ds2408 I will be connected with most of the buttons you will turn on the lights

will I be able to call the entity “switch.light-trends” directly from Node red ??

You need to got to the Integrations page. Then click on the devices link in the 1-Wire box.
image

Then look for your DS2408 device. On the right I will show that it is disabled.

Click on the device then you can enable it. You will also need to enable the entities on the device (ie. each switch or GPIO port).

Not sure that 1-Wire can do that fast of checking on that many sensors. Check the 1-wire specification documentation. I do not believe that is what is was designed for. Speed is not one of its features. Ease of wiring yes.

1 Like

@brano1990 One tip on the owserver. It is possible to use an alias file so instead of the long serial number you can use short names that you can remember. I recently file a issue to have this added as it was not in the documentation. Write my if it is not in and I can tell you were the file needs to go and what it needs to look like.

The alias used on owserver will then show up in Home Assistant as well.

1 Like

There’s also the interesting feature of telling all 20-or-however-many of your temperature sensors to do their measurement in the background. When you read them the naïve way each access blocks the whole bus for a second or so.

My asyncowfs Python library can do that but it’s not integrated into HA. I planned to do it but had no free time.

So that’s why I have reading errors

recommend a separate DS18b20?
and another separated on ds2408?

according to the manual from @frederickjh it works for me but it’s slow

I will try to disconnect the DS18b20 as recommended

@brano1990 I am not sure you comprehend the 1-wire technology. It is an old technology. It needs only two wires but can use a third for sending power to devices.

With only a two wire data bus it can only poll one device at a time. The topography of your wiring in your 1-wire network can also affect the speed at which a device can respond.

If you are trying to do time critical switching of devices on and off, I am pretty sure that 1-wire is the wrong choice for this application. Bus timing on newer devices has made this better, but I am not sure this is fast enough for your application. Check the documentation at Maxim Integrated’s website for the details.

I have only 3 wires in each room on the wall, (bus connection) my solution how to control 3 buttons and 3 LEDs is to use 1-wire

i2c needs 4 wire

my old installation was a KNX bus
it is very expensive to repair, so I’m trying to change it

I welcome any solution
without wifi

@brano1990 What is your use case that you need such quick responses from your sensor and switches?

When I did this, with a proximity sensor, my use case was to poll the sensor every 1/10th second.

If you don’t have anything else on the bus this even works. Mostly.

The sensible thing is to add a diode, capacitor, and resistor to each button so that pressing the button discharges the capacitor, which then gets recharged during the next two seconds or so. You can now get away with the occasional half second without polling the button.

The even more sensible thing is to not do this in Home Assistant, because consistent sub-second timing is not what it’s built for. Instead use an external program. I’d take distmqtt + asyncowfs and write a few lines of Python to interface the two. (Actually I’m using distkv-owfs … which is probably severe overkill for your use case.)

NB: instead of reading the temperature from each sensor, you need to write 1 to /simultaneous/temperature, wait a second or two, and then read each temperature sensor’s latesttemp attribute. This avoids blocking the whole bus during temperature conversions. (asyncowfs does this for you in the background.)

You also need to supply 5V to your sensors instead of relying on parasite power.

I estimated only 50ms i can use the update about 200ms i have to try it

I use multi click button
now i am using ADS1115 update_interval: 50ms

http://www.ignorantofthings.com/2018/07/the-perfect-multi-button-input-resistor.html

the problem is that I can’t use the LED to output from the HA to the “information LED on the button” button

for ADS I can’t use ttp223 touch button over 6pcs

I don’t know programming in python

@frederickjh @MatthiasU do you have any binary sensor connected to DS2408?
The HA sensor is read slowly for 30 seconds

The switch is beautiful fast, it’s not a problem, it’s

when i read 1pc ds2408 via node red so it read me 50ms quote is ok

I have a problem with a server loss error message on red nodes, where can be the problem? even though I read 10s,
I still get an error from the server, when I use solo 10ks DS18b20 I have no problem with the server

i have ds2408 involved
with pullup 2.2k on 1-wire

I use a logic level converter DS2482 i2c pullup 2.2k to 3.3v and I have a pullup 2.2k to 5Vzapojenie

Hi @frederickjh @MatthiasU

A bit off-topic, but it’s regarding my OWFS (ow-server) setup. Got a problem since a couple of days regarding reading the USB bus master. This must be related to the Zigbee2Mqtt installation I was working on (see the set permissions chapter below in the link).

I have OWFS running on my Ubuntu 20.04, everything worked fine but for Zigbee2Mqtt I needed to change a bit regarding premissions and now OWFS is telling me not to work regarding (the same?) premissions. Do you know how to undo / fix this premissions issue?

SSH Log:

sudo /opt/owfs/bin/owfs u -m /mnt/1wire/
<LIBUSB_ERROR_ACCESS> Could not open the USB bus master. Is there a problem with permissions?
DEFAULT: ow_usb_msg.c:(188) <LIBUSB_ERROR_ACCESS> Could not open the USB bus master. Is there a problem with permissions?
DEFAULT: owlib.c:(208) Cannot open USB bus master
DEFAULT: owlib.c:(52) No valid 1-wire buses found

sudo /usr/bin/owfs -u --allow_other /mnt/1wire/
Segmentation fault

Schermafbeelding 2021-02-24 om 00.02.14

@bernd Yes, it is off topic but I will humor you as I think I know what your issue is. From the page you linked to, I am guessing you have two usb devices plugged into the computer one for the 1-wire and one for Zigbee. On the page you linked to there is a section in the instructions titled 2. UDEV Rules. They don’t really explain what this is doing but I recognized it.

When you plug a USB device on Linux that is a USB serial connection, it creates a devices like /dev/ttyUSB1. However when you plug and unplug or plug them in a different order or reboot they may get assigned to a different device. The number at the end changes.

My guess is that in your current 1-wire owserver configuration (/etc/owfs.conf) you have a line with a device like this:

device = /dev/ttyUSB1

You need to add a UDEV rule so that the 1-wire USB devices serial port is always reachable at the same device, just like you did for the Zigbee devices serial port and change the device in /etc/owfs.conf.

My 1-wire setup worked fine until I also plugged a 3D printer with a USB serial interface into the same computer. Then I had to setup these UDEV rules to make the USB serial devices always be named the same. Here are my notes on how to do this.

Create persistent USB serial device names on Linux: how to force a USB device to use the same ttyUSB number
Based on information from:

Used with OneWire USB devices for owserver part of owfs when using it with Home Assistant.

  1. find out what’s on ttyUSB:

dmesg | grep ttyUSB

  1. list all attributes of the device:

udevadm info --name=/dev/ttyUSBx --attribute-walk

(with your device number(s) instead of x, of course). Pick out a unique identifier set, eg idVendor + idProduct. You may also need SerialNumber if you have more than one device with the same idVendor and idProduct. SerialNumbers ought to be unique for each device.
3. Create a file /etc/udev/rules.d/99-usb-serial.rules (or your own .rule file see examples below) with something like this line in it:

SUBSYSTEM=="tty", ATTRS{idVendor}=="1234", ATTRS{idProduct}=="5678", SYMLINK+="your_device_name"

(assuming you don’t need a serial number there, and of course with the numbers for idVendor and idProduct that you found in step 2.
4. Load the new rule:

sudo udevadm trigger

  1. Verify what happened:

ls -l /dev/your_device_name

will show what ttyUSB number the symlink went to. If it’s /dev/ttyUSB1, then verify who owns that and to which group it belongs:

ls -l /dev/ttyUSB1

Then just for the fun of it:

udevadm test -a -p $(udevadm info -q path -n /dev/your_device_name)

Examples:
in /etc/udev/rules.d/62-fjh-persistant-x1-sidewinder-3d-printer.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="x1sidewinder"

in /etc/udev/rules.d/62-fjh-one-wire-usb-adapter.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="USBonewire"

Then run sudo udevadm trigger to load the new rule(s).

You need to add a UDEV rule so that the 1-wire USB devices serial port is always reachable at the same device, just like you did for the Zigbee devices serial port and change the device in /etc/owfs.conf .

That, or take advantage of the already-existing udev ruleset in /lib/udev/rules.d/60-serial.rules which creates a guaranteed-stable-and-unique link to your device in /dev/serial/by-path/. There’s also a by-id directory but given that some manufacturers take a rather dim view of writing actual serial numbers to their firmware I wouldn’t depend on that.

I’m running Home Assistant on a raspberry pi using the “official” image for hass.

Is there a way to install ofws/owserver on that unit to access 1-Wire devices through a USB-stick connected to the pi?
(I find old posts mentioning owserver as an addon, but I cannot find any such addon in the HMI.)

also looking for a way to install OWServer onto

 OS Version:               Home Assistant OS 7.6
  Home Assistant Core:      2022.4.6

Tried

and can still not get it working as I can not find the devices