Air quality sensor Sensair S8

Moderator: leecollings

Post Reply
column
Posts: 2
Joined: Tuesday 25 July 2017 18:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Air quality sensor Sensair S8

Post by column »

Hello,

I have connected Sensair S8 sensor to my Raspberry Pi on /dev/serial0 and have run test Python script:

Code: Select all

#rpi serial connections
#Python app to run a S8 Sensor
import serial
import time
#RPi pin connections:
#pin 6 GND
#pin 4 5v
#pin 8 TXD: UART data to S8
#pin 10 RXD: UART data from S8
ser = serial.Serial("/dev/serial0",baudrate =9600,timeout = .5)
print " AN-168: Raspberry Pi3 to S8 Via UART\n"
ser.flushInput()
time.sleep(1)
for i in range(1,21): # Print 20 readings from sensor

 ser.flushInput()
 ser.write("\xFE\x44\x00\x08\x02\x9F\x25")
 time.sleep(.5)
 resp = ser.read(7)
 high = ord(resp[3])
 low = ord(resp[4])
 co2 = (high*256) + low
 print "i = ",i, " CO2 = " +str(co2)
 time.sleep(.1)
Sensor works fine. Now I would like to connect it to Domoticz. I found some blog regarding that.

But how to create Air sensor device in Domoticz? I suppose I need to add new hardware to my domoticz, but which one I should use? How to connect my Sensair S8 that runs on serial to my Domoticz?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Air quality sensor Sensair S8

Post by waaren »

column wrote: Saturday 18 May 2019 13:05 I have connected Sensair S8 sensor to my Raspberry Pi on /dev/serial0 and have run test Python script:
But how to create Air sensor device in Domoticz? I suppose I need to add new hardware to my domoticz, but which one I should use? How to connect my Sensair S8 that runs on serial to my Domoticz?
Add new hardware as "Dummy(does nothing used for virtual switches only)"
Then push the [Create Virtual Sensor] button on the just created hardware and choose "Air Quality" as sensor type.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
column
Posts: 2
Joined: Tuesday 25 July 2017 18:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Air quality sensor Sensair S8

Post by column »

Thank you!

Now I have Air Quality device. But how to get to Task Settings in order to set GPIO?


Image
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest