Monthly Archives: August 2017

Kello Smart Alarm Clock, Part 2

I’ve now had enough time to play with my Kello and I’ve done enough integrations to share some updates.

Now Kello doesn’t have an API per se, but there are a few commands that can be used to communicate with it.

This enabled me to created a Kello interface on Home-Assistant so I can control my Kello remotely. Bonus: I can even do this when I’m not home.

The main interface is this one:

And here are some of the functions that I’ve achieved:

  • When I stop the alarm, I then get greeted with the weather forecast for the day as well as estimated time to go to work
  • I can play various radio stations, change the volume
  • If for any reason the Kello loses WiFi connection, I get a notification email
  • When I leave home, or when I set the house mode to “Holidays”, all alarms get deactivated
  • When I reach home or when the house mode is no longer set to “Holidays”, all alarms are enabled

 

Here is a list of the commands I used to achieve the above:

Volume:

printf "\n0p40xx\r" | nc [Kello's IP Address] 4444

Where xx is the volume in hex (Dec from 0 to 100, so 0x00 to 0x64 in hex)

 

Muting all Alarms:

printf "\n0p231\r" | nc [Kello's IP Address] 4444

 

Unmuting all Alarms:

printf "\n0d231\r" | nc [Kello's IP Address] 4444

 

Play (online) Media:

printf "\n0p41uri:http\:\/\/cdn.us1.sunup.co\/files\/music\/sounds\/fireside.ogg\r" | nc [Kello's IP Address] 4444

 

Stop Media:

printf "\n0d41\r" | nc [Kello's IP Address] 4444

 

And don’t forget the IFTTT Integration for more automation, check my previous post on how do to this.




Xiaomi Mi Robot Vacuum

I have finally purchased a robotic vacuum cleaner. After much time trying to get the best smart / connected automated vacuum cleaner for my money, I opted for the Xiaomi Mi Robot Vacuum.

Xiaomi Mi Robot Vacuum

Xiaomi Mi Robot Vacuum

I have to say it’s excellent at navigating through the house in each and every nook it can get into, yet not once has it got stuck somewhere.

And the app is pretty good in telling you what the vacuum has done as well as sending you notifications (if you want) each time something happens (e.g. start cleaning, completed, main brush stuck, etc.)

Xiaomi Cleaning House Map

Xiaomi Cleaning House Map

The best part though is that in addition to controlling the vacuum from the Xiaomi app, it can also be integrated into Home-Assistant:

Xiaomi on Home-Assistant

Xiaomi on Home-Assistant

Clicking the button will simply start vacuuming.

I then created a simple automation to initiate the cleaning on specific days/time IF I’m not home.

If only I could also automate emptying the vacuum bin…




Kello Smart Alarm Clock

I have recently taken the plunge and jumped on the kickstarter wagon for the first time.
I successfully backed up a project called Kello.
And after months of anticipation, I finally received the product: a smart alarm clock:

Kello

Kello

Now not only does this alarm look good, but it’s also WiFi and IFTTT enabled and for me that was the major sales point. The plan was to integrate it with my automation setup.

I’ve only had it for about a month and already I’m really impressed with its prowess. The first thing I did was to connect it to IFTTT.

At the time of writing IFTTT is only a beta feature access needs to be requested ([email protected]). They are really responsive and I was granted access within 24h via the use of the TestFlight app on iOS

IFTTT integration currently offers 4 triggers:

  • alarm_start: triggers when an alarm starts ringing.
  • alarm_snooze: triggers when you press snooze.
  • alarm_stop: triggers when you stop the alarm.
  • alarm_soon_-1440, ..., alarm_soon_-120, alarm_soon_-6: the number on the right is the number of seconds before the alarm rings. Only use multiples of 60, up to 1440 seconds (24 minutes) before the alarm rings.

The other interesting bit is that the device can programatically be made to play online content with a one line piece of code:

printf "\n0p41uri:http\:\/\/cdn.us1.sunup.co\/files\/music\/sounds\/fireside.ogg\r" | nc 192.168.x.x 4444

The URL can be adjusted to play any online content (I’ve not tested all formats). The IP address needs to be the Kello’s IP address (best to set it to static on your router’s DHCP settings)

Armed with the above, I wanted to adjust my weather greeting script so as to play the audio on the Kello. The idea is to have the Kello play its set alarm sound to wake me up, then when I stop the alarm, a rule is triggered to play the weather forecast for the day (I pressed the stop button so I’m awake enough to pay attention to the forecast)

Here is how I did it.

  1. IFTTT:
    1. Go to http://www.ifttt.com/maker_webhooks.
    2. Press on the gear icon on the top right of your screen.
    3. Copy your webhook ID (the text after ‘http://make.ifttt.com/use/’).
  2. Home Assistant:
    1. Add the IFTTT integration to your configuration:
    2. Don’t forget to copy/save your webhook URL, you’ll need this later
    3. Add a new shell command to your configuration.yaml file. Replace the IP with your Kello’s IP address and replace the URL with the address of the weather forecast sound file you want to play (this is created and uploaded separately)
      shell_command:
      weather_on_kello: printf "\n0p41uri:http\:\/\/cdn.us1.sunup.co\/files\/music\/sounds\/fireside.ogg\r" | nc 192.168.x.x 4444
  3. Kello App:
    1. Go to the settings.
    2. Press ‘IFTTT’.
    3. Paste your webhook ID.
  4.  IFTTT:
    1. Create a new Applet.
    2. For the if THIS condition, choose Webhooks.
    3. Click on Receive a web request
    4. For the Event Name, choose one of the event as listed earlier on. I chose alarm_stop
    5. Click on Create trigger
    6. For the then THAT action, choose Webhooks.
    7. Click on Make a web request
    8. Enter the following details:
      1. URL: your Home Assistant IFTTT Webhook (you will get this when you setup the IFTTT Integration in HA, see 2.1 above)
      2. Method: POST
      3. Content Type: application/json
      4. Body: { “action”: “somekeywordgoeshere”}
    9. Click on Create action
  5. Home Assistant Automation:
    1. Create a new automation. The needed trigger will be:
  trigger:
    - platform: event
      event_type: ifttt_webhook_received
      event_data:
        action: somekeywordgoeshere

(*): To be able to receive events from IFTTT, your Home Assistant instance needs to be accessible from the web. This can be achieved by forwarding port 8123 from your router to the device running Home Assistant.

My next “project” is to mute or stop an alarm from playing if for any reason I’m not home so I don’t disturb anyone. Check this post to see how I did it