DLP-IO20 data acquisition; 1-wire i/f

Hassio has an integration for 1-wire directly, and via an interface adapter [DS9490R].

I have a number of DS18B20s interfaced by a DLP-IO20. The DLPs are still being sold on Mouser and Digikey, and work pretty well. The DLP-IO20 is USB based and has a simple command structure. Currently, (before my current transition to Hassio) I have the DLP-IO20 interfacing upstream to DomotiGa3. I run bash scripts to retrieve temp data, and DomotiGa3 picks it up and forms it into a status.

Now, I want to interface the DLP-IO20 to Hassio. This is my lazy attempt by simply asking if anyone has done it. If not, I will have to do something similar as I did with DomotiGa3, and work to get the data into Hassio. A nice project nonetheless …

Hello,
just in case (long time from the original post), i leave here my python code to communicate with similar DLP-IO8. it reads all ports and publishes to MQTT broker. For the serial commands, please use the DLP datasheets.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# DLP-IO8 usb FTDI 8-CHANNEL DATA ACQUISITION MODULE
# publish to MQTT broker 

import cgi
import os
import glob
import serial
import time
import sys, json
#import RPi.GPIO as GPIO
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish

# interpolate stuff for analog humidity sensors
from bisect import bisect_right

class Interpolate:
    def __init__(self, x_list, y_list):
        if any(y - x <= 0 for x, y in zip(x_list, x_list[1:])):
            raise ValueError("x_list must be in strictly ascending order!")
        self.x_list = x_list
        self.y_list = y_list
        intervals = zip(x_list, x_list[1:], y_list, y_list[1:])
        self.slopes = [(y2 - y1) / (x2 - x1) for x1, x2, y1, y2 in intervals]
    
    def __call__(self, x):
        if not (self.x_list[0] <= x <= self.x_list[-1]):
            raise ValueError("x out of bounds!")
        if x == self.x_list[-1]:
            return self.y_list[-1]
        i = bisect_right(self.x_list, x) - 1
        return self.y_list[i] + self.slopes[i] * (x - self.x_list[i])

#serial port and mqtt broker         
port = "/dev/ttyUSB0"
Broker = "192.168.1.170"

def readLine(port):
    s = ""
    while True:
        ch = port.read()
        s += ch
        if ch == '\r':
            return s


############### MQTT section ##################

# when connecting to mqtt do this;

def on_connect(client, userdata, flags, rc):
    print("Connected with result code "+str(rc) + " ...zero ie OK!")

# when sending a mqtt message do this;

def on_publish(mosq, obj, mid):
    print("mid: " + str(mid))


client = mqtt.Client()
client.on_connect = on_connect
client.connect(Broker, 1883, 60)
client.loop_start()

##### usb serial init
ser = serial.Serial(port, baudrate = 115200)
print("starting")

##### dlp-io8 settings
# "`" Return ASCII, "\" Return Binary
print("set celsius")
ser.write(";")
print("set Binary")
ser.write("`") 

ni = 1
# interpolate ADC value to relative humidity
rh = Interpolate([0, 0.58, 0.76, 1.03, 1.36, 1.7, 2.04, 2.35, 2.62],[0, 10, 20, 30, 40, 50, 60, 70, 80])

while True:
    
#    print("request channel 1 ANALOG IN")
    ser.write("Z")
    rcv = readLine(ser)
    rcv = rcv[:-3]
    rcv = float(rcv)
#   print(type(rcv))
#   print(rcv)
    rhv = round(rh(rcv), 2)
    vt = str(rhv)
#    print("received:" + vt[:-3])
#    if rcv > 10:
    client.publish("dlpio8/ch1", vt[:-3],qos=0,retain=True)
    disp = vt[:-3].rjust(9)+"|"

#    print("request channel 2")
    ser.write("0")
    rcv = str(readLine(ser))[:-4]
#    print("received:" + rcv)
    client.publish("dlpio8/ch2", rcv, qos=0, retain=True)
    disp = disp + rcv.rjust(9) + "|"   

#    print("request channel 3")
    ser.write("-")
    rcv = str(readLine(ser))[:-4]
#    print("received:" + str(rcv))
    client.publish("dlpio8/ch3", str(rcv),qos=0,retain=True)
    disp = disp + rcv.rjust(9) + "|"
    
#    print("request channel 4")
    ser.write("=")
    rcv = str(readLine(ser))[:-4]
#    print("received:" + str(rcv))
    client.publish("dlpio8/ch4", str(rcv),qos=0,retain=True)
    disp = disp + rcv.rjust(9) + "|"

#    print("request channel 5")
    ser.write("O")
    rcv = str(readLine(ser))[:-4]
#    print("received:" + str(rcv))
    client.publish("dlpio8/ch5", str(rcv),qos=0,retain=True)
    disp = disp + rcv.rjust(9) + "|"

#    print("request channel 6")
    ser.write("P")
    rcv = str(readLine(ser))[:-4]
#    print("received:" + str(rcv))
    client.publish("dlpio8/ch6", str(rcv),qos=0,retain=True)
    disp = disp + rcv.rjust(9) + "|"
    
#    print("request channel 7")
    ser.write("[")
    rcv = str(readLine(ser))[:-4]
#    print("received:" + str(rcv))
    client.publish("dlpio8/ch7", str(rcv),qos=0,retain=True)
    disp = disp + rcv.rjust(9) + "|"
   
#    print("request channel 8")
    ser.write("]")
    rcv = str(readLine(ser))[:-4]
#    print("received:" + str(rcv))
    client.publish("dlpio8/ch8", str(rcv),qos=0,retain=True)
    disp = disp + rcv.rjust(9) + "|"

###### A nice table view for the console, with loop counter  #######  
    os.system('clear')
    tabel = "channel 1|".rjust(9)
    for x in range(2,9):
        tabel = tabel + ("channel " + str(x) + "|").rjust(10)
    
    print(tabel + "bucle |".rjust(10))
    print(disp + str(ni).rjust(9) + "|")
    ni=ni+1
#time between readings
    time.sleep(2)