sent parameter not passing

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

sent parameter not passing

Post by Gianni »

hello

I'm converting the philips tv script to use in a docker envoirement.
Everythings is working now except passing parameters.
It's seems that the parameter is not sending with the script:///

if i add a simple line to a test bash file like

Code: Select all

python3 /opt/domoticz/scripts/pylips/pylips.py --host $host --user $user --pass $pass --command mute
and run this from my selector

Code: Select all

script:///opt/domoticz/scripts/test.sh
then my tv will mute en unmute so thats working

but if i working with multiple commnands and a switch then the arg is not passing

Code: Select all

echo $1

case $1 in
standby)
python3 $path --host $host --user $user --pass $pass --command standby &
exit 0
;;
power_on)
python3 $path --host $host --user $user --pass $pass --command power_on &
exit 0
;;
mute)
python3 $path --host $host --user $user --pass $pass --command  mute &
exit 0
;;
and run this in the selector

Code: Select all

script:///opt/domoticz/scripts/pylips/tvphilips.sh mute
then it's not working.
In my log i also not seeing the argument passing?

Code: Select all

 2022-12-20 17:57:03.944 Status: User: Admin (IP: xxx.xxx.xxx.xxx) initiated a switch command (323/test/Set Level)
2022-12-20 17:57:04.186 Status: Executing script: /opt/domoticz/scripts/pylips/tvphilips.sh 
any idea?
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: sent parameter not passing

Post by Gianni »

fix it with KISS
Delete everything and restart

remove the case and passing the correct command direct to script

Code: Select all

script:///opt/domoticz/scripts/pylips/test.sh volume_down
Script

Code: Select all

echo -n "Parameter is  $1"
host=xxx.Xxx.xxx.xxx
user=xxxxxxxxxxxxxxxxx
pass=xxxxxxxxxxxxxxxx
path=/opt/domoticz/scripts/pylips/pylips.py

echo -n $host
echo -n $user
echo -n $pass
echo -n $path


python3 $path --host $host --user $user --pass $pass --command $1
Now i need to find the solution for my next problem.
The selector does not allow to let me volume up multiple time's
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests