Whilst I await delivery of more WS2812 LEDs, I wanted to start investigating how I can leverage the Alexa Gadget Toolkit integration, so that when I set a timer using Alexa, my LED clock can show the countdown.
I found an open source project called nixie-timer, which had an Alexa Integration and was written for the ESP32
After a few hours of digging around, I had a very basic idea of what the code was doing. I started by trying to replicate the flow using the OOB ESP-IDF.
After many, many, many hours, I realised that I really didn’t know what I was doing, so I went back to the nixie-timer code and added the btstack ESP32 port into my code. This meant I could at least follow the samples provided.
I began trying to run some code myself, but the Bluetooth radio wouldn’t even start. I then took one of the BTStack examples and used that as a starting point. At least they worked.
After more hours, I got the code running, with the occasional kernel panic as I figured stuff out..
Eventually, I got it responding to the Alexa queries and receiving the messages for wakeword, timeinfo and timer.
Exactly what I wanted to achieve. I’m not 100% sure I know what’s going on, but I’ll get more understanding over time.
For starters, I want to use timeinfo to set the internal clock and then I want to use the timer command to display the countdown of an alexa timer.
Now that I’ve moved back to ESP-IDF, I’m going to have to bin my existing Arduino code which powers the LED strip and look at how to make that work.
Happy with progress.
My other WS2812 strip arrived the other day, so I’ve got to look at cutting and connecting the two strips to form one long 180 LED strip. Then I get get a feel of the overall diameter and cut some MDF to house the damn thing.
In Part I, I covered the basics of controlling the LEDs. This covered the hands of the clock.
The second part of my investigation covers time and how to make the clock tick. The ESP 8266 I am using for this prototyping work doesn’t include a Real Time Clock, so I was required to add an external one.
With the module connected, I turned to the code. I’m using Arduino for this as it’s easy to prototype and there are lots of libraries!
This starts the clock. In reality, as the module I’m using is battery backed, this step should only be performed once, but I found that having a fixed “time” would make debugging the lights a little easier.
I plan to revisit this code to ensure that I grab the current time from the internet when required.
Using the time is achieved by reading it.
//get the time from the RTC
RtcDateTime currentTime = rtcObject.GetDateTime();
char str; //declare a string as an array of chars
//print the time for debugging.
sprintf(str, "%d/%d/%d %d:%d:%d",
currentTime.Year(), //get year method
currentTime.Month(), //get month method
currentTime.Day(), //get day method
currentTime.Hour(), //get hour method
currentTime.Minute(), //get minute method
currentTime.Second() //get second method
Each part of the time is available in a named method, so to get an idea of where my LEDs should be, I grabbed the hour, minute and second.
// Fetch the current time
hour = currentTime.Hour();
minute = currentTime.Minute() * 2;
second = currentTime.Second() * 2;
I multiply them as I’m using a strip with 120 LEDs on it.
Building on my LED control code, I make the clock tick by turning off LEDs in the right place.
I use multiple lights to make it more visible. With it now ticking, I hastily assembled the LED strip into a circle using cardboard and sellotape. I ran a length of alarm cable from the strip to the breadboard. To see it in action, I sellotaped it to the wall!
After letting it run for quite a while, I was surprised the hour “hand” hadn’t moved. It took my wife to point out that there aren’t 60 hours on a clock face 🤣
I’m pleased with these initial results.
As for my next steps, I’m not 100% sure. I’ve got to refine the “hands” code. I also need to think about how to mount it on the wall. I suspect it won’t be self contained and I’ll probably have a control box somewhere.
I’ve ordered another strip from the excellent Pimoroni and this will, I hope, let me add another 36 LEDs to the strip, taking it up to 180, which I think will give me a nice resolution.
I’ve got to think about power too. My estimate is that I’ll need around 3.5A to power the whole affair.
As part of the Den Automation range, they ship a 2 gang smart socket. It has the ability to be switched on remotely, to determine what’s plugged in and to even monitor the energy usage of the item plugged in.
I pre-ordered a few of these units as I saw them being used to turn my TVs off at the wall, rather than use their own standby. I currently achieve this using a few Sonoff Plugs flashed with Tasmota firmware. These are great, but are ugly as hell.
To get the ball rolling, I wanted to test out Den’s Smart Tag feature, the one that knows what is plugged in. I thought this best on a socket that is regularly used. For me, that’s one in my bedroom where my wife plugs in her hair dryer and hair straighteners. I thought this would be a good testing ground!
Installation was very simple. **** DON’T ATTEMPT THIS UNLESS YOUR CONFIDENT YOU KNOW WHAT YOU’RE DOING! REMEMBER TO ISOLATE EVERYTHING AT THE FUSE BOARD AND CHECK THE SOCKET IS DEAD BEFORE TAKING THE COVER OFF. GET A QUALIFIED ELECTRICIAN IF YOU HAVE ANY DOUBT ****
With the socket installed, I tested the manual operation to ensure everything was okay.
The pairing process starts the same as the switch. Hold the Den button for a few seconds until the light starts blinking and start the process in the app. It paired very quickly.
Once it was connected, it showed that two sockets individually. Tapping the little socket flicked the physical switch on and off. The sockets don’t have the same 45 second recharge time that the light switches have since these sockets have constant power. A limitation of the lack of neutral in UK light switches. Den still deserves credit for solving that in their light switches.
Once I’d finished this part, the app prompted me to add some smart tags.
The Den Socket comes with five Smart Tags. You can see this in my unboxing post.
I found my wife’s hair dryer and straighteners and popped a tag onto each plug.
I think plugged in one of them.
The part at the bottom is interesting – if the appliance is left on for a specified number of minutes, Den can turn it off automatically. They use hair straighteners as their example for this, so I turned it on, setting ten minutes.
I repeated the process for a hair dryer.
These two items then show up in the Appliance section of the app. It knows *where* it’s plugged in and when something is unplugged.
I haven’t tested the notify if left on feature yet, so I’ll post something when I get a chance to test that.
I was also disappointed to find out that the energy usage feature isn’t currently available. I would have expected them to include something pretty basic (current watt consumption or similar). I’ll update this post when they release that.
I have two more of these units to install. The next one goes onto the TV in the sitting room. I’m going to pair my Den Remote with those sockets, making it easier to control the TV.
I ordered four of these, to cover the rooms upstairs in my house. I’ll post the processing I went through to install one of the switches.
WARNING – CHANGING THESE SWITCHES REQUIRES EXPOSE TO MAINS VOLTAGE, WHICH IS EXTREMELY DANGEROUS. TAKE THE NECESSARY PRECAUTIONS. I AM NOT RESPONSIBLE FOR ANY INJURY THAT MAY RESULT. REMEMBER TO ISOLATE YOUR SWITCHES AT THE FUSE BOARD. IF IN DOUBT, GET AN ELECTRICIAN!
Having turned off the lights at the fuse board (see my stern warning above) I removed the face plate.
Den Switches require an earth connection to function (I’m guessing they use the voltage across live and earth to charge their capacitor, keeping the leaked current so low it doesn’t trip the RCD – clever sods!)
The Den switch has four inputs, Earth, Live, Switched Live 1 and Switched Live 2.
Den provide a small Earth cable that acts as an extensions, so I wired that into the backing box.
The backing box on my switches isn’t deep enough to accommodate the Den switch, so I had to use the provided spacer. I hung that over the wires.
I then connected it up and screwed it in place (using the longer screws provided by Den)
After restoring the power at the fuse board, I was able to turn the light on and off. Pretty useful to know that still worked 🙂
To pair the switch with the Hub, I launched the Den App and, under the settings part, opted to add a new light switch.
The installation process was quick and painless.
Unfortunately, after I’d installed mine and I was cleaning it down, I noticed it didn’t quite fit correctly:
I wrote to Den’s support email and, whilst it took two days to get an actual response, they dispatched a replacement which I received the next day. I swapped them out and the replacement was perfectly fine. I would have liked a faster reply from support, but they did resolve the issue without any question (I just included the above picture).
I swapped out four light switches upstairs, so I can now control all the bedroom lights.
One point of complaint that I still has is that one of the switches hasn’t updated its firmware yet. Three updated to the 1.3 firmware without any issues, but the forth is still stuck on the 1.1 firmware. I need to contact support about this.
The Den Smart Hub is the core component of Den’s smart home offering. You need to have one in order to use any of their other products.
The Hub is responsible for remote access and firmware upgrades. It’s worth noting that the Den products will operate *without* an internet connection (once initially setup). This is something that’s important to me. I find it really frustrating that an internet outage renders most smart home stuff useless. Den have addressed that and state the app etc. will work when on the same network as the Hub. I haven’t tried this out myself, but intend to.
I plugged my Hub in and connected the Ethernet cable to one of my Google WiFi units. For most users, I expect they’ll just plug the Hub directly into their WiFi router.
Of course, I immediately tried to pair and failed miserably.
I then read the letter that Den supplied with my order and there, they clearly state, that I should give it 10 minutes after plugging it in to update itself. So I made a cup of tea and sat at my table to drink it.
After scanning again, it found the Hub and asked me what room it was in. I just chose Kitchen as I was there and hit finish.
Simple as that. The process was simple. A small indicator within the app informing me of a firmware update might have been a useful and it’s something I’ve suggested to the Den team.
It’s been a long time in the making, but Den Automation finally started fulfilling their pre-orders earlier this month. I received my pre-ordered items, an order I placed in March 2018, last Monday. I’ve been looking forward to getting my hands on some Den gear since I first heard about the company in 2017. I love to dabble in home automation and the idea of a light switch that was a drop in replacement for a “dumb” light switch sparked joy!
I should point out that I’m an investor in Den Automation, holding a few shares that I bought through Seedrs.
So, what did I buy?
Smart Hub (required to control everything else)
Four One-Gang switches
One Double Gang socket
Den, as a thank you, threw in a remote too. That was a nice surprise.
The packaging looks nice and reminds me a little of Nest product packaging, with a nice sleeve surrounding the box.
The Smart Hub
The Smart Hub is the brains of the operation.
The hub itself was a little smaller than I expected. It was very light in weight. If I’m honest, it does feel a little cheap, but I’m only comparing that a Google WiFi unit that I had close at hand. That said, it didn’t feel flimsy and the connectors were solid when I plugged in the power and Ethernet cables. I was surprised that the power connector on the hub itself wasn’t USB. I was also surprised the Smart Hub required an Ethernet connection.
UPDATE: 28 Jan 2019 I’ve installed four light switches and they feel solid now that they are on the wall. After a few operations I couldn’t tell the difference. The Hub is also in position and I’ll hopefully never touch it again, so comments on its weight seem silly now.
The Smart Switch
This particular device was the reason I love Den’s concept. Smart WiFi switches are nothing new, but most are either touch based or require a neutral connection (like Sonoff’s offerings). I like the old fashioned rocker switch. Familiar and reliable. Lightwave RF have offered WiFi switches for a long time, but I’ve never taken to their push button design.
On lifting the switch out and flicking the rocker a few time, I have to admit I felt a little disappointed. The rocker lacked the weight I’m used to. I handed it to my wife and she agreed. Of course, it’s easy to criticise something like this and, weighting aside, we agreed to reserve final judgement until I’d installed them. Having something that can flick itself on and off is *never* going to as solid as something manual.
The spacing plate is provided in case the backing box isn’t deep enough. it was well packaged, being hidden under the insert. This meant it didn’t get in the way of the Switch itself and the box was opened.
I read some of Den Automation’s early tweets and the use of Earth is crucial to the operation of their light switches, so I’m glad the included some extra cabling.
The Smart Socket
I ordered a Smart Socket just to try it out. I currently use one Sonoff Smart Plug to controlling power to my TV. It’s used a lot (the standby on my ten year old telly draws more wattage than I’d care to admit). The sockets in my house are brushed steel downstairs, but the sockets behind my TV aren’t visible, so I think this is a natural place. It will mean I turn off both my Apple TV and the TV itself.
One of the things that Den have done in this space is something I personally find very clever. They have created a concept of Smart Tags. These little tags fit over a plug and can be used to identify an appliance or item.
I haven’t tested them out yet, but the idea is as following. You pair a tag with an appliance i.e. a hair dryer. When you plug it in, the socket *knows* what’s plugged in. The example Den give is around hair straighteners and a person leaving them plugged in and turned on. I think it’s innovative, but requires every socket in your house to be a Den Socket (I don’t know if they have a patent on this idea).
As a neat touch, Den also put a Smart Tag on the power supply for the Smart Hub. That made me smile!
As a gesture of goodwill, for the numerous delays in shipping, Den chucked in a free remote.
It seems to just be an on or off type deal, but I don’t know anything beyond that. I assume you can pair it to one or more sockets or switches in the Den App. Once I get everything setup, I’ll be sure to write more about it.
The packaging was nice and well presented, but the items themselves felt a little cheap. It’s hard to explain. I have put this feeling down to the type of plastic and how it feels. The weight of the items also feeds into that feeling too. I know it’s pointless to try and gauge quality by the weight or feel of something and I’ll reserve judgement until I’ve installed them and used them.
I’ll do another post on the setup once I get more time.
I’m happy to answer any questions you might have. I think it’s fantastic that a small UK startup are producing products like this and that they have finally shipping is a testament to their hard work and determination. I’ve played no part in the development of the product, nor do I personally know anyone involved, but I can appreciate the monumental effort required to deliver hardware and software, especially consumer facing.