Node Configuration

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"
                }
            ]
        }
    ]
}

Settings

OptionTypeRequiredDescription
name[String]YesFriendly display name of the node. Useful for UI.
address[String]YesSerial or IP address of the node connected to our raspberry pi.
type[String]YesType of node that is connected to determine proper worker to load. Available options arduino, ADC-MCP3008
sensors[Array]NoArray of sensor object configs for sensors attached to the node.
controls[Array]NoArray of control object configs for controls attached to the node.
relays[Array]NoArray of control object configs for relays attached to the node.
use_wifi[Boolean]NoBoolean to determine if the connection should be wireless. To use wifi: set to True and change address to a local ip.

Sensor Settings

Read more in depth about sensor configurations here.

OptionTypeRequiredDescription
type[String]YesType of sensor. Options: Soil, Rain, Float, Humidity Temperature
pin[Integer]YesGPIO pin number on arduino the sensor is connected to.
name[String]YesName of the sensor. The name will be slugged and used as key to store in redis if a key is not specified.
key[String]NoKey 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.

Sensor Types (Arduino)

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.

TypeReturnsDescription
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

Control Settings

Read more in depth about control configurations here.

OptionTypeRequiredDescription
type[String]YesType of control. Options: button, switch, potentiometer
pin[Integer]YesGPIO pin number on raspberry pi the control is connected to.
name[String]YesName of the control. The name will be slugged and used as key to store in redis if a key is not specified.
key[String]NoKey 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.

Control Types (Arduino)

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.

TypeReturnsDescription
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 - 1024Triggers on state changed and sends current state in event. Has value buffer of 3 before triggering change event. (Works on Arduino Only)

Sensor Types (MCP3008)

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.

TypeReturnsDescription
Soil[Integer]Takes analog reading of capacitive soil sensor to determine soil moisture.

Relays (Arduino)

The relays configuration and controls for nodes are identical to general relay settings. Read more on the relays page to find information.