I´m trying to use the initial state value of a string item by using stateDescription.pattern in a rule - Is there any restriction using this value in combination with an exec cmd?
.
*.rules
...
// Execute command on selected blind
gRolloMAC.members.filter[ i | i.name == macItem ].forEach[ i |
var Number j = 0
while(j < 3) {
// logInfo("TEST", "sudo python /etc/openhab2/scripts/blind_control.py -t " + i.stateDescription.pattern + " -c move_target -a " + triggeringItem.state)
executeCommandLine("sudo python /etc/openhab2/scripts/blind_control.py -t " + i.stateDescription.pattern + " -c move_target -a " + triggeringItem.state, 5000)
j = j + 1
}
]
...
Thanks for your quick answer - and yes, I´am aware of that.
I took this approach from another post (Smart Shades and OpenHAB) - where was said, that this could be helpful if you encounter problems with the reliability of the command - which I had. (maybe it has something to do with a poor BT connection or the implementation on the used device itself?!)