gmeks / myUplinkSmartConnect

This program connect to the myuplink.com and adjust the schedule of Høiax CONNECTED hot water heaters, and adjust the schedule so that it uses electricity when the price is low.
8 stars 1 forks source link

Failed to check VgApi #9

Closed simonepittis closed 1 year ago

simonepittis commented 1 year ago

System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.List1[System.Double]. Path: $.priceByHour.pricesObj.oslo[2] | LineNumber: 0 | BytePositionInLine: 1512. ---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number. at System.Text.Json.Utf8JsonReader.TryGetDouble(Double& value) at System.Text.Json.Utf8JsonReader.GetDouble() at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at xElectricityPriceApiShared.ElectricityPrice.VgApi.GetVgPriceInformation(String vgURL) in /src/xElectricityPriceApiShared/ElectricityPrice/VgApi.cs:line 59

gmeks commented 1 year ago

Strange, it fails like this all the time?

I wonder if its culture, are you located outside of Norway or does the machine think so?

simonepittis commented 1 year ago

Jeg er i Norge :-) i Trondheim :-)

the error started when the time changed, on Saturday night. Works before

simonepittis commented 1 year ago

ok..... restarted the docker and no errors:

[17:28:46 INF] Target Schedule change time is 17:17 [17:28:46 INF] Starting up service, detected version is 1.2.0.61 [17:28:46 INF] Reading settings from environmental variables [17:28:46 INF] Reporting to MQTT is: True [17:28:46 INF] Automatic adjusting of schedule will follow price rules [17:28:46 INF] Application started. Press Ctrl+C to shut down. [17:28:46 INF] Hosting environment: Production [17:28:46 INF] Content root path: /app [17:28:48 INF] Found device with ID: HOIAX_4855196e1b29_a942cbbb-2b77-480b-bc54-bf689df1b29b [17:28:50 INF] Changed schedule for HOIAX_4855196e1b29_a942cbbb-2b77-480b-bc54-bf689df1b29b for today and tomorrow

probably a glitch related to the daylight savings time ;-)

gmeks commented 1 year ago

Neste version vil ha noe ekstra sikkerhet rundt dette. Typisk issues rundt parsing av 0,0 eller 0.0

simonepittis commented 1 year ago

det går bra :-)