This post will show you how to use home automation to autoplay shows on a Roku throughout the night. On a variety of apps (i.e., Hulu, Netflix, Amazon) you can only stream a limited number of episodes before the app checks if “you’re still watching”.
Following the Node Red Project Guide allows you to backup your flows in git projects. This is a great feature for adding revision control to your projects. In this article, I will expand on the project guide and show you how to set up link your projects to a remote repository.
First, this article assumes that you have an account on a git revision control system (i.e., github or gitlab). Next, it assumes you know how to create projects and add SSH keys to your account profile.
Start by creating an empty project in your git revision control system. Next locate the ssh url for your newly created project.
Now, in the Node Red, select the Hamburger icon on the upper right and then select Project->Project Settings. Once again select the Project tab.
Click on the “add remote” button and add the ssh url for your project. Confirm that the url now appears in the Git remotes list.
Generating SSH Keys
The next step is to generate a SSH keys and adding the public key to your git revision control system account.
Once again, in Node Red, select the hamburger icon and then select the “Settings” menu item. Then, select the “Git config” tab.
Now let’s click on “add key”.
Give your key a friendly name and then click Generate key and a public key will be generated.
Copy the public key and then add it to your git revision control system account. Make sure to keep it secret. Don’t worry about me, I only generated this key as an example :).
Pushing Changes to Your Remote Repository
One area I find lacking in the user interface is the ability to Push or Pull changes from a remote repository. Currently the only available is to manually push or pull from the command line.
Projects are stored in your Node Red configuration directory under the ./project folder.
Open a terminal and navigate to the directory. Issue the following command to link the local git project to the remote repository and upload the project.
git push --set-upstream origin master
This should push all the changes from the local project to the remote repository.
Going forward you can utilize the Node Red user interface to commit changes to the local repository. However when you want to push or pull changes from the remote repository, you will need to use the command line.
This post showed you how to set up a remote repository and push / pull project changes. It would be great if the developers could add this feature directly to the Node Red user interface. If you’re in agreement, let the developers know.
Right now selecting an action does nothing. Let’s change that.
If you hadn’t noticed, selecting an action causes the notification to disappear. Behind the scenes, an event transmits to Home Assistant with action information. Listening to the event is the first step in doing something with it.
In Home Assistant, select the “Events” tab from “Developers Tools”. Scroll all the way to the bottom of the page and locate the “Listen to events” pane.
In the “Event to subscribe to” enter “mobile_app_notification_action” to listen to events from the Android application. Finally, click “Start Listening”. Send the example notification to your phone and select an action to see the corresponding event.
In the example above, the “action” key indicates the selected action.
In my updated “Node Red” example, I added an “events: all” node.
I configured the node as follows:
I have a “debug node” on the output of the “events: all” node, with this I can see the event in the debug panel.
The “payload.event.action” key indicates which action was. In my next post, we’ll take it to the next level and start controlling things around the house.
I’m always looking for ways to make my Smart Home experience more interactive. I recently came across “Actionable Notifications“. In this post, I will show you how to use them to interact with “Home Assistant” from your Android devices.
Android Actionable Notifications
An actionable notification is an interactive “Push Notification”. For instance, Using Home Assistant, you can create custom notifications with “buttons” that can be selected on you smart device to interact with your home.
Now, I found very little information on how to set up actionable notifications for Android devices and I’m hoping the information helps you out.
In the Home Assistant web interface, select the “Services” tab under “Developer Tools”. Enter “notify.mobile_app_” and select the service corresponding to your android device. In the image below, the device name is “sm_g973u”.
Paste the “yaml” snippet below into the “Service Data” field, and then click on the “Call Service Button”.
message: This is a test message
- action: action_1
title: Action 1
- action: action_2
title: Action 2
- action: action_3
title: Action 3
If everything went well, the notification should appear on your device. If you don’t see the actions, try expanding the notification.
Using Node Red
We’ll start by setting up the following sequence in Node Red using a “Call Service” node.
Next, configure the “Call Service” node.
The most important configurations are the “Domain”, “Service” and data field.