Kello Smart Alarm Clock

Kello is a alarm clock with Wifi. The waking times can be set directly on the Kello or via the Kello app. There is an IFTTT integration so that actions can be triggered when the alarm rings, x minutes before the alarm rings, and when you stop the alarm or snooze.

Playing a Webradio Station on Kello

I want to present how Kello can be integrated in openHAB as a speaker / internet radio. I found this tutorial which shows how to send commands to the Kello. This example shows how start and stop playing an internet radio station.

Firstly, create an Item Kello_Radio of type Switch and put it in a sitemap:

Switch item=Kello_Radio label="Radio" icon="soundvolume"

Next, a rule sends commands to Kello to play and stop the webradio:

rule "Kello Radio"
when
	Item Kello_Radio changed
then
	if(Kello_Radio.state == ON) {
		executeCommandLine("/home/openhabian/kello radioOn",10000)
	} else {
		executeCommandLine("/home/openhabian/kello radioOff",10000)
	}
end

And here the kello shell script:

#!/bin/bash
if [ $1 == "radioOn" ]
  then
    printf "\n0p41uri:http\:\/\/br-br1-obb.cast.addradio.de\/br\/br1\/obb\/mp3\/128\/stream.mp3\r" | nc 192.168.1.88 4444
fi

if [ $1 == "radioOff" ]
  then
    printf "\n0d41\r" | nc 192.168.1.88 4444
fi

Replace the IP address with Kello’s IP address (you find it in your WiFi Router settings), and the URL with the URL to your favorite webradio station. Escape special characters like : and /.

This was just a simple example with one radio station. You can have a selector with multiple stations, you can set the volume with printf “\n0p40xx\r” (replace xx by a hexadecimal number between 00 and 64), and more. Use Kello for notification sounds by storing mp3 files on a webserver and use the printf “\n0p41uri:…” (as above) to play that sound.

The next level is to write a script that generates a mp3, for example with the current weather forecast, the number of your Twitter followers, the gas station prices, some sensor values from openHAB items, or whatever. And then send the URL to this mp3 to Kello to play it.

IFTTT Integration: Kello --> IFTTT —> openHAB
If your openHAB instance is accessible from outside your home network (e.g., for myopenhab users), this is very easy:

  • Create an IFTTT account, create a Maker channel, copy the Webhook ID in the Kello App (see here and here)
  • For myopenhab users, create a openHAB channel in IFTTT and log in
  • Create an IFTTT applet; use the event name alarm_start, alarm_stop, alarm_snooze, or alarm_soon_-600 (-600 are ten minutes, any number between -1440 and -60 seconds are possible).
  • In your applet, use the openHAB action to turn on your lights, change the state of an openHAB item, send a command, or whatever.

If you’re not using myopenhab, or when your openHAB is not available from the outsite world, it is more complicated. You can use IFTTT’s maker channel to send a request to a REST API. For example, you can have a PHP script or a simple webserver running on a server somewhere that accepts IFTTT calls to write a value 1 in a file. A openHAB Exec binding thing makes a curl request every minute to another script to read the value in the file. If the value 1 is, the script sets it back to 0. This way, your openHAB instance is not accessible from the outsite, but it asks a server every minute, if the alarm event just triggered.

1 Like