Flow to open solenoid valves on prescribed interval using Raspberry Pi

The first thing that jumps out to me here is your switch node rules; the first rule is checking to see if your value is == to the number 301 but then you check if it’s != to the string “301”. While this might work sometimes, I highly recommend setting them both to the number data type to avoid any potential errors.

The second thing is that this 30 minute injects only once, but if I understand your original post correctly you want it to turn the solenoid on, wait 20 minutes, then inject 10 times, once a minute for each measurement, and then finally close the solenoid after the 10th test. Is that right?

Finally, these checks are only looking for msg.payload[0], which could be “301”, but if there is a “302” in msg.payload[1] do you need to queue that up to run next? or will the “301” entry be knocked off the dataset when the test is complete, moving “302” up to payload[0]?
How you choose to handle the array will change your flow a bit.