- Platform information:
- Hardware:Pi 3
- OS: Raspbian GNU/Linux 9 (stretch)
- Java Runtime Environment: which java platform is used and what version
- openHAB version: openHAB 2.3.0-1 (Release Build)
- Issue of the topic:Error executing scripts in rules
-
Unable to convert Number type to Integer. I understand the base type is Decimal, used the intValue() method but gives error as mentioned below. Current workaround is to use strVal = item.state.toString() and then convert to integer using Integer.valueOf(strVal)
-
Error in sending command to an item using string (both literal or variable) i.e. sendCommand (“itemName” ON) or sendCommand( strvVariable, OFF), Error given in 2 below. Current Workaround is to findmembers in the group using members.findFirst and then use item.sendCommand(…)
- If logs where generated please post these here using code fences:
1 For intValue error
Rule ‘UpdateDelayLightState’: ‘intValue’ is not a member of ‘org.eclipse.smarthome.core.library.types.DecimalType’; line 61, column 24, length 29
- For sendCommand log as follows :
Rule ‘Remove Load When Offline’: An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(java.lang.String,java.lang.String) on instance: null