Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save edorgeville/6f4cf5de9c017cb787e9be98789644ab to your computer and use it in GitHub Desktop.
Save edorgeville/6f4cf5de9c017cb787e9be98789644ab to your computer and use it in GitHub Desktop.
Setting and accessing environment variables in node-red

Setting and accessing environment variables in node-red

Setting

  • echo "UUID=12345" > ~/env
  • sudo nano /lib/systemd/system/nodered.service
  • Add EnvironmentFile=/home/pi/env
  • sudo systemctl daemon-reload
  • sudo systemctl restart nodered

Accessing

  • In node-red, create a MQTT-in node
  • In the topic field, write $(UUID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment