Turn switch on from tasker

Post Reply
dmont
Posts: 6
Joined: Thursday 17 March 2016 5:47
Target OS: Windows
Domoticz version:
Contact:

Turn switch on from tasker

Post by dmont » Wednesday 12 October 2016 17:15

Anyone know how to send an http post from Tasker to turn on/off switch in Domoticz? With the example below(of course with my user name & password and correct server:port), when I play the task it gives a green light, but my switch doesn't change. I tried several different variations including the entire post in the server:port field. I am trying to turn the switch when motion is sensed from tinycam monitor. Any help would be appreciated.
Attachments
Screenshot_20161012-090323.png
Screenshot_20161012-090323.png (360.64 KiB) Viewed 1797 times

DutchHans
Posts: 245
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Turn switch on from tasker

Post by DutchHans » Wednesday 12 October 2016 19:01

Hi, here is what I did:
I did a portforwarding in my router to the Ipaddress and port of domoticz (in my case fritzbox)

In Tasker I gave in server:port the myfritz URL with Port

Something like:
User:[email protected]:8080

Then in path in Tasker:
/json.htm?type=command&param=switchlight&idx=45&switchcmd=On&level=0

It works for me, I hope for you too..
Success, Hans

dmont
Posts: 6
Joined: Thursday 17 March 2016 5:47
Target OS: Windows
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post by dmont » Thursday 13 October 2016 20:27

Thanks Hans, but your suggestion still didnt work for me. I think it would be safer if I used my internal server address since my Domoticz server and Tasker tablet are on the same network. I sent the http post in Google Chrome and it switched the switch fine, so I guess there is something in my firewall settings blocking it.

dmont
Posts: 6
Joined: Thursday 17 March 2016 5:47
Target OS: Windows
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post by dmont » Friday 14 October 2016 17:19

I was able to get it to work with the info in this post, thanks to alvarolb.

https://community.thinger.io/t/http-pos ... orized/135

nizaga
Posts: 96
Joined: Monday 30 November 2015 12:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post by nizaga » Thursday 29 December 2016 11:47

install imperihome in your android, the bridge to domoticz and then use the imperihome tasker plugin to call domoticz scenes, it works for me. put in your scene whatever you want to do.

regards,

nim

karl8754
Posts: 40
Joined: Thursday 15 October 2015 12:00
Target OS: Linux
Domoticz version: beta
Location: Wales
Contact:

Re: Turn switch on from tasker

Post by karl8754 » Tuesday 03 January 2017 1:27

I've got this working in Tasker. I've built a couple of generic tasks that can be called from other tasks with parameters (Parameter 1 = domoticz idx, Parameter 2 = "On"/"Off"

Switches
Task: Domoticz Switch

Code: Select all

HTTP Get:
Server/Port: %Domoticz 
Path: json.htm?type=command&param=switchlight&idx=%par1&switchcmd=%par2
Trust Any Certificate: Ticked [If you are not using signed certs for external]
(I've then checked it worked with IF %HTTPR neq 200 => flash "Domoticz Error: No response received")

Scenes
Task: Domoticz Scene

Code: Select all

HTTP Get: 
Server/Port: %Domoticz
Path: json.htm?type=command&param=switchscene&idx=%par1&switchcmd=On 
Trust Any Certificate: Ticked [If you are not using signed certs for external]
 
(Scenes can only be switched On)

User Variables

Code: Select all

Path: json.htm?type=command&param=updateuservariable&vname=%par1&vtype=2&vvalue=%par2
[Here vtype is '2' for a string, you can find all the options at the wiki: https://www.domoticz.com/wiki/Domoticz_ ... w_variable


You'll see from that I'm also using a variable for the server address and port number in the tasks. I've another task called Domoticz Reroute that toggles the address to use depending on my location. I've got it deciding based on whether I'm connected to my home wifi or not:

Task: Domoticz Reroute

Code: Select all

State / Wifi Connected, SSID = [your SSID]

Enter Task: Variable Set %Domoticz to http://192.168.1.xxx:80

Exit Task: Variable Set %Domoticz to https://user:[email protected][your external ip or url here]:[port_number]



User avatar
constapel
Posts: 16
Joined: Friday 30 December 2016 22:43
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Turn switch on from tasker

Post by constapel » Tuesday 03 January 2017 1:33

Maybe you should use a Http Get. Not a Http Post.

nizaga
Posts: 96
Joined: Monday 30 November 2015 12:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post by nizaga » Tuesday 03 January 2017 11:35

install imperihome in your tablet and use the tasker plugin to run scenes, then you program the scenes in the domoticz... it works great!

forumdomo
Posts: 9
Joined: Saturday 30 April 2016 19:31
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post by forumdomo » Friday 06 January 2017 18:06

Hi - any working solution with pure json with tasker and/or Automagic?

With firefox the json URL its working - but not with Automagic or tasker - WTH?
Raspi 2, domoticz-raspi-image, rfxcom433e, intertechno, home easy

Engberg
Posts: 3
Joined: Monday 20 February 2017 14:28
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post by Engberg » Monday 20 February 2017 14:35

I have the excact same problem.

Any news on this?

Tasker error says:
13.33.48/E prot: http:// serverport: MYINTERNALIP:8084 contenttype: application/x-www-form-urlencoded
13.33.48/E method: POST url: http://MYINTERNALIP:8084/json.htm?type= ... itchcmd=On timout: 10000 dataisfile false save null
13.33.48/WakeLockManager acquired partial lock for M flags: 1 autorelease: true warn: true
13.33.48/WakeLockManager setClearAlarm: not setting, last set 66ms ago
13.33.48/WakeLockManager acquired partial lock for M flags: 1 autorelease: true warn: true
13.33.48/WakeLockManager setClearAlarm: not setting, last set 84ms ago
13.33.48/E body isfile: false cont: null
13.33.58/E Input/Output error for http://MYINTERNALIP:8084/json.htm?type= ... itchcmd=On: java.net.SocketTimeoutException: timeout.
13.33.58/E result: stop task (error)
13.33.58/E Error: 1
13.33.58/MacroEdit action finished exeID 1 action no 0 code 116 status: Err next 0

woody4165
Posts: 442
Joined: Monday 14 March 2016 14:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Turn switch on from tasker

Post by woody4165 » Monday 20 February 2017 17:40

I've discovered Macrodroid and the Http GET is working like a charm....
Very easy

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests