micw / tibber-meter-uploader

18 stars 6 forks source link

OBIS register 1-0:1.8.0 not always available #2

Closed micw closed 1 year ago

micw commented 1 year ago

The user @wischnu reported that he gets the following error. The reason is that the meter on tibber's side does not request the default OBIS register for total power consumption (see https://de.wikipedia.org/wiki/OBIS-Kennzahlen for reference).

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-02-25 11:17:17.108 ERROR 25773 --- [ main] o.s.boot.SpringApplication : Application run failed

java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:820) ~[spring-boot-2.5.14.jar!/:2.5.14]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:801) ~[spring-boot-2.5.14.jar!/:2.5.14]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:350) ~[spring-boot-2.5.14.jar!/:2.5.14]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1370) ~[spring-boot-2.5.14.jar!/:2.5.14]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1359) ~[spring-boot-2.5.14.jar!/:2.5.14]
at de.wyraz.tibberuploader.TibberUploader.main(TibberUploader.java:28) ~[classes!/:1.0.0-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[tibber.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[tibber.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[tibber.jar:1.0.0-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[tibber.jar:1.0.0-SNAPSHOT]
Caused by: java.lang.IllegalArgumentException: Meter 861645c7-c339-46fb-a9dc-45873bddd383 has no register with id '1-0:1.8.0'
at de.wyraz.tibberuploader.tibber.InternalAccountInfoResponse$AccountInfoMeter.unwrap(InternalAccountInfoResponse.java:96) ~[classes!/:1.0.0-SNAPSHOT]
at de.wyraz.tibberuploader.tibber.InternalAccountInfoResponse$AccountInfoMe.unwrap(InternalAccountInfoResponse.java:44) ~[classes!/:1.0.0-SNAPSHOT]
at de.wyraz.tibberuploader.tibber.InternalAccountInfoResponse.unwrap(InternalAccountInfoResponse.java:14) ~[classes!/:1.0.0-SNAPSHOT]
at de.wyraz.tibberuploader.tibber.TibberPrivateApi.getAccoutInfo(TibberPrivateApi.java:116) ~[classes!/:1.0.0-SNAPSHOT]
at de.wyraz.tibberuploader.TibberUploader.uploadMissingReadings(TibberUploader.java:52) ~[classes!/:1.0.0-SNAPSHOT]
at de.wyraz.tibberuploader.TibberUploader.run(TibberUploader.java:43) ~[classes!/:1.0.0-SNAPSHOT]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:817) ~[spring-boot-2.5.14.jar!/:2.5.14]
... 13 common frames omitted
micw commented 1 year ago

The register here is 1-1:1.8.0 which is also valid for total power consumption (see https://de.wikipedia.org/wiki/OBIS-Kennzahlen). I'm adding an option configure this.