Building an Alexa-Powered Electric Blanket


One evening, my wife turned to me in bed and said, "Winter is coming..."

Well, what she actually said was "Get your frozen feet away from me, you cold-blooded monster!"

The only way to save our marriage? HOOK OUR BED UP TO THE INTERNET!

I couldn't find an electric blanket with IoT connectivity - so I built my own.

Why?

As a person with cold feet, I want to yell at my robot servant to pre-heat the bed, so that it is toasty warm by the time I've finished my evening ablutions.

The Blanket

The key was finding a blanket with dual-controls, which also could turn on from the plug socket. Lots of blankets have a separate control unit. I found this one which started heating as soon as it received power from the plug.

An electric blanket.

I'm sure there are many different models available. Choose whichever one suits your needs, but make sure it defaults to "on".

Cost: £70 from Amazon

The Plug

My side of the bed is controlled by a Meross smart plug. Pair of plug sockets.

Pretty simple. Plug in, use the app to configure the WiFi. Done. It can now be controlled by a smartphone.

Cost: £15 on Amazon

The Other Plug

I had a Sonoff S20 smart plug laying around. It's an older model - but still works.

A schematic of a smart plug.

Again, use the app to configure. Only takes a few minutes.

Cost: £10 on Amazon

Alexa

Configuring an Alexa for a smarthome used to be a pain - but it is much improved. Once the "Skills" are installed for your plug sockets, the individual smart things can be renamed and configured. Still takes a little bit of time, but fairly simple.

I've set up a group called "Electric Blanket". It contains both plugs. Electric blanket showing in Alexa's settings screen.

I've given a unique name to each side of the blanket.

Alexa settings screen showing Terry's bed and Liz's bed.

For some reason, Alexa thinks the Meross is a switch and the Sonoff is a plug. What's the difference? Who knows!

I can say "Alexa, switch on the electric blanket" or "switch on Liz's side of the bed." But that's about the limit.

Cost: £25 on Amazon

In Action

It works!

It doesn't quite work

There are some flaws in my plan.

Alexa doesn't recognise voices. So I can't say "Turn on my side of the bed" and my wife can't say "turn on his side of the bed." As I've said before, voice interfaces are like the command-line. There's no room for error.

Secondly, the electric blanket automatically shuts off after an hour - but the plug socket stays live. In order to turn on the blanket again, I need to turn it off first. There is no way to tell Alexa to switch on a socket for an hour and then switch it off. So there are two possible solutions:

  1. Set up a schedule in the plug's app to automatically turn off the plug at, say, 10 AM.
  2. Every time we want to use the blanket, tell Alexa to turn it off first.

Neither of those are particularly satisfactory.

There's also the minor risk that attackers could break through my firewall and burn down my house. WONTFIX.

Conclusion

For around £100 you can self-built an IoT heated blanket. It mostly works. This will save your marriage, 100% guaranteed.


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

7 thoughts on “Building an Alexa-Powered Electric Blanket”

  1. Alex says:

    Thanks, definitely a project I need to undertake.

    For the shutoff problem, could you modify the "turn on" command to turn it on with an hour timer so the plug control mirrors the blanket's underlying behaviour?

    Reply
  2. Tony says:

    IFTTT with timer to turn off (x) minutes after it's turned on. It'll always be ready for the next on command.

    Reply
  3. Nice idea for a project!

    I have opted to use Home Assistant (https://www.home-assistant.io) along with an alexa integration for most of my home automation. I am sure this would do most of what you want (assuming there is compatible support for your smart-switches). I can already think of a case where you could use Home Assistant to set a timer once you turn on the blanket that would turn it off after a pre-set amount of time.

    Reply
  4. Col. Panek says:

    I've not seen a blanket with 2 separate power feeds in the USA. Some hacking and rewiring would be needed on ours.

    Reply
    1. @edent says:

      Please do not rewire your electrics! That is a dangerous idea. Get a qualified electrician to do it - or find a reputable supplier of dual control blankets.

      Reply
  5. A belated comment to this post, but yes, I agree with Alexander about Home Assistant. I resisted for a while but have now become completely hooked.

    You can also re-flash all of the Sonoff devices with the excellent Tasmota Open Source firmware, which lets you do a variety of nice things with open standards (MQTT, HTTP) etc and also frees you from dependence on a Chinese web service. You would then need to make use of something like Home Assistant if you wanted to get Alexa integration back, though.

    Reply
  6. said on disabled.social:

    @Edent We have the same except no IoS cos resident geek has set up MQTT network and smartplugs and coded some interface stuff for it.

    We were early home automation adoptees due to me being deaf and an inaudible student house doorbell and it's just grown ever since, like these things do...

    Reply | Reply to original comment on disabled.social

What links here from around this blog?

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">