HomeHome AutomationTasker and NodeRED - Streamlining notification system

Tasker and NodeRED – Streamlining notification system

Making uncomplicated, complicated again!

From the previous write up we know I can use Tasker and NodeRED together. I want to have a very efficient and easy way of sending the notifications to my phone. Instead of creating a single notification and a flow for each project I decided to spend a little more time to unify all the notifications.

New AutoNotifications

To display a dynamic notification I have to assign variables to the AutoNotification action. The message sent by AutoRemote is a string that can be split into a prefix and command. I will start to issue new notification using the following key:

source=:=type=:=message_id=:=notification_details=:=extra

Before any notification to my phone is issued via AutoRemote all fields have to be configured. This way the notification will contain all the information which I can use to update or create a new notification. I can use this also to issue commands.

The picture above should explain how the values are assigned.  A little more information about each section:

  • source – who is issuing the command  (%arpar) which also is the trigger for the Tasker profile(I can assign sender to trigger different profiles – currently set to node/alexa)
  • type – I have two types (not/com) – not – is issuing a notification to be displayed on my phone, com is a command to execute without a notification appearing.
  • message_id – I’m setting this manually as it will give me a choice to update an existing notification or create a new one if the id is different
  • notification_details – contains the info in the following order: title=:=text=:=icon this way I can customise all the notification details.
  • extra – anything else I would like to use – is added to the end of the string

NodeRED subflow

Instead of creating a complicated flow each time I want to send a message, I spent a little more time to create a flow which would compose the message according to your requirements then issue it to the correct device.

To send the AR message I’m still using the HTTP POST node but this time the URL is composed this way:

https://autoremotejoaomgcd.appspot.com/sendmessage?key={{{arkey}}}&message={{{source}}}=:={{{type}}}=:={{{msg_id}}}=:={{{payload}}}
  • arkey – stored in mgs.arkey  – keeps the AR Key for a target device
  • source – stored in mgs.source – keeps the info about the source of the command
  • type – stored in mgs.type – has not or com value
  • mgs_id – stored in mgs.mgs_id – has unique ID for AutoNotification
  • payload – the actual payload mgs.payload from the flow. Contains the info about the notification.

Before I  can use this subflow I have to pass additional arguments either directly from a flow or from a specially designed change node. Depending on arguments submitted to the flow, input goes through switch node which selects the correct values and the change node enters it into the HTTP POST node.I will link the subflow for you, beware you will have to edit it to your preference.

Tasker AutoNotification profile

To receive the notification correctly I need a profile that will respond to the AR command and either execute the command or display a notification. The AutoNotification action has all the important fields filled in with AR variables.

TASKER PROFILE - NodeRED Notifications
Profile: NodeRED Notifications
	Event: AutoRemote [ Configuration:node ]
Enter: Alexa notification 
	A1: Anchor 
		
	A2: If [ %arcomm1 ~ not ]
	A3: AutoNotification [ Configuration:Title: %arcomm3
		Text: %arcomm4
		Icon: /storage/emulated/0/Tasker/icons/random_icons/ic_blur.png
		Status Bar Icon: ic_launcher
		Status Bar Icon Manual: /storage/emulated/0/Tasker/icons/random_icons/ic_blur_radial.png
		Status Bar Text Size: 16
		Id: %arcomm2
		Title Expanded: %arcomm3
		Text Expanded: %arcomm4 Timeout (Seconds):20 ] 
	A4: End If 
		Command actions go here
	A5: If [ %arcomm1 ~ com ]
	A6: End If 

As you can see, I’m using the value from %arcomm1 to display a notification or action a command. I could simply assign – perform a task action based on the value of the other fields if %arcomm1 is set to ‘com’. In the next tutorial, I will show you how I integrated this with the ‘Alexa, wake up my computer’  showcase.

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

Nora – Google Assistant in NodeRED

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

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

Smart Home

We’ve seen this before: SwitchBot K10+ PRO

0
This is an odd one. Building on the success of SwitchBot K10+ they released SwitchBot K10+ PRO - but is the experience actually better?

Is this the smart panel we have waited for?

0
ITEAD has released a new smart panel: Sonoff NSPanel Pro 120 - have they learned the lesson from the terrible launch of the original Pro? Let's see what's new.

Aqara FP1E detects motionless humans

0
This isn't exactly a new device, it's an interaction of the original Aqara presence sensor. Aqara FP1E brings Matter, ZigBee and new triggers to your smart home

SwitchBot S10: cleaning re-imagined!

0
SwitchBot S10 promises unattended vacuuming and mopping so you can focus on things you love and care for. Does it deliver?

Sonoff for households and gardens

0
ITEAD released two ZigBee devices to manage water in your household and gardens. Now you can monitor the flow and dispense water with Sonoff SWV and prevent water damage using the Sonoff Water Leak sensor with a twist.