---
title: "Casper Smits (@caspersmits) | Hashnode"
description: "Casper Smits (@caspersmits) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@caspersmits"
---

@caspersmits

# Casper Smits

@caspersmits · Joined October 2020

## Comments

[Great article! Last week I discovered two (advanced?) things that you might be interested in: getting flow variables in subflows and the status message Getting a flow variable from a subflow The sun position dictates a flow variable in my lights automations. It sets a brightness modifier so I'm not blinded at night. This is how I format the JSONata for the light.turn\_on service call: { "transition": 2, "brightness\_pct": ( 0.01 \* $flowContext('$parent.sun\_brightness\_modifier') ) \* $env('BRIGHTNESS\_BASE') } Mind the $flowContext('$parent.variable\_name') syntax: with $parent you get access to the subflows parent variables. Outputting a node status for a subflow: The status node lets you update the message that's underneith the subflow node. Now, my formatting is not very pretty but the information is very useful! The JSONata for the message formatting: { "fill": "green", "shape": "dot", "text": $join(\['On:', $env('ENTITY\_ID'), "at:", $now()\], ' ') }](https://hashnode.com/posts/creating-subflows-in-node-red/5f909e006aa1ed54804ba01e/comment/5f9289aec626a0545fb61f4c)

Comment · Article · Oct 23, 2020 · [Creating subflows in Node-Red](https://hashnode.com/posts/creating-subflows-in-node-red/5f909e006aa1ed54804ba01e)
