Page 1 of 1

Set number of decimals on control pages

PostPosted: Thu May 07, 2020 12:53 pm
by Stoutjesdijk
Hi everyone,

I have several types of temperature-reporting devices. I would like to ensure that all of them report in the same number of digits. Is there a plugin that I can use? Some other trick?

Thanks,

Mark

Re: Set number of decimals on control pages

PostPosted: Thu May 07, 2020 2:40 pm
by DaveL17
I use the Adapters Plugin for this type of thing.

Re: Set number of decimals on control pages

PostPosted: Fri May 08, 2020 4:00 am
by Stoutjesdijk
That does the trick!

Now, I have three temperature readings in one room, from two valve thermostats and from a NEST. I am looking at the very nice TRV plugin for a more complicated heating setup, but I don't think there is a way to use multiple external temperature sensors in TRV directly. In Adapters I can do math but only use one parameter x. I probably didn't search carefully enough, but is there a way to do math (like return 0.25*x+0.25*y+0.5*z)?

Re: Set number of decimals on control pages

PostPosted: Fri May 08, 2020 5:04 am
by DaveL17
I don't think Adapters can handle that, but I'm not positive. I did a quick test trying to add the value from another device within the formula, but Adapters didn't like it. If it were me, at this point, I'd use a short Python script to do what you're suggesting.

Re: Set number of decimals on control pages

PostPosted: Sat May 23, 2020 2:13 am
by Stoutjesdijk
A very simple Python conditional does seem like the best solution.

It would be very nice if we could do such things through the user interface. I can think of many applications, most importantly configuration of system behavior through control pages. Is there any chance this will at some point be added to the Triggers functionality of Indigo?

Re: Set number of decimals on control pages

PostPosted: Sat May 23, 2020 10:15 am
by matt (support)
Possibly, but once you get to trying to do formulas like what you posted above a script will typically be easier / faster than trying to define it using a graphical UI.