Housebot Controlled by Twitter

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Housebot Controlled by Twitter

Post 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 208 times
lostdreamer
Member
Posts: 54
Joined: Sat Apr 18, 2009 8:53 pm

Re: Housebot Controlled by Twitter

Post 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
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Housebot Controlled by Twitter

Post 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
lostdreamer
Member
Posts: 54
Joined: Sat Apr 18, 2009 8:53 pm

Re: Housebot Controlled by Twitter

Post 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
Attachments
ReceiveTwitter2.zip
Twitter script
(1.3 KiB) Downloaded 188 times
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Housebot Controlled by Twitter

Post 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
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Housebot Controlled by Twitter

Post 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
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Housebot Controlled by Twitter

Post 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 198 times
Post Reply