Convert an Automation into NodeRed

Hi. I have this pretty automation which I created for my KLF20 System and the VELUX integration.

alias: KLF reboot on hass stop event
description: Reboots the KLF200 in order to avoid SSL Handshake issue
trigger:
  - platform: homeassistant
    event: shutdown
action:
  - service: velux.reboot_gateway
    data: {}

How do I convert that into a usable NodeRed format?

Thank You for your help.

You’ll need a call service node. I don’t see shutdown as an available command but there is a stop command.

I’m able to detect a restart event, but not a shutdown.

[{"id":"4354f120b055e552","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"35d84701e6ceb349","type":"server-events","z":"4354f120b055e552","name":"","server":"8be923df.d66f9","version":3,"exposeAsEntityConfig":"","eventType":"call_service","eventData":"","waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":170,"y":80,"wires":[["aafdbac8704f6749"]]},{"id":"aafdbac8704f6749","type":"switch","z":"4354f120b055e552","name":"","property":"payload.event.service","propertyType":"msg","rules":[{"t":"eq","v":"restart","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":80,"wires":[["36411015d36a2c26"]]},{"id":"36411015d36a2c26","type":"debug","z":"4354f120b055e552","name":"debug 14","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":460,"y":80,"wires":[]},{"id":"8be923df.d66f9","type":"server","name":"homeassistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

If I look in devtools under services I don’t see shutdown as an option, I do see host_shutdown. Did you try listening for the event in devtools? does it come through as shutdown?

I copied the automation from the Velux integration documentation.
I actually have not tested it yet but I thought that I might as well convert it to NodeRed while I’m al it.

I think what @mightybosstone posted should work. Shutdown in HA means that you’ll need to cycle the power to turn it back on, not something I use often.

Does it have to be rebooted before? Possibly reboot the gateway when HA starts, that would cover a shutdown, restart and power failure.