Home Home Automation "Dinner time!!" button using Amazon Dash

“Dinner time!!” button using Amazon Dash

Hey all! It's dinner time!

The AmazonDash buttons have a very niche use. I have 10 of them at home, and I’m yet to order anything from Amazon using buttons. All caused by how easy is to link the buttons to NodeRED and use it for anything you want. After reading some questions, I decided to revisit the Doorbell project and put a little spin on it. I’m going to create “Dinner time!!” button using Amazon Dash.

Whether you want a WiFi Doorbell or a “Dinner is ready” button in the kitchen, the working principle remains the same. Once the button is pressed, a notification is issued to a device (or devices). You will know that someone is at the door, or that the dinner is ready and you should stop whatever fun thing you have been working on and head back to have some food.

I’m going to use Join app, and Join Node to deliver notifications to the Android devices (sorry Apple fans, but sucks to be you this time!). If you don’t have the Join app – it’s awesome! Be sure to check how to add AmazonDash to NodeRED before you continue.

To get the Join Node ready – follow this setup guide!

NodeRED setup

If you just want a barebone notification – all you need to do is to connect the Amazon Dash and limiter node to the fully configured Join Node. I said I will put a little twist on it. I want the button to announce the correct meal times. So the notifications will be as follows:

  • 7 am – 11 pm: breakfast time
  • 12 – 4 pm: lunch time
  • 5 pm 10 pm:  dinner time

Obviously, feel free to change these times or the number of meals. You should be able to do it on your own once you complete this tutorial.

To get the formatted time in NodeRED, we need to convert the UNIX time in seconds into something easy to recognise. Turns out, there is a node for that! Install the node moment:

cd ~/.node-red
sudo npm install node-red-contrib-moment

And we will have all the tools we need for this tutorial. Thanks to this node I will be able to receive the time (hours) which I’m going to use to select the correct message and icon formatting.

To get the access to hours, I have to set the moment node to deliver object output. I’m going to save it as msg.time.

Based on this property (msg.time.hour) switch node will direct the outcome to one of the three possible outputs. Each output has a change node setting the msg.meal and msg.url as follows

  1. 7-12 Breakfast (msg.meal = breakfast| msg.url = url_to_breakfasticon)
  2. 12-17 Lunch (msg.meal = Lunch | msg.url = url_to_lunchicon)
  3. 17-22 Dinner (msg.meal = Dinner| msg.url = url_to_dinnericon)

Then, a function node will put that information together and send it using a Join node to selected devices. If you want to send the Join to devices that do not belong to your account, you will need to send the deviceId instead of the names.

var url = msg.url;
msg.title = "Kitchen Alert!"
msg.text = "Time for a " + msg.meal;
msg.devices = "Pixel,Desktop";
msg.icon = url;
return msg;

Additionally, you can add a Google Notify node to announce the call for the meal over the Google Home. To do this, just pass the msg.text as a payload(see the video):

var x = msg.text;
msg.payload = x;
return msg;

And send over it to your Google Home. You can learn more about NodeRED and Google Home Notifications here.

If you have Join added as your Chrome browser, you will be able to receive the messages on computers too.

Conclusion

As you can see, the same setup can be used for any scenario where you want a button to issue a notification  to an Android device. This includes doorbells , panic alarms and more. Additionally, you could check if the device is present on the local network before sending out the request, as the messages would reach devices that are not currently home. There is very little sense in calling someone for a dinner if they are miles away right?

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 in style with crypto-currency

Smart Ideas with

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

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

ESP8266 WIFI lights under $5

0
Your Sonoff device can't do this!

Free wireless doorbell (Amazon Dash button hack)

0
The most terrifying situation I can imagine* is missing a parcel

New Amazon Dash Buttons

0
You can teach new buttons old tricks!

ESP8266 ceiling light – demo

0
Testing the ESP8266 as a WIFI light controller

Try Tasker and Raspberry Pi for your home automation needs!

0
Raspberry Pi can help you with your Tasker profiles

Smart Home

Awesome time with Wio Terminal

0
Wio Terminal from SeeedStudio is a great all-in-one development board that doesn't require soldering skills to get started with.

Flashing Tasmota on Sonoff ZigBee Bridge

0
How to flash Tasmota on Sonoff ZigBee Bridge to enable it for NodeRED and Home Assistant

Flashing Tasmota on Novostella smart bulb & floodlights

0
Flashing Tasmota on Tasmota on Novostella smart bulb & floodlights - it's quick simple and rewarding - here is how to use lights in NodeRED

Adding Sonoff sensors in Zigbee2MQTT and other systems

0
Can you use Sonoff sensors in Zigbee2MQTT and other ecosystems? Trying Tuya, Xiaomi, IKEA Tradfi and CC2531

Sonoff Zigbee sensors

0
I'm checking out Sonoff ZigBee sensors by ITEAD - what's the budget sensors like?