GithubHelp home page GithubHelp logo

aaronhktan / homebridge-soil-moisture Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 2.32 MB

A Homebridge plugin for an analog soil moisture sensor. Sensor <--> Arduino Dock <--UART--> Omega2 <--MQTT--> Raspberry Pi. JavaScript, Python, and the Arduino Language.

License: MIT License

JavaScript 67.85% Python 30.31% C++ 1.84%
homebridge plugin soil-moisture-sensor homekit smart-home mqtt arduino onion-omega2 c python javascript node-js

homebridge-soil-moisture's Introduction

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 name Description Type / Unit Default value Required?
name Name of the accessory string Y
maxAnalogReading Maximum analog reading (i.e. reading when soil is wet) int 1024 N
minAnalogReading Minimum analog reading (i.e. reading when soil is dry) int 0 N
moistureThreshold Threshold at which to notify that plant is too dry int 25 N
timeout Time since last data received until setting "Not responding" status int (min) 5 N
enableFakeGato Enable storing data in Eve Home app bool false N
fakeGatoStoragePath Path to store data for Eve Home app string (fakeGato default) N
mqttConfig Object containing some config for MQTT object N

The mqttConfig object is defined as follows:

Field name Description Type / Unit Default value Required?
url URL of the MQTT server, must start with mqtt:// string Y
soilMoistureTopic MQTT topic to which soil moisture data is received from Onion string soil_humidity N

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.

homebridge-soil-moisture's People

Contributors

aaronhktan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

homebridge-soil-moisture's Issues

still maintaining? => TypeError: Cannot convert undefined or null to object

Looking for a soil moisture mqtt possibility drove me here. But i guess this isn't maintained anymore? At least the following error will be provided by installing it:

743 timing metavuln:packument:homebridge-soil-moisture Completed in 2301ms
744 verbose stack TypeError: Cannot convert undefined or null to object
744 verbose stack     at Function.keys (<anonymous>)
744 verbose stack     at Advisory.load (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:102:33)
744 verbose stack     at Calculator.[calculate] (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js:59:14)
744 verbose stack     at async Promise.all (index 0)
744 verbose stack     at async Map.[init] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:192:7)
744 verbose stack     at async Map.run (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:110:7)
....
750 error Cannot convert undefined or null to object
751 verbose exit 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.