question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run external script.

See original GitHub issue

Hi, I am trying to execute nodejs script from ha-bridge and getting errors, I set command type to “Execute Script/Program” and my command is [{"item":"nodejs ~/Downloads/ha-bridge/scripts/led.js 2 on", "type":"cmdDevice"}] The command nodejs ~/Downloads/ha-bridge/scripts/led.js 2 on runs fine in terminal. But running in ha-bridge I am getting error:

Request Error, Please look in your habridge log: error {“type”:6,“address”:“/lights/2”,“description”:“Error on calling out to device”,“parameter”:“/lights/2state”}

Looking into debug log I see

Decode Json for url items: [{"item":"[{\"item\":\"nodejs ~/Downloads/ha-nridge/scripts/led.js 2 on\"}]","type":"cmdDevice"}]
Exec Request called with url: [{"item":"nodejs ~/Downloads/ha-nridge/scripts/led.js 2 on"}]
Executing request: [{"item":"nodejs ~/Downloads/ha-nridge/scripts/led.js 2 on"}]    com.bwssystems.HABridge.plugins.exec.CommandHome
Could not execute request: [{"item":"nodejs ~/Downloads/ha-nridge/scripts/led.js 2 on"}]

Any idea what’s wrong? Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:24 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
ygalantercommented, Feb 25, 2017

It’s working out beautifully. I put together a small blog post: http://codecorner.galanter.net/2017/02/24/full-control-of-your-limitless-ledmilight-v6-bulbs-from-amazon-echo/ maybe will be useful to others struggling with Milight v6.

Thanks,

Yuriy.

On Fri, Feb 24, 2017 at 8:45 PM, Yuriy Galanter yuri@galanter.net wrote:

Never mind, deleted and re-added the device and it’s is working now. Here’s final commands:

ON: nodejs /home/ygalanter/ha-bridge/scripts/led.js 2 on DIM: nodejs /home/ygalanter/ha-bridge/scripts/led.js 2 dim ${intensity.percent} OFF: nodejs /home/ygalanter/ha-bridge/scripts/led.js 2 off

btw, I am using https://github.com/mwittig/node-milight-promise module, which is a very nice wrapper for Milight v6. Maybe others can use it too.

Thanks for your help!

Yuriy.

On Fri, Feb 24, 2017 at 3:02 PM, yuri@galanter.net wrote:

Yes, this is content of the led.sh (I am passing params to it):

#!/bin/sh /usr/bin/nodejs /home/ygalanter/ha-bridge/scripts/led.js $1 $2

if I call it from terminal as

/usr/bin/nodejs /home/ygalanter/ha-bridge/scripts/led.js 2 off

it works. But bridge stirll throws

Request Error, Pleae look in your habridge log: error {“type”:6,“address”:“/lights/2”,“description”:“Error on calling out to device”,“parameter”:“/lights/2state”}

From: BWS Systems notifications@github.com Sent: Friday, February 24, 2017 2:56 PM To: bwssytems/ha-bridge ha-bridge@noreply.github.com Cc: ygalanter yuri@galanter.net ; Author author@noreply.github.com Subject: Re: [bwssytems/ha-bridge] Cannot run external script. (#496)

You will need to have the whole command in the script:

/usr/bin/nodejs /home/ygalanter/ha-bridge/scripts/led.js 2 off

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bwssytems/ha-bridge/issues/496#issuecomment-282389034, or mute the thread https://github.com/notifications/unsubscribe-auth/AHhqwD0tqLj7RYK6wxv86tNViu40i2xrks5rfzXugaJpZM4MLitI .

0reactions
centity13commented, Apr 23, 2018

So it looks like the issue is that I was actually running it out of docker which is why it was not working.

It is all good now!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't include external javascript in html - Stack Overflow
If I try to include the JavaScript I have between the as an external file, the slider doesn't work. So I take this...
Read more >
[SOLVED] Cannot run External Javascript in Embedded HTML
Hi, I am a beginner at play canvas. I'm trying to load HTML pages into Play Canvas and execute third-party JavaScript in HTML....
Read more >
Cannot execute an external program in Orion
A customer cannot run or execute a script on his alerts. Execute an external program fails, Execute an external program not working.
Read more >
JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module syntax.
Read more >
JavaScript Where To - W3Schools
External scripts cannot contain <script> tags. External JavaScript Advantages. Placing scripts in external files has some advantages: It separates HTML and code ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found