Nodes are slave units attached via serial to the main controller that run on micro-controllers (arduino, esp32 and esp8266). The nodes wait for configuration and commands from the main controller.
Nodes have five main configurations: name
, address
, type
, controls
and sensors
. You can find the address of attached serial devices with the following command on the pi: ls /dev
Below is an example of a node configuration with one attached sensor.
{
"nodes": [
{
"name": "Node 1",
"address": "/dev/ttyUSB0",
"type": "arduino",
"sensors": [
{
"pin": 1,
"type": "Soil",
"name": "Garden_soil_moisutre"
}
]
}
]
}
Option | Type | Required | Description |
name | [String] | Yes | Friendly display name of the node. Useful for UI. |
address | [String] | Yes | Serial or IP address of the node connected to our raspberry pi. |
type | [String] | Yes | Type of node that is connected to determine proper worker to load. Available options arduino , ADC-MCP3008 |
sensors | [Array] | No | Array of sensor object configs for sensors attached to the node. |
controls | [Array] | No | Array of control object configs for controls attached to the node. |
relays | [Array] | No | Array of control object configs for relays attached to the node. |
use_wifi | [Boolean] | No | Boolean to determine if the connection should be wireless. To use wifi: set to True and change address to a local ip. |
Read more in depth about sensor configurations here.
Option | Type | Required | Description |
type | [String] | Yes | Type of sensor. Options: Soil , Rain , Float , Humidity Temperature |
pin | [Integer] | Yes | GPIO pin number on arduino the sensor is connected to. |
name | [String] | Yes | Name of the sensor. The name will be slugged and used as key to store in redis if a key is not specified. |
key | [String] | No | Key to store value under in redis. Alphanumeric with underscores only. Must be valid redis key. If a key is not provided it will use the name converted to lowercase and spaces replaced with underscores. |
Arduinos have analog GPIO support and allow us access to a larger range of sensors. Below is a list of available sensor types. You can find more about each sensor type under the nodes section in the docs.
Type | Returns | Description |
Humidity | [Object] | DHT11 / DHT22 Temperature and humidity reading. |
Rain | [Integer] | Takes an analog reading of resistance across rain sensor to detect moisture level. |
Soil | [Integer] | Takes analog reading of capacitive soil sensor to determine soil moisture. |
Float | [Boolean] | 0 or 1 digital read of liquid level. If marked critical it will prevent pump from running until it returns 1 (true) |
Temperature | [Object] | A temperature sensor running on Onewire bus. Onewire can be buggy with other sensors running |
Read more in depth about control configurations here.
Option | Type | Required | Description |
type | [String] | Yes | Type of control. Options: button , switch , potentiometer |
pin | [Integer] | Yes | GPIO pin number on raspberry pi the control is connected to. |
name | [String] | Yes | Name of the control. The name will be slugged and used as key to store in redis if a key is not specified. |
key | [String] | No | Key to store value under in redis. Alphanumeric with underscores only. Must be valid redis key. If a key is not provided it will use the name converted to lowercase and spaces replaced with underscores. |
Arduinos have analog GPIO support and allow us access to a larger range of control options. Below is a list of available control types. You can find more about each control type under the controls section in the docs.
Type | Returns | Description |
Button | [Boolean] | Triggers on button press and released. Continues to fire events while pressed. |
Switch | [Boolean] | Triggers on state change only once. |
Potentiometer | [Integer] 0 - 1024 | Triggers on state changed and sends current state in event. Has value buffer of 3 before triggering change event. (Works on Arduino Only) |
MCP3008 is an analog to digital converter chip. This allows connecting analog signals to be converted before getting to the pi GPIO. This was a community added feature.
Type | Returns | Description |
Soil | [Integer] | Takes analog reading of capacitive soil sensor to determine soil moisture. |
The relays configuration and controls for nodes are identical to general relay settings. Read more on the relays page to find information.