Running a script (for Energenie)

Hello,

I am a complete newbie to Raspberry Pi 3 and Blynk, both got yesterday - and soon got Blynk up and running and successfully did a test project and all working as expected.

What I’d like to do and can’t seem to find the answer is this (please let me know if it’s not what Blynk is intended to do!)

I have Energenie plugs, that can be switched on and off by the PI. I have crafted Python scripts based upon their demos to turn the plugs off and on. These scripts work well as expected and I can trigger them via Bash scripts.

Is there a way to trigger a script on the machine via my interaction via Blynk? I’d like to basicaly be able to turn them off and on by my Android phone.

Or, has anyone encountered a way for a Blynk sript to directly operate Energenie?

I did extensive searching but came up empty on both.

Thanks for any help.

HI. Sorry for bumping my own topic, but there’s no way to trigger a script at all?

@hostile17 we run scripts via Blynk on our Pi’s. You need Blynk’s node.js system on the Pi.

If you provide a link to the Energenie hardware I’ll take a look to see if it can be done without node.js.

Hi. This is the product (well the EU version) https://energenie4u.co.uk/catalogue/product/ENER002-2PI-EUR

At the bottom is a link to software, which is the script they provide.

I have adapted that, and can run it via a simple bash script - so even just the command to trigger the bash script woudl probably do what I want.

Also I do have node.js installed.

Thanks.

I took a quick look at the hardware and they are RF devices. Couldn’t see if they are the standard 433Mhz but presumably they are.

We do a lot of work with RF devices and ESP’s running “Arduino” code. Basically with a $1 RF transmitter you can remotely control most RF devices via the internet.

Some devices are easier to hack than others but ESP’s are our preferred route.

For the Pi, the controller board and your scripts you will basically call a child process in your node.js script.

Is there no way with Blynk just say say:

If widget activated, run /foo/bar/script.sh

?

I’m new to it, so not sure if it’s posssible.I can see tweets, and emails etc. but no ‘run’.

No I did ask about shell commands but it’s not that straightforward and not required by that many Blynkers.

It’s only 5 or 6 lines of code in node.js though. Google “spawn child process in javascript” or something like that.

Thanks for the responses. It sounds like I’m trying to use Blynk in a way not really intended… and I just don’t know javascript. So I’ll look for some alternatives.

Thanks.

Probably quicker to find the 6 lines of javascript than an alternative to Blynk but good luck nonetheless.

It’s just over my level of knowledge, I’m not a developer. I ‘get by’.

http://webiopi.trouch.com/

Looks promising.

Cayenne uses Blynk.

Funny you should say that, as I found that on my journey too and have installed it. Hopefully one should do the trick.

Thanks again.

Why use an imitation when you can use the real thing :slight_smile:

Because I just want to activate my on/off scripts, and if those things allow me to do it then gollygosh that’ll be awesome.