Thanks - wasn’t aware of that capability - very cool.
Confirms that the custom command isn’t getting to the relay - when I run a piston w/only a custom command nothing appears in the log, when I run a piston w/a custom command and a custom broadcast, only the broadcast appears. So seems likely I’ve missed something when I updated from the github.
When I updated assistant relay on my Pi, I downloaded the updated zip for the Assistant Relay from Greg’s github, unzipped and then copied over my assistant relay folders (replacing any existing files except for config.json).
i@raspberrypi:~ $ cd assistant-relay-master
pi@raspberrypi:~/assistant-relay-master $ npm install
> speaker@0.3.1 install /home/pi/assistant-relay-master/node_modules/speaker
> node-gyp rebuild
make: Entering directory '/home/pi/assistant-relay-master/node_modules/speaker/build'
CC(target) Release/obj.target/output/deps/mpg123/src/output/alsa.o
../deps/mpg123/src/output/alsa.c:19:28: fatal error: alsa/asoundlib.h: No such file or directory
#include <alsa/asoundlib.h>
^
compilation terminated.
deps/mpg123/output.target.mk:108: recipe for target 'Release/obj.target/output/deps/mpg123/src/output/alsa.o' failed
make: *** [Release/obj.target/output/deps/mpg123/src/output/alsa.o] Error 1
make: Leaving directory '/home/pi/assistant-relay-master/node_modules/speaker/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:160:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.9.59-v7+
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/assistant-relay-master/node_modules/speaker
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN assistant-relay@0.0.2 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: speaker@0.3.1 (node_modules/speaker):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: speaker@0.3.1 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 4 packages in 18.451s
Expected? Or re-run w/sudo?
I restarted the relay using the normal command I’ve been using and see this below…I assume I don’t need to worry about the two instances listed (assistant relay and “assistant relay”).
pi@raspberrypi:~/assistant-relay-master $ pm2 start index.js --name=“assistant_relay”
[PM2] Starting /home/pi/assistant-relay-master/index.js in fork_mode (1 instance)
[PM2] Done.
┌───────────────────┬──────┬─────────┬───┬─────┬───────────┐
│ Name │ mode │ status │ ↺ │ cpu │ memory │
├───────────────────┼──────┼─────────┼───┼─────┼───────────┤
│ assistant_relay │ fork │ stopped │ 0 │ 0% │ 0 B │
│ “assistant_relay” │ fork │ online │ 0 │ 74% │ 15.5 MB │
└───────────────────┴──────┴─────────┴───┴─────┴───────────┘
Use `pm2 show <id|name>` to get more details about an app
pi@raspberrypi:~/assistant-relay-master $
You shouldn’t need to specify an owner when sending custom broadcasts using the DTH from webCore pistons. Don’t add an owner and just select the customBroadcast option and a single String parameter from the Parameters drop-down.
Like this, correct? If so, nothing outputs then from my speaker when I turn off the light. If I don’t include that 2nd param, I can watch in the PM2 dashboard saying the following:
assistant_relay > No user specified, using matt │
│ ││ assistant_relay > Conversation Complete
And it runs fine.
That’s how I have it setup, was I suppose to edit something in there as well?
I can copy/paste what’s in it, if that helps.
I’m still just getting “An unexpected error occurred” .
When I go into my smartthings app, Marketplace > SmartApps > My Apps. I see Assistant Relay, it finds my 1 device named “Assistant Relay fb5” (not sure what fb5 is from).
I tried it both ways, both with and without a user name and it doesn’t work either way for some reason. My relay never sees the command, so it’s getting lost between the piston and a relay somehow.
Trying to figure out why customcommand is failing, used Postman to send the following from my Chromebook, and pm2 monitor does see the request. Tested again from my piston and now pm2 also sees the request, but in both cases it errors out.
From Postman sent below (xx replaced by actual IP in command sent, and also sent the custom command from a piston using DTH/parameter selections. Note that like @Phred_Doolittle, I get an error on the name even though the name is accurate and in my config.json file.
PM2 monitor shows a bunch of what looks like errors (in red?) but I cannot figure out how to copy the text from the log window in the pm2 monitor - highlighting via mouse doesn’t work, as the hightlight goes across the entire UI and doesn’t scroll the text down to select it.
I took a screen shot to show the first pm2 monitor screen of the response:
I ran a test with a custom piston to trigger what’s the weather if I turn on my office bloom and it fired. Here are the screens. Despite saying it triggered twice, I only heard it the weather forecast once on my googe home mini.