Question on efficiency

Concerning efficiency (cpu/mem), does it matter if there are multiple conditions using a device state or multiple conditions using an expression value?

Probably not much, but now I’m wondering why you would do this?

Well, I started to think about this when I began to use expression variables in Notify actions. And realized you’ll have to have locally defined expression variables for each Reactor sensors as you couldn’t utilize exported variables (there’s no way to reference them in a Notify action, or is there?). I would have a need to use the same variable in multiple RS.

So as I was forced to define the same variable in multiple RS, and there was already a lot of conditions using (this time) exported variable through device state, I was wondering if there could be any efficiency gain by changing these to expression values.

I see. Since you are using them as strings (by incorporating them into the notification message), it’s probably simplest to export the variable from the ReactorSensor that owns the calculation of the value, and then use getstate() functions in the dependent ReactorSensors to fetch a copy of that value to use locally.

Also note that since the “stuff” between the {}s is an expression, you don’t really need to fetch and store a local copy in a new variable, you can just do { getstate("other RS", "urn:toggledbits-com:serviceId:ReactorValues", "theExportedVariable") } directly. Concatenating it with other strings is done the usual way:

{ "The devices in alarm are " + getstate(...) + ". Please check the panel." }
1 Like