0.0.1 • Published 3 years ago

homebridge-soil-moisture v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Homebridge Plugin for Analog Soil Moisture Sensor

This is a Homebridge plugin for an analog soil moisture sensor, working on the Raspberry Pi 3.

The actual sensor values are read in by an Arduino, communicated to an Onion Omega2 over UART, and then sent over MQTT to a Raspberry Pi.

Configuration

Field nameDescriptionType / UnitDefault valueRequired?
nameName of the accessorystringY
maxAnalogReadingMaximum analog reading (i.e. reading when soil is wet)int1024N
minAnalogReadingMinimum analog reading (i.e. reading when soil is dry)int0N
moistureThresholdThreshold at which to notify that plant is too dryint25N
timeoutTime since last data received until setting "Not responding" statusint (min)5N
enableFakeGatoEnable storing data in Eve Home appboolfalseN
fakeGatoStoragePathPath to store data for Eve Home appstring(fakeGato default)N
mqttConfigObject containing some config for MQTTobjectN

The mqttConfig object is defined as follows:

Field nameDescriptionType / UnitDefault valueRequired?
urlURL of the MQTT server, must start with mqtt://stringY
soilMoistureTopicMQTT topic to which soil moisture data is received from Onionstringsoil_humidityN

Example Configuration

{
  "bridge": {
    "name": "Homebridge",
    "username": "XXXX",
    "port": XXXX
  },

  "accessories": [
    {
      "accessory": "Soil Moisture Sensor",
      "name": "Pothos",
      "maxAnalogReading": 800,
      "minAnalogReading": 200,
      "moistureThreshold": 25,
      "timeout": 5,
      "enableFakeGato": true,
      "mqtt": {
        "url": "mqtt://192.168.0.38",
        "soilMoistureTopic": "plants/soilmoisture"
      }
    },
  ]
}

Project Layout

  • All things required by Node are located at the root of the repository (i.e. package.json and index.js).
  • The rest of the code is in src, further split up by language.
    • arduino contains code that runs on the Arduino and reads in an analog value from a pin and transmits that data over UART to the Onion.
    • python contains code that runs on the Onion, reading data over UART from the Arduino and transmitting that data over MQTT to the Raspberry Pi.
0.0.1

3 years ago