In need of some help te create an automation (or in node-red) to detect waterusage when bathroomlight is on and humidity goes up.
I have 3 entities:
current water consumption: sensor.water_consumptie_nu
current bathroom humidity: sensor.esp32_duco_01_sensor_1_humidity
current light status: switch.relay_1_relay
I want to create an automation to:
flash the light 2 times quickly when: water consumption (with some possible intervals) is 5 minutes >0
and humidity is rising during the 5 minutes
and light is on.
Where do I start? → I need some automation advice.
Triggers AND Conditions (one of each for all three):
The first two are numeric_state triggers and conditions, the last one is a state trigger and condition.
By including each as a trigger and a condition you achieve the AND logic you want. The automation will trigger on any of them but all must be true to pass the conditions. Which ever two trigger first will fail the third condition but the last to trigger will pass as by then all three conditions are true.
How do I handle that? NowI think the water usage should be 5 mins more than 0, but what if the shower isstopped for a while for doing shampoo? It should count "5 minutes’ from start during high humidity and lights on…
Some more information. I would like to acheive to flash the light if 5 minutes (example) of water have been used during the time the light was on and the humidity is raised above 75%.
Try to imagine the “Flow” of each “Trigger”, and whether the " 3 triggers" is AND or OR …
Then go on to imagine whether your Automation will abort or continue through the “conditions” and when it will “abort” and/or “Restart” ( not counting in state-changes in Spots and it’s attributes )
So start “simple” i.e “1 trigger” , so AND/OR is not involved in the equation, left is your “Conditions” , and as you have a “sensor” involved which measure consumption over time, thou you want only the “accumulated” consumption, you might need another template-sensor.
i.e. If you measure your Oven, it used i.e 1000W during the day(or within an hour), thou you only used it twice, ones in the morning, ones in the evening(or within an hour) … however you did turn it off in between, so to find out how much time you actually had it on, you have to subtract the “time-on” from from total-time(1 day/ 1 hour) , a counter might accomplice this, or template
I find quite uncertain what/why you want this particular automation for, with it’s particular conditions/triggers, but obviously you have your “shower-session-entity” ( 4 - 3 == total-water-minutes-been used ) … (not counting in humidity-level, do to uncertain circumstances, and neither “Spots and it’s attributes changes”)
PS: my “shower-sessions” begins before humidity reach 75%, in fact my fan starts to evacuate at this point ( and might even, hopefully, either keep it under 75% or reduce under 75% from “time-to time” during the “Shower-session”), and who knows some attributes in my “light-entity” might change during the session, if it’s on at all … i don’t know if you can “follow” me here ?, i.e how many minutes did my water run through the pipes ? how many minutes do i have to subtract, from my “shower-session” because the humidity was under 75% (spite the water was running) , even worse, the power-measuring, or “instability” of my light-entity(or some atribute-update/state-changes turned out to give me no result at all ( or 10 “Showers-sessions” within half an hour )
Good Luck , although i wonder why you got the idea of trying your luck with Node-Red, when you don’t understand how your entities work, and that a “trigger” is what suppose to start your automation
As i said start simple, until you know( or that way you know ) what goes wrong
I.E 1 trigger + 1 Condition , then add successfully 1 by 1 … or you’ll never learn how it works and how your entities work, and whether you need a template-sensor involved instead of i.e “Current Values”
Anyhow you might still ending up with an automation that flashes your light “repeatedly” during your shower-session, the way you want it to work ( True i do assume this do to my own shower-habits, seldom under 30min long, could be 5 times flashing then … for what ever reason )
PS: I assume also that your Water-Meter only is connected to your Shower-Pipe
Im not particular good in templates, but wont last_changed always be “before now” ? , meaning less
Edit: And again, i think other people(who might be interested in helping “solving” your mystery) would be interested in knowing how/what your sensor.water_consumptie_nu provide , i.e screenshot from dev_tools-states, int/string, or are you addressing attribute, last_changed ?
And does your water-meter provide/update amount(Liters), every minute, or hour, i believe there is a huge variation of what/how a water-meter “report”