To operate the Merlin Prolift 230T garage door via Alexa and Siri Voice Commands as well as visally via a webpage app.
N.B. The operation of the webpages and for Siri Voice Commands depend on the use of VPN.
The relay features a highly versatile dry (potential-free) contact mode. By isolating the relay outputs from the line voltage, it allows you to control isolated circuits like garage doors, low-voltage garden lighting, and compatible central heating boilers. It connects to the Aqara M100 router via Zigbee.
How the Dry Contact Mode Works
Configuration: By default or by removing the red jumper wire connecting \(L-IN\) and \(L-OUT\) on the module, the T2 enters dry contact mode. This ensures that the module’s power source is completely isolated from the two output relays (\(L1\) and \(L2\)).
Switching: When a relay is triggered, it simply closes the circuit between the common (\(COM\)) and switched output (\(L1\) or \(L2\)), acting exactly like a standard physical button press without introducing external voltage.
Common Use Cases
Garage Doors: Many garage door openers require a dry contact button-press signal to open or close. By wiring the T2’s dry relay to your garage door’s wall button terminals, you can integrate it securely into your Apple Home, Google Home, or Amazon Alexa ecosystem.
L and N are connected to the 240 V mains, while LOUT and L1 are connected to the P/B and GND, as is the bell push button for the gaarage door.
1. Before activating the accessory, make sure that the Aqara Home app is downloaded (e.g. onto iPhone) and Aqara M100 hub is installed.
2. Open the app,"tap Home"and then tap"+"in the top right corner to enter"Add Device
(Accessory)"page. Select"Dual Relay Module T2", and add it according to instructions and renamed eg Garage
* If the connection fails, move the accessory closer to the Hub and try again.
To trigger a routine in Node-RED whenever a webpage is opened, use the ui-control (or ui_control) node from the Node-RED Dashboard or Dashboard 2.0 (FlowFuse). This node emits a message on its output port whenever a browser client connects or loads the UI.
Since I have more than a single Flow in Node Red on the Raspberry Pi Zero 2w, then the ui_control node must recognise its individual page in which it resides. The ui_control (Catch Page Open) node with its ui_base config node of My Dashboard [/dashbooard] is on a Flow page named GarageDoor. The ui_control node outputs Page/Tab Change events Only. The Switch (Is Garage Door Page?) node responds only to received outputs with the Property of msg.name equal to GarageDoor and triggers the Change (Set Type: single) node which clears the incoming msg.payload and sets the outgoing msg.payload.type to single. The mattergenericswitch (Up&Over)of @sammachin/node-red-matter-bridge is set as type Momentary Switch.
The ui-button (Manual Trigger Button) has its click event enabled and Payload string arbitrarily set as "single" not that it matters as its payload is cleared by the change node (Set Type: single). The colour of the switch is set by the link in node (Status MYGGBETT garage sets colour).
N.B.The mattercommand or matterwriteattr from @sammachin/node-red-matter-controller cannot be used to control the Aqara Dual Relay Module T2 device since it connects to the Aqara M100 relay via Zigbee and is not matter compatible, hence the need to use a virtual mattergenericswitch to contol the device within Alexa rather than directly from Node Red.
Flow Architecture & Configuration
Environment: Raspberry Pi Zero 2W running multiple Node-RED flows.
UI Base Configuration: Main dashboard path is set to My Dashboard [/dashbooard].
Flow Page: The logic resides entirely on the GarageDoor flow tab.
Requirements: Accessing only the Garage Door Page from the Dashboard menu should activate the mattergenericswitch Node (Up&Over) to trigger the Alexa routine up-over to set the Garage device to Power: On (the device setup in Aqara app) .
Node-by-Node Logic
ui_control Node (Catch Page Open):
Scope isolated to its own specific flow page.
Configured to output Page/Tab Change events Only.
Switch Node (Is Garage Door Page?):
Filters incoming messages.
Routes traffic only when msg.name equals GarageDoor.
Change Node (Set Type: single):
Clears the incoming msg.payload.
Sets the outgoing msg.payload.type to single.
mattergenericswitch Node (Up&Over):
Powered by the @sammachin/node-red-matter-bridge library.
Configured specifically as a Momentary Switch type.
Build a simple automated command to give Siri a script that maps your voice command directly to the http address.
Open the built-in Shortcuts app on your iPhone.
Tap the + (plus) icon in the top right corner to make a new shortcut.
Tap the Search Actions bar.
Type URL into the search bar.
Scroll down to the Actions section and select Get Contents of URL.
Tap the faint blue URL text field inside that action and type http://<YOUR_IP>:1880/garage-voice.
Now add the security key e.g. http://<YOUR_IP>:1880/garage-voice?key=MySecretGarageKey123!. The security key will be known only to Node Red and the iPhone.
Tap the small dropdown arrow at the very top of the screen and select Rename.
Change the Shortcut Name to the exact phrase you want to say out loud to Siri (like "garage door").
Close the app. Try triggering Siri by saying, "Hey Siri, [Your Shortcut Name]".
Flow Configuration Instructions
Node-RED Flow Configuration Instructions
Add the HTTP Endpoint
Drag an http in node onto your canvas.
Double-click it, set the Method to GET, and set the URL path to something unique, like /garage-voice.
Add the Security Gate
Drag a switch node onto the canvas and name it Secure Garage-Voice.
Set the Property field to msg.req.query.key.
Add two routing rules inside this node:
Rule 1: Set the dropdown to == (is equal to) and type your secret security key (e.g., MySecretGarageKey123!).
Rule 2: Click + add at the bottom and change the dropdown condition to otherwise (or else).
Wire the output of your http in node directly into the input of this switch node.
Configure the Success Path (Top Dot)
Wire the top output dot (Rule 1) of the switch node into your garage door activation trigger node (e.g., your Set Type: single change node).
Drag an http response node onto the canvas, double-click it, and set the Status code explicitly to 200.
Wire that same top output dot of the switch node straight into this 200 http response node. This tells your iPhone "Success!" instantly so Siri wraps up with "Done".
Configure the Blocked Path (Bottom Dot)
Drag a change node onto the canvas and name it Deny Access msg.
Configure its rule to Set msg.payload to the String value: Access Denied: Invalid Security Key.
Wire the bottom output dot (Rule 2) of the switch node into the input of this change node.
Drag a second http response node onto your canvas, name it Unauthorized, and set its Status code to 401.
Wire the output of the Deny Access msg change node straight into this 401 http response node to cleanly deflect intruders.
The advantage over the Original Method is:
Completely Silent: No browser pages will ever flash on your screen or clutter up Safari's history.
Instant: It triggers your Node-RED flow in milliseconds because it doesn't have to load any graphics, themes, or icons.
ORIGINAL iPhone Custom Voice Trigger
Rather than use the simple http call the rationale of the implementation was that the ui_control (Catch Page Open) would ensure that whenever Siri accessed and displayed the webpage it would result in a triggering of dashboard 2 ui-button (Up&Over). Inclusion of the Manual Trigger Button ensured that the webpage had something on it which would be displayed when accessed.
Displaying the webpage on audio command worked but the browser history could turn up in Safari when triggered from homescreen resulting in inadvertent operation of garage doors.
The original build was a simple automated command to give Siri a script that maps your voice command directly to the web address, bypassing the application directory search entirely.
Open the built-in Shortcuts app on the iPhone.
Tap the + (plus) icon in the top right corner to create a new shortcut.
Tap Add Action, search for Open URLs, and select it.
Tap the faint blue "URL" text field and type or paste the exact website address used by your web widget.
As using a local IP address type http:// directly before your numbers.
Tap the small dropdown arrow at the very top of the screen (next to "Open URLs") and select Rename.
Important: Change the name to the exact phrase you want to say out loud to Siri (e.g., "garage door").
Close the app. Try triggering Siri by saying, "Hey Siri, [Your Shortcut Name]".
To have Feedback of the Garage Door opening and closing status both visually on the iPhone when issuing a Siri command, and Audibly on the Amazon Echo when an Alexa command. The status should also be visually checkable. Mobile notifications independent of a VPN should also occur.
Ikea's matter over thread MYGGBETT door/window sensor associated with the Aqara M100 router used for sensing whether the garage door is open/closed via Node Red and mattersubscribe of @sammachin/node-red-matter-controller (MYGGBETT garage | stateValue).
(See §Accessing Matter Pairing Code; §Add Matter Device to Node Red)
MYGGBETT garage | stateValue node
The boolean output of MYGGBETT garage | StateValue is converted to Open or Closed as msg.payload in the Function node Set Status. The Change node uses JSONATA to add a timestamp to msg.time=$moment().local().format('ddd DD/MM/YY h:mma' and then combines it with the msg.payload in msg.topic=" " & $string(payload) & " " & $string(time). The required Colours are then set depending on the status of the msg.payload as determinesd by Check Status node.
The output to @flowfuse/node-red-dashboard : ui-text node Activity node shows the time and date of the msg.topic. However when the garage door opens then the Text output is shown in red rather than black, so as to highlight the event. The output is shown below that of the Blinds open/close status on the Blinds Webpage. Setting the colour when OPEN or CLOSED uses msg.ui-update.color and text string of "red" or "black" respectively.
N.B. To take effect the Style: Apply Style in the ui-text node Edit Panel must be checked.
The colour button of the dashboard 2 ui-button (Up&Over) also has its backgroud colour set to Red when the garage door is opened as sensed by the MYGGBETT garage | stateValue. The colour is Set by msg.ui_update.buttonColor and connected to the garage's Manual Trigger Button via a link node.
The output to @flowfuse/node-red-dashboard : ui-text node Activity node shows the time and date of the msg.topic. However when the garage door opens then the Text output is shown in red rather than black, so as to highlight the event. The output is shown below that of the Blinds open/close status on the Blinds Webpage. Setting the colour when OPEN or CLOSED uses msg.ui-update.color and text string of "red" or "black" respectively.
N.B. To take effect the Style: Apply Style in the ui-text node Edit Panel must be checked.
The colour button of the dashboard 2 ui-button (Up&Over) also has its backgroud colour set to Red when the garage door is opened as sensed by the MYGGBETT garage | stateValue. The colour is Set by msg.ui_update.buttonColor and connected to the garage's Manual Trigger Button via a link node.
The Change node (set email Header) sets msg.payload=msg.topic and msg.topic="Garage". The to mobile e-mail node from node-red-node-email sends the msg.payload as an email, with a subject of msg.topic.
Email notify works best using an output email solely used for Notifications from Node Red, to omes own hotmail address which is managed in Outlook so that those emails are moved to a particular Inbox folder (eg Alarm) rather than appearing in the general Inbox.
The MYGGBETT garage device is added to Alexa using the pairing code as explained below. Two Routines added:
MYGGBETT Garage open for the WHEN event MYGGBETT garage opens then Alexa says "Garage opening".
and Push Notification
Send Notification garage open
MYGGBETT Garage close for the WHEN event MYGGBETT garage closes then Alexa says "Garage shut".
and Push Notification
Send Notification garage shut
The MYGGBETT device added in the Aqara App to the Aqara M100 and renamed MYGGBETT garage. The matter pairing code can be accessed in the App and used for Adding the matter device to Node Red or Alexa.
Adding a Matter device over Thread to a Controller to Node Red:
When you connect a contact sensor such as the IKEA MYGGBETT through a Matter bridge to Alexa, it is brought over strictly as a status sensor. Because it is a secure Matter device, Alexa locks it down so it cannot be controlled or easily targeted by traditional smart home actions.
Instead of adding the sensor as an Action, you need to use Alexa's built-in custom command feature. This forces Alexa to look for the device exactly as if you spoke it out loud.
Open the Alexa App.
Tap More (bottom right) and select Routines.
Tap the plus (+) icon to create a new routine.
Tap When this happens ➔ select Voice.
Type your simple phrase: "Is the garage open" or "Garage status" and tap Next.
Tap Add action ➔ scroll down and select Customized (at the very top).
Type exactly what you want Alexa to do behind the scenes:
“Is the MYGGBETT garage open?”
Tap Save.
Customized Action Setup
To make sure it is running perfectly on your Aqara M100 setup, verify your routine looks exactly like this:
When this happens: You say "Alexa, is the garage open" (or your favorite short phrase).
Action: Select Customized (found at the top of the action list).
Text input: Type out the exact phrase: "Is the MYGGBETT garage open?"
Why this is the perfect solution
Keeps Node-RED working: Node-RED can continue to poll and watch the exact name "MYGGBETT garage" through your local network.
Keeps Matter happy: The Aqara M100 handles the local Matter-over-Thread communication, keeping your garage sensor fast and reliable.
Gives you simple voice control: You only ever have to say two words to your Echo speaker to get a direct answer.
If you ever add more Matter devices to your Aqara M100, you can use this exact same custom routine trick for them too.