Turn switch on from tasker

Moderator: leecollings

Post Reply
dmont
Posts: 8
Joined: Thursday 17 March 2016 4:47
Target OS: Windows
Domoticz version: 2020.1
Contact:

Turn switch on from tasker

Post 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.
Attachments
Screenshot_20161012-090323.png
Screenshot_20161012-090323.png (360.64 KiB) Viewed 9309 times
DutchHans
Posts: 229
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Turn switch on from tasker

Post 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&param=switchlight&idx=45&switchcmd=On&level=0

It works for me, I hope for you too..
Success, Hans
dmont
Posts: 8
Joined: Thursday 17 March 2016 4:47
Target OS: Windows
Domoticz version: 2020.1
Contact:

Re: Turn switch on from tasker

Post 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.
dmont
Posts: 8
Joined: Thursday 17 March 2016 4:47
Target OS: Windows
Domoticz version: 2020.1
Contact:

Re: Turn switch on from tasker

Post 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
nizaga
Posts: 69
Joined: Monday 30 November 2015 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post 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
karl8754
Posts: 31
Joined: Thursday 15 October 2015 12:00
Target OS: Linux
Domoticz version: stable
Location: Wales
Contact:

Re: Turn switch on from tasker

Post 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&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:password@[your external ip or url here]:[port_number]


User avatar
constapel
Posts: 15
Joined: Friday 30 December 2016 21:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Turn switch on from tasker

Post by constapel »

Maybe you should use a Http Get. Not a Http Post.
nizaga
Posts: 69
Joined: Monday 30 November 2015 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post 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!
forumdomo
Posts: 12
Joined: Saturday 30 April 2016 19:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

Re: Turn switch on from tasker

Post 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?
Raspi 2 @ Debian, rfxcom433e, intertechno, home easy, hue, piface
Engberg
Posts: 2
Joined: Monday 20 February 2017 13:28
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Turn switch on from tasker

Post 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
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Turn switch on from tasker

Post by woody4165 »

I've discovered Macrodroid and the Http GET is working like a charm....
Very easy
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
User avatar
galadril
Posts: 828
Joined: Monday 07 September 2015 10:32
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Contact:

Re: Turn switch on from tasker

Post by galadril »

old topic, but im looking into Tasker integrations with a plugin app
https://www.domoticz.com/forum/viewtopi ... 37&t=32696
Solar panels of Ginlong, Omnik-Solar, Transenergy or Solarman?? Try my Android app:
https://play.google.com/store/apps/deta ... ongmonitor
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest