Rules-Definition "Optimization" Question

I have a question regarding optimization of rules.

I have 6 items which are fed by ESP8266 Microcontrollers for the battery voltage…so each delivers some value like 3,23V whatever…

What I would like to have is a warning mail message that is triggered as soon as one of the ESP8266s reaches a voltage below 2,5V…which means its almost dead…

I could of course do a single rule per battery item and trigger a mail, but i hope that somehow this could be packaged together in a single rule…

The tricky thing would be that inside the email it should clearly state which ESP is nearly dead. Otherwise it would be easy to simply say “One of your ESPs is nearly dead”…

Thanks for your thoughts! Norbert

You should search the forums for ‘design pattern’, lots of good examples. In this case maybe checķ out the group functionality and examples at Design Pattern: Working with Groups in Rules

The solution in general is to put them all in a group and search this groups members in a single rule

1 Like


for a specific example. Also look a couple posts down where I show how to avoid repeated alerts.

But I agree with lfs_alp5, I specifically wrote the Design Pattern articles to provide generically application ways to solve common problems in Rules using the minimum amount of code. Any time you encounter a situation where you feel like you are repeating lots of code, look to see if there is a Design Pattern(s) that apply. If not post a new thread and I or someone will likely write a new Design Pattern for your situation.

1 Like