Shell script for Rasbian / Domoticz

Hi there,

I'm really noob in scripting so I will give it a try on this forum.
The code below will make sure that my amplifier is going on.

Is there anyone who can help me making a script of this code.

When you run the script the only thing what it have to do is to run the code below.

Raspberry PI 3 - Raspbian operating system.

The code in terminal:

pi@raspberrypi:~ $ cd HarmonyHubControl
pi@raspberrypi:~/HarmonyHubControl $ ./HarmonyHubControl *USERNAME* *PASSWORD* 192.168.0.16 issue_device_command 42735709 PowerToggle
LOGITECH WEB SERVICE LOGIN     : BYPASSED
HARMONY COMMUNICATION LOGIN    : SUCCESS
HARMONY COMMAND SUBMISSION     : SUCCESS

How about a file named control.sh which contains the following:

#!/bin/sh

cd /home/username/HarmonyHubControl

./HarmonyHubControl *USERNAME* *PASSWORD* 192.168.0.16 issue_device_command 42735709 PowerToggle

Replace /home/username with your actual home directory of course.

Thanks Corona688.

One problem when execute it:

Failed to execute child process "/home/pi/domoticz/scripts/control.sh" (No such file or directory)

Ideas?

I suspect there is no such file or directory. Where did you put it?

Also, how are you running it? Show exactly how that error message happened.

I'm sorry after some testing the script will run now.

The only problem is that my amplifier is not 'On' after running the script.
When I run the string below in directory: HarmonyHub the amplifier will get on.

pi@raspberrypi:~ $ cd HarmonyHubControlpi@raspberrypi:~/HarmonyHubControl $ ./HarmonyHubControl *USERNAME* *PASSWORD* 192.168.0.16 issue_device_command 42735709 PowerToggle
LOGITECH WEB SERVICE LOGIN     : BYPASSED
HARMONY COMMUNICATION LOGIN    : SUCCESS
HARMONY COMMAND SUBMISSION     : SUCCESS

And what happens when you run the script?

Also, how are you running it?

All my questions from last post still apply.

Works fine now!
Did a new configuration and use your script.

Everything works fine now.

Thanks for your help.

1 Like