Hi
So, I thought the best thing to do might be to clean up the flow tab that I use for this bathroom magic and share it.
The triggering part is quite straightforward.
I have a strap of temperature sensing switch (I think it is of the >30°C variety) that closes a contact when the pipe exceeds 30°C and opens the contact when it gets below ~25°C.
This presents to a Channel in openHAB2 as “Pressed” or “Released”
There are also two other buttons that I use to manually trigger the lights and music. (until such time as I fit some sensors to the other pipes (bath filler and hand held shower head).
These are in the “Triggers” section of the flow.
All the Comment Nodes have more details inside, if you are looking for extra information.
If you’d like me to export just a small section of the flow, just let me know.
Good luck.
(I hope you get plenty of WAF)
The Nodes in use on this flow are :—
node-red-node-random
node-red-contrib-openhab2
node-red-contrib-weekday
node-red-contrib-light-scheduler
I tried posting the text of the flow, but apparently that was >20,000 characters more than permitted, so it’s in a JSON file that can be downloaded here