Goal is to be able to pass either an individual device or a group. if the former it should repeat the loop just once, if the latter, should repeat for all members of the group. Appears like it’s not fetching the state of the device being passed.
I’m sure it’s something small I’m overlooking. Thx in advance!
n
It’s probably a scope issue… i.e. the repeat variable is local to it’s own loop. Try assigning the value of repeat item to a new variable before starting the second loop.
As I understand it, this script turns on (or off) a list of entities. It repeatedly tries to turn the entity on (or off), waiting 3 seconds between each attempt, until the entity is in the desired state.
Can you provide some examples of what is passed to your script’s device variable?
Using this script b/c ZWave via USB stick went bonkers in HA and has the controller ‘jamming’ constantly. This script will attempt a few times and (hopefully) one of the times won’t be jammed and the device will actually do what I ask it to do.
Going to pull the ZWave via USB altogether and switch to a Hubitat C8 to run the radios (both for ZWave and Zigbee). Hate introducing add’l failure points / integrations - but the need to even figure out a script like this and the woes I’ve had w/ USB dongles hooked up to HA sadly deems it necessary…