I have an issue with the item state when building a rule for the Battery for Netatmo.
The item type should be Number according to the documentation.
I tried already different approaches to convert (.floatValue of . intValue,) but I always get the error
Rule 'AkkuCheck': An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(T,org.eclipse.xtext.xbase.lib.Procedures$Procedure1) on instance: null
When I just use below, without the “if then” statement
When I use this format, then I get below error (just tested)
(ignore the rule name - I use this for testing)
15:25:02.536 [ERROR] [untime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Luftentfeuchters LaufzeitTimer': An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(T,org.eclipse.xtext.xbase.lib.Procedures$Procedure1) on instance: null
// Keller
//
if ((Netatmo_Indoor3_BatteryVP.state as Number) < 30 && (Netatmo_Indoor3_BatteryVP.state as Number) => 15)
{
sendBroadcastNotification("Niedriger Akkustand - Sensor Keller!\n Kapazität: " + Netatmo_Indoor3_BatteryVP.state.toString + "%")
}
if ((Netatmo_Indoor3_BatteryVP.state as Number) < 15)
{
sendBroadcastNotification("Kritischer Akkustand - Sensor Keller!\n Kapazität: " + Netatmo_Indoor3_BatteryVP.state.toString + "%")
}