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

in #homeautomation7 years ago (edited)

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

Tutorial

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

On Domoticz

Setup Scene

  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

Get your JSON command


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
  3. The JSON API is documented here 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.
  4. 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
  5. Write down the URL or transfer it to your phone somehow( I use push bullet)

On the phone

Setup you Morning-Alarm calendar event

  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

Tasker Task


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

Tasker Profile

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.

Still to do Here

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 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

Sort:  

Upvoted on behalf of the dropAhead Curation Team!
Your post will be Resteemed by @dropahead witness account of the dropAhead curation team!

Watch out for the #xx-votesplus tag!

Do you want more earnings?

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

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! Good luck!

The @OriginalWorks bot has determined this post by @spidersprog to be original material and upvoted it!

ezgif.com-resize.gif

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!

For more information, Click Here! || Click here to participate in the @OriginalWorks writing contest!
Special thanks to @reggaemuffin for being a supporter! Vote him as a witness to help make Steemit a better place!

@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

@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

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.030
BTC 61470.93
ETH 3436.77
USDT 1.00
SBD 2.52