
#Node red alarm update
Select Update when complete.Įnter an OAS Tag as the Topic and select a parsed JSON object as the output. You can add a Client ID or leave it blank to auto generate an ID. In the server properties box, enter the OAS MQTT Broker Name and IP address. Select Add new mqtt-broker from the Server dropdown and then click the pencil icon next to it. To write data to the MQTT Broker pull an MQTT Out icon out onto the flow.ĭouble-click the MQTT In or MQTT Out node to bring up the properties window.
#Node red alarm android
If you ever wanted to trigger a home automation event before your alarm goes off, this is the way to do this Simply set the alarm on your Android mobile phone and you will have the alarm data available on your server. To read data from the OAS MQTT broker pull an MQTT In icon out onto the flow. Android Alarm Sync in NodeRED Now you can sync Android alarms with NodeRED. Open the Node Red Editor and start a new flow. Set up the OAS MQTT Broker: /data-destinations/mqtt-broker/mqtt-broker/.

set ( ' cachedItems ', cachedItems ) // Send notifications as a stream messages. get ( ' service ' ) const messages = let type = '' if ( ! msg. get ( ' defaults ' ) const service = env. I use the "Setup" tab of the function node to set some defaults which are used in the flow:Ĭonst defaults = flow.


Let's start with the "Parse alarms & timers" function node which does all the heavy lifting. Send the messages to the Call service node.For every inactive item make a clear_notification message.For every active item create/update a notification message.Cache the active items (with type and sensor info) in memory.Determine if it is an alarm or timer sensor.The bottom flow handles cleared notifications. In the end result I wanted to have just 1 sublfow which would control everything, having multiple alarm and timer sensors as input. Which I then finetune and often convert to a reusable subflow.
#Node red alarm trial
What you see next is the end result of some trial and error programming, usually I start with just 1 sensor input and a normal flow.
#Node red alarm code
It's often described as a low code solution, as a developer I like the option to apply code logic as well. I use Node-RED for all my automations, I like the way it visualizes the flows. If they are deleted on the google device the notification should be removed.When I dismiss a notification the alarm / timer should be deleted.When they ring the notification should show this.Let them countdown to the time they fire.Show alarms and timers as notifications on my phone.I wondered if I could use it for some new automations which would add more functionality for me, especially have them as notifications on my phone. I installed it via HACS and it works really nice, the sensor entities for alarms and timers are created per device. Home Assistant Google Home custom component This week I discovered a new community integration called "Google Home" which exposes the alarms and timers as sensors in HA. When the device rings and I'm not in the same room I won't notice the alarm / timer ringing.They work fine, but I'm missing some functionality to make them awesome. The alarm and timer functions on the devices are the most frequent used by me, I use them every day.

Paired with Home Assistant and Node-RED I use them to control every device and automation flow. I'm a big fan of the Google(Nest) smart devices and have multiple Hub and Mini devices in my smart home setup. The notifications show all information, they are grouped and have a countdown. Using Home Assistant and Node-RED I receive actionable notifications on my android phone for Google Home alarms and timers.
