Condition in rule - need to convert number?

I have my doubts, but let’s see.
My car isn’t plugged in at the moment, so I manually triggered the rule with “run now” - if I understand correctly, this replaces the actual trigger, doesn’t it? In any case, the current state of the SOC shows “100” and the actions were still happening, despite the condition saying < 90

In the meantime, here’s the log entry after I manually triggered the rule:

2022-10-19 17:20:16.929 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'GenericMQTTThing_OpenWBLademodus' received command 2
2022-10-19 17:20:16.930 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'GenericMQTTThing_OpenWBLademodus' predicted to become 2
2022-10-19 17:20:16.932 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'GenericMQTTThing_OpenWBLademodus' changed from 0 to 2

Obviously, I don’t have a corresponding log entry for the SOC change, but I assume you want to look at the format, so here are the last entries from event log which show those:

2022-10-19 08:44:35.281 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OpenWGMQTTThing_SOCStatus' changed from 95 to 96
2022-10-19 08:45:56.069 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OpenWGMQTTThing_SOCStatus' changed from 96 to 97
2022-10-19 08:48:55.893 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OpenWGMQTTThing_SOCStatus' changed from 97 to 98
2022-10-19 08:57:15.627 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OpenWGMQTTThing_SOCStatus' changed from 98 to 99
2022-10-19 09:01:26.156 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OpenWGMQTTThing_SOCStatus' changed from 99 to 100

There is no entry in the openhab.log - except for one, that might be interesting:

2022-10-19 09:27:56.088 [ERROR] [ernal.handler.ScriptConditionHandler] - Script execution failed: OpenWGMQTTThing_SOCStatus.state. ___ floatValue > 90

However, this event only shows up when using your suggestion of using a EC-script (makes sense, since your suggestion included the float value), it doesn’t show up now (currently I have DSL) and it didn’t show when using the UI condition.

Yes but it also skips the conditions. A manually triggered rule will always execute the actions no matter what the conditions say.

That’s not a good test. You have to trigger the rule by triggering the rule through an event, not manually.

Thanks - it works now.
Interestingly, it now works with setting up the condition through UI - when using the DSL script that @binderth provided, it didn’t work…

1 Like

Apparently that’s not (yet) possible with OpenWB, but will be introduced with the upcoming 2.0 Version (current version is 1.92 - even though that might not mean anything).