Skip to content

Commit

Permalink
flatten config options to enable ENV variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnodgrass committed Jun 13, 2020
1 parent 06d7b49 commit c2c756c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
*.pyc
*.log
*/tmp/*
1 change: 1 addition & 0 deletions radiora-classic-bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

# DOES NOT WORK YET

[Hass.io](https://www.home-assistant.io/hassio/) add-on to enable communication and control for a variety of pool devices including controllers, pumps, chlorinators, lights, valve controls, etc. which are compatible with the Pentair RS485 communication protocol. This packages up [nodejs-poolController](https://github.com/bsileo/hubitat_poolcontroller) and [poolController-MQTT](https://github.com/crsherman/nodejs-poolController-mqtt) into a Hass.io compatible add-one package. Credit for all the heavy lifting in actually communicating with the pool equipment goes to Russell Goldin, creater of nodejs-poolController, as well as contributors to the project's success including Brad Sileo, Jason Young, Michael Russe, Michael Usner and many others.

Expand Down
20 changes: 15 additions & 5 deletions rs485-pool-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,24 @@ RUN apk update \
python \
linux-headers

RUN npm install

WORKDIR /app

# install latest released versions (FIXME: what is the update strategy for exposing to HASSIO?)
RUN git clone https://github.com/tagyoureit/nodejs-poolController /app/server \
&& git clone https://github.com/crsherman/nodejs-poolController-mqtt /app/mqtt
# && git clone https://github.com/bsileo/hubitat_poolcontroller /app/hubitat
RUN git clone https://github.com/tagyoureit/nodejs-poolController server \
&& git clone https://github.com/crsherman/nodejs-poolController-mqtt mqtt
# && git clone https://github.com/bsileo/hubitat_poolcontroller hubitat

# modify the package.json to add support for nodejs-poolController-mqtt

#1. Add the following to the package.json file in the nodejs-poolController folder
# "jsonata": "^1.5.3", "mqtt": "^2.17.0",
#2. Add the following to the config.json file in the nodejs-poolController folder
# "integrations": { "outputSocketToMQTT": 1 }, "outputSocketToMQTT": { "level": "debug" },
#3. Modify outputSocketToMQTT.js line 42 to specify the IP address of YOUR MQTT server on your network.
#4. Add the outputSocketToMQTT.js file to the nodejs-poolController/src/integrations folder on your rapsberry pi
#5. Run npm install in the nodejs-poolController folder where package.json exists

RUN npm install /app/server

COPY run.sh /
RUN chmod a+x /run.sh
Expand Down
12 changes: 6 additions & 6 deletions rs485-pool-controller/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"i386"
],
"options": {
"mqtt": {
"ip": "192.168.1.8",
"username": "hassio",
"password": "your-mqtt-password"
}
"mqtt_broker": "http://192.168.1.8:1883",
"mqtt_username": "hassio",
"mqtt_password": "your-mqtt-password"
},
"schema": {
"mqtt": { "ip": "str", "username": "str", "password": "password" }
"mqtt_broker": "url",
"mqtt_username": "str",
"mqtt_password": "password"
},
"host_network": false,
"gpio": true,
Expand Down
5 changes: 4 additions & 1 deletion rs485-pool-controller/run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# /data/options.json is the Hass.io config block saved into the Docker instance
CONFIG_PATH=/data/options.json

TARGET="$(bashio::config 'target')"
# inject the HASS.io configured MQTT credentials via environment variables
MQTT_BROKER_ADDRESS="$(bashio::config 'mqtt')"
MQTT_USERNAME="$(bashio::config 'mqtt')"
MQTT_PASSWORD="$(bashio::config 'mqtt')"

# FIXME:
# - convert HASSIO config.json and apply to nodejs-poolController config style
Expand Down

0 comments on commit c2c756c

Please sign in to comment.