Hi Guys,
maybe many of you know this stuff already, but i just make for new guys this little “Guide” with Examples.
What you need for this Examples:
- Andriod Mobile Phone
- The App “Tasker” - 2,99Euro in the AppStore
- a Pimatic Server with DynDNS Access
(i use the German Version, so the Sceenshots are in German, i try to translate the Options back, but it is possible that some stuff called other in English.)
1. Example - “is Some one Home detection” via Tasker
Settings in Pimatic:
- Set up a Dummy Switch for your Device e.g. “my Phone”
- Set up a Dummy Switch for Detection e.g. “SomeOneAtHome”
- Make a Rule with : if “my phone” turn on -> turn on “SomeOneAtHome”
- Make a Rule with "if "my Phone turn off for X min -> turn off “SomeOneAtHome”
Why this Rules? With this rules you have littlebit time be for a other rule does something when you are not at Home or when your are at Home. Use for your other rules now the “Dummy SomeOneAtHome” as in indicator.
Settings in the Tasker App:
-
Buy and Install Tasker
-
Start Tasker and go to “Profiles” and tap on the “+”
-
Now Tasker ask for when the Profile will be used, pick “Status”
-
in this Screen Tasker ask what kind of Status you want, choose “Network”
-
In the Next and last Option menu its ask for what Device / Action, choose “Wifi connected”
-
Now you can typ your SID of your Wifi or tap on the Magnifying glass to search possible WLAN networks. Just enter the SID and leave the other Stuff blank
-
After this Tasker ask for a Name of the “Task” choose a Name
-
now Tasker is shown the Task Editor for your Task, tap on the “+” to set up your Action.
-
Next Step choose again “Network”
-
Choose “HTTP Post”
-
Now you get a Mask with fields, you have to Enter stuff like this:
Server:Port
if you dont have access in your local Network to your DYNDNS (some Routers blocking this), use the localIP and Port
With Port 80 or 443 (behind a Nginx webserver - Reverse Proxy)
http://PIMATIC_USER:PIMATIC_PW@Your_DYNDNS.com
or
https://PIMATIC_USER:PIMATIC_PW@Your_DYNDNS.com
Without a Nginx and costum Port
http://PIMATIC_USER:PIMATIC_PW@Your_IP:PORT
or
https://PIMATIC_USER:PIMATIC_PW@Your_IP:PORT
or
http://PIMATIC_USER:PIMATIC_PW@Your_DYNDNS.com:PORT
etc…
Path
/api/execute-action
Data / File
{“actionString”: “turn myPhone on”}
Content Type
application/json
Trust Any Certificate
yes
All other fields you can leave blank. Now your Phone sets up the Switch wenn its connected to your Wifi, you need now a second “Profile” in Tasker to switch them of if you are leave your Wifi.
Its pretty same but follow changes:
- Choose also “Wifi connected” but activate “reverse”, now its checking for you are not connected
- in Task it must be now a DynDNS URL to your pimatic because your online over mobile connection. And set the ActionString to “off”
2. Example - “If your Andriod Alarm clock is ringing turn lights on”
Settings in Pimatic:
- Set up a Dummy Switch “Alarm clock”
- Make a rule with follow Content:
When Alarm clock is turned on and its before XX:XX then turn Alarm clock off and turn Lamp1 on for XXminutes and …etc
With this Rule we set up that the Lights will be only turned on if its before a specific Time, you can do it also with a Lightsensor but i havent one so i do it with time. The Rule sets the Dummy switch instand to “off” because we will only turn on the Switch via Tasker.
If you use your Alarm Clock from your Phone also Outsite from your Home, you should at a “SomeOneAtHome” State to your Rule.
When Alarm clock is turned on and SomeOneAtHome is turned on …
- Make 2nd Rule with follow Content
When Alarm clock is turned on and its after XX:XX then turn Alarm clock off
this rule is only to get the Dummy ready again for the next event.
Tasker Settings (Without screenshots see 1. Example):
- Add a new Profile -> choose “Events” (in Ger: “Ereignis”) -> “Date / Time” -> Alarm Clock is ringing
- choose a Name for your Task and add a Task -> Network -> Http Post
- Now enter follow stuff:
Server:Port
if you dont have access in your local Network to your DYNDNS (some Routers blocking this), use the localIP and Port
With Port 80 or 443 (behind a Nginx webserver - Reverse Proxy)
http:\PIMATIC_USER:PIMATIC_PW@Your_DYNDNS.com
or
https:\PIMATIC_USER:PIMATIC_PW@Your_DYNDNS.com
Without a Nginx and costum Port
http:\PIMATIC_USER:PIMATIC_PW@Your_IP:PORT
or
https:\PIMATIC_USER:PIMATIC_PW@Your_IP:PORT
or
http:\PIMATIC_USER:PIMATIC_PW@Your_DYNDNS.com:PORT
etc…
Path
/api/execute-action
Data / File
{“actionString”: “turn Alarm Clock on”}
Content Type
application/json
Trust Any Certificate
yes
Now you have a dynamic Smarthome Alarm Clock, its pretty good for people like me that haven´t every week the same Work begin.