Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must check for state UndefType before trying to convert to other type #71

Closed
seime opened this issue Nov 2, 2022 · 6 comments
Closed

Comments

@seime
Copy link
Collaborator

seime commented Nov 2, 2022

java.lang.NumberFormatException: Invalid BigDecimal value: UNDEF
at org.openhab.core.library.types.QuantityType.(QuantityType.java:130) ~[?:?]
at org.openhab.core.library.types.QuantityType.(QuantityType.java:106) ~[?:?]
at org.openhab.core.library.types.QuantityType.valueOf(QuantityType.java:206) ~[?:?]
at org.openhab.automation.jrule.internal.engine.excutioncontext.JRuleItemExecutionContext.lambda$4(JRuleItemExecutionContext.java:67) ~[?:?]
at java.util.Optional.filter(Optional.java:223) ~[?:?]
at org.openhab.automation.jrule.internal.engine.excutioncontext.JRuleItemExecutionContext.matchCondition(JRuleItemExecutionContext.java:67) ~[?:?]
at org.openhab.automation.jrule.internal.engine.excutioncontext.JRuleItemChangeExecutionContext.match(JRuleItemChangeExecutionContext.java:51) ~[?:?]
at org.openhab.automation.jrule.internal.engine.JRuleEngine.lambda$46(JRuleEngine.java:267) ~[?:?]

@querdenker2k
Copy link
Collaborator

should be fixed in #77 . The error triggered me there as well.

@seaside1
Copy link
Owner

seaside1 commented Nov 5, 2022

After merge of PR 66 I see this with various types:

2022-11-05 20:37:19.402 [WARN ] [ab.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.openhab.core.e
vents.EventSubscriber' failed: Invalid BigDecimal value: ON
java.lang.NumberFormatException: Invalid BigDecimal value: ON
        at org.openhab.core.library.types.QuantityType.<init>(QuantityType.java:130) ~[?:?]
        at org.openhab.core.library.types.QuantityType.<init>(QuantityType.java:106) ~[?:?]
        at org.openhab.core.library.types.QuantityType.valueOf(QuantityType.java:206) ~[?:?]
        at org.openhab.automation.jrule.internal.engine.excutioncontext.JRuleItemExecutionContext.lambda$4(JRuleItemExecutionContext.java:69) ~[?:?]
        at java.util.Optional.filter(Optional.java:223) ~[?:?]
        at org.openhab.automation.jrule.internal.engine.excutioncontext.JRuleItemExecutionContext.matchCondition(JRuleItemExecutionContext.java:69) ~[?:?]
        at org.openhab.automation.jrule.internal.engine.excutioncontext.JRuleItemReceivedUpdateExecutionContext.match(JRuleItemReceived

I'll see if I can find more stacktraces

@seaside1
Copy link
Owner

seaside1 commented Nov 5, 2022

I have a precondition rule with a number item being check to trigger this:

@JRuleWhenItemReceivedUpdate(item = MyScene.ITEM, condition = @JRuleCondition(gt = 20))

@seaside1
Copy link
Owner

seaside1 commented Nov 5, 2022

And looks better when I merge pr77 with main. Still testing it.

@seime
Copy link
Collaborator Author

seime commented Nov 8, 2022

Have not seen this issue on my side after merging and running locally since the weekend

@seime
Copy link
Collaborator Author

seime commented Nov 13, 2022

Solved by #77

@seime seime closed this as completed Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants