[OBSOLETE] Russound Multi-Zone Controller Integration

Great… you should be able to get this up and running with a few tweaks… sounds like you haven’t seen the install video? Check out the FAQ in the first post of this thread, look at the video and the question titled “What do I need to do to get this running?”

Did you create the plugins folder and copy the plugins you want to use?

I fixed the last error I was getting by keeping “secret-key” as the auth code…I wasn’t sure if it could be changed.

For the SmartApp, how do I find the proxy address for the smartthings node proxy? All I have seen is “:::”. Connecting the app seems to be the last piece I need to figure out…

apologies for some rudimentary questions but much appreciated for the help.

The STNP address is the IP address of the RPi. Easiest way to get that is to run the following from the command line:

ifconfig

But I recommend that you assign a static IP to the RPi or else ST will lose it’s connection if the RPi gets assigned a new IP.

Thanks for the response, @redloro. I will give that a try. I greatly appreciate your assistance. Just to make sure I understand everything correctly absent assigning a static IP, I need to do the following:

  1. figure out RPi IP address using ifconfig (it is 198.68.0.20/24, so using 198.68.0.20 in #2)
  2. Input RPi IP address as the ‘Proxy Address’ in the Russound RNET smartapp

I did the two steps above, but I’m having no luck getting anything to populate in SmartThings under ‘Things’.

Just to be clear, I re-did config.json file, and only the following steps/commands:
cd ~/smartthings-nodeproxy
npm install
npm run install:rnet
npm run start
After 'npm run start, I get something similar to your example response at the top of this topic under ‘How do I know it’s running?’.

Well, I still couldn’t get it to work, so as a last resort I did the factory initialization on my Russound CAA66. I then deleted all of the files and re-did everything on the RPi, and then re-added the SmartApp and Device Handler in SmartThings.

For the first time, I am seeing my zones populate in the SmartThings app; however, that’s about as far as I get. I don’t have the error in front of me (I can get it if needed). After I start everything by using ‘npm run start’ it all seems to work for a bit, and when I refresh the app I can see the live logging on the RPi, but then I get an error that references the following line 154 in the rnet.js “if (device && device.isOpen”, and it closes out of the STNP. It let’s me restart it back up again, and it works for a few, but then shows an error again.

pi@raspi:~/smartthings-nodeproxy $ npm run start

smartthings-nodeproxy@1.0.0 start /home/pi/smartthings-nodeproxy
node server.js

[2017-08-01T04:59:51.526Z] [stnp] SmartThings Node Proxy listening at http://:::8080
[2017-08-01T04:59:51.698Z] [stnp] Loaded plugin: rnet
[2017-08-01T04:59:51.878Z] [rnet] Detected serial ports: [“/dev/ttyAMA0”,“/dev/ttyUSB0”]
[2017-08-01T04:59:51.882Z] [rnet] Connected to RNET: /dev/ttyAMA0
[2017-08-01T05:00:23.428Z] [stnp] ::ffff:192.168.0.15 GET /plugins/rnet/controllers/0/zones/1/state/0
TypeError: device.isOpen is not a function
at write (/home/pi/smartthings-nodeproxy/plugins/rnet.js:197:28)
at Rnet.setZoneState (/home/pi/smartthings-nodeproxy/plugins/rnet.js:298:5)
at /home/pi/smartthings-nodeproxy/plugins/rnet.js:106:8
at Layer.handle [as handle_request] (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/layer.js:95:5)
at next (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/layer.js:95:5)
at /home/pi/smartthings-nodeproxy/node_modules/express/lib/router/index.js:281:22
at param (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/index.js:354:14)
at param (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/index.js:365:14)
[2017-08-01T05:00:26.284Z] [stnp] ::ffff:192.168.0.15 GET /plugins/rnet/controllers/0/zones/1/state/1
TypeError: device.isOpen is not a function
at write (/home/pi/smartthings-nodeproxy/plugins/rnet.js:197:28)
at Rnet.setZoneState (/home/pi/smartthings-nodeproxy/plugins/rnet.js:298:5)
at /home/pi/smartthings-nodeproxy/plugins/rnet.js:106:8
at Layer.handle [as handle_request] (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/layer.js:95:5)
at next (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/layer.js:95:5)
at /home/pi/smartthings-nodeproxy/node_modules/express/lib/router/index.js:281:22
at param (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/index.js:354:14)
at param (/home/pi/smartthings-nodeproxy/node_modules/express/lib/router/index.js:365:14)
[2017-08-01T05:00:40.834Z] [stnp] ::ffff:192.168.0.15 GET /subscribe/192.168.0.15:39500
/home/pi/smartthings-nodeproxy/plugins/rnet.js:154
if (device && device.isOpen()) { return };
^

TypeError: device.isOpen is not a function
at Rnet.init (/home/pi/smartthings-nodeproxy/plugins/rnet.js:154:26)
at Timeout._onTimeout (/home/pi/smartthings-nodeproxy/plugins/rnet.js:181:33)
at ontimeout (timers.js:469:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:264:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! smartthings-nodeproxy@1.0.0 start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the smartthings-nodeproxy@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2017-08-01T05_00_51_779Z-debug.log
pi@raspi:~/smartthings-nodeproxy $

Ok looks like you’ve got it running but I think maybe the port you’ve specified may be incorrect? The easiest way to troubleshoot this is to unplug the USB cable and restart STNP. When it starts up it’ll show the detected ports as such:

[2017-08-01T04:59:51.878Z] [rnet] Detected serial ports: ["/dev/ttyAMA0","/dev/ttyUSB0"]

whichever one is not showing anymore is the one you need to use in your config.json. Give it a go and let me know.

Thanks, @redloro. I did that check and ended up switching the serial port specified in the config.json to “/dev/ttyUSB0”. I then re-ran STNP, but I’m getting the same error above.

I’m not sure if this is related, but in the SmartApp it shows all zones as “on”, and if I switch it “off” it eventually shows back up as “on”.

From your STNP folder, can you share the output of:

node -v

and:

npm run install:rnet

and:

npm install serialport

@redloro
pi@raspi:~ $ cd ~/smartthings-nodeproxy
pi@raspi:~/smartthings-nodeproxy $ node -v
v8.2.1
pi@raspi:~/smartthings-nodeproxy $ npm run install:rnet

smartthings-nodeproxy@1.0.0 install:rnet /home/pi/smartthings-nodeproxy
npm install && npm install serialport

up to date in 5.721s

serialport@5.0.0 install /home/pi/smartthings-nodeproxy/node_modules/serialport
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/5.0.0/serialport-v5.0.0-node-v57-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@5.0.0 and node@8.2.1 (node-v57 ABI) (falling back to source compile with node-gyp)
make: Entering directory ‘/home/pi/smartthings-nodeproxy/node_modules/serialport/build’
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
CXX(target) Release/obj.target/serialport/src/poller.o
SOLINK_MODULE(target) Release/obj.target/serialport.node
COPY Release/serialport.node
make: Leaving directory ‘/home/pi/smartthings-nodeproxy/node_modules/serialport/build’

  • serialport@5.0.0
    updated 1 package in 45.729s
    pi@raspi:~/smartthings-nodeproxy $ npm install serialport

serialport@5.0.0 install /home/pi/smartthings-nodeproxy/node_modules/serialport
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/5.0.0/serialport-v5.0.0-node-v57-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@5.0.0 and node@8.2.1 (node-v57 ABI) (falling back to source compile with node-gyp)
make: Entering directory ‘/home/pi/smartthings-nodeproxy/node_modules/serialport/build’
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
CXX(target) Release/obj.target/serialport/src/poller.o
SOLINK_MODULE(target) Release/obj.target/serialport.node
COPY Release/serialport.node
make: Leaving directory ‘/home/pi/smartthings-nodeproxy/node_modules/serialport/build’

  • serialport@5.0.0
    updated 1 package in 42.583s
    pi@raspi:~/smartthings-nodeproxy $

Well look at that… you found a bug. The dumb guys that manage serialport decided to issue a release a few weeks ago and broke the plugin. It’s been fixed… get the latest rnet.js plugin from here:

Let me know how it goes.

@redloro @tcjennings - Thanks for the work on this! I look forward to using it.

I just attempted to install on a fresh Raspbian install tonight and wonder if there is another bug introduced by the serialport upgrade. When I run “npm run start” I receive an error complaining about the parser.

/opt/smartthings-nodeproxy/plugins/mpr-sg6z.js:174
                          parser: serialport.parsers.readline('\n'),
                                                     ^

I attempted different iterations of case on readline, but was unable to get it to load correctly. Thoughts?

Made some fixes… get the latest mpr-sg6z.js plugin and give it a go…

@redloro - It now complains that Readline is not defined on line 178.

And try again… this should do it! (fingers crossed…)

Says connected to MPR6Z. I’ll do some further digging tonight. Thanks for all your help!

@redloro, it is working! Thank you so much for your patience and help. I truly appreciate it.

Hello,

I am new to this and trying to setup smarthings node proxy. I am running node js on qnap. I am getting the following error when I run npm run start:

[~/smartthings-nodeproxy] # npm run start

smartthings-nodeproxy@1.0.0 start /root/smartthings-nodeproxy
node server.js

[2017-08-11T15:22:00.764Z] [stnp] SmartThings Node Proxy listening at http://0.0.0.0:8083
module.js:327
throw err;
^

Error: Cannot find module ‘serialport’
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/root/smartthings-nodeproxy/plugins/ad2usb.js:21:18)
at Module._compile (module.js:409:26)
at Object.Module._extensions…js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

npm ERR! Linux 4.2.8
npm ERR! argv “/share/CACHEDEV1_DATA/.qpkg/nodejsv4/node/bin/node” “/usr/local/bin/npm” “run” “start”
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! smartthings-nodeproxy@1.0.0 start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the smartthings-nodeproxy@1.0.0 start script ‘node server.js’.
npm ERR! This is most likely a problem with the smartthings-nodeproxy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs smartthings-nodeproxy
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR!
npm ERR! npm owner ls smartthings-nodeproxy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/smartthings-nodeproxy/npm-debug.log

You may want to post your config file.

My config:

{
“port”: 8083,
“authCode”: “secret-key”,

“rnet”: {
“c-series”: false,
“serialPort”: “/dev/usbser”,
“sources”: [
“Sonos”,
“Airplay”,
“Apple TV”,
“Source 4”,
“Source 5”,
“Source 6”
],
“controllerConfig”: {
“type”: “discover”,
“controllers”: [{
“controller”: 0,
“zones”: [
{“zone”: 0, “name”: “Family Room”},
{“zone”: 1, “name”: “Kitchen”},
{“zone”: 2, “name”: “Living Room”},
{“zone”: 3, “name”: “Patio”},
{“zone”: 4, “name”: “Dining Room”},
{“zone”: 5, “name”: “Office”}
]
}]
}
},

“mpr6z”: {
“serialPort”: “COM2”,
“baudRate”: 9600,
“sources”: [
“Sonos”,
“Airplay”,
“Apple TV”,
“Source 4”,
“Source 5”,
“Source 6”
],
“controllerConfig”: {
“type”: “discover”,
“controllers”: [{
“controller”: 1,
“zones”: [
{“zone”: 1, “name”: “Family Room”},
{“zone”: 2, “name”: “Kitchen”},
{“zone”: 3, “name”: “Living Room”},
{“zone”: 4, “name”: “Patio”},
{“zone”: 5, “name”: “Dining Room”},
{“zone”: 6, “name”: “Office”}
]
}]
}
},

“envisalink”: {
“address”: “192.168.1.11”,
“port”: “4025”,
“password”: “test”,
“securityCode”: “1111”,
“dumpZoneTimer”: “0”,

"panelConfig": {              
  "type": "discover",
  "partitions": [
    {"partition": 1, "name": "Security Panel"}
  ],
                    "zones": [
                            {
                                    "zone": 1,
                                    "type": "contact",
                                    "name": "Front or Garage Doors"
                            },
                            {
                                    "zone": 2,
                                    "type": "motion",
                                    "name": "Living Room Motion"
                            },
                            {
                                    "zone": 3,
                                    "type": "contact",
                                    "name": "Patio Door"
                            },
                            {
                                    "zone": 4,
                                    "type": "contact",
                                    "name": "Master Bedroom Windows"
                            },
                            {
                                    "zone": 5,
                                    "type": "contact",
                                    "name": "Downstairs Windows"
                            },
                            {
                                    "zone": 6,
                                    "type": "contact",
                                    "name": "Upstairs Windows"
                            }
  ]
}

},

“ad2usb”: {
“mode”: “serial”,
“securityCode”: “1234”,
“clearFaults”: true,

"serialPort": "COM2",        

"address": "192.168.2.22",    
"port": "9001",               
"panelConfig": {             
  "type": "discover",
  "partitions": [
    {"partition": 1, "name": "Security Panel"}
  ],
  "zones": [
    {"zone": 1, "type": "smoke", "name": "Smoke Detector", "serial": "0180036"},
    {"zone": 2, "type": "contact", "name": "Front Door", "serial": "0180037"},
    {"zone": 3, "type": "contact", "name": "Back Door", "serial": "0180038"},
    {"zone": 4, "type": "contact", "name": "Kitchen Door", "serial": "0180039"},
    {"zone": 5, "type": "contact", "name": "Kitchen Window", "serial": "0180040"}
  ]
}

},

“notify”: {
“address”: “192.168.1.12”,
“port”: “39500”
}
}