FHEM - Hausautomations-Systeme > Home Connect

Syntaktisch falsches JSON, war:Siemens Home Connect Hausgeräte

<< < (2/3) > >>

Andy77H:
Hallo!

Ist jetzt gerade wieder passiert, hier die letzten Einträge im FHEM-Log:


--- Code: ---2018.01.01 13:16:08 5: HS658GXS6 event channel data: {"items":[{"timestamp":1514808634,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active","key":"BSH.Common.Root.ActiveProgram","value":"Cooking.Oven.Program.HeatingMode.HotAir","level":"hint"},{"timestamp":1514808634,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration","key":"BSH.Common.Option.Duration","unit":"seconds","value":600,"level":"hint"},{"timestamp":1514808634,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature","key":"Cooking.Oven.Option.SetpointTemperature","unit":"°C","value":180,"level":"hint"},{"timestamp":1514808634,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative","key":"BSH.Common.Option.StartInRelative","unit":"seconds","value":0,"level":"hint"},{"timestamp":1514808634,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime","key":"BSH.Common.Option.RemainingProgramTime","unit":"seconds","value":225,"level":"hint"},{"timestamp":1514808634,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime","key":"BSH.Common.Option.ElapsedProgramTime","unit":"seconds","value":375,"level":"hint"},{"timestamp":1514808634,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ProgramProgress","key":"BSH.Common.Option.ProgramProgress","unit":"%","value":63,"level":"hint"}]}

2018.01.01 13:16:08 4: BSH.Common.Root.ActiveProgram = Cooking.Oven.Program.HeatingMode.HotAir
2018.01.01 13:16:08 4: BSH.Common.Option.Duration = 600 seconds
2018.01.01 13:16:08 4: Cooking.Oven.Option.SetpointTemperature = 180 °C
2018.01.01 13:16:08 4: BSH.Common.Option.StartInRelative = 0 seconds
2018.01.01 13:16:08 4: BSH.Common.Option.RemainingProgramTime = 225 seconds
2018.01.01 13:16:08 4: BSH.Common.Option.ElapsedProgramTime = 375 seconds
2018.01.01 13:16:08 4: BSH.Common.Option.ProgramProgress = 63 %
2018.01.01 13:16:18 5: HS658GXS6 event channel searching for data
2018.01.01 13:16:18 5: HS658GXS6 event channel received event:NOTIFY
data:{"items":[{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active","key":"BSH.Common.Root.ActiveProgram","value":"Cooking.Oven.Program.HeatingMode.HotAir","level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration","key":"BSH.Common.Option.Duration","unit":"seconds","value":600,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature","key":"Cooking.Oven.Option.SetpointTemperature","unit":"°C","value":180,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative","key":"BSH.Common.Option.StartInRelative","unit":"seconds","value":0,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime","key":"BSH.Common.Option.RemainingProgramTime","unit":"seconds","value":219,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime","key":"BSH.Common.Option.ElapsedProgramTime","unit":"seconds","value":381,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ProgramProgress","key":"BSH.Common.Option.ProgramProgress","unit":"%","value":64,"level":"hint"}]}
id:SIEMENS-HS658GXS6-68A40E04C5C6


2018.01.01 13:16:18 5: HS658GXS6 event channel data: {"items":[{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active","key":"BSH.Common.Root.ActiveProgram","value":"Cooking.Oven.Program.HeatingMode.HotAir","level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration","key":"BSH.Common.Option.Duration","unit":"seconds","value":600,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature","key":"Cooking.Oven.Option.SetpointTemperature","unit":"°C","value":180,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative","key":"BSH.Common.Option.StartInRelative","unit":"seconds","value":0,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime","key":"BSH.Common.Option.RemainingProgramTime","unit":"seconds","value":219,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime","key":"BSH.Common.Option.ElapsedProgramTime","unit":"seconds","value":381,"level":"hint"},{"timestamp":1514808640,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ProgramProgress","key":"BSH.Common.Option.ProgramProgress","unit":"%","value":64,"level":"hint"}]}

2018.01.01 13:16:18 4: BSH.Common.Root.ActiveProgram = Cooking.Oven.Program.HeatingMode.HotAir
2018.01.01 13:16:18 4: BSH.Common.Option.Duration = 600 seconds
2018.01.01 13:16:18 4: Cooking.Oven.Option.SetpointTemperature = 180 °C
2018.01.01 13:16:18 4: BSH.Common.Option.StartInRelative = 0 seconds
2018.01.01 13:16:18 4: BSH.Common.Option.RemainingProgramTime = 219 seconds
2018.01.01 13:16:18 4: BSH.Common.Option.ElapsedProgramTime = 381 seconds
2018.01.01 13:16:18 4: BSH.Common.Option.ProgramProgress = 64 %
2018.01.01 13:16:28 5: HS658GXS6 event channel searching for data
2018.01.01 13:16:28 5: HS658GXS6 event channel received event:NOTIFY
data:{"items":[{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active","key":"BSH.Common.Root.ActiveProgram","value":"Cooking.Oven.Program.HeatingMode.HotAir","level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration","key":"BSH.Common.Option.Duration","unit":"seconds","value":600,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature","key":"Cooking.Oven.Option.SetpointTemperature","unit":"°C","value":180,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative","key":"BSH.Common.Option.StartInRelative","unit":"seconds","value":0,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime","key":"BSH.Common.Option.RemainingProgramTime","unit":"seconds","value":213,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime","key":"BSH.Common.Option.ElapsedProgramTime","unit":"seconds","value":387,"level":"hint"},{
2018.01.01 13:16:28 5: HS658GXS6 event channel data: {"items":[{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active","key":"BSH.Common.Root.ActiveProgram","value":"Cooking.Oven.Program.HeatingMode.HotAir","level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration","key":"BSH.Common.Option.Duration","unit":"seconds","value":600,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature","key":"Cooking.Oven.Option.SetpointTemperature","unit":"°C","value":180,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative","key":"BSH.Common.Option.StartInRelative","unit":"seconds","value":0,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime","key":"BSH.Common.Option.RemainingProgramTime","unit":"seconds","value":213,"level":"hint"},{"timestamp":1514808646,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime","key":"BSH.Common.Option.ElapsedProgramTime","unit":"seconds","value":387,"level":"hint"},{
'"' expected, at character offset 1430 (before "(end of string)") at ./FHEM/48_HomeConnect.pm line 760.
--- Ende Code ---

Es ist nicht passiert, als als das Programm beendet war, sondern als sich der Ofen nach einer gewissen Idle-Zeit selbst abgeschalten hat...

FHEM-Prozess ist definitiv nicht mehr da....

Ciao,

Andy

Pf@nne:
Moin Andy,

danke für die Forschungsarbeit!

So wie es aussieht kommt da ein syntaktisch falsches json von HomeConnect rein, zumindest sieht es im LOG so aus.
Wenn ich den JSON aus dem LOG mal anschaue meckert FHEM hier völlig zu recht.

Ein "normaler" event channel data sieht so aus:

2018.01.01 13:16:18 5: HS658GXS6 event channel received event:NOTIFY

--- Code: ---{
"items": [{
"timestamp": 1514808640,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active",
"key": "BSH.Common.Root.ActiveProgram",
"value": "Cooking.Oven.Program.HeatingMode.HotAir",
"level": "hint"
}, {
"timestamp": 1514808640,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration",
"key": "BSH.Common.Option.Duration",
"unit": "seconds",
"value": 600,
"level": "hint"
}, {
"timestamp": 1514808640,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature",
"key": "Cooking.Oven.Option.SetpointTemperature",
"unit": "°C",
"value": 180,
"level": "hint"
}, {
"timestamp": 1514808640,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative",
"key": "BSH.Common.Option.StartInRelative",
"unit": "seconds",
"value": 0,
"level": "hint"
}, {
"timestamp": 1514808640,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime",
"key": "BSH.Common.Option.RemainingProgramTime",
"unit": "seconds",
"value": 219,
"level": "hint"
}, {
"timestamp": 1514808640,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime",
"key": "BSH.Common.Option.ElapsedProgramTime",
"unit": "seconds",
"value": 381,
"level": "hint"
}, {
"timestamp": 1514808640,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ProgramProgress",
"key": "BSH.Common.Option.ProgramProgress",
"unit": "%",
"value": 64,
"level": "hint"
}]
}
--- Ende Code ---

Die Errorzeile sieht auch irgendwie nach zwei Ereignissen aus?

2018.01.01 13:16:28 5: HS658GXS6 event channel received event:NOTIFY


--- Code: ---{
"items": [{
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active",
"key": "BSH.Common.Root.ActiveProgram",
"value": "Cooking.Oven.Program.HeatingMode.HotAir",
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration",
"key": "BSH.Common.Option.Duration",
"unit": "seconds",
"value": 600,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature",
"key": "Cooking.Oven.Option.SetpointTemperature",
"unit": "°C",
"value": 180,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative",
"key": "BSH.Common.Option.StartInRelative",
"unit": "seconds",
"value": 0,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime",
"key": "BSH.Common.Option.RemainingProgramTime",
"unit": "seconds",
"value": 213,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime",
"key": "BSH.Common.Option.ElapsedProgramTime",
"unit": "seconds",
"value": 387,
"level": "hint"
}, {
--- Ende Code ---

Dieser JSON ist schon defekt, weil nicht richtig abgeschlossen, führt aber scheinbar noch nicht zu einem Fehler im FHEM-JSON-Modul.

Dieses Event läßt dann FHEM crashen:

2018.01.01 13:16:28 5: HS658GXS6 event channel


--- Code: ---{
"items": [{
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active",
"key": "BSH.Common.Root.ActiveProgram",
"value": "Cooking.Oven.Program.HeatingMode.HotAir",
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration",
"key": "BSH.Common.Option.Duration",
"unit": "seconds",
"value": 600,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature",
"key": "Cooking.Oven.Option.SetpointTemperature",
"unit": "°C",
"value": 180,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative",
"key": "BSH.Common.Option.StartInRelative",
"unit": "seconds",
"value": 0,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime",
"key": "BSH.Common.Option.RemainingProgramTime",
"unit": "seconds",
"value": 213,
"level": "hint"
}, {
"timestamp": 1514808646,
"handling": "none",
"uri": "/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime",
"key": "BSH.Common.Option.ElapsedProgramTime",
"unit": "seconds",
"value": 387,
"level": "hint"
}, {
--- Ende Code ---

Auch dieses JSON ist nicht richtig abgeschlossen und daher defekt.


Ich spreche darüber nochmal mit Stefan.....

Andy77H:
Danke mal dafür - diesmal war es definitiv, als ich ein laufendes Zeitprogramm abgebrochen habe:


--- Code: ---2018.01.04 19:12:15 5: HS658GXS6 event channel data: {"items":[{"timestamp":1515089527,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active","key":"BSH.Common.Root.ActiveProgram","value":"Cooking.Oven.Program.HeatingMode.HotAir","level":"hint"},{"timestamp":1515089527,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.Duration","key":"BSH.Common.Option.Duration","unit":"seconds","value":1800,"level":"hint"},{"timestamp":1515089527,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/Cooking.Oven.Option.SetpointTemperature","key":"Cooking.Oven.Option.SetpointTemperature","unit":"°C","value":180,"level":"hint"},{"timestamp":1515089527,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.StartInRelative","key":"BSH.Common.Option.StartInRelative","unit":"seconds","value":0,"level":"hint"},{"timestamp":1515089527,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.RemainingProgramTime","key":"BSH.Common.Option.RemainingProgramTime","unit":"seconds","value":141,"level":"hint"},{"timestamp":1515089527,"handling":"none","uri":"/api/homeappliances/SIEMENS-HS658GXS6-68A40E04C5C6/programs/active/BSH.Common.Option.ElapsedProgramTime","key":"BSH.Common.Option.ElapsedProgramTime","unit":"seconds","value":2165,"level":"hint"}
, or ] expected while parsing array, at character offset 1430 (before "(end of string)") at ./FHEM/48_HomeConnect.pm line 760.

--- Ende Code ---

Vielleicht hilft's ja bei der Fehlersuche...

Ciao,

Andy

CoolTux:

--- Zitat von: swhome am 26 Dezember 2017, 11:50:52 ---Stimmt. Durch einen Fehler in einem Modul sollte nicht das ganze FHEM abkacheln. Mir ein Rätsel warum das so ist.

Inzwischen habe ich herausgefunden wie ich diese Json Parser Fehler abfangen kann, aber leider sind es viele Stellen die in Frage kommen und daher dauert es eine Weile. Wer Zeit hat ist eingeladen mitzuhelfen.

--- Ende Zitat ---

FHEM hat damit nichts zu tun. Da ist jeder Autor selber für verantwortlich


--- Code: ---my $parsed = $JSON->decode ($json);

--- Ende Code ---
Das in einem eval aufrufen.


--- Code: ---my $parsed = eval{$JSON->decode ($json)};
if($@){
        Log3 $name, 3, " ($name) - JSON error while request: $@";
        return;
    }

--- Ende Code ---

swhome:
Hallo allseits, ich habe gerade eine neue Version der Schnittstelle veröffentlicht, die hoffentlich alle erdenklichen JSON Parser Fehler sinnvoll abfängt. Nachdem dazu ziemlich viele Änderungen erforderlich waren, bitte ich um rege Mithilfe beim Testen.

Edit: Übersicht der Code-Änderungen

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln