{"id":16786845,"url":"https://github.com/luebbe/homie-node-collection","last_synced_at":"2025-03-22T00:32:42.985Z","repository":{"id":48832105,"uuid":"91066595","full_name":"luebbe/homie-node-collection","owner":"luebbe","description":"Collection of Node implementations for the Homie-ESP8266 library","archived":false,"fork":false,"pushed_at":"2024-12-01T16:37:40.000Z","size":248,"stargazers_count":26,"open_issues_count":2,"forks_count":12,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T06:36:00.538Z","etag":null,"topics":["esp8266","homie","homie-convention","measure-voltage","mqtt","platformio","relay","sensor-nodes"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luebbe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-12T07:59:38.000Z","updated_at":"2024-12-01T16:37:43.000Z","dependencies_parsed_at":"2024-10-28T12:14:49.965Z","dependency_job_id":null,"html_url":"https://github.com/luebbe/homie-node-collection","commit_stats":{"total_commits":232,"total_committers":7,"mean_commits":"33.142857142857146","dds":0.0818965517241379,"last_synced_commit":"f93679e9bd0e9dc4f79db963c5c11119d2bcf0f5"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luebbe%2Fhomie-node-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luebbe%2Fhomie-node-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luebbe%2Fhomie-node-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luebbe%2Fhomie-node-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luebbe","download_url":"https://codeload.github.com/luebbe/homie-node-collection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890102,"owners_count":20527030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp8266","homie","homie-convention","measure-voltage","mqtt","platformio","relay","sensor-nodes"],"created_at":"2024-10-13T08:13:27.522Z","updated_at":"2025-03-22T00:32:42.680Z","avatar_url":"https://github.com/luebbe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Homie Node Collection\n\n[![Languages](https://img.shields.io/github/languages/top/luebbe/homie-node-collection.svg?style=flat-square)](https://img.shields.io/github/languages/top/luebbe/homie-node-collection)\n[![GitHub release](https://img.shields.io/github/release/luebbe/homie-node-collection.svg?style=flat-square)](https://github.com/luebbe/homie-node-collection/releases)\n[![Build status](https://img.shields.io/github/actions/workflow/status/luebbe/homie-node-collection/main.yml?branch=master\u0026style=flat-square)](https://github.com/luebbe/homie-node-collection/actions)\n[![Codacy](https://img.shields.io/codacy/grade/e6d5e648b83b4667b399b81e2986dea6?style=flat-square)](https://app.codacy.com/gh/luebbe/homie-node-collection/dashboard)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n[![PlatformIO](https://img.shields.io/static/v1?label=Powered\u0026message=PlatformIO\u0026color=blue\u0026style=flat-square)](https://platformio.org/lib/show/6163/Homie%20node%20collection)\n[![Homie](https://img.shields.io/static/v1?label=Powered\u0026message=Homie\u0026color=blue\u0026style=flat-square)](https://github.com/homieiot/homie-esp8266)\n\nCollection of nodes and examples for Homie. The nodes are designed as independent classes, so they can work standalone. For instance you can easily wire up a firmware for a Sonoff Relay by combining a ButtonNode with a RelayNode.\n\nThe software is based on [Homie](https://github.com/homieiot/homie-esp8266) and is developed using [PlatformIO](https://github.com/platformio)\nIt has recently been migrated to the [Homie v3 Develop branch](https://github.com/homieiot/homie-esp8266/tree/develop-v3).\n\n- Releases up to 1.0.x are using the [Homie convention 2.0.1](https://github.com/homieiot/convention/releases/tag/v2.0.1)\n- Releases from 1.1.x onwards are using the [Homie convention 3.0.1](https://github.com/homieiot/convention/releases/tag/v3.0.1)\n\n## Attention\n\nJuly 2023: newer expressif platform versions cause a linker \"... relocation ...\" error. This is why I recommend to explicitely use the 4.1.0 version. So you should add the following line to your platformio.ini.\n\n```markdown\n[env]\nplatform = espressif8266@4.1.0 ; July 2023: newer expressif platform versions cause a linker error.\nframework = arduino\n```\n\n## Sensor Nodes\n\nAll sensor nodes have a common `status` subtopic wit the enum values: `ok|error`. `status` is `ok` when a sensor could be detected and a valid measurement could be taken, `error` otherwise.\nAll sensor nodes publish their data type on the `$datatype` subtopic.\nAll sensor nodes publish their unit on the `$unit` subtopic.\nMost sensor nodes publish their format/value range on the `$format` subtopic.\nSo if a sensor nodes publishes a temperature, you will see the following subtopics:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/status`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/temperature`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/temperature/$datatype`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/temperature/$unit`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/temperature/$format`\n\n### AdcNode.cpp\n\nHomie Node using the internal ESP ADC to measure voltage.\n\nIt has three settings:\n\n- _adcCorrect_: Correction factor for AD converter.  \n  Range = \\[0.5 .. 1.5], Default = 1.\n\n- _battMax_: Measured voltage that corresponds to 100% battery level.  \n  Must be greater than _battMin_. Range = \\[2.5V .. 4.0V]. Default = 3.3V.\n\n- _battMin_: Measured voltage that corresponds to 0% battery level.  \n  Must be less than _battMax_. Range = \\[2.5V .. 4.0V]. Default = 2.6V.\n\nAdvertises the values as:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/voltage`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/batterylevel`\n\n### BME280Node\n\nA node for Bosch BME280 I2C temperature/humidity/pressure sensors. Reports the three values back via MQTT.\n\nIt has one setting:\n\n- _\\\u003cnode-id\u003e.temperatureOffset_: The temperature offset in degrees.  \n  Range = \\[-10.0°C .. 10.0°C]. Default = 0°C.  \n  This is a _per node_ setting, so pay attention that the node ids are different.\n\nThis offset is passed into the Adafruit BME280 library and used for depending calculations.\n\nAdvertises the values as:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/temperature`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/humidity`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/pressure`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/dewpoint`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/abshumidity`\n\n### DHT22Node\n\nA node for DHT22 temperature/humidity sensors. Reports the two values back via MQTT.\n\nAdvertises the values as:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/temperature`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/humidity`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/dewpoint`\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/abshumidity`\n\n### DS18B20Node\n\nA Homie Node for Dallas 18B20 one wire temperature sensors. Reports the temperature back via MQTT.\n\nAdvertises the value as:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/temperature`\n\n### PingNode\n\nAn ultrasonic sensor that reports the distance to an object based on the echo time.\n\nThe following topics are advertised:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/distance` - the distance between the sensor and the object\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/ping` - the time between pulse and echo in microseconds\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/valid` (ok|error) - signals if the measurement was valid\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/changed` (true|false) - signals if the distance to the object changed significantly (i.e. if the object was moved).\n\nThe reported distance is calculated from the ping time. This distance depends on the [speed of sound](https://en.wikipedia.org/wiki/Speed_of_sound) and therefore on the temperature. The temperature can be adjusted with the\n`setTemperature(float temperatureCelcius)` method, e.g. in conjuction with a temperature sensor such as the DHT22Node:\n\n```cpp\nvoid loopHandler() {\n  //...\n  pingNode.setTemperature(temperatureNode.getTemperature());\n  //...\n}\n```\n\n## Actor Nodes\n\n### ButtonNode\n\nA pushbutton that just detects a single (debounced) button press. An optional callback can be triggered by the button press event. The button press is reported via these topics:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/down` (true|false) - signals when the button is pressed\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/duraction` - after the button is pressed and released, it signals the total time that the button was pressed. This is useful to detect a short of long button press.\n\nThe minimum and maximum button press time in milliseconds can be set with:\n\n```cpp\nvoid setMinButtonDownTime(unsigned short downTime);\nvoid setMaxButtonDownTime(unsigned short downTime);\n```\n\nToDo: detect multiple button presses and report them back.\n\n### ContactNode\n\nA contact that reports its open state (true|false) via MQTT. An optional callback can be triggered by the state change event.\n\nAdvertises the state as:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/open` (true|false)\n\n### PulseNode\n\nIn some way similar to the contact node only that it reacts on pulses on the selected input pin. It reports its state (true|false) via MQTT. An optional callback can be triggered by the state change event. Imagine an optocoupler pulsing with 50Hz when a switch is closed or a button is pressed.\n\nAdvertises the state as:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/active` (true|false)\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/pulses`\n\nIn order to use the PulseNode you need an interrupt procedure which is attached to the selected pin. e.G.:\n\n```cpp\nvoid IRAM_ATTR onOptoCouplerPulse()\n{\n  pulseNode.onInterrupt();\n}\n\nvoid setup()\n{\n  attachInterrupt(PIN_OPTOCOUPLER, onOptoCouplerPulse, FALLING);\n}\n```\n\nIt has two settings:\n\n- _interval_: The interval in which to check for pulses.  \n  Range = \\[1 .. Max(long)ms], Default = 5000ms.  \n  This is a _per node_ setting, so pay attention that the node ids are different.\n\n- _activePulses_: The number of pulses per interval to be considered active.  \n  Range =\\[1 .. Max(long)]. Default = 10.  \n  This is a _per node_ setting, so pay attention that the node ids are different.\n\n### RelayNode\n\nA relay that can be set on (true|false) via MQTT message. An optional GPIO pin (e.g. to light up a LED) can be passed in the constructor. This pin will be set high/low synchronous to the relay. Additonally the relay can be turned on for a number of seconds by sending this number to the timeout subtopic. The Relay supports reverse logic.\n\nThe relay has two different constructors:\n\nUse the following constructor, if your relay is connected directly to the ESP.\n\n```cpp\nRelayNode(const char *id,\n          const char *name,\n          const int8_t relayPin = DEFAULTPIN,\n          const int8_t ledPin = DEFAULTPIN,\n          const bool reverseSignal = false);\n```\n\nUse the following constructor, if your relay is not connected directly, e.g. via a port expander. Turning the relay on and off as well as getting the relay state is handled in the callbacks. Timeout and positive/negative logic are handled in the RelayNode.\n\n```cpp\nRelayNode(const char *id,\n          const char *name,\n          const uint8_t callbackId,\n          TGetRelayState OnGetRelayState,\n          TSetRelayState OnSetRelayState,\n          const bool reverseSignal = false);\n```\n\nIt has one setting:\n\n- _\\\u003cnode-id\\\u003e.maxTimeout_: The maximum time that the relay is turned on.  \n  Range = \\[0s .. max(long)s]. Default = 600 seconds. 0 = no max timeout.  \n  This is a _per node_ setting, so pay attention that the node ids are different.\n\nThe relay can be controlled by posting to the follwing MQTT topics:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/on/set` (true|false|toggle)\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/timeout/set` (positive integer) - turns the relay on for the corresponding number of seconds, limited by _maxTimeout_.\n\nAdvertises the state as:\n\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/on` (true|false)\n- `homie/\u003cdevice-id\u003e/\u003cnode-id\u003e/timeout/` (positive integer) - counts down the number of seconds until the relay will turn off again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluebbe%2Fhomie-node-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluebbe%2Fhomie-node-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluebbe%2Fhomie-node-collection/lists"}