Simplifying multiple 'copies' of pistons using arrays


#1

1) Give a description of the problem

Simplifying multiple ‘copies’ of pistons using arrays?

2) What is the expected behaviour?

Instead of having one of these pistons for each sensor…

image

… I’m wondering if this piston can be adapted to work for multiple sensors instead using an arrays?

3) What is happening/not happening?

I’m useless with arrays, and thus I tried and failed.

**4) Post a Green Snapshot of the piston![image|45x37]

(upload://xK8WwMCzoDkDrcB1Jf27yjtZ9bq.png)**

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

n/a

Here are the two ‘devices’. They’re just a way to to store some info for use in dashboards. The first is for a single motion sensor, of which there will a number of these in various rooms on the same floor of the house. The second one is a way to illustrate the status of the floor as a whole, based on the most recent activity of any of the sensors on that floor. There’ll only be one of these. Whatever gets accomplished, I can just recreate as a separate instance with a fresh floor and it’s own set of sensors.

image
image

image
image


#2

The following piston may help. I use it to trigger lights when a corresponding sensor is activated. It has values for dim level & time on for both day & night modes.
One issue with arrays is that the values are stored in alphabetic order, so you need to have a suitable naming standard to ensure your array of sensors & array of devices match.