Onewire DS2408 I/O Board integration

Hi all,
I’m starting to use HA for my home a couple of months ago moving from another windows based system, I’m a beginner of python and HA so I’m slowing migrate all my automation devices to HA powered on a RPi3.

Yesterday evening I’ve setup owfs to manage 1-wire network using an USB adapter.
I’ve a couple of temperature sensors (DS18S20) already imported into HA.

Then I’ve a DS2408 I/O board that I use for garden irrigation, I can manage it easily using owfs (owget/owput) and owhttpd but I cannot import data into Home Assistant.

my first question… is it supported?
I’ve put the serialID in the configuration.yaml file but only temperature sensors was imported.

Any help will be appreciated and… in meantime… HA is a very great framework!

Best regards, Lukxz.

Check out this PR for onewire: https://github.com/home-assistant/core/pull/39321

hi how did you handle DS2408 communication? it is possible ?
does the switch work? sensor DS2408 (DS2406)?

Hi, sorry for delay in my question but it’s my first connection on the forum after a while.
I’m using HA 2021.8.8 I cannot find the integration of Maxim DS2408 in the onewire component.
I’m not an expert but it seems that the integration was not integrated in the release version.

looking at the code, I found some const related to this integration:

SENSOR_TYPE_SENSED: [None, None],
SWITCH_TYPE_LATCH: [None, None],
SWITCH_TYPE_PIO: [None, None],

looking at the sensor.py code I’ve add the following rows (I repeat, I’m not a developer so please sorry if I break all coding rules…):


    "29": [
        {"path": "sensed.0","name": "sensed_0", "type": SENSOR_TYPE_SENSED},
        {"path": "sensed.1","name": "sensed_1", "type": SENSOR_TYPE_SENSED},
        {"path": "sensed.2","name": "sensed_2", "type": SENSOR_TYPE_SENSED},
        {"path": "sensed.3","name": "sensed_3", "type": SENSOR_TYPE_SENSED},
        {"path": "sensed.4","name": "sensed_4", "type": SENSOR_TYPE_SENSED},
        {"path": "sensed.5","name": "sensed_5", "type": SENSOR_TYPE_SENSED},
        {"path": "PIO.0", "name": "pio_0", "type": SWITCH_TYPE_PIO},
        {"path": "latch.0", "name": "latch_0", "type": SWITCH_TYPE_LATCH},
    ],

sensor integration works fine
both switches (latch and pio) does not works as switches in HA but only as sensor.
It would be great if someone can help me to transform the SWITCH_TYPE_PIO in a working switch in HA environment.

Many thanks in advance for your help!
Regards, Lukxz.

Hi,

DS2408 is fully available, but switches are disabled by default.
They need to be enabled manually through the interface.

Please check note 4 on the documentation: 1-Wire - Home Assistant

Also, as a side note you should remove the code changes that you have made. Switches and latches are totally unrelated to “sensor.py” file

Uhm…. ok so, if I’ve understand correctly I’ve to replace the original sensor.py file and enable sensors by integration page.
I’ll try in the next hours but I’ve a doubt related to DS2408 because when I opened the code, one wire family “29” is not present so I’ve some doubt that my device was already integrated.
But I trust you :slight_smile: and I’ll let you know.

Thanks!

sensor.py is for sensors
switch.py is for switches

For DS2408, that’s 8 switches and 8 latches but most people only use some of these (personally just 4 switches) so we don’t want to enable all 16 entities automatically as it will add unnecessary strain on the onewire bus
It’s better to enable them individually through the interface.

Thanks!
it works perfectly! I cancelled all my customization (damn…) and restore original code then enabled used relays from integration page.
Another question, sensed sensor is ON when the relay is OFF.
Is there a simple way to invert the status of sensor in order to display the sensed sensor (that I use as double check to relay status) ?

Many thanks again!
Regards, Lukxz