Skip to content

Commit

Permalink
units, healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Legobas committed Jan 29, 2023
1 parent 3a6fc76 commit 951e420
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 127 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ json examples:
topic:

rfxcom2mqtt/commmand/Switch1

json examples (lighting4, command identifies device id):

{"command": "on"}
Expand All @@ -55,12 +56,22 @@ json examples (lighting4, command identifies device id):
topic:

rfxcom2mqtt/commmand/Lights

json examples (lighting2, unitCode identifies device):

{"unitCode":"2", "command": "on"}
{"unitCode":"2", "command": "off"}
{"unitCode":"3", "command": "on"}
{"unitCode":"3", "command": "off"}
{"unit":"Light1","command":"on"}

the unitname can also be defined in the topic:

rfxcom2mqtt/command/Lights/Light1

{"command": "on"}

### Healthcheck

If healthcheck is enabled in the config, the rfxcom status will be read every minute.
In case of an error the node process will exit.
If installed in docker the container will try to restart try to reconnect to the RFXCOM device.

----

Expand Down
14 changes: 14 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
debug: true
healthcheck: true

mqtt:
base_topic: rfxcom2mqtt
Expand Down Expand Up @@ -52,6 +53,19 @@ devices:

- id: '0x00ED400F'
name: 'Lights'
units:
- unitCode: '1'
name: 'Light1'
title: 'Living Room'
- unitCode: '2'
name: 'Light2'
title: 'Kitchen'
- unitCode: '3'
name: 'Light3'
title: 'Garage'
- unitCode: '4'
name: 'Light4'
title: 'Garden'
type: 'lighting2'

- id: '0x3D090F'
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
version: "3.8"

services:
rfxtrx2mqtt:
rfxcom2mqtt:
image: legobas/rfxcom2mqtt
container_name: rfxcom2mqtt
build: /home/legobas/rfxcom2mqtt
volumes:
- /home/legobas/data/rfxcom2mqtt:/app/data
devices:
- /dev/ttyUSB1:/dev/ttyUSB0
environment:
- TZ=Europe/Amsterdam
restart: unless-stopped
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"description": "RFXCOM to MQTT bridge",
"main": "rfxcom2mqtt.js",
"dependencies": {
"mqtt": "^2.15.0",
"rfxcom": "^2.4.0",
"node-config-yaml": "^0.1.4"
"mqtt": "^4.3.7",
"rfxcom": "^2.4.1",
"node-config-yaml": "^0.1.4",
"node-cron": "^3.0.2"
},
"author": "Legobas<legobas@github.com>",
"license": "Apache-2.0"
Expand Down
Loading

0 comments on commit 951e420

Please sign in to comment.