So I've been tinkering and researching during my free time recently, and it seems there is some interest in some of the things I've managed to set up. I'm sure there are many out there who will find this boring and won't learn much, but I'm sure there are many more who will benefit from some of what I've learned. I'm going to detail how to create a Tasker Profile and Tasks to create a home occupancy tracker.
My goal when I decided to give tasker a try was to use my home automation system to actually, you know, automate my home more. I mean, I love HS Touch and I use it (along with a custom layout) to control my televisions via globalcache IR devices. I also enjoy being able to control the attic fan, outside flood lights, gazebo lighting, and other remote devices from anywhere with Homeseer. But I found that there was a decided lack of automation in my home automation system. That's what led me to Tasker, and to posting this how-to.
So to begin with, you'll need an Android smartphone and a copy of Tasker. I believe I paid $5 for it, and it is SOOO worth every penny. If you are interested in learning more advanced Tasker usage, check out this link. You'll need to have HS web server remote access enabled for this to work and for simplicity's sake, a dynamic DNS service. You also need a wifi router at home, though you don't need to connect to it if you choose not to.
Alright, down to business:
To get started, launch Tasker and select the Profiles tab. At the bottom of the screen, press the + symbol to add a context (condition) that will control when the profile should be active. Click on State, then choose the Net icon. Finally, select the Wifi Near state to indicate that we want to check for the presence of a wifi network as our trigger. On the next screen, click the magnifying glass on the SSID line, and choose your home wifi from the list. Now simply click the back button ONCE to complete the profile context.
The next thing we need to do is create a task that will be triggered whenever the "At home" Tasker profile is activated. You should see a pop-up with the heading Enter Task. Click on New Task +, and then type a name for your task. Something like "Activate Home" should work nicely. Click the check mark, and you should be brought to the Task Edit screen. Do as it says, and click the + button to add an action.
Now we have some options. We can choose to control a virtual device, and use an event to trigger HS actions, or we can run an event directly from Tasker. For my setup (which I will assume you are duplicating), I created a "Wes Location" virtual device in Homeseer with value-status pairs as shown here:
In order to directly control a device with an HTTP request (whether a similar virtual device, or any other) you need to know it's device reference ID. This can be found on the Additional Information tab of our new virtual device's properties. Keep this number handy, as we'll need it in a moment.
Back to Tasker... To communicate with HS, we're going to use HTTP Post requests. So click on Net, then HTTP Post. On the Server:Port line, you'll use the following format to reach your HS server: Username:Password@yourDDNS:homeseerport. So if your HS web server username is mickey, password is mouse, and your server is configured on port 80, enter mickey:mouse@yourdomain.com:80 In the Path field, enter "/stif", with the / but without the quotes. In the Data/File field, enter the following two lines:
control_device=xxxx
selectvalue=X
where xxxx is the device reference ID, and X is the device value that indicates Home.
That almost does it. Now we only need to create a task that changes the status to Away when not near home wifi. So click the back arrow to return to the Task Edit screen. To make the last step easier, I suggest long pressing on the HTTP Post line we've just created. This will bring up some edit options. Click the copy icon. Then we want to click the back button again to return to the profiles list. You should see your Activate Home task with a green arrow next to it. Long press on this task, and from the popup, select Add Exit Task. Now once again select New Task +, and enter a name such as Activate Away. On the Task Edit screen, long-press on the white background and select Paste from the popup. Now select the HTTP Post command you just pasted. The only thing that needs to change here is the value of the "selectvalue=". Change it to whatever indicates you are now away from home.
The last thing I would recommend doing is to rename the profile we created in Tasker. To do this, return to the profile screen using the back arrow. Then just long press on the Wifi Near ... profile and click the A that appears in the top menu bar. Input a name and select the check mark to save. Your work in Tasker should be done.
Now just dream up all of the cool things that location awareness can add to Homeseer and add a bit more automation to your day.
If you would like to directly trigger a Homeseer event, there are a few changes you need to make to the HTTP Post command. On the Path line, change /stif to /evls. On the Data/File line, enter run_event=xxxxxx, where xxxxxx is the exact name of your event. Thanks to CocoonTech for that tidbit.
Enjoy!
WeaslyD
My goal when I decided to give tasker a try was to use my home automation system to actually, you know, automate my home more. I mean, I love HS Touch and I use it (along with a custom layout) to control my televisions via globalcache IR devices. I also enjoy being able to control the attic fan, outside flood lights, gazebo lighting, and other remote devices from anywhere with Homeseer. But I found that there was a decided lack of automation in my home automation system. That's what led me to Tasker, and to posting this how-to.
So to begin with, you'll need an Android smartphone and a copy of Tasker. I believe I paid $5 for it, and it is SOOO worth every penny. If you are interested in learning more advanced Tasker usage, check out this link. You'll need to have HS web server remote access enabled for this to work and for simplicity's sake, a dynamic DNS service. You also need a wifi router at home, though you don't need to connect to it if you choose not to.
Alright, down to business:
To get started, launch Tasker and select the Profiles tab. At the bottom of the screen, press the + symbol to add a context (condition) that will control when the profile should be active. Click on State, then choose the Net icon. Finally, select the Wifi Near state to indicate that we want to check for the presence of a wifi network as our trigger. On the next screen, click the magnifying glass on the SSID line, and choose your home wifi from the list. Now simply click the back button ONCE to complete the profile context.
The next thing we need to do is create a task that will be triggered whenever the "At home" Tasker profile is activated. You should see a pop-up with the heading Enter Task. Click on New Task +, and then type a name for your task. Something like "Activate Home" should work nicely. Click the check mark, and you should be brought to the Task Edit screen. Do as it says, and click the + button to add an action.
Now we have some options. We can choose to control a virtual device, and use an event to trigger HS actions, or we can run an event directly from Tasker. For my setup (which I will assume you are duplicating), I created a "Wes Location" virtual device in Homeseer with value-status pairs as shown here:
In order to directly control a device with an HTTP request (whether a similar virtual device, or any other) you need to know it's device reference ID. This can be found on the Additional Information tab of our new virtual device's properties. Keep this number handy, as we'll need it in a moment.
Back to Tasker... To communicate with HS, we're going to use HTTP Post requests. So click on Net, then HTTP Post. On the Server:Port line, you'll use the following format to reach your HS server: Username:Password@yourDDNS:homeseerport. So if your HS web server username is mickey, password is mouse, and your server is configured on port 80, enter mickey:mouse@yourdomain.com:80 In the Path field, enter "/stif", with the / but without the quotes. In the Data/File field, enter the following two lines:
control_device=xxxx
selectvalue=X
where xxxx is the device reference ID, and X is the device value that indicates Home.
That almost does it. Now we only need to create a task that changes the status to Away when not near home wifi. So click the back arrow to return to the Task Edit screen. To make the last step easier, I suggest long pressing on the HTTP Post line we've just created. This will bring up some edit options. Click the copy icon. Then we want to click the back button again to return to the profiles list. You should see your Activate Home task with a green arrow next to it. Long press on this task, and from the popup, select Add Exit Task. Now once again select New Task +, and enter a name such as Activate Away. On the Task Edit screen, long-press on the white background and select Paste from the popup. Now select the HTTP Post command you just pasted. The only thing that needs to change here is the value of the "selectvalue=". Change it to whatever indicates you are now away from home.
The last thing I would recommend doing is to rename the profile we created in Tasker. To do this, return to the profile screen using the back arrow. Then just long press on the Wifi Near ... profile and click the A that appears in the top menu bar. Input a name and select the check mark to save. Your work in Tasker should be done.
Now just dream up all of the cool things that location awareness can add to Homeseer and add a bit more automation to your day.
If you would like to directly trigger a Homeseer event, there are a few changes you need to make to the HTTP Post command. On the Path line, change /stif to /evls. On the Data/File line, enter run_event=xxxxxx, where xxxxxx is the exact name of your event. Thanks to CocoonTech for that tidbit.
Enjoy!
WeaslyD
Comment