Node-RED nodes for controlling Rituals Perfume Genie diffusers using the V2 API.
- 🔐 Authentication and persistent token storage
- 🔍 Automatic device discovery
- 💨 Power control (on/off)
- 🎚️ Perfume intensity control (1-3)
- 📊 Device status monitoring (WiFi signal, perfume level)
- ✅ Token validation helper
Navigate to your Node-RED directory and run:
cd ~/.node-red # or /config/node-red for Home Assistant
npm install https://github.com/florianleon/node-red-contrib-ritualsRestart Node-RED after installation.
npm install node-red-contrib-ritualsConfiguration node to store your Rituals account credentials (email/password).
Authenticate and store token + device list in context. Run once on startup.
Validate stored token and extract device hash. Use before control nodes.
Turn device on or off. Configure action in node or via msg.action.
Set perfume intensity (1-3). Configure amount in node or via msg.perfumeAmount.
Get device status (power, intensity, WiFi signal, perfume level).
- Add any Rituals node to your flow
- Click the pencil icon next to "Config"
- Enter your Rituals account email and password
- Click "Add"
[Inject: once on startup] → [Rituals Auth] → [Debug]
This stores your token and device list in context (persists across deploys).
[Inject] → [Token Check] → [Rituals Power] → [Debug]
Token Check validates and provides device hash automatically.
[Inject: button] → [Token Check] → [Rituals Power: "on"] → [Debug]
The Power node is pre-configured with "on" or "off" action.
[Inject: button] → [Token Check] → [Rituals Perfume: "3"] → [Debug]
Configure intensity (1-3) in the Perfume node, or override with msg.perfumeAmount.
[Inject: repeat 5min] → [Token Check] → [Rituals Status] → [Debug]
Returns: isOn, perfumeAmount, wifi, perfumeLevel.
[Inject] → [Function] → [Rituals Power] → [Debug]
Function node:
const devices = flow.get('ritualsDevices');
msg.deviceHash = devices[0].hash;
msg.action = 'on'; // or 'off'
return msg;[Inject] → [Token Check] ──valid──→ [Rituals Power]
│
invalid
↓
[Rituals Auth] → retry
Token Check has 2 outputs: valid (top) and invalid (bottom).
SSH into your Home Assistant:
cd /config/node-red
npm install https://github.com/florianleon/node-red-contrib-ritualsRestart Node-RED add-on.
Use with node-red-contrib-home-assistant-websocket to create native HA entities
Import the example flow from examples/example-flow.json to get started quickly. It includes:
- Startup authentication
- Turn on/off with token validation
- Set perfume intensity
- Get device status
After authentication, these variables are stored in flow context:
ritualsToken- Authentication token (24h validity)ritualsTokenExpiry- Token expiration timestampritualsDevices- Array of all your devices
Access in function nodes:
const devices = flow.get('ritualsDevices');
const hash = devices[0].hash;- Verify your email and password are correct
- Check that you can log in to the Rituals app
- Ensure internet connection is working
- Run the Rituals Auth node first
- Check debug output for authentication success
- Tokens are valid for 24 hours
- Run Rituals Auth again to refresh
- Consider setting up automatic refresh (inject every 23 hours)
- Ensure device is online and connected to WiFi
- Check device status with Rituals Status node
- Verify deviceHash is correct
Uses Rituals V2 API:
- Authentication:
POST /apiv2/account/token - Get Hubs:
GET /apiv2/account/hubs - Control:
POST /apiv2/hubs/{hash}/attributes/{attr} - Status:
GET /apiv2/hubs/{hash}/attributes/{attr}
MIT License
This is primarily a personal project created for my own use. While I'm happy to share it with the community, please note that:
- Maintenance and updates are not guaranteed
- Support may be limited
- Breaking changes may occur without notice
This is an unofficial project and is not affiliated with or endorsed by Rituals Cosmetics.