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

[homewizard] DateTime format issue with OH3.1.0 #11639

Closed
jbuekens opened this issue Nov 25, 2021 · 7 comments · Fixed by #11666
Closed

[homewizard] DateTime format issue with OH3.1.0 #11639

jbuekens opened this issue Nov 25, 2021 · 7 comments · Fixed by #11666
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@jbuekens
Copy link

Homewizard P1 binding on OH3.1.0 windows 10 server with Zulu 11. The binding goes online, reads out the consumption numbers from the Homewizard P1 device once but then generates the following error in the openhab.log:

2021-10-03 18:10:47.117 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.IllegalArgumentException: 2000-00-00T00:00:00 is not in a valid format.
at org.openhab.core.library.types.DateTimeType.(DateTimeType.java:112) ~[?:?]
at org.openhab.core.library.types.DateTimeType.valueOf(DateTimeType.java:123) ~[?:?]
at org.openhab.binding.homewizard.internal.HomeWizardHandler.pollingCode(HomeWizardHandler.java:197) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.time.format.DateTimeParseException: Text ‘2000-00-00T00:00:00T00:00:00’ could not be parsed, unparsed text found at index 19
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2049) ~[?:?]
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1948) ~[?:?]
at java.time.LocalDateTime.parse(LocalDateTime.java:492) ~[?:?]
at org.openhab.core.library.types.DateTimeType.parse(DateTimeType.java:232) ~[?:?]
at org.openhab.core.library.types.DateTimeType.(DateTimeType.java:106) ~[?:?]
… 8 more

The thing stays online, but P1 polling does not happen anymore.

Here is an output of the API link on the homewizard:
{"smr_version":50,"meter_model":"Fluvius 253769484_A","wifi_ssid":"telenet-7822442","wifi_strength":56,"total_power_import_t1_kwh":2425.626,"total_power_import_t2_kwh":3829.128,"total_power_export_t1_kwh":2361.773,"total_power_export_t2_kwh":883.506,"active_power_w":1448,"active_power_l1_w":1478,"active_power_l2_w":0,"active_power_l3_w":-30,"total_gas_m3":null,"gas_timestamp":null}

As you can see the gas_timestamp and total_gas_m3 show null as I do not have a gas meter. Maybe this is causing the issue?

@jbuekens jbuekens added the bug An unexpected problem or unintended behavior of an add-on label Nov 25, 2021
@wborn
Copy link
Member

wborn commented Nov 25, 2021

As you can see the gas_timestamp and total_gas_m3 show null as I do not have a gas meter. Maybe this is causing the issue?

I would think so too!
Perhaps @Daniel-42 can have a look at it?

@Daniel-42
Copy link
Contributor

Yeah I will pick it up, thanks for reporting it.

@jbuekens
Copy link
Author

Thanks for looking into this. Let me know if you need any additional info or testing.

@Daniel-42
Copy link
Contributor

It's an easy fix and with the file you provided above I can test it.

Updating my dev environment to the latest version and getting Eclipse to work again to test the fix however... ah well, it will be fine.

Daniel-42 added a commit to Daniel-42/openhab-addons that referenced this issue Nov 29, 2021
This commit fixes a crash that happens when the smart meter does not provide gas values. The crash was caused by the empty timestamp.

Signed-off-by: Daniël van Os <daniel@supercell.nl>
Daniel-42 added a commit to Daniel-42/openhab-addons that referenced this issue Nov 29, 2021
This commit fixes a crash that happens when the smart meter does not provide gas values. The crash was caused by the empty timestamp.

Signed-off-by: Daniël van Os <daniel@supercell.nl>
Daniel-42 added a commit to Daniel-42/openhab-addons that referenced this issue Nov 29, 2021
This commit fixes a crash that happens when the smart meter does not provide gas values. The crash was caused by the empty timestamp.

Signed-off-by: Daniël van Os <daniel@supercell.nl>
@wborn wborn linked a pull request Nov 29, 2021 that will close this issue
@jbuekens
Copy link
Author

Hi Daniel,

I tested the fix #11666 and it works like a charm! Thanks for the fast turnaround.

Jos

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/homewizard-binding-generating-date-format-java-error/127166/2

@Daniel-42
Copy link
Contributor

Thanks for the test and the feedback, glad to hear this fixes the issue!

Daniel-42 added a commit to Daniel-42/openhab-addons that referenced this issue Dec 1, 2021
This commit fixes a crash that happens when the smart meter does not provide gas values. The crash was caused by the empty timestamp.

Signed-off-by: Daniël van Os <daniel@supercell.nl>
Daniel-42 added a commit to Daniel-42/openhab-addons that referenced this issue Dec 1, 2021
Imported the (now slightly different) exception and feeding the numbers directly to a ZonedDateTime

Signed-off-by: Daniël van Os <daniel@supercell.nl>
Daniel-42 added a commit to Daniel-42/openhab-addons that referenced this issue Dec 1, 2021
This commit fixes a crash that happens when the smart meter does not provide gas values. The crash was caused by the empty timestamp.

Signed-off-by: Daniël van Os <daniel@supercell.nl>
Daniel-42 added a commit to Daniel-42/openhab-addons that referenced this issue Dec 1, 2021
Imported the (now slightly different) exception and feeding the numbers directly to a ZonedDateTime

Signed-off-by: Daniël van Os <daniel@supercell.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants