I think that @Madcodger is referring to this topic. In this particular case, the person who started the topic marked it as solved.
However, the topic is not closed, and other good solutions have been offered, including one from @kahn-hubitat, after the OP marked it as "solved".
So @Madcodger - if I have the correct topic, please feel free to add to it.