Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Generate README.md from template #405

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 28 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Hardware support is provided by specific GPIO, Sensor and Stream modules. It's e
### GPIO Modules

- Beaglebone GPIO (`beaglebone`)
- DockerPi 4 Channel Relay GPIO (`dockerpi`)
- Linux Kernel 4.8+ libgpiod (`gpiod`)
- GPIO Zero (`gpiozero`)
- MCP23017 IO expander (`mcp23017`)
Expand All @@ -27,37 +28,62 @@ Hardware support is provided by specific GPIO, Sensor and Stream modules. It's e
- PCF8575 IO expander (`pcf8575`)
- PiFace Digital IO 2 (`piface2`)
- Raspberry Pi GPIO (`raspberrypi`)
<<<<<<< HEAD
- Sunxi Board (`sunxi`)
=======
- XL9535/PCA9535/TCA9535 IO expander (`xl9535`)
>>>>>>> upstream/develop

### Sensors

- ADS1x15 analog to digital converters (`ads1x15`)
<<<<<<< HEAD
- ADXL345 Digital Accelerometer Sensor (`adxl345`)
=======
- ADXl345 3-axis accelerometer up to ±16g (`adxl345`)
>>>>>>> upstream/develop
- AHT20 temperature and humidity sensor (`aht20`)
- AS3935 lightning detector (`as3935`)
- BH1750 light level sensor (`bh1750`)
- BME280 temperature, humidity and pressure sensor (`bme280`)
- BME680 temperature, humidity and pressure sensor (`bme680`)
- BMP085 temperature and pressure sensor (`bmp085`)
- DHT11/DHT22/AM2302 temperature and humidity sensors (`dht22`)
- DS18S20/DS1822/DS18B20/DS1825/DS28EA00/MAX31850K temperature sensors (`ds18b`)
<<<<<<< HEAD
- ENS160 Air Quality Sensor (`ens160`)
- Flowsensor: Generic Flow Rate Sensor (`flowsensor`)
- Frequencycounter: Generic Frequency Counter (`frequencycounter`)
=======
- ENS160 digital multi-gas sensor with multiple IAQ data (TVOC, eCO2, AQI) (`ens160`)
- FLOWSENSOR generic flow rate sensor like YF-S201, YF-DN50 or others (`flowsensor`)
- FREQUENCYCOUNTER Counts pulses from GPIOs and return the frequency in Hz (`frequencycounterr`)
>>>>>>> upstream/develop
- HCSR04 ultrasonic range sensor (connected to the Raspberry Pi on-board GPIO) (`hcsr04`)
- INA219 DC current sensor (`ina219`)
- LM75 temperature sensor (`lm75`)
- MCP3008 analog to digital converter (`mcp3008`)
<<<<<<< HEAD
- MCP3xxx analog to digital converter via GPIOZero (`mcp3xxx`)
- MH-Z19 NDIR CO2 sensor (`mhz19`)
- PMS5003 Particulate Matter Sensor (`pms5003`)
- SHT4x temperature and humidity sensor (`sht4x`)
- TSL2561 luminosity sensor (`tsl2561`)
- VEML 6075 UV sensor (`veml6075`)
- VEML7700 luminosity sensor (`veml7700`)
=======
- PMS5003 particulate sensor (`pms5003`)
- SHT40/SHT41/SHT45 temperature and humidity sensors (`sht4x`)
- TSL2561 light level sensor (`tsl2561`)
- VEML7700 light level sensor (`veml7700`)
- YF-S201 flow rate sensor (`yfs201`)

>>>>>>> upstream/develop

### Streams

- Serial port (`serial`)
- PN532 NFC/RFID reader (`pn532`)
- Serial port (`serial`)

## Installation

Expand Down Expand Up @@ -113,30 +139,11 @@ sensor_modules:
module: lm75
i2c_bus_num: 1
chip_addr: 0x48
# An INA219 sensor attached to the I2C bus
- name: ina219_sensor
module: ina219
i2c_bus_num: 1
chip_addr: 0x43


sensor_inputs:
# lm75 - The configuration of the specific sensor value to use (LM75 only has temperature)
# The configuration of the specific sensor value to use (LM75 only has temperature)
- name: porch_temperature
module: lm75_sensor
# ina219 - The configuration of the specific sensor value to use (4 options for the ina219 sensor)
- name: power
type: power
module: ina219_sensor
- name: bus_voltage
type: bus_voltage
module: ina219_sensor
- name: current
type: current
module: ina219_sensor
- name: shunt_voltage
type: shunt_voltage
module: ina219_sensor

# Streams
stream_modules:
Expand Down
1 change: 1 addition & 0 deletions README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ stream_modules:
device: /dev/ttyUSB0
baud: 9600
```

24 changes: 12 additions & 12 deletions mqtt_io/modules/sensor/adxl345.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
"""
ADXL345 Digital Accelerometer Sensor

Mandatory:
- chip_addr

Optional:
- output_g (set True if output in g). default:m*s²

Output:
- x (in m*s²)
- y (in m*s²)
- z (in m*s²)
"""

from json import dumps
from typing import cast

from ...types import CerberusSchemaType, ConfigType, SensorValueType
from . import GenericSensor

## Mandatory:
## - chip_addr
##
## Optional:
## - output_g (set True if output in g). default:m*s²
##
## Output:
## - x (in m*s²)
## - y (in m*s²)
## - z (in m*s²)


REQUIREMENTS = ("adxl345",)
CONFIG_SCHEMA: CerberusSchemaType = {
"chip_addr": {"type": 'integer', "required": True, "empty": False},
Expand Down
54 changes: 27 additions & 27 deletions mqtt_io/modules/sensor/ens160.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
"""
ENS160 Air Quality Sensor

sensor_modules:
- name: ens160
module: ens160
chip_addr: 0x53
temperature_compensation: 25
humidity_compensation: 50

sensor_inputs:
- name: air_quality
module: ens160
interval: 10
digits: 0
type: aqi

- name: volatile_organic_compounds
module: ens160
interval: 10
digits: 0
type: tvoc

- name: eco2
module: ens160
interval: 10
digits: 0
type: eco2
"""

from typing import cast

from ...types import CerberusSchemaType, ConfigType
from . import GenericSensor

## Example configuration:
##sensor_modules:
## - name: ens160
## module: ens160
## chip_addr: 0x53
## temperature_compensation: 25
## humidity_compensation: 50
##
##sensor_inputs:
## - name: air_quality
## module: ens160
## interval: 10
## digits: 0
## type: aqi
##
## - name: volatile_organic_compounds
## module: ens160
## interval: 10
## digits: 0
## type: tvoc
##
## - name: eco2
## module: ens160
## interval: 10
## digits: 0
## type: eco2

DEFAULT_CHIP_ADDR = 0x53
DEFAULT_TEMPERATURE_COMPENSATION = 25
DEFAULT_HUMIDITY_COMPENSATION = 50
Expand Down
59 changes: 28 additions & 31 deletions mqtt_io/modules/sensor/flowsensor.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
"""

Flowsensor: Generic Flow Rate Sensor

Example configuration:

sensor_modules:
- name: yfs201
module: flowsensor

sensor_inputs:
- name: flow_rate1
module: yfs201
pin: 0
digits: 0
interval: 10
factor: 0.2

Factor can be calculated from Pulse characteristcs (dicumentation):

From YF-S201 manual:
Pulse Characteristic: F = 7 * Q (L/MIN).
Pulse frequency (Hz) / 7.0 = flow rate in L/min
==> Factor = 7.0

From YF-DN50 manual:
Pulse Characteristic: F = 0.2 * Q (L/MIN).
Pulse frequency (Hz) / 0.2 = flow rate in L/min
==> Factor = 0.2

If you use "factor = 1", the sensor module returns the frequency in Hertz (Hz).

"""

from typing import Dict
from ...types import CerberusSchemaType, ConfigType, SensorValueType
from . import GenericSensor

## Example configuration:
##sensor_modules:
## - name: yfs201
## module: flowsensor
##
##sensor_inputs:
## - name: flow_rate1
## module: yfs201
## pin: 0
## digits: 0
## interval: 10
## factor: 0.2
##
##Factor can be calculated from Pulse characteristcs (dicumentation):
##
##From YF-S201 manual:
## Pulse Characteristic: F = 7 * Q (L/MIN).
## Pulse frequency (Hz) / 7.0 = flow rate in L/min
## ==> Factor = 7.0
##
##From YF-DN50 manual:
## Pulse Characteristic: F = 0.2 * Q (L/MIN).
## Pulse frequency (Hz) / 0.2 = flow rate in L/min
## ==> Factor = 0.2
##
##If you use "factor = 1", the sensor module returns the frequency in Hertz (Hz).


REQUIREMENTS = ("gpiozero",)


Expand Down
30 changes: 14 additions & 16 deletions mqtt_io/modules/sensor/frequencycounter.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
"""

Frequencycounter: Generic Frequency Counter

Example configuration:

sensor_modules:
- name: frequency
module: frequencycounter

sensor_inputs:
- name: flow_rate1
module: frequency
pin: 0
digits: 0
interval: 10

"""

from typing import Dict
from ...types import CerberusSchemaType, ConfigType, SensorValueType
from . import GenericSensor

##Example configuration:
##
##sensor_modules:
## - name: frequency
## module: frequencycounter
##
##sensor_inputs:
## - name: flow_rate1
## module: frequency
## pin: 0
## digits: 0
## interval: 10


REQUIREMENTS = ("gpiozero",)


Expand Down