maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread (https://talk.maemo.org/showthread.php?t=45388)

No!No!No!Yes! 2010-11-24 09:36

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by matristain (Post 881713)
How can i change the (delayIndex = 9 customIntervalSecs = 275) at runtime?

This is what I have (just first part)
PHP Code:

if [ "$QBW_EXEC_REASON== "QBW_CLICK" ]; then
    
if [ "$QBW_CURRENT_RESULTS_TEXT== "ON" ]; then
        
echo "OFF";
        exit 
0;
    else
        
#MAKE CALL
        #delayIndex = 9 customIntervalSecs = 275
        
echo "ON";
        exit 
1;
    
fi;  
fi


http://wiki.maemo.org/Queen_BeeCon_W..._QBW_over_DBUS

sanros 2010-11-24 18:46

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
PLEASE HELP NEEDED>>>
i want to make a QBW for rebooting device please help me to execute command in QBW. i will be really thankful to u

matristain 2010-11-24 20:18

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
OK almost done, :P
I Just have one problem.
I can activate the "delayIndex" and set "customIntervalSecs" to start updating.
PHP Code:

i=10;
j=9;
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'delayIndex' uint32:$j string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'customIntervalSecs' uint32:$i string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.reset_rearm_timer

What I Can't do is make it stop.
This doesn't stop running avery 10 sec.
PHP Code:

i=0;
j=0;
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'delayIndex' uint32:$j string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'customIntervalSecs' uint32:$i string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.reset_rearm_timer

When i get into the setting @Interval is disable, but script still running until I save settings eaven without making any changes.

No!No!No!Yes! 2010-11-24 20:49

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by matristain (Post 882351)
OK almost done, :P
I Just have one problem.
I can activate the "delayIndex" and set "customIntervalSecs" to start updating.
PHP Code:

i=10;
j=9;
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'delayIndex' uint32:$j string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'customIntervalSecs' uint32:$i string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.reset_rearm_timer

What I Can't do is make it stop.
This doesn't stop running avery 10 sec.
PHP Code:

i=0;
j=0;
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'delayIndex' uint32:$j string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.set_param_uint32 string:'customIntervalSecs' uint32:$i string:'' 'update_content' 'update_layout'
dbus-send --session --type=method_call --dest=oh.no.more.qbw $id oh.no.more.qbw.reset_rearm_timer

When i get into the setting @Interval is disable, but script still running until I save settings eaven without making any changes.

Syntax is not correct, right syntax is:

For arming timer
PHP Code:

i=10;
j=9;
dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid0 oh.no.more.qbw.set_param_uint32 string:'delayIndex' uint32:$j string:''
dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid0 oh.no.more.qbw.set_param_uint32 string:'customIntervalSecs' uint32:$i string:''
dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid0 oh.no.more.qbw.reset_rearm_timer

For disarming:
PHP Code:

i=0;
j=0;
dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid0 oh.no.more.qbw.set_param_uint32 string:'delayIndex' uint32:$j string:'';
dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid0 oh.no.more.qbw.set_param_uint32 string:'customIntervalSecs' uint32:$i string:''
dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid0 oh.no.more.qbw.reset_rearm_timer

replace id0 in command with value you find here in your beecon:
http://wiki.maemo.org/images/thumb/2...px-Snap017.png

No!No!No!Yes! 2010-11-25 07:33

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by sanros (Post 882286)
PLEASE HELP NEEDED>>>
i want to make a QBW for rebooting device please help me to execute command in QBW. i will be really thankful to u

http://wiki.maemo.org/Desktop_Comman...scripts#Reboot

one1002 2010-11-25 09:30

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
hi, may i know how do i delete the QBW saved widget?

where is the path for saved widget?

if i remove the widgets (say id0,id1,id2) from the desktop, and then i want to add a new qbw widget, the existing previous widget (id0, id1 which i previously removed) was added back..

is there any way i can remove those widget from the phone?

No!No!No!Yes! 2010-11-25 09:58

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by one1002 (Post 882786)
hi, may i know how do i delete the QBW saved widget?

where is the path for saved widget?

if i remove the widgets (say id0,id1,id2) from the desktop, and then i want to add a new qbw widget, the existing previous widget (id0, id1 which i previously removed) was added back..

is there any way i can remove those widget from the phone?

Behaviour is by design as hildon home widget deletion mechanism does not offer confirmation in case of widget instance close/remove

If you wanto to purge a widget instance that you closed/removed on desktop with the top-right cross, open up another qbw setting and hit advanced buttons, you'll be asked to go pro and after that you'll be asked to purge closed instances one by one

Ciao.

No!No!No!Yes! 2010-11-25 12:37

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by slarti (Post 880214)
Ok, this is driving me nuts. I finally understood how to write a simple script (never done one before) to check a value in a text file and wget my server rewriting that file. This works in terminal, but for some reason, not in QBW. The wget is never sent.

PHP Code:

#!/bin/sh

state=$(awk '{ FS = "~" } ; /Ruokapöytä/{print $4}' zwave.txt)
if [ 
"$state== "0" ]; then 
wget 
-Ozwave.txt 'http://ipaddress:port/ZwaveCommand?command=device&id=22&level=99'
exit 0
else
wget -Ozwave.txt 'http://ipaddress:port/ZwaveCommand?command=device&id=22&level=0'
exit 1
fi


What am I doing wrong?

Any help would be appreciated.

P.S. Is there some way to enable/disable a set alarm in a script?

Hi, have you tried it in the Advanced Dialog Box Test Drive?

slarti 2010-11-25 21:09

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by No!No!No!Yes! (Post 882912)
Hi, have you tried it in the Advanced Dialog Box Test Drive?

Yes, I tried it. The problem was the missing path.

I now have a working script that does what I want for a single node (you have to excuse my code, I really have never done this before:o):

PHP Code:

node=$(awk -F"~" "/$name/ "'{print $3}' /home/user/zwave/zwave.txt)
state=$(awk -F"~" "/$name/ "'{print $4}' /home/user/zwave/zwave.txt)
if [ 
"$state== "0" ]
then wget -O/home/user/zwave/zwave.txt "http://ipaddress:port/ZwaveCommand?command=device&id=${node}&level=99"
dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"$name ON"
exit 0
else wget -O/home/user/zwave/zwave.txt "http://ipaddress:port/ZwaveCommand?command=device&id=${node}&level=0"
dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"$name OFF"
exit 1
fi


I call it in QBW with:

PHP Code:

name="Node name"export namesh /home/user/zwave/script 

Now I'm trying to make them update on startup, update whenever zwave.txt gets rewritten and work as they do now.

I just tried this in QBW:

PHP Code:

name="Node name";
node=$(awk -F"~" "/$name/ "'{print $3}' /home/user/zwave/zwave.txt);
state=$(awk -F"~" "/$name/ "'{print $4}' /home/user/zwave/zwave.txt);
if [ 
"$QBW_EXEC_REASON== "QBW_STARTUP_UPDATE" ]; then
    
if [ "$state== "0" ]; then
        
exit 0;
    if [ 
"$state!= "0" ]; then
        
exit 1;
    
fi;
fi;
if [ 
"$QBW_EXEC_REASON== "QBW_DBUS_UPDATE_CONTENT" ]; then
    
if [ "$state== "0" ]; then
        
exit 0;
    if [ 
"$state!= "0" ]; then
        
exit 1;
    
fi;
fi;
if [ 
"$QBW_EXEC_REASON== "QBW_CLICK" ]; then
export name
;
sh /home/user/zwave/state;
run-standalone.sh dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid3 oh.no.more.qbw.update_content;
fi 

For some reason that didn't work, it just exits with code 2. I'll keep trying...:rolleyes:

In the wiki there is:

Code:

run-standalone.sh dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbw<idX> oh.no.more.qbw.<method> <type1>:"<param1>" <type2>:"<param2>" ... <typeN>:"<paramN>"
Can I use multiple QBW ids in one command somehow? I'm trying to get a QBW to tell the others to update content when it is clicked.

No!No!No!Yes! 2010-11-25 22:21

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by slarti (Post 883260)
Yes, I tried it. The problem was the missing path.

I now have a working script that does what I want for a single node (you have to excuse my code, I really have never done this before:o):

PHP Code:

node=$(awk -F"~" "/$name/ "'{print $3}' /home/user/zwave/zwave.txt)
state=$(awk -F"~" "/$name/ "'{print $4}' /home/user/zwave/zwave.txt)
if [ 
"$state== "0" ]
then wget -O/home/user/zwave/zwave.txt "http://ipaddress:port/ZwaveCommand?command=device&id=${node}&level=99"
dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"$name ON"
exit 0
else wget -O/home/user/zwave/zwave.txt "http://ipaddress:port/ZwaveCommand?command=device&id=${node}&level=0"
dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"$name OFF"
exit 1
fi


I call it in QBW with:

PHP Code:

name="Node name"export namesh /home/user/zwave/script 

Now I'm trying to make them update on startup, update whenever zwave.txt gets rewritten and work as they do now.

I just tried this in QBW:

PHP Code:

name="Node name";
node=$(awk -F"~" "/$name/ "'{print $3}' /home/user/zwave/zwave.txt);
state=$(awk -F"~" "/$name/ "'{print $4}' /home/user/zwave/zwave.txt);
if [ 
"$QBW_EXEC_REASON== "QBW_STARTUP_UPDATE" ]; then
    
if [ "$state== "0" ]; then
        
exit 0;
    if [ 
"$state!= "0" ]; then
        
exit 1;
    
fi;
fi;
if [ 
"$QBW_EXEC_REASON== "QBW_DBUS_UPDATE_CONTENT" ]; then
    
if [ "$state== "0" ]; then
        
exit 0;
    if [ 
"$state!= "0" ]; then
        
exit 1;
    
fi;
fi;
if [ 
"$QBW_EXEC_REASON== "QBW_CLICK" ]; then
export name
;
sh /home/user/zwave/state;
run-standalone.sh dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbwid3 oh.no.more.qbw.update_content;
fi 

For some reason that didn't work, it just exits with code 2. I'll keep trying...:rolleyes:

In the wiki there is:

Code:

run-standalone.sh dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbw<idX> oh.no.more.qbw.<method> <type1>:"<param1>" <type2>:"<param2>" ... <typeN>:"<paramN>"
Can I use multiple QBW ids in one command somehow? I'm trying to get a QBW to tell the others to update content when it is clicked.

Have a look at POKER DICE beecon script for example on how to issue update on multiple QBWs in sequence; it is also a goot example of 1 QBW driving others.
You can also write a loop like this (metacode by heart):
PHP Code:

for i in id2 id3 id4 id5
do
run-standalone.sh dbus-send --session --type=method_call --dest=oh.no.more.qbw /oh/no/more/qbw$i oh.no.more.qbw.update_content;
done 

2 exit code you are experiencing might suggest some sort of syntax error in the script
also pay attention that if you need $QBW_* meta variables inside you external script then you need to pass them with something like this and manage positional parameters $1 $2 $3 $4 $5 inside your external script:
in QBW cmd:
PHP Code:

/home/user/myscripts/execme.sh $QBW_ID $QBW_EXEC_REASON 

in script:
PHP Code:

QBW_ID=$1
QBW_EXEC_REASON
=$2
... 



All times are GMT. The time now is 18:58.

vBulletin® Version 3.8.8