create account

Rise with the (artificial) sun: (Home automation series post #4) by spidersprog

View this thread on: hive.blogpeakd.comecency.com
· @spidersprog · (edited)
$7.11
Rise with the (artificial) sun: (Home automation series post #4)
![sketch-1507139008815.png](https://steemitimages.com/DQmcxiiKPRd7pqoPhhyC8v5A1rawT9pynfKSg8YjXxfGY9Q/sketch-1507139008815.png)

One of the great things about home automation is the ability to setup scenarios

I have a morning alarm scenario which is triggered by a calendar event (or alarm event) on my android phone.
once it is triggered it sends a message to my home automation server which then triggers the morning alarm scenario.
this scenario does the following

1.  Gradually brightens the bedside lamps over 30 min. 
2.  after 30 min turn the main bedroom light on to full brightness
3.  Turn the TV on in the living room and set to a news channel

Here's a time lapse video of what it looks like(you might wanna skip through a few times points its still 2:30 min of watching  a light turn on :-p

https://dtube.video/#!/v/spidersprog/f9idqmus

<h1>Tutorial</h1>
 
here's the step by step to set this up

I'm assuming you already have:-
Some lights setup including a dimmer device.
Tasker on your android phone
Domoticz server setup with your lights/devices added and controlled by domoticz 

<h2>On Domoticz </h2>

<h3> Setup Scene</h3>
 1. Connect to your domoticz web server front end go to the scenes tab
 2. click "Add Scene"> enter a name> leave the type as "Scene"
 3. A new Scene will appear> Click "edit" on this new scene
 4. Now you just need to add the devices you want to tigger in the scene.
I have added the same device (bedroom lamp) many times but each time with a longer on delay and a higher brightness setting.   I timed these series of commands to last 30 min, so the lights come on gradually over a 30 min period.
After these events I added the other lights and TV on events.  Take a look at the screenshot below for an example of how it looks when complete
 
![Screenshot 2017-10-04 at 5.47.03 PM.png](https://steemitimages.com/DQmQ6Ng9uA6r5THdgfStoSnFRGugvqJcbZiQ97xiJnfk1Ha/Screenshot%202017-10-04%20at%205.47.03%20PM.png)

<h3>Get your JSON command</h3>
Domoticz has a JSON interface which can be used to trigger commands (and scenes ) over http.  You need to find the IDX of the scene we just made.

1. In domoticz click setup and then devices
2. Use the search bar to the right and find your newly created scene and note its idx number
2. The JSON API is documented [here](https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s) but essentaly what you want is something like this
`http://192.168.1.4:70/json.htm?type=command&param=switchscene&idx=1&switchcmd=on` 
but replacing 192.168.1.4:70 with your servers IP and port and 1 with the IDX number of your scene.
3. If you make these changes and then attempt to open the URL (on the same network as your domoticz installation) it should trigger the scene(check your domoticz log, or your lights :-p ) f it works its on to the next step
4. Write down the URL or transfer it to your phone somehow( I use push bullet)

<h2>On the phone </h2>

<h3>Setup you Morning-Alarm calendar event</h3>

1. Open up Google calendar and add a calendar event called Morning-Alarm (or whatever you like)
2. Set it for 30 min before you want to get up.  if you want you can set recurrence and days if the week too.
3. Remember the name of the calendar event for the profile step


<h3>Tasker Task</h3>
Their are two main parts to tasker.  The task which performs the actions, lets setup the action now.

1. Open tasker>click task>click the + button
2. Name your task > click +
3. Net>http get
4. In the server:port field enter your JSON command string from step earlier
5. Hit back 
6. If you want you can test it by clicking the play button (bottom left)
7. Hit back again


<h3>Tasker Profile</h3>

And the profile which triggers your actions.  So lets set that up too.

1. Open tasker and click profile, then the + button
2. Then State>App>Calendar Entry
3. Enter your calendar event title from step earlier
4. Hit back


That's it. when the alarm is triggered on your phone and connected to the same network as the domoticz server. It will trigger the morning alarm scenario and run your defined commands.

<h3> Still to do Here</h3>

There's still some more i would like to add to my scenario:-

1. Set some music to play on the bedroom Chromecast
2. Snooze functions (I will soon be getting a [knocki](https://knocki.com/) which I plan to use for this) but any device capable of sending a message to the phone or server will work

When I get round to these I will cover them in their own posts
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorspidersprog
permlinkrise-with-the-artificial-sun-home-automation-series-post-4
categoryhomeautomation
json_metadata{"tags":["homeautomation","alarm","technology","smarthome","sunrise"],"image":["https://steemitimages.com/DQmcxiiKPRd7pqoPhhyC8v5A1rawT9pynfKSg8YjXxfGY9Q/sketch-1507139008815.png","https://steemitimages.com/DQmQ6Ng9uA6r5THdgfStoSnFRGugvqJcbZiQ97xiJnfk1Ha/Screenshot%202017-10-04%20at%205.47.03%20PM.png"],"links":["https://dtube.video/#!/v/spidersprog/f9idqmus","https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s","https://knocki.com/"],"app":"steemit/0.1","format":"markdown"}
created2017-10-04 18:24:18
last_update2017-10-04 19:15:03
depth0
children6
last_payout2017-10-11 18:24:18
cashout_time1969-12-31 23:59:59
total_payout_value6.964 HBD
curator_payout_value0.150 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,468
author_reputation2,491,927,921,592
root_title"Rise with the (artificial) sun: (Home automation series post #4)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,787,455
net_rshares2,900,218,601,377
author_curate_reward""
vote details (36)
@lottobot ·
Congratulations! This post has been awarded a 100% upvote by @lottobot! This post was the winner of lottery #266, which had a total of 1 entries. @lottobot always has a lottery going on! If you would like to nominate a post for the current lottery, just send 0.1 SBD or STEEM to @lottobot, and include the url of the post you would like to nominate as a memo. Learn more by reading the [introductory post](https://steemit.com/introduceyourself/@lottobot/introducing-lottobot-are-you-ready-to-win-big)! Good luck!
👍  
properties (23)
authorlottobot
permlinkre-rise-with-the-artificial-sun-home-automation-series-post-4-20171005t113108
categoryhomeautomation
json_metadata"{"app": "pysteem/0.5.5"}"
created2017-10-05 11:31:09
last_update2017-10-05 11:31:09
depth1
children0
last_payout2017-10-12 11:31:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length512
author_reputation95,038,246,518
root_title"Rise with the (artificial) sun: (Home automation series post #4)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,850,613
net_rshares381,352,769
author_curate_reward""
vote details (1)
@mandolincarls ·
Upvoted on behalf of the **dropAhead Curation Team!**
Your post will be Resteemed by @dropahead witness account of the [dropAhead curation team](https://steemit.com/introduceyourself/@dropahead/introduceyourself-xxvotesplus-dropahead-curation-trail-and-my-path-to-witness)!
#### Watch out for the #xx-votesplus tag!

### <center>Do you want more earnings?</center> 

- ***Upvote this comment!*** 
- **Upvote the** [**dropAhead's latest post!**](https://steemit.com/xx-votesplus/@dropahead/dropahead-daily-report-2017-09-23)
- @dropahead - [***Vote for witness!***](https://steemit.com/~witnesses)
- [Delegate/donate some POWER](https://steemit.com/delegate/@zeartul/how-to-delegate-steem-power-the-easy-way-if-you-have-over-30-sp-you-can-delegate) to @dropahead 

By doing the above you will give us more STEEM POWER (SP) **to give YOU more earnings** next time.

Keep up the good work!

---
Most recent post: [Moving #25_votes_plus to Discord](https://steemit.com/xx-votesplus/@dropahead/moving-25votesplus-to-discord)
👍  ,
properties (23)
authormandolincarls
permlinkre-spidersprog-rise-with-the-artificial-sun-home-automation-series-post-4-20171005t185015433z
categoryhomeautomation
json_metadata{"tags":["homeautomation","xx-votesplus"],"users":["dropahead"],"links":["https://steemit.com/introduceyourself/@dropahead/introduceyourself-xxvotesplus-dropahead-curation-trail-and-my-path-to-witness","https://steemit.com/xx-votesplus/@dropahead/dropahead-daily-report-2017-09-23","https://steemit.com/~witnesses","https://steemit.com/delegate/@zeartul/how-to-delegate-steem-power-the-easy-way-if-you-have-over-30-sp-you-can-delegate","https://steemit.com/xx-votesplus/@dropahead/moving-25votesplus-to-discord"],"app":"steemit/0.1"}
created2017-10-05 18:20:51
last_update2017-10-05 18:20:51
depth1
children0
last_payout2017-10-12 18:20:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,019
author_reputation2,157,799,664,736
root_title"Rise with the (artificial) sun: (Home automation series post #4)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,881,396
net_rshares5,118,595,726
author_curate_reward""
vote details (2)
@minnowbooster ·
@minnowbooster upvoted this post!
![Calling @originalworks :)](http://minnowshares.net/upgoat/?user=spidersprog&receiver=spidersprog&value=6.65&hash=635)
*@spidersprog got you a $6.65 @minnowbooster upgoat, nice!
- img credz: pixabay.com*
---
[Want a boost? Minnowbooster's got your back!](https://steemit.com/minnowbooster/@minnowbooster/6rt2mn-introducing-minnowbooster-beta)
    
properties (22)
authorminnowbooster
permlinkcomment-1507141607158
categoryhomeautomation
json_metadata""
created2017-10-04 18:26:48
last_update2017-10-04 18:26:48
depth1
children1
last_payout2017-10-11 18:26:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length349
author_reputation230,546,282,483,083
root_title"Rise with the (artificial) sun: (Home automation series post #4)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,787,657
net_rshares0
@originalworks ·
originalworks
The @OriginalWorks bot has determined this post by @spidersprog to be original material and upvoted it! 
<center>![ezgif.com-resize.gif](https://steemitimages.com/DQmaBi37A5oTnQ9NBLH8YU4jpvhhmFauyvgg3YRrEJwskM9/ezgif.com-resize.gif)</center> 

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message! 
### To enter this post into the daily RESTEEM contest, upvote this comment! The user with the most upvotes on their @OriginalWorks comment will win!<h3>
For more information, [Click Here!](https://steemit.com/writing/@originalworks/originalworks-bot-explanation-and-info) || [Click here to participate in the @OriginalWorks writing contest!](https://steemit.com/fiction/@originalworks/originalworks-fictional-writing-contest-1-the-invisible-meeting)
Special thanks to @reggaemuffin for being a supporter! Vote him as a witness to help make Steemit a better place! 
👍  
properties (23)
authororiginalworks
permlinkre-comment-1507141607158-20171004t182804
categoryhomeautomation
json_metadata"{"app": "pysteem/0.5.4"}"
created2017-10-04 18:28:06
last_update2017-10-04 18:28:06
depth2
children0
last_payout2017-10-11 18:28:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length913
author_reputation79,292,026,602,057
root_title"Rise with the (artificial) sun: (Home automation series post #4)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,787,773
net_rshares2,218,017,639
author_curate_reward""
vote details (1)
@minnowpond ·
@cmtzco has voted on behalf of @minnowpond. If you would like to recieve upvotes from minnowpond on all your posts, simply FOLLOW @minnowpond. To be Resteemed to 4k+ followers and upvoted heavier send 0.25SBD to @minnowpond with your posts url as the memo
properties (22)
authorminnowpond
permlinkre-rise-with-the-artificial-sun-home-automation-series-post-4-20171004t183613
categoryhomeautomation
json_metadata"{"app": "pysteem/0.5.4"}"
created2017-10-04 18:36:15
last_update2017-10-04 18:36:15
depth1
children0
last_payout2017-10-11 18:36:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length255
author_reputation13,239,048,956,578
root_title"Rise with the (artificial) sun: (Home automation series post #4)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,788,505
net_rshares0
@minnowpond ·
@reported has voted on behalf of @minnowpond. If you would like to recieve upvotes from minnowpond on all your posts, simply FOLLOW @minnowpond. To be Resteemed to 4k+ followers and upvoted heavier send 0.25SBD to @minnowpond with your posts url as the memo
properties (22)
authorminnowpond
permlinkre-rise-with-the-artificial-sun-home-automation-series-post-4-20171004t192731
categoryhomeautomation
json_metadata"{"app": "pysteem/0.5.4"}"
created2017-10-04 19:27:33
last_update2017-10-04 19:27:33
depth1
children0
last_payout2017-10-11 19:27:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length257
author_reputation13,239,048,956,578
root_title"Rise with the (artificial) sun: (Home automation series post #4)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id16,792,204
net_rshares0