I am trying to create a lambda that will accept a SwitchItem as a paremeter but I am getting a:
Script execution of rule with UID 'automation_shutter-1' failed: null in automation_shutter
when trying to execute rule.
I have isolated issue to this example:
val LOGGER_NAME = "automation_blinds" val foo = [ SwitchItem test | logInfo(LOGGER_NAME, "foo") //test.state ] rule "automation_blinds" when Time cron "*/5 * * ? * * *" then then logInfo(LOGGER_NAME, "calling foo with: " + aByAngleRoletaKuchniaOknoEnabled) foo.apply(aByAngleRoletaKuchniaOknoEnabled) end
The result is:
2021-08-04 00:17:15.438 [INFO ] [.core.model.script.automation_blinds] - calling foo with: aByAngleRoletaKuchniaOknoEnabled (Type=SwitchItem, State=ON, Label=Auto (kat) - Roleta Kuchnia okno, Category=null, Groups=[gAParterRolety]) 2021-08-04 00:17:15.442 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'automation_shutter-1' failed: null in automation_shutter
I have also tried to use
GenericItem as parameter type but with no luck.