HomeHome AutomationMarvelous notifications - Putting ESP8266 Jarvis into toy Ironman

Marvelous notifications – Putting ESP8266 Jarvis into toy Ironman

It's a mini Jarvis!

I was looking at my shelf the other day and I noticed an Ironman figurine given to me by a friend. Initially, I was only going to paint it, so it would look more pretty, but upon closer examination, I thought I could make a little more interactive. With that said – meet Ironman – the rock star of Marvelous Notifications!

The Marvelous Notifications

The idea is to make an IoT device which will blink the LED over the Internet. This way I can visualise any notification or data. Here are proposed uses:

  • monitor http://notenoughtech.com website
  • flash when a phone notification is received
  • flash when a doorbell is pressed
  • flash when the Amazon Dash button is used
  • more

There is enough space inside to fit an ESP-01 and an RGB LED (WS2812b) – the same LEDs I used in my Automated Staircase project. A couple of minutes later, the Ironman’s head was open. There was no sign of Jarvis. The ESP-01 may not have the Jarvis computing power, but it is enough to drive a single LED even without 5V logic.

The breadboard test was a success, so it was time to paint the shell. I appreciate the gold colour, but I can do so much better than this with my art degree! See? All these years at the university won’t go to waste! I have a 10 min timelapse of that. The entire process took about 3h! I used just regular acrylic paints and varnish to improve the looks.

The Hardware

The hardware is pretty simple:

If you want to learn how to connect and flash ESP8266 – I have you covered! Read this guide to learn more. I also used my DIY flash adapter to make the process much quicker.

Because I was short on space inside the Ironman, I glued the LED to the ESP8266. I also shortened the CH-EN and VCC, so I only have to use one cable to power it on. The plan is to power it all of a USB.

The USB has 5V which is too much for the ESP8266-01 board, and this is where inline 5V to 3.3V step-down module comes in. That’s the complete hardware.

The Software

I wrote a specific library to drive the WS2812b LED via MQTT protocol. In short, I use the MQTT pubsubclient to send a string containing the following information:

Format: (num:red:green:blue:LedON:LedOFF:Brightness:loop)

num:        int 0-255  // number of blinks
red:        int 0-255  // red channel (use color picker)
green:      int 0-255  // green channel (use color picker)
blue:       int 0-255  // blue channel (use color picker)
LedOn/Off:  int mills 100 - 1000 // LED and break timings
Brightness: int 0-255  // LED brightness
loop:       int 0,1,2  // mode (count/constant blinking/clear)

Based on this key a sample message like this:

3:15:96:226:1000:300:255:0

Would translate to 3 Blue 1 sec blinks every 300 ms at the full brightness. Now that I have the firmware ready, it’s time to take care of the notifications. I created a flow in NodeRED (tutorial to NodeRED) to test the setup. It’s simple for now, but I will add the notification bit later.

Ironman notifications – interfacing with other systems

It’s time to make my IoT Ironman usable! The default way of sending the configuration string will be via HTTP POST. I added the nodes. I will assume that the incoming string is already configured.

I mentioned, that I want to monitor my website. I can ping my server every X seconds and compose a configuration string to send single flashing green light

1:15:224:99:200:100:254:0

When the website ping is below 1000ms or continuous blinking red when the website is down or it is taking over 1sec to get the ping back:

2:224:15:15:200:100:254:2

And this is how you can monitor the website with Ironman. Let’s talk about mobile notifications next.

Mobile Notifications

Obviously to capture messages and notifications I’m going to use Tasker and AutoNotification plugin. Each time I receive a message of a certain type – let’s do WhatsApp and SMS – I want the Ironman to blink x times in y colour.

For WhatsApp I’m going to blink LED 6 times, set the colour to green

led=6:15:224:99:600:100:254:0

For SMS I want  LED to turn blue and blink 10 times

led-10:15:96:226:1000:300:254:0

When I receive the appropriate notification on my phone, Tasker will check what was the notifying app and will send the correct HTTP POST with one of the strings above.

TASKER PROFILE - Ironman Intercept
Profile: Iron Man Intercept 
	Event: AutoNotification Intercept [ Configuration:Event Behaviour: true
	Has Reply Action: true
	Notification Apps: WhatsApp,Messages ]
	Enter: IronMan Notify
	
	A1: HTTP Post [ Server:Port:%HTTPuser:%HTTPpass@%NODEREDIP 
		Path:/ironman/notifications/ 
		Data / File:led=6:15:224:99:600:100:254:0 
		Cookies: User Agent: Timeout:10 
		Content Type:application/x-www-form-urlencoded 
		Output File: Trust Any Certificate:On ] 
			If [ %anapp ~ WhatsApp ]
	
	A2: HTTP Post [ Server:Port:%HTTPuser:%HTTPpass@%NODEREDIP 
		Path:/ironman/notifications/ Data / File:led=10:15:96:226:1000:300:254:0 
		Cookies: User Agent: Timeout:10 
		Content Type:application/x-www-form-urlencoded 
		Output File: Trust Any Certificate:On ] 
			If [ %anapp ~ Messages ]

The Tasker task is simple and it will select the correctly formatted post based on the IF statement checked against the AutoNotification’s %anapp (contains the app name)

Conclusion

I love this project, as at heart, this is a very simple idea. By giving it an Ironman spin, it’s fun, and it gives the entire project extra depth. You can transform many toys like this. You can make the parts move, you can add more LEDs, whatever you like!

It’s all about making it personal and special. I hope you will come up with your own ideas and upcycle toys or items you still care for.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

0
To server or not to server? That's a very silly question!

Best Automation Projects

Tuya SDK for beginners: Intro to Tuya Cloud API

0
Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

NEST your old thermostat under $5

0
Nest-ing up your older thermostat under $5

Sonoff Zigbee Bridge – review

0
Sonoff line up will soon include Sonoff Zigbee Bridge and more Zigbee sensors - here is the first look

DIY Smart Washing Machine – for about 15 bucks!

0
Learn how to add washing machine notifications to your Google Home on the cheap

Nora – Google Assistant in NodeRED

0
Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

Smart Home

I damaged the cheapest Smart Socket with power metering for you

0
Sonoff S60 has an exeptional price for a smart socket with a power meter - I decided to check it out and see how flashable it is

The end of Tasmota? Sonoff SwitchMan M5 Matter

0
These are one of the least expensive Matter devices to automate your lights. Will Sonoff SwitchMan M5 Matter put an end to Tasmota?

Meros TRV to the rescue?

0
I got my hands on another TRV - this time from Meross. I heard good things about the brand so I wanted to see if Meross TRV would be good to manage smart heating.

Aqara brings Thread sensors but…

0
Aqara brings new Thread sensors to their ecosystem. First sensors to support Matter this way are Aqara Motion and Light Sensor P2 and Aqara Contact Sensor P2

Multi-lights for your ceiling from Aqara

0
This is the biggest light I held in my hands so far. It's ZigBee and it comes from Aqara - meet Aqara Ceiling Light T1M