Tag Archives: Sonoff SC and UK Mains Control via MQTT

Today I got a couple of new(ish) gadgets from Sonoff – one being a UK version of their WIFI mains adaptor. So the point of this if you don’t know Sonoff is that their stuff is solid and inexpensive – not two words you normally find in the same sentence. The mains adaptor is absolutely solid – and when it powers on it has a nice coloured ring light to let you know it is working. Sonoff have their own software for this but as it is ESP8266-based I usually put my own in or use Arendst’s Sonoff-MQTT-OTA-Arduino software – which up to now is proving reliable and has one advantage over my own – it is smaller and fits into the Sonoff devices without replacing the FLASH (well, it has two advantages – it supports the Amazon Echo – but as I use HA-Bridge to do that, the subject is moot).

So – I opened the unit up and Sonoff have even now kindly put labelling on the 4-hole connector inside for programming – very nice of them.

What can I say, it worked first time, I can fire off MQTT commands to turn the thing on and off and can override that with the button on the front. Most other similar products I’ve seen are either proprietary, expensive or generally naff – this is GOOD and no secrets – you can get diagrams, change software and it works well. Like the other Sonoff mains control boxes, good product – good price ($12.86 plus whatever post to get to your location – but even then – compare that to B&Q rip-offs). Lovely.

And with that, I’ll move onto the Sonoff SC – the unit you see on the right. No it is not a loudspeaker. To quote the company - Sonoff SC is an ESP8266 based WiFi environmental monitor device. It detects current temperature, humidity, light intensity, air quality, and even sound levels, and directly send realtime data to iOS/Android APP EWeLink

And yes, I believe there is some source out there but this one is likely to be a little more difficult to DIY as it contains both an ESP8266 and an Atmel 328 – no doubt for two things that need A/D where the ESP8266 has only one analog input. So this gadget contains a SHARP Dust sensor, a DHT11 (I know, the crappy one) temperature and humidity sensor, a light sensor (a simple ORP-12) and a microphone – so it is a test-everything unit. It runs off 5v.

So we ran it up this afternoon – there’s a nice phone app and it only takes 5 minutes to setup – I’m trying to think where you would use this – maybe in an old-folks home you were running just to keep an eye on everything?

For me it fails in that there’s no MQTT connection so unless you use their App the use is limited but they DO claim it is “hacker friendly” so when someone goes to the bother of making a complete replacement software – with MQTT and the option to replace the hated DHT-11 with a marginally more expensive DHT-22 – I may just take more of an interest.

The thing is you have light sensing in the range of “dusky, normal and bright” – I’m not sure what use that is – had they made this more than $19 they could have used one of those little light sensors that gives exact LUX out for visible and also measures humidity and temperature accurately.

As it is they’ve used an ORP-12 device which is a bit basic. Still – if I made a super-duper one and had a 3d printed case made, it would look like something out of Dr Who so hats off to them for making this at a price in a sensible case. It is almost worth getting one for the case to then gut it and do your own thing! Recently in the blog we’ve covered all of these sensor scenarios except for the dust sensing and there’s plenty of doc on that. Worth a second glance.

Depending on the device you are using you can click on any of these images to get larger ones.

Update 12/JAN/2017: Reader Jayhttp://tinkerman.cat/sonoff-sc-with-mqtt-and-domoticz-support/ pointed me to this link which gives the oppotunity to replace the lacklustre DHT11 with a DHT22 on the Sonoff SC and to upgrade the software - nicely written article. And secondly - just to say I now have three of the mains UK sockets in full time use and not a hitch - they work perfectly using this software (latest version as of a couple of weeks ago - but note at the time of writing he's just today updated the software again).

Welcome to the Blog

Hi - I'm Pete and this is my technology blog. It is BIG. It is also the home of "ESP-GO". "The Script", Node-Red-Contrib-Bigtimer and many other useful toys. Use the search box below or check out the archives and other links below - be sure to SHARE what you like using the social media buttons and please subscribe to my YouTube channel http://www.youtube.com/PeterScargill

Please register or log in - the top menu changes a lot when you are part of the party... and once in, don't forget to tick the box so you will get email follow-ups to comments.

If you want to buy me a coffee or help fuel my gadget habit, use the Paypal donate link below.

Disclaimer: Because I have no idea of your level of technical skill or the requirements of your country laws in terms of electricity supply etc., I accept no responsibility for any damage caused through following advice in these pages. When dealing with mains voltages you should satisfy yourself that whatever you are doing is safe and if unsure, seek advice from someone who is sure.

Notice: I'm always happy to offer advice on stuff I've written - and indeed take advice. If I can help in any way just let me know but PLEASE don't ask me how to program in C/PASCAL/NODE/etc. There are many resources out there - if you want to program and can't - there's always Google.

Search for:

Email Newsletter

Enter a name and your real email address if you would like to receive occasional summary emails - sorry but invalid-looking or automated names and email addresses will be removed to help protect others.

Links

EE Times | Electronic Engineering TimesEE Times connects the global electronics community through news, analysis, education, and peer-to-peer discussion around technology, business, products and design