Page 1 of 1
Turn switch on from tasker
Posted: Wednesday 12 October 2016 17:15
by dmont
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.
Re: Turn switch on from tasker
Posted: Wednesday 12 October 2016 19:01
by DutchHans
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¶m=switchlight&idx=45&switchcmd=On&level=0
It works for me, I hope for you too..
Success, Hans
Re: Turn switch on from tasker
Posted: Thursday 13 October 2016 20:27
by dmont
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.
Re: Turn switch on from tasker
Posted: Friday 14 October 2016 17:19
by dmont
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
Re: Turn switch on from tasker
Posted: Thursday 29 December 2016 10:47
by nizaga
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
Re: Turn switch on from tasker
Posted: Tuesday 03 January 2017 0:27
by karl8754
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¶m=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¶m=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¶m=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:password@[your external ip or url here]:[port_number]
Re: Turn switch on from tasker
Posted: Tuesday 03 January 2017 0:33
by constapel
Maybe you should use a Http Get. Not a Http Post.
Re: Turn switch on from tasker
Posted: Tuesday 03 January 2017 10:35
by nizaga
install imperihome in your tablet and use the tasker plugin to run scenes, then you program the scenes in the domoticz... it works great!
Re: Turn switch on from tasker
Posted: Friday 06 January 2017 17:06
by forumdomo
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?
Re: Turn switch on from tasker
Posted: Monday 20 February 2017 13:35
by Engberg
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
Re: Turn switch on from tasker
Posted: Monday 20 February 2017 16:40
by woody4165
I've discovered Macrodroid and the Http GET is working like a charm....
Very easy
Re: Turn switch on from tasker
Posted: Friday 15 May 2020 20:35
by galadril
old topic, but im looking into Tasker integrations with a plugin app
https://www.domoticz.com/forum/viewtopi ... 37&t=32696