ESP8266 Relay Modules from Itead and Electrodragon

Electrodragon relay module (top) and Itead Sonoff (bottom)
Electrodragon relay module (top) and Itead Sonoff (bottom)

Here are two similar but also rather different WiFi controlled mains switching relay modules that both use the ESP8266 WiFi SoC. Both come with a nice case, can be reprogrammed with your own firmware and are exceedingly cheap for what you get.

I’m using these with MQTT and Node-RED so that they seamlessly integrate with the other WiFi and 433MHz remote mains devices that I already have. In day to day use there will be no way to tell which type of device is controlling a particular light or appliance which is just how it should be.

Continue reading

Amazon Echo Alexa Skills Kit integration with Node-RED

Amazon Echo
Amazon Echo

I have been using my Amazon Echo and a Raspberry Pi running AlexaPi for voice control of lights, appliances and modes using ha-bridge, a Java app that emulates the Philips Hue API which is one of the few devices that the Echo supports natively. I use ha-bridge to do http GET requests to endpoints on my Node-RED based home automation system which allows me to control lights and appliances etc. by saying things such as “Alexa turn on the kitchen lights” or “Alexa switch the stairs lights off” or “Alexa turn cinema mode on”.

This works very well and as it is piggybacking on functionality that the Echo/AVS has built in there is no need for additional keywords but for something more advanced than on/off/brightness control we need to use the Alexa Skills Kit (ASK).

With ASK skills you can add new functionality which is operated by saying something like “Alexa ask the house to….” or “Alexa tell the house to….” where “the house” is the name of your custom skill and what follows can be anything you like. You can also customise the response that the Echo returns to the user so this opens up a lot of opportunities.

I’ve used “Echo” throughout this post but this will work with a real Echo or a Raspberry Pi running AlexaPi or Amazon’s new Java client. It’s easy to set up with Node-RED and certainly beats all that tedious mucking about in hyperspace with IFTTT.

Continue reading

Orvibo S20 WiFi Mains Socket with Node-RED

orvibo_S20
Orvibo S20 WiFi Smart Socket

For years I used X10 for all my remote controlled sockets but the unreliability eventually drove me to RF based sockets, the Home Easy ones in particular as you can’t beat the price, often available for circa £20 for a pack of 3 with a remote control and easily integrated into Node-RED and the likes with a simple 433MHz transmitter and receiver, the downside being there is no security.

Anyway, there are lots of affordable WiFi controlled sockets on the market now and a common one is the Orvibo S20, £15.99 on Amazon, a bit less from some sellers on ebay or under £11 from Banggood (be sure to select the right model for your country there).

They seem to be pretty well made and are small unobtrusive units. They are designed to work only with their proprietary Android and iPhone apps but there has been several pieces of work done on reverse engineering the protocol and some libraries for various platforms already exist but it looked easy enough to knock something up in Node-RED so that’s what I did as it is the heart of my home automation system these days. This is just simple on/off control here, no point in messing with the built in timers when we have better control than that in Node-RED itself.

Continue reading

Background Radiation Monitoring

Geiger counter kit connected to Tiny328
Geiger counter kit connected to Tiny328

A little Saturday afternoon project last weekend was putting together this geiger counter kit from RH Electronics in Israel, paired with a soviet SBM-20 Geiger-Müller tube sourced from an eBay seller in the Ukraine. Total cost was £32 which seems very reasonable to me.

The RH Electronics kit comes with all the components apart from the Geiger-Müller tube, it is all through hole components (there are a few SMD components in the design but these are presoldered) and the PCB is well labelled so it is very easy to build. It runs on 4.5-5.5V, has a very low power consumption, stable HV output for the G-M tube and support for both 400V and 500V tubes. It also provides a handy interrupt output so that it can easily be linked to your favourite microcontroller.

Continue reading

Pebble Timeline node for Node-RED

Pin Notification
Pin Notification

The reason behind the last post was so that I could create a node for Node-RED to send pins to the Timeline on a Pebble smartwatch.

To use this you obviously need a Pebble Time (or a classic Pebble once the Timeline update is available) but you will also need a Timeline user token which is unique to you the user and an installed Pebble app. I detailed in the last post about how you can create a simple app to get a token or you can just install my Timeline Token app on your watch and get one that way.

The Timeline User Token is entered into the node and is stored in the credentials file in your .node-red directory.

Continue reading

Sending Pins to the Pebble Timeline

Pins added via Node.js
Pins added via Node.js

There are a number of different libraries available for sending pins to the Timeline on a Pebble watch, including those for Javascript, Node.js, Ruby, Python, PHP and C.  To use any of these you need a unique user token which is a UUID unique to both an app installed on the watch and the user, I couldn’t find a straightforward description of what is required to get a token so I’ve detailed what needs to be done below.

Getting a token the easy way

If you just want to do it the easy way I’ve created a Timeline Token app which is available on the Pebble Appstore, once installed on your Pebble it will display the token and give you a short URL to view it on the web (to save retyping the lengthy UUID from the Pebble screen).

token
My Timeline Token app, aka the easy way

Continue reading

3D Printed Cases For TinyTX and Tiny328

With TinyTX3 and single 3V battery
3D printed case ith TinyTX3 and Tadiran 3.6V AA battery.

Another post I’ve been meaning to write for a long time. I finally got my Rigidbot 3D printer in August 2014 some 9 months later than the estimate but I was one of the lucky ones, many had to wait a lot longer and some have even had to pay extra for delivery, having already paid it once as the company completely ran out of funds. I am very happy with the printer though, I’ve printed all kinds of things since I’ve had it and it has produced some great results.

One of the main things I had in mind for it was printing customised enclosures for my electronics projects. I’ve used a variety of off the shelf cases for my indoor TinyTX and Tiny328 sensors, my favourite being the Evatron EN30W sensor case but I really wanted to design something of my own.

Continue reading

Lenny, The bot that fools telesales callers

lennyI mentioned in the last post that I send all but a select few callers on my landline straight to voicemail but that’s actually no longer true. Thanks to a casual comment by @ichilton on Twitter I’ve recently switched to diverting calls from unknown numbers to Lenny.

Lenny who? Lenny is an Asterisk dial plan which together with a set of very convincing recordings works as a bot to fool telesales callers into thinking they are talking to a real person. Lenny will answer then wait for the caller to speak and when they stop he moves on to the next recording, it really is very convincing and there are some great recordings of people having lengthy conversations with him on this YouTube channel.

Continue reading

Sending incoming call info to MQTT

asterisk-mqttI’ve used Asterisk at home since around 2004, originally using a clone of a Digium FXO card and later a Sipura SPA-3000 (later owned and branded by Linksys) to interface to my landline. When that server decommissioned itself (with a bang and bad smell) a year or so ago I switched over to the Asterisk based FreePBX on a Raspberry Pi (using the RasPBX distro) but still using the old but perfectly serviceable SPA-3000. It’s rare that anyone I want to speak to calls me on the landline these days (hi Mum!) but I need to keep it active for my BT Infinity fibre broadband so I may as well have something connected to it. Most of the calls I do get on it are junk so I have Asterisk set up to only ring the phones for a specific set of callers and anyone else just gets dumped straight to voicemail or rejected.

Continue reading

Switching Voice Notifications To Ivona

ivonaI had long used the unofficial Google speech API for voice notifications (TTS) as it has a very good, clear voice, much better than Festival which I had used previously. However late one night a couple of months ago this stopped working as Google started to redirect it to a captcha if you tried access it directly. That’s fair enough I suppose, it’s their service to do with what they like and it was never even advertised as a publicly available API for this purpose so all of us who were using it were on a free ride. I’m sure there will be ways around this but it got me looking at alternatives again.

This lead me to Ivona which is a speech synthesis system originally developed by a Polish company but is now owned by Amazon. Using their beta Speech Cloud service you can get a free account for “development purposes” which allows you to make 50,000 requests per month. I don’t know about you but that is more than enough for me.

Continue reading