Tasker getting device status.

  • 467 Views
  • Last Post 09 January 2014
monkey-magic posted this 02 January 2014

[quote=tnamey]I'm new to using tasker and have been able to get voice control to work fine. I was wondering if there is anyway for tasker to read a sensor or device's status for use with a variable? If not do you think this is something that can be added to the InControl plugin?[/quote]

[quote=tnamey]One example would be asking it to "close the garage door" and programming tasker to tell me if it's already closed. Or simply asking it for the status of things. I liked your idea of the Athome virtual device. It would be great, when I set it up, to be able to ask if a specif person is home yet? Things like that. The responses would require alot of time to create but none of it can work without tasker being able to see the status of devices or sensors.

Sorry if I posted this in the wrong place. I'm not great at always posting in the right place. [/quote]

Okay, this may be possible but I haven't tested it and I'll look into it more.

you would probably need this: http://developer.incontrolha.com/json-api/device-retrieve-list.aspx In Tasker that would be a HTTP GET task: [code]http://xxx.xxx.xxx.xxx:1178/zwave/device/{deviceid}?password=?????/[/code]

Tasker will save this into a variable %HTTPD

You may then be able to section that variable up into lots of little ones using variable split. Only issue is that you may end up with heaps.

you should then be able to get Tasker to read the variable you want, namely level

I'll have a play around.

Josh

Order By: Standard | Newest | Votes
jonfrance posted this 05 January 2014

I've been reading in device states using this method myself as follows:

1- Read in the device information using the HTTP Get as you have stated above. I had some issues getting the data into a variable so I just saved the output to a file, then read the file back to a variable.

2- I used the variable split with value "level:" (including the ")

3- This puts the actual level as the first text in second variable value. i.e. If the full device info is in var %mydevice then the split has created %mydevice1 and %mydevice2.

4- I then split %mydevice2 using value ,

5- This pulls out the numeric value into %mydevice21. The easiest thing to do next is just do a variable pop of %mydevice2 position 1 into a new variable.

My advice would be to use plenty of Alerts to display the variables as you go so you know it is working at each step then remove them later.



monkey-magic posted this 06 January 2014

Thanks,

I had a quick try when I had some time for the original poster but I had troubles saving the variable like you did. I was about to try the file next and use the variable split like you mentioned but holidays are over now and work and kids consume life again.

What type of file did you save it as?

Thanks Josh

tnamey posted this 06 January 2014

Just finished reading a nice walk-through on Tasker Variables, so I now know what the heck you guys are talking about. I'll give this a try tonight. Is it possible to include sensors into the InControl Tasker plugin? If getting sensor levels was easier that would be great! Is it possible Ryan?

monkey-magic posted this 07 January 2014

Just finished reading a nice walk-through on Tasker Variables, so I now know what the heck you guys are talking about. I'll give this a try tonight. Is it possible to include sensors into the InControl Tasker plugin? If getting sensor levels was easier that would be great! Is it possible Ryan?


There are a few good tutorials around, the pockatables stuff and some decent ones on youtube too.

Josh

tnamey posted this 07 January 2014

I'm getting nothing from the HTTP GET task. How should I be formatting the device ID within this?

http://xxx.xxx.xxx.xxx:1178/zwave/device/{deviceid}?password=?????/

I also want to make sure I'm using the correct ID. I'm using a long string of letters and numbers with several dashes. I have been placing this with the {}. I don't get an error, Tasker just doesn't populate the %HTTPD variable.

jonfrance posted this 08 January 2014

I'm getting nothing from the HTTP GET task. How should I be formatting the device ID within this?

http://xxx.xxx.xxx.xxx:1178/zwave/device/{deviceid}?password=?????/

I also want to make sure I'm using the correct ID. I'm using a long string of letters and numbers with several dashes. I have been placing this with the {}. I don't get an error, Tasker just doesn't populate the %HTTPD variable.


Don't put the {} around the GUID (that is the string of numbers/letters with dashes)
i.e.
http://xxx.xxx.xxx.xxx:1178/zwave/device/4F8C27C8-C329-4F14-9503-D2E553A5ED14?password=123456789

As per the other thread, I had an issue with the variable being populated so saved the data to a file and then just read the file back into a varaiable using the basic elelments in Tasker.

tnamey posted this 09 January 2014

Finally got it working with your help. Thanks so much! It's time consuming but now I can set up all sorts of actions and responses. Tell the house I'm leaving and it can shut the lights off and open the garage door for me if the door isn't already up.

Close