HUEBridge führt zum FHEM-Absturz

Begonnen von peterk_de, 21 März 2023, 09:13:44

Vorheriges Thema - Nächstes Thema

peterk_de

Hallo zusammen,

mehrere Nächte in Folge hat sich FHEM bei mir komplett verabschiedet - ich denke es liegt an der HUE_Bridge. Das war das letzte im Log:

2023.03.21 00:41:06.696 2: system.huebridge: http request failed: read from https://192.168.178.70:443 timed out
2023.03.21 00:41:06.697 2: system.huebridge: EventStream: terminated
2023.03.21 01:41:06.812 2: system.huebridge: http request failed: read from https://192.168.178.70:443 timed out
2023.03.21 01:41:06.812 2: system.huebridge: EventStream: terminated; retrying later
2023.03.21 01:41:09.035 2: system.huebridge: json error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "<!DOCTYPE HTML PUBLI...") at ./FHEM/30_HUEBridge.pm line 2501.
 in <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>hue personal wireless lighting</title>
    <link rel="stylesheet" type="text/css" href="/index.css">
</head>
<body>
    <div class="philips-header">
      <img src="/philips-blue.png" class="philips-logo" alt="Philips" />
    </div>
    <div class="header">
      <img class="header-logo" src="/hue-logo.png" alt="hue personal wireless lighting" />

      <img src="/hue-color-line.png" class="colorline" />

    </div>
    <div class="error">Oops, there appears to be no lighting here</div>
</body>
</html>

Can't use an undefined value as an ARRAY reference at ./FHEM/30_HUEBridge.pm line 2503.

Das hier ist ein der Übersichtlichkeit halber gekürztes list vom betroffenen HUE-Device, nachdem morgens FHEM wieder neu gestartet war:

   STATE      connected
   TYPE       HUEBridge
   apiversion 1.56.0
   application id zensiert
   bridgeid   001788FFFE64EC29
   eventCount 1
   has_v2_api 1
   host       192.168.178.70
   mac        00:17:88:64:ec:29
   manufacturer Signify
   modelName  Philips hue bridge 2015
   modelid    BSB002
   name       Hue Bridge 1
   swversion  1956178040
   zigbeechannel 25
   READINGS:
     Heute um 08:58 Uhr   aliveCheck      ok
     letzten Sonntag um 00:46 Uhr   groups          15
     Gestern um 13:05 Uhr   lastError       invalid value, <unknown>, for parameter, scene
     letzten Sonntag um 00:46 Uhr   lights          46
     letzten Sonntag um 00:46 Uhr   rules           104
     letzten Sonntag um 00:46 Uhr   scenes          80
     letzten Sonntag um 00:46 Uhr   schedules       0
     letzten Sonntag um 00:46 Uhr   sensors         35
     Heute um 08:58 Uhr   state           connected
     29.06.2022   swupdate        28.18
   helper:
     apiversion 79872
     count      0
     last_config_timestamp 1679385512
     offsetUTC  3600
     HTTP_CONNECTION:
       EventSource 1
       FD         34
       NAME      
       addr       https://192.168.178.70:443
       auth       0
       buf       

       compress   1
       displayurl https://192.168.178.70/eventstream/clip/v2
       header     Accept: text/event-stream
HUE-Application-Key: zensiert
Last-Event-ID: 1679380811:0
       host       192.168.178.70
       httpdata  
       httpdatalen -1
       httpheader HTTP/1.1 200 OK
Server: nginx
Date: Tue, 21 Mar 2023 07:40:11 GMT
Content-Type: text/event-stream; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src 'self'
Cache-Control: no-store
Pragma: no-cache
Referrer-Policy: no-referrer
       httpversion 1.1
       hu_blocking 0
       hu_inProgress  HUEBridge_openEventStream:2486 HUEBridge_dispatch:111 HttpUtils_TimeoutErr:3501 HandleTimeout:705
       hu_port    443
       hu_portSfx
       hu_sslAdded 1
       incrementalTimeout 1
       keepalive  1
       loglevel   4
       method     GET
       noshutdown 1
       path       /eventstream/clip/v2
       protocol   https
       redirects  0
       timeout    3600
       type       event
       url        https://192.168.178.70/eventstream/clip/v2
       hash:
       sslargs:
     groups:
       1:
         class      Kids bedroom
         name       Kinderzimmer

// gekürzt //

           54
           55
           56
         sensors:
         state:
     ignored:
       system.huebridge
   NOTIFYDEV  global
   NR         210
   NTFY_ORDER 50-system.huebridge
   STATE      connected
   TYPE       HUEBridge
   apiversion 1.56.0
   application id zensiert
   bridgeid   001788FFFE64EC29
   eventCount 1
   has_v2_api 1
   host       192.168.178.70
   mac        00:17:88:64:ec:29
   manufacturer Signify
   modelName  Philips hue bridge 2015
   modelid    BSB002
   name       Hue Bridge 1
   swversion  1956178040
   zigbeechannel 25
   READINGS:
     2023-03-21 08:58:32   aliveCheck      ok
     2023-03-19 00:46:24   groups          15
     2023-03-20 13:05:18   lastError       invalid value, <unknown>, for parameter, scene
     2023-03-19 00:46:24   lights          46
     2023-03-19 00:46:24   rules           104
     2023-03-19 00:46:24   scenes          80
     2023-03-19 00:46:24   schedules       0
     2023-03-19 00:46:24   sensors         35
     2023-03-21 08:58:32   state           connected
     2022-06-29 10:42:41   swupdate        28.18
   helper:
     apiversion 79872
     count      0
     last_config_timestamp 1679385512
     offsetUTC  3600
     HTTP_CONNECTION:
       EventSource 1
       FD         34
       NAME      
       addr       https://192.168.178.70:443
       auth       0
       buf       

       compress   1
       displayurl https://192.168.178.70/eventstream/clip/v2
       header     Accept: text/event-stream
HUE-Application-Key: zensiert
Last-Event-ID: 1679380811:0
       host       192.168.178.70
       httpdata  
       httpdatalen -1
       httpheader HTTP/1.1 200 OK
Server: nginx
Date: Tue, 21 Mar 2023 07:40:11 GMT
Content-Type: text/event-stream; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src 'self'
Cache-Control: no-store
Pragma: no-cache
Referrer-Policy: no-referrer
       httpversion 1.1
       hu_blocking 0
       hu_inProgress  HUEBridge_openEventStream:2486 HUEBridge_dispatch:111 HttpUtils_TimeoutErr:3501 HandleTimeout:705
       hu_port    443
       hu_portSfx
       hu_sslAdded 1
       incrementalTimeout 1
       keepalive  1
       loglevel   4
       method     GET
       noshutdown 1
       path       /eventstream/clip/v2
       protocol   https
       redirects  0
       timeout    3600
       type       event
       url        https://192.168.178.70/eventstream/clip/v2
       hash:
       sslargs:
     groups:
       1:
         class      Kids bedroom
 
 // gekürzt //
 
         lights:
           58
           49
           50
           51
           52
           53
           54
           55
           56
         sensors:
         state:
     ignored:
       system.huebridge-S100 1
       system.huebridge-S103 1
       system.huebridge-S105 1
       system.huebridge-S107 1
       system.huebridge-S63 1
       system.huebridge-S71 1
       system.huebridge-S78 1
       system.huebridge-S79 1
       system.huebridge-S80 1
       system.huebridge-S81 1
       system.huebridge-S82 1
       system.huebridge-S83 1
       system.huebridge-S84 1
       system.huebridge-S85 1
       system.huebridge-S87 1
       system.huebridge-S89 1
       system.huebridge-S90 1
       system.huebridge-S91 1
       system.huebridge-S92 1
       system.huebridge-S93 1
       system.huebridge-S94 1
       system.huebridge-S95 1
       system.huebridge-S96 1
     lights:
       15:
         manufacturername Signify Netherlands B.V.
         modelid    LTC014
         name       Deckenleuchte
         productid  Philips-LTC014-1-AurelleBSP_v1
         productname Hue ambiance panel
         swconfigid F62D1CFA
         swversion  1.101.2
         type       Color temperature light
         uniqueid   00:17:88:01:04:50:47:cd-0b
         capabilities:
           control:
             maxlumen   4200
             mindimlevel 100
             ct:
               max        454
               min        153
           streaming:
         config:
           archetype  ceilingsquare
           direction  downwards
           function   functional
           startup:
             mode       powerfail
         state:
           alert      select
           bri        254
           colormode  ct
           ct         217
           mode       homeautomation
         swupdate:
           lastinstall 2022-12-08T09:29:36
           state      noupdates

// gekürzt //

     resource:
       by_id:
         0194752a-2d53-4f92-8209-dfdc52745af3:
           description Automatically turn off your lights when you leave
           id         0194752a-2d53-4f92-8209-dfdc52745af3
           type       behavior_script
           version    0.0.1
           configuration_schema:
             $ref       leaving_home_config.json#
           metadata:
             category   automation
             name       Leaving home
           state_schema:
           supported_features:
           trigger_schema:
             $ref       trigger.json#
         01b5f8c7-0d3e-42a7-b173-28f4a1e48d24:
           id         01b5f8c7-0d3e-42a7-b173-28f4a1e48d24
           id_v1      /lights/56
           type       entertainment

// gekürzt //

       data:
         HASH(0x56049f4127f0)
         HASH(0x56049f1c8378)
         ...
        
// gekürzt //

       errors:
     scenes:
    
       ...
// gekürzt //

Attributes:
   alias      Hue Bridge 1
   createGroupReadings 0
   devStateIcon (initialized|connected|update.done):general_ok@grey
   event-on-change-reading state,lastError,aliveCheck
   group      Interfaces
   httpUtils  1
   icon       hue_filled_bridge_v2
   key        zensiert
   noshutdown 1
   room       System
   userReadings aliveCheck {(ReadingsVal("$name","state","") =~ /(connected|^active|update.done)/ ?"ok":"failed")}
   verbose    3

Installierte Version müsste aktuell sein:

File            Rev   Last Change

30_HUEBridge.pm 26438 2022-09-22 06:40:39Z justme1968

doif.js                    24438 2021-05-14 18:08:18Z Ellert
fhemweb.js                 27117 2023-01-25 09:13:32Z rudolfkoenig

Zum Zeitpunkt des Auftretens war das System fast komplett idle und die Bewohner haben geschlafen. Unter höherer Last trat das bislang nicht auf ... Hat jemand sachdienliche Hinweise bzw. das auch schon einmal gehabt? Die Fehlermeldung der Bridge mit dem "Oops" scheint etwas exotisch zu sein und konnte ich im Forum nicht finden ...
FHEM auf Ubuntu-VM / 2xNUC Proxmox Cluster
UI: HomeKit, TabletUI, Grafana
IOdevs: 2xHueBridge, RaspiMatic-CCU, CUL868, 2xHarmonyHub, 6xRaspi-Roomnode mit CO2, VOC und lepresenced
Devices: 107xHomematic(IP), 96xPhilips Hue, 17xTECHEM, 12xBTLE, 8xSONOS, 2xHomeConnect, 1xShelly 3em, 1xNanoleaf ...

peterk_de

Heute wieder ein identischer Absturz, diesmal während niemand zu Hause war - also absolut keine Statusänderungen von oder Kommandos an die HUEBridge. Ich habe einmal auf gut Glück folgendes geändert:

30_HUEBridge.pm - Zeile 2503:

Log3 $name, 1, "$name: error: ". Dumper $json->{errors} if(scalar @{$json->{errors}} );
zu

Log3 $name, 1, "$name: error: ". Dumper $json->{errors} if($json && scalar @{$json->{errors}} );
Sieht mit meinen beschränkten Perl-Kenntnissen so aus als ob das das Problem lösen könnte. Vielleicht kann ja der Maintainer einmal gucken, ob da noch irgendwo was getan werden muss. Da diese komischen Aussetzer der Bridge ziemlich regelmäßig zu kommen scheinen, kann ich euch vermutlich morgen sagen, ob das das Problem wirklich löst.
FHEM auf Ubuntu-VM / 2xNUC Proxmox Cluster
UI: HomeKit, TabletUI, Grafana
IOdevs: 2xHueBridge, RaspiMatic-CCU, CUL868, 2xHarmonyHub, 6xRaspi-Roomnode mit CO2, VOC und lepresenced
Devices: 107xHomematic(IP), 96xPhilips Hue, 17xTECHEM, 12xBTLE, 8xSONOS, 2xHomeConnect, 1xShelly 3em, 1xNanoleaf ...

peterk_de

Ja, meine kleine Änderung hat funktioniert - falls auch jemand das Problem hat. Kein Absturz mehr trotz mehrfachem Oops. Würde mich freuen, wenn die in das Modul übernommen werden würde :-)

Heute morgen - leere Wohnung - gleich 3 mal im Stundentakt passiert, aber Dank Änderung ohne Absturz:

2023.03.23 08:38:59.499 2: system.huebridge: http request failed: read from https://192.168.178.70:443 timed out
2023.03.23 08:38:59.500 2: system.huebridge: EventStream: terminated
2023.03.23 08:38:59.707 2: system.huebridge: json error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "<!DOCTYPE HTML PUBLI...") at ./FHEM/30_HUEBridge.pm line 2501.
 in <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>hue personal wireless lighting</title>
    <link rel="stylesheet" type="text/css" href="/index.css">
</head>
<body>
    <div class="philips-header">
      <img src="/philips-blue.png" class="philips-logo" alt="Philips" />
    </div>
    <div class="header">
      <img class="header-logo" src="/hue-logo.png" alt="hue personal wireless lighting" />

      <img src="/hue-color-line.png" class="colorline" />

    </div>
    <div class="error">Oops, there appears to be no lighting here</div>
</body>
</html>

2023.03.23 09:38:59.606 2: system.huebridge: http request failed: read from https://192.168.178.70:443 timed out
2023.03.23 09:38:59.606 2: system.huebridge: EventStream: terminated; retrying later
2023.03.23 09:39:01.871 2: system.huebridge: json error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "<!DOCTYPE HTML PUBLI...") at ./FHEM/30_HUEBridge.pm line 2501.
 in <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>hue personal wireless lighting</title>
    <link rel="stylesheet" type="text/css" href="/index.css">
</head>
<body>
    <div class="philips-header">
      <img src="/philips-blue.png" class="philips-logo" alt="Philips" />
    </div>
    <div class="header">
      <img class="header-logo" src="/hue-logo.png" alt="hue personal wireless lighting" />

      <img src="/hue-color-line.png" class="colorline" />

    </div>
    <div class="error">Oops, there appears to be no lighting here</div>
</body>
</html>

2023.03.23 10:39:01.762 2: system.huebridge: http request failed: read from https://192.168.178.70:443 timed out
2023.03.23 10:39:01.762 2: system.huebridge: EventStream: terminated; retrying later
2023.03.23 10:39:03.975 2: system.huebridge: json error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "<!DOCTYPE HTML PUBLI...") at ./FHEM/30_HUEBridge.pm line 2501.
 in <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>hue personal wireless lighting</title>
    <link rel="stylesheet" type="text/css" href="/index.css">
</head>
<body>
    <div class="philips-header">
      <img src="/philips-blue.png" class="philips-logo" alt="Philips" />
    </div>
    <div class="header">
      <img class="header-logo" src="/hue-logo.png" alt="hue personal wireless lighting" />

      <img src="/hue-color-line.png" class="colorline" />

    </div>
    <div class="error">Oops, there appears to be no lighting here</div>
</body>
</html>
FHEM auf Ubuntu-VM / 2xNUC Proxmox Cluster
UI: HomeKit, TabletUI, Grafana
IOdevs: 2xHueBridge, RaspiMatic-CCU, CUL868, 2xHarmonyHub, 6xRaspi-Roomnode mit CO2, VOC und lepresenced
Devices: 107xHomematic(IP), 96xPhilips Hue, 17xTECHEM, 12xBTLE, 8xSONOS, 2xHomeConnect, 1xShelly 3em, 1xNanoleaf ...