Let’s setup some notifications so we can spend more time on rides!
Theme Park Alerts
Overview
With the Theme Parks HACS integration for Home Assistant, we can easily integrate theme park data into any Home Assistant instance using the ThemeParks.wiki API. This project takes that data and creates a custom ride wait time notification system that will notify you about which of your favorite rides have a low wait. Each ride can be enabled and disabled at any point, and the wait time threshold can be configured for each ride individually! The system sends a rollup alert every 30 minutes during park hours and can also be triggered via a chat command for on demand updates!
Home Assistant
Setting up the Theme Parks Add On
The first step is to add the theme parks integration into Home Assistant. This integration is a HACS add on, so if you do not have HACS installed yet, check out Install HACS. Next, we will need to add the add on as a custom repository. To do this head to http://homeassistant.local/hacs/integrations and click the menu button at the top right to add custom repositories. Paste in the URL from the overview, click add, and restart Home Assistant to finish the installation process.
Finally, after Home Assistant finishes restarting head to the integrations page and add the theme park you are interested in monitoring. We will use Walt Disney World as an example.
Setting up Helpers
After adding the Walt Disney World integration, each ride has a sensor entity that displays the current wait time. In order to create ride alerts, we will need two helper objects for each ride we want to track.
Example for Avatar: Flight of Passage
Name | Type | Description |
---|---|---|
sensor.avatar_flight_of_passage_walt_disney_world_r_resort | Sensor | This is how the theme park integration stores ride wait time information and should show up automatically after you select a theme park. |
input_boolean.ride_alerts_avatar_flight_of_passage_notification | Input Boolean | This helper will be used to determine whether or not we want to receive ride alerts for this ride. This must match the ride sensor name and end with _notification for the flow later. |
binary_sensor.ride_alerts_avatar_flight_of_passage_wait_time | Threshold | This helper will be used to determine how low of a wait we want to alert on for this ride. This must match the ride sensor name and end with _wait_time for the flow later. |
After you have created two helpers for each ride and confirmed they are named based on the above naming standard, you can move on to the next step.
Other Useful Helpers/Objects
Alert Group
It may make sense to create a group for the input booleans based on each park to easily turn on and off alerts based on your itinerary. To do that, add the following to your Home Assistant Configuration:
---
animal_kingdom_ride_alerts:
name: Ride Alerts - Animal Kingdom
- platform: group
entities:
- input_boolean.ride_alerts_avatar_flight_of_passage_notification
- input_boolean.ride_alerts_expedition_everest_legend_of_the_forbidden_mountain_notification
- input_boolean.ride_alerts_kilimanjaro_safaris_notification
Average Wait Time
You can also create a helper that takes the average of all the wait times in a park, that way you know which park is busiest.
Setting up the Dashboard
Next, we will setup the dashboard in Home Assistant that will be used to control what rides we want to alert on while we are in the park. I wanted the ability to be able to configure both which rides are alerting and how long we were willing to wait without needing a laptop to update any code. Below is an example of dashboard that has 3 rides, a group toggle, and the average wait time between all three rides.
square: false
columns: 1
type: grid
cards:
- type: custom:mushroom-title-card
title: Ride Alerts
subtitle: Animal Kingdom
- type: custom:mushroom-entity-card
entity: sensor.animal_kingdom_average_wait_time
icon: mdi:account-clock
layout: vertical
fill_container: false
- type: custom:mushroom-entity-card
entity: group.animal_kingdom_ride_alerts
layout: vertical
icon: mdi:toggle-switch
- type: custom:mushroom-entity-card
entity: sensor.avatar_flight_of_passage_walt_disney_world_r_resort
secondary_info: state
icon_type: none
fill_container: false
layout: vertical
- square: false
columns: 2
type: grid
cards:
- type: custom:mushroom-entity-card
entity: input_boolean.ride_alerts_avatar_flight_of_passage_notification
name: Notifications
fill_container: false
layout: vertical
- type: custom:mushroom-entity-card
entity: binary_sensor.ride_alerts_avatar_flight_of_passage_wait_time
name: Short Wait!
layout: vertical
- type: custom:mushroom-entity-card
entity: >-
sensor.expedition_everest_legend_of_the_forbidden_mountain_walt_disney_world_r_resort
primary_info: name
secondary_info: state
icon_type: none
fill_container: false
layout: vertical
- square: false
columns: 2
type: grid
cards:
- type: custom:mushroom-entity-card
entity: >-
input_boolean.ride_alerts_expedition_everest_legend_of_the_forbidden_mountain_notification
name: Notifications
fill_container: false
layout: vertical
- type: custom:mushroom-entity-card
entity: >-
binary_sensor.ride_alerts_expedition_everest_legend_of_the_forbidden_mountain_wait_time
name: Short Wait!
layout: vertical
- type: custom:mushroom-entity-card
entity: sensor.kilimanjaro_safaris_walt_disney_world_r_resort
primary_info: name
secondary_info: state
icon_type: none
fill_container: false
layout: vertical
- square: false
columns: 2
type: grid
cards:
- type: custom:mushroom-entity-card
entity: input_boolean.ride_alerts_kilimanjaro_safaris_notification
name: Notifications
fill_container: false
layout: vertical
- type: custom:mushroom-entity-card
entity: binary_sensor.ride_alerts_kilimanjaro_safaris_wait_time
name: Short Wait!
layout: vertical
Node Red
Below is the Node Red automation that will be used to determine which rides are currently alerting and will roll that information up into a single message with each ride and the current wait time.
Step | Node Type | Description | Configuration |
---|---|---|---|
Trigger | Inject OR Incoming Webhook | This flow is triggered every 30 minutes via an inject node. It can also be triggered by webhook. | |
Reset Alerts | Change | This node resets all of the flow variables. | |
Get Active Ride Alerts | Get Entities | This node will get all the rides that have their input boolean helper set to on and store it in a flow array called rides. | |
Get Count of Active Ride Alerts | Get Entities | This node will get the number of rides to enumerate. | |
Set Number of Rides | Change | This node will store the number of rides to enumerate in a flow variable ride_count. | |
For Each Ride | msg-resend | This node will iterate through each ride to check one at a time. | |
Set Counter | Change | This node will store the current count in the loop called ride_counter. | |
Get Ride | Array Iterator | This node will get current ride out of the rides array. | |
Extract Entity ID | Change | This node will get the entity id of the input boolean helper for the ride. | |
Set Current Ride | Change | This node will store the entity id in a flow variable called current_ride. | |
Normalize | Change | This node will store the name of the ride in a readable format in a flow variable called current_ride_normalized. | |
Find Wait Time | Change | This node will take the value in flow.current_ride and use our naming standard above to convert it to the sensor object for the ride. It will be stored in current_ride_wait_entity. | |
Query HA | Get Entities | This node will query Home Assistant to find the current wait time for the ride and store it in. | |
Set Current Wait | Change | This node stores the current wait in current_ride_wait. | |
Find Ride Alert Status | Change | This node uses the naming standard to store the name of the threshold helper in current_ride_wait_threshold_entity. | |
Query HA | Get Entities | This node will query Home Assistant to get the state of the threshold sensor for the ride. | |
Set Current Alert Status | Change | This node will store the result of the previous query in current_ride_in_alert. | |
If Over Threshold | Change | This node will check to see if the ride has a short wait (if threshold sensor is on). | |
Add to Ride Alerts | Function | This node will append the ride to a flow variable for the notification. |
var current_alerts = flow.get("ride_alerts");
var current_ride = " * " + flow.get("current_ride_normalized");
var current_wait = flow.get("current_ride_wait");
var ride_status = current_ride.concat(": ", current_wait + " minutes");
var new_alerts = current_alerts.concat(" ", ride_status + "\n");
flow.set("ride_alerts", new_alerts);
msg.payload = flow.get("ride_alerts");
return msg;
|
Exit | Change | This node will detect the end of the loop. | |
If Alerts | Change | This node will check to see if any rides are in an alert status. | |
Get Ride Alerts | Template | This node will create the message that will be used for the notification. |
RocketChat
Every 30 minutes the flow is configured to send a notification to a Rocket Chat channel. This can easily be swapped out for Slack, Discord, Mattermost, or Teams. It may also make sense to add a webhook that can be used to trigger the automation on demand. In this example, the automation will be triggered any time that the word “rides” is posted in the channel.