What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Controlling Amazon dash button via postlease.sh

fun4stuff

Regular Contributor
Ive been using an Amazon dash button to control smart led lights Via this postlease.sh script:

#!/bin/sh
logger "amazon script running"
NowLeasedMac=$2
if [ "$NowLeasedMac" == "xx:xx:xx:xx:xx:xx" ]; then
wget "https://maker.ifttt.com/trigger/xxxx/with/key/xxxx"
logger "amazon script triggered"
fi
#

If I wanted to add another Amazon dash button to control a second light, how would I modify the script to do it? I tried the following but it didn't work.


#!/bin/sh
logger "amazon script running"
NowLeasedMac=$2
if [ "$NowLeasedMac" == "xx:xx:xx:xx:xx:xx" ]; then
wget "https://maker.ifttt.com/trigger/xxxx/with/key/xxxx"
logger "amazon script triggered"
fi

if [ "$NowLeasedMac" == "Aa:Aa:Aa:Aa:Aa:Aa" ]; then
wget "https://maker.ifttt.com/trigger/xxxx/with/key/Aaaa"
logger "amazon script 2 triggered"
fi


#



What am I missing? thanks
 
hi!

Im using several dash buttons on my routers (ac56u/n66u) and it works flawless!
i dont see the error in your script :(
this is what I use :
Code:
#!/bin/sh

NowLeasedMac=$2
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/kleenex;touch /tmp/dash-kleenex@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/duracell;touch /tmp/dash-duracell@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/finish;touch /tmp/dash-finish@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/somat;touch /tmp/dash-somat@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/niveamen;touch /tmp/dash-niveamen@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/nivea;touch /tmp/dash-nivea@$(date +%Y%m%d-%H:%M:%S);exit;fi

I dont like to spam my syslog,so I just create 0byte files with date/time/name when a button was pressed.
 
hi!

Im using several dash buttons on my routers (ac56u/n66u) and it works flawless!
i dont see the error in your script :(
this is what I use :
Code:
#!/bin/sh

NowLeasedMac=$2
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/kleenex;touch /tmp/dash-kleenex@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/duracell;touch /tmp/dash-duracell@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/finish;touch /tmp/dash-finish@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/somat;touch /tmp/dash-somat@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/niveamen;touch /tmp/dash-niveamen@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/nivea;touch /tmp/dash-nivea@$(date +%Y%m%d-%H:%M:%S);exit;fi

I dont like to spam my syslog,so I just create 0byte files with date/time/name when a button was pressed.

Thanks!!
 
hi!

Im using several dash buttons on my routers (ac56u/n66u) and it works flawless!
i dont see the error in your script :(
this is what I use :
Code:
#!/bin/sh

NowLeasedMac=$2
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/kleenex;touch /tmp/dash-kleenex@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/duracell;touch /tmp/dash-duracell@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/finish;touch /tmp/dash-finish@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/somat;touch /tmp/dash-somat@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/niveamen;touch /tmp/dash-niveamen@$(date +%Y%m%d-%H:%M:%S);exit;fi
if [ "$NowLeasedMac" == "00:00:00:00:00:00" ]; then /jffs/scripts/shortcuts/amdash_actions/nivea;touch /tmp/dash-nivea@$(date +%Y%m%d-%H:%M:%S);exit;fi

I dont like to spam my syslog,so I just create 0byte files with date/time/name when a button was pressed.

Could you post an example of one of your script files (e.g. Kleenex)?
 
Similar threads
Thread starter Title Forum Replies Date
M Unknown MAC address filling up router log- Amazon Fire TV Cube Asuswrt-Merlin 9

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top