WIP: Replacing onewire with an owserver-based library

Hi,
Is anybody using the onewire platform/sensors? I’m working on replacing the current 1wire code with access via owserver (leaner, faster, more features) and would appreciate beta testers / feedback.

1 Like

Yes! I’m running owserver as a hassio addon and would love to beta test!

I’m running several counters, humidity sensors, temperature sensors, and voltage sensors on a 1wire-network.

Links:
https://github.com/agronholm/anyio (you need the master branch)
https://github.com/M-o-a-T/home-assistant (you need the “owfs” branch)
https://github.com/M-o-a-T/home-assistant.io (documentation; you need the “owfs” branch)

@MatthiasU
Does it support the DS2406 (device family 12) and DS2408 (device family 29)?

For the DS2408, it is used on an 8-relay card, and I’m currently using it via “command_line” switches over owfs. (pio.0-> pio.7)

- platform: command_line
  switches:
    onewire_29xxxxxx000000_pio0:
      command_on: "echo 1 > /mnt/1-Wire/29.xxxxxx000000/PIO.0"
      command_off: "echo 0 > /mnt/1-Wire/29.xxxxxx000000/PIO.0"
      command_state: "cat /mnt/1-Wire/29.xxxxxx000000/PIO.0"
      value_template: '{{value == "1"}}'

For the DS2406, I use as a current detector using:

/mnt/1-Wire/12.yyyyyy000000/sensed.A

Thanks for your effort. Tested your implementation and found one issue. Due to my missing python experience i am not able to solve this adhoc. I tried to port it to HA 0.86…

Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: 2019-01-23 23:39:40 WARNING (MainThread) [homeassistant.components.owfs] Device not handled: <Device_28:28.58C6F9040000.53 @ None>
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: 2019-01-23 23:39:40 ERROR (MainThread) [homeassistant.components.owfs] While processing DeviceAdded(device=<Device_28:28.58C6F9040000.53 @ None>
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: Traceback (most recent call last):
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: File “/var/homeassistant/lib/python3.6/site-packages/homeassistant/components/owfs.py”, line 361, in _owfs_loop
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: objs = dev._OWFSDevice__objects.values()
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: File “/var/homeassistant/lib/python3.6/site-packages/trio_owfs/device.py”, line 182, in getattr
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: return super().getattribute(name)
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: AttributeError: ‘Device_28’ object has no attribute ‘_OWFSDevice__objects’
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: During handling of the above exception, another exception occurred:
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: Traceback (most recent call last):
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: File “/var/homeassistant/lib/python3.6/site-packages/homeassistant/components/owfs.py”, line 363, in _owfs_loop
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: await self.auto_device(evt.device)
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: File “/var/homeassistant/lib/python3.6/site-packages/homeassistant/components/owfs.py”, line 392, in auto_device
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: None,
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: File “/var/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/discovery.py”, line 151, in async_load_platform
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: assert hass_config, ‘You need to pass in the real hass config’
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: AssertionError: You need to pass in the real hass config
Jan 23 23:39:40 ip-172-26-10-117 hass[4742]: 2019-01-23 23:39:40 WARNING (MainThread) [trio_owfs.device] <class ‘trio_owfs.device.Device.new..cls’>: not overwriting family

any news about onewire support via owserver? I’m new at Home Assistant and I hope to use my previuous onewire home sensor netowork (temperature) and also fews DS2408… I’ve HASS.IO on docker container under Intel NUC and Debian 9.9…

No, not yet. I’m working on a chunk of other parts of my home automation system at the moment. Help is welcome …

Hi Matthias,

I’m also very interested in a comprehensive support for onewire devices. For me the current solution lacks some important features:

  • support for arbitrary paths in OW directory to support special values, e.g. HIH3600/humidity; statistics; settings
  • user definable scan interval for every sensor
  • support for binary sensors which get their state from the presence of a device. I use some DS2401 silicon serial numbers as window contacts… The window is closed if the DS2401 is connected to the onewire net. iButtons work similar.
  • uncached access
  • and much more

I hacked a small prototype which fulfills my current needs based on the current onewire component (using pyownet): https://github.com/mampfes/home-assistant/tree/ownet.
Then I’ve seen that you are working on a async onewire library (https://github.com/smurfix/asyncowfs). Therefore I would be happy to know whether you still have plans to improve the onewire support in HA and I would like to support you.

Steffen

Yes, I still plan to do that. I might even have some time for it this month …

Hi Matthias,

Do you have a tiny update regarding the development? I would also love to use all of it.

Kind regards,
Bernd

Hi @MatthiasU !
Looks like you have done a lot of work on this. However before you do any more work on this you should take a look at the work that has been done in Home Assistant since you forked their repository back in August 2018.

A lot has changed regarding 1-wire in HA. All components have moved into their own sub-directories, include a integration manifest, and the python files have been renamed to the HA component type. In the case of onewire /onewire/sensor.py, as it currently only supports sensors.

In December of 2019 support was added for connecting via a owserver by adding the pyownet library as a dependency. This is what I am using to test my onewire devices with HA. Currently you have three ways to connect onewire devices to HA: via the Raspberry PI GPIO, owserver, or mounted owfs.

I am connecting to owserver on the computer that I had them connect to via a LinkUSBi 1-wire interface.

I have a number of devices that I can offer to help out with testing. I have two different devices that use the DS2408, a Hobby boards 8-CHANNEL I/O with 8 inputs and 8 relays (outputs), switches in HA speak. I also have a Denkovi 1-Wire Eight Channel Relay Module with 8 relays, no inputs on this one. I also have an environmental sensor EDS0068 with the optional relay, from EDS that has the following sensors: Temp, humidity, barometric pressure and light. It can calculate Dew Point, Humidex and Heat Index. I also have a handful of DS18B20+ temperature sensors.

I stand ready to help test. I do not have any experience with programming in Python, I have programmed in PHP and write scripts in Bash.

Thanks again for all your work on adding 1-wire support to Home Assistant!

Frederick

Hi!

I have quite recently moved to HomeAssistant (from Domoticz) and is struggling to get my OneWire devices into the system. I have a couple of temperature sensors (DS18B20), humidity sensors (via DS2438) and a voltage counter (DS2423).

I can see all the sensors in the directory, /sys/bus/w1/devices, which I suppose is the “owfs device tree”:

1d-0000000cf16c  
26-000001922401  
28-0000041c2636  
28-0000058427dc  
28-000005843487 
81-000000340ef1  
w1_bus_master1e

That path is also set to mount_dir in the configuration.
My problem is that only the temperature sensors, family 28, gets represented as entities in Home Assistant. I’m missing both the humidity sensor, family 26, and the counter, family 1D.
What am I missing, why isn’t all my sensors visible?
(For the family 1D, could it be an issue that it is named “1d”?)

Best Regards
Anders

@hovgalf Those two one wire families are listed in both @MatthiasU work on one wire and in the Home Assistant work. However the coded may not be setup for auto discovery. I don’t have any of those sensors myself to test with. You may just need to add them manually to the configuration file.

I have some other unsupported one wire devices (see my post above). I got them working with Home Assistant using NodeRed and MQTT. Let me know if you are interested in the details.

1 Like

@frederickjh Yes, they seem to be supported according the HomeAssistant OneWire integration page at least. But I have not figured out the difference between that and the work done by @MatthiasU and where to find documentation about it?

Looking in the source of the HomeAssistant OneWire integration, /core/homeassistant/components/onewire/, sensor.py seems to loop through devices in mount_dir and create an entity for each matching a supported family. I have not seen any examples for how to add them manually in the configuration file. Anyone that knows if that is possible and what the syntax would be? I appreciate any examples :slight_smile:
For know I just have this regarding 1-Wire in my configuration.yaml:

sensor:
  - platform: onewire
    mount_dir: /sys/bus/w1/devices/

I’m happy to get any help to get the sensors into the system, it would be great to look in the details of your solution, thanks!

@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