Page 1 of 1

Housebot Controlled by Twitter

Posted: Tue Jan 04, 2011 5:15 am
by jacco van der Ven
I wrote ( with an little help from the internet ) this script to control your devices by Twitter.

For example,

I tweet "light livingroom ON"
When the script find this tweet and the tweet is not older than 5 minutes he will turn on that light.

I hope this will be useful, I look forward to your replies

Have fun, Jacco
ReceiveTwitter.zip
Receive tweets
(1.19 KiB) Downloaded 360 times

Re: Housebot Controlled by Twitter

Posted: Tue Jan 04, 2011 6:59 am
by lostdreamer
Nice script, just 1 thing:
If I want to control like 50 devices via twitter, this script will check twitter 50x every time you start the script.

It would be better if it would check twitter once, then checks the XML for known commands.
I'll see if I have a bit of time to make a few adjustments....

Regards,
LostDreamer

Re: Housebot Controlled by Twitter

Posted: Tue Jan 04, 2011 7:12 am
by jacco van der Ven
Yes, that would be better.

But I think also you don't tweet 50 device's, then you tweet "All lights ON" and you start an task or another script.

Regards,
Jacco

Re: Housebot Controlled by Twitter

Posted: Tue Jan 04, 2011 8:28 am
by lostdreamer
No I meen more something like:

I have 50 devices which I would like to be able to control by twitter. (not all at once, but I would have to set them up in the array in your script).

Then the script would check twitter for every value in the array (all 50 of them) to see if 1 of them was posted.
Your script also opens the page of every tweet it finds, adding to the total number of pages downloaded.

10 actions in the VBscript array + 3 tweets in the last 5 minutes and the script would download 30 pages, instead of just 1.

Attached is a v2 of the script, not very good, but this one downloads 1 page (rss feed), then loops through all items, compares the date / time and if it is in the specified timeframe, it will check if the message posted is a valid one.

Let me know if it works ;)

LostDreamer

Re: Housebot Controlled by Twitter

Posted: Tue Jan 04, 2011 9:36 am
by jacco van der Ven
I test it with

commands(1) = "Licht aan"
commands(2) = "Licht uit"

Select case cmd
case "Licht aan"
msgbox("aan")
SetPropertyValue "TV Lamp rechts.Power State", "On"
Case "Licht uit"
msgbox("uit")
SetPropertyValue "TV Lamp rechts.Power State", "Off"
End select

I posted "Licht" after running the script the light goes ON and OFF.

Jacco

Re: Housebot Controlled by Twitter

Posted: Wed Jan 05, 2011 4:22 am
by jacco van der Ven
Ok, I did't read the comment in the middle of the script.
A valid message is

House: Light on

It works but the message is 20 minutes old now, and still the lights goes on.
You write in the script 1 message / month, I think this is message/day


I can't find the problem in the script, maybe you can look again.
Thanks for your support.

Jacco

Re: Housebot Controlled by Twitter

Posted: Wed Jan 05, 2011 8:22 am
by jacco van der Ven
I did some changes and solved the problems that I have.

Regards,
Jacco


ReceiveTwitter3.zip
Version 3
(1.31 KiB) Downloaded 345 times