{"id":13583511,"url":"https://github.com/terafin/mqtt-rainforest-bridge","last_synced_at":"2025-04-06T21:32:16.017Z","repository":{"id":20032689,"uuid":"88581790","full_name":"terafin/mqtt-rainforest-bridge","owner":"terafin","description":"Simple docker container that locally polls the rainforest energy bridge, and sends the results to an MQTT broker","archived":true,"fork":false,"pushed_at":"2023-03-30T18:36:12.000Z","size":394,"stargazers_count":2,"open_issues_count":9,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T15:53:28.845Z","etag":null,"topics":["automation","energy-monitor","mqtt"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/terafin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-18T04:31:42.000Z","updated_at":"2023-07-10T15:21:00.000Z","dependencies_parsed_at":"2023-01-11T20:41:41.318Z","dependency_job_id":null,"html_url":"https://github.com/terafin/mqtt-rainforest-bridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terafin%2Fmqtt-rainforest-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terafin%2Fmqtt-rainforest-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terafin%2Fmqtt-rainforest-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terafin%2Fmqtt-rainforest-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terafin","download_url":"https://codeload.github.com/terafin/mqtt-rainforest-bridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223264834,"owners_count":17116219,"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":["automation","energy-monitor","mqtt"],"created_at":"2024-08-01T15:03:31.854Z","updated_at":"2024-11-06T00:30:23.195Z","avatar_url":"https://github.com/terafin.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# Rainforest -\u003e MQTT Bridge\n\n## Required environment variables\n\n| ENV VARIABLE        | EXAMPLE                                              |                 |\n|---------------------| -----------------------------------------------------| --------------- |\n| MQTT_HOST           | \"mqtt://your-mqtt.server.here\"                       | **REQUIRED**    |\n| MQTT_USER           | \"mqtt username\"                                      | *OPTIONAL*      |\n| MQTT_PASS           | \"mqtt password\"                                      | *OPTIONAL*      |\n| TOPIC_PREFIX        | \"/your/topic/prefix\"                                 | **REQUIRED**    |\n| RAINFOREST_IP       | YOUR.RAINFOREST.IP.OR.HOSTNAME                       | *OPTIONAL*      |\n| RAINFOREST_MAC      | \"your rainforest eagle Zigbee MAC\"                   | *OPTIONAL*      |\n| RAINFOREST_USER     | \"your rainforest username (on the device itself)\"    | *OPTIONAL*      |\n| RAINFOREST_PASS     | \"your rainforest password\"                           | *OPTIONAL*      |\n| LISTENING_PORT      | \"32000\"                                              | *OPTIONAL*      |\n| LISTENING_PATH      | \"/rainforest/data\"                                   | *OPTIONAL*      |\n\n## Modes\n\nThere are two modes to this mqtt brdige, one as a poller, one as an HTTP REST endpoint\n\n* To set it up as a poller, you must set RAINFOREST_IP, RAINFOREST_MAC - and RAINFOREST_USER, RAINFOREST_PASS if you have security enabled\n* To set it up as an HTTP endpoint, you must set LISTENING_PORT and LISTENING_PATH *(note: Example below)*\n\n\n## Example Usage for HTTP endpoint\n\nHere's a full docker flow you can use to pull the latest image, delete the old one, and create a new container named 'mqtt-rainforest-bridge':\n\n* `docker pull terafin/mqtt-rainforest-bridge:latest`\n* `docker rm -f mqtt-rainforest-bridge`\n* `docker run -d -p 32000:32000 -e TOPIC_PREFIX='/energyusage/home' -e LISTENING_PORT='32000' -e LISTENING_PATH='/rainforest/data' -e MQTT_HOST='mqtt://mymqtt.local.address' --name='mqtt-rainforest-bridge' terafin/mqtt-rainforest-bridge:latest`\n  \nThis will spin up a working rainforest HTTP PUT endpoint at port 32000, with path /rainforest/data, which will start sending the MQTT messages below\n\nTo look at the logging output, you can:\n\n* `docker logs -f mqtt-rainforest-bridge`\n\n## Example Usage for polling\n\nHere's a full docker flow you can use to pull the latest image, delete the old one, and create a new container named 'mqtt-rainforest-bridge':\n\n* `docker pull terafin/mqtt-rainforest-bridge:latest`\n* `docker rm -f mqtt-rainforest-bridge`\n* `docker run -d -p 32000:32000 -e TOPIC_PREFIX='/energyusage/home' -e RAINFOREST_USER='0x1234' -e RAINFOREST_PASS='mysecretpassword!' -e RAINFOREST_IP='10.0.1.100' -e RAINFOREST_MAC='0xdeadbeef00000abcd' -e MQTT_HOST='mqtt://mymqtt.local.address' --name='mqtt-rainforest-bridge' terafin/mqtt-rainforest-bridge:latest`\n\n\nThis will spin up a working rainforest bridge to a device at IP 10.0.1.100, which will start sending the MQTT messages below\n\nTo look at the logging output, you can:\n\n* `docker logs -f mqtt-rainforest-bridge`\n\n## MQTT results\n\nHere's some sample (from my system) results after using the above setup:\n\n*Note: These will be polled and updated every 5 seconds.*\n\n    /energyusage/home/demand 0\n    /energyusage/home/meter_status Connected\n    /energyusage/home/demand_units kW\n    /energyusage/home/summation_received 4022.795\n    /energyusage/home/summation_delivered 57155.849\n    /energyusage/home/summation_units kWh\n    /energyusage/home/price -1.0000\n    /energyusage/home/price_units 840\n    /energyusage/home/message_timestamp 946684800\n    /energyusage/home/message_confirmed N\n    /energyusage/home/message_confirm_required N\n    /energyusage/home/message_id 0\n    /energyusage/home/message_queue active\n    /energyusage/home/message_read Y\n    /energyusage/home/threshold_upper_demand 20.609000\n    /energyusage/home/threshold_lower_demand -14.967000\n    /energyusage/home/fast_poll_frequency 0x00\n    /energyusage/home/fast_poll_endtime 0x00000000\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterafin%2Fmqtt-rainforest-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterafin%2Fmqtt-rainforest-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterafin%2Fmqtt-rainforest-bridge/lists"}