Statt nur Icon wird auch ein < html > Tag hinzugefügt - Volles Log

Begonnen von flummy1978, 29 November 2019, 15:05:57

Vorheriges Thema - Nächstes Thema

flummy1978

Hallo zusammen,

Ich weiß Crosposting ist sicherlich nicht erwünscht. Allerdings glaube ich im Unterforum readingsgroups schaut kaum jemand rein  :-\ Leider ist der Fehler sehr nervig, weil er mir den Log zumüllt und ich hab keine Ahnung was es sein soll  :-[  Falls immernoch komplett unerwünscht, bitte löschen.

ich habe die unten stehende Readingsgroup erstellt, die mir den Status des Batterien und Wifi / Rssi von den Funk geräten anzeigt. Übersichtlichkeitshalber habe ich diese mal auf ne größe gebracht, die hier nicht den Code Rahmen sprengt - Der Fehler ist aber der Gleiche.

Sobald irgendwelche Geräte ihren Status beim Event Update ändern, bekomme ich im Event Monitor eine eeeeeewig lange Zeile die mit < html> </html> eingebettet ist. Herausgefunden habe ich das indem ich das Erstellen der Icons weg gelassen habe und dort dann statt dessen den Text eingesetzt hab. Hier stand dann nämlich

<html>75</ html>

Mit Icons sieht die Zeile dann so aus:
2019-11-28 11:07:00.413 readingsGroup rg_SYS_ALL_wifi_battery_status HEAT_BUE_HZ.battery: <html><svg class="icon measure_battery_75 green" data-txt="75"    xmlns:dc="http://purl.org/dc/elements/1.1/"    xmlns:cc="http://creativecommons.org/ns#"    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"    xmlns:svg="http://www.w3.org/2000/svg"    xmlns="http://www.w3.org/2000/svg"    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"    version="1.1"    x="0px"    y="0px"    width="361px"    height="361px"    viewBox="0 0 361 361"    style="enable-background:new 0 0 361 361;"    xml:space="preserve"    id="svg2"    inkscape:version="0.48.5 r10040"    sodipodi:docname="measure_battery_75.svg"><metadata    id="metadata34"><rdf:RDF><cc:Work        rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type          rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs    id="defs32" /><sodipodi:namedview    pagecolor="#ffffff"    bordercolor="#666666"    borderopacity="1"    objecttolerance="10"    gridtolerance="10"    guidetolerance="10"    inkscape:pageopacity="0"    inkscape:pageshadow="2"    inkscape:window-width="779"    inkscape:window-height="480"    id="namedview30"    showgrid="false"    inkscape:zoom="0.65373961"    inkscape:cx="180.5"    inkscape:cy="180.5"    inkscape:window-x="0"    inkscape:window-y="0"    inkscape:window-maximized="0"    inkscape:current-layer="measure_x5F_battery_x5F_75" /> <g    id="measure_x5F_battery_x5F_75"    style="stroke:#000000;stroke-opacity:1">  <g    id="g5"    style="stroke:#000000;stroke-opacity:1"    transform="matrix(1.6077208,0,0,1.6077208,-111.65426,-108.11351)">  <path    style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:green;fill-opacity:1;stroke:none;stroke-width:10;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"    d="m 134.65625,89.15625 c -6.01649,0 -11,4.983509 -11,11 l 0,180 c 0,6.01649 4.98351,11 11,11 l 95.5,0 c 6.01631,0 11,-4.9825 11,-11 l 0,-180 c 0,-6.016491 -4.98351,-11 -11,-11 l -95.5,0 z m 0,10 95.5,0 c 0.60951,0 1,0.390491 1,1 l 0,180 c 0,0.6085 -0.39231,1 -1,1 l -95.5,0 c -0.60951,0 -1,-0.39049 -1,-1 l 0,-180 c 0,-0.609509 0.39049,-1 1,-1 z"    id="path7"    inkscape:connector-curvature="0" />  <path    style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:green;fill-opacity:1;stroke:none;stroke-width:10;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"    d="m 169.625,69.65625 c -6.01649,0 -11,4.983509 -11,11 l 0,14 10,0 0,-14 c 0,-0.609509 0.39049,-1 1,-1 l 25.5,0 c 0.60951,0 1,0.390491 1,1 l 0,14 10,0 0,-14 c 0,-6.016491 -4.98351,-11 -11,-11 l -25.5,0 z"    id="path9"    inkscape:connector-curvature="0" />  </g>  <g    style="display:none;stroke:#000000;stroke-opacity:1"    id="g11">  <path    style="display:inline;fill:none;stroke:#000000;stroke-width:10;stroke-opacity:1"    d="M221.141,266.334c0,3.313-2.688,6-6,6h-65.5    c-3.313,0-6-2.688-6-6v-6c0-3.314,2.687-6,6-6l65.5-20c3.313,0,6,2.686,6,6V266.334z"    id="path13" />  <path    style="display:inline;fill:none;stroke:#000000;stroke-width:10;stroke-opacity:1"    d="M221.141,166.667c0,3.313-2.688,6-6,6l-65.5,20    c-3.313,0-6-2.687-6-6v-20c0-3.313,2.687-6,6-6l65.5-20c3.313,0,6,2.687,6,6V166.667z"    id="path15" />  <path    style="display:inline;fill:none;stroke:#000000;stroke-width:10;stroke-opacity:1"    d="M221.141,120c0,3.313-2.688,6-6,6l-65.5,20    c-3.313,0-6-2.687-6-6v-26c0-3.313,2.687-6,6-6h65.5c3.313,0,6,2.687,6,6V120z"    id="path17" />  <path    style="display:inline;fill:none;stroke:#000000;stroke-width:10;stroke-opacity:1"    d="M221.141,213.667c0,3.313-2.688,6-6,6l-65.5,20    c-3.313,0-6-2.687-6-6v-20c0-3.313,2.687-6,6-6l65.5-20c3.313,0,6,2.687,6,6V213.667z"    id="path19" />  </g>  <path    style="fill:green;fill-opacity:1;stroke:none"    d="m 243.87874,320.07722 c 0,5.32637 -4.32156,9.64632 -9.64633,9.64632 H 128.9267 c -5.32638,0 -9.64633,-4.32156 -9.64633,-9.64632 v -9.64632 c 0,-5.32799 4.31995,-9.64633 9.64633,-9.64633 l 105.30571,-32.15442 c 5.32638,0 9.64633,4.31834 9.64633,9.64632 v 41.80075 z"    id="path21"    inkscape:connector-curvature="0" />  <path    style="fill:green;fill-opacity:1;stroke:none"    d="m 243.87874,159.84051 c 0,5.32636 -4.32156,9.64631 -9.64633,9.64631 L 128.9267,201.64124 c -5.32638,0 -9.64633,-4.31994 -9.64633,-9.64632 v -32.15441 c 0,-5.32638 4.31995,-9.64633 9.64633,-9.64633 l 105.30571,-32.15442 c 5.32638,0 9.64633,4.31994 9.64633,9.64633 v 32.15442 z"    id="path23"    inkscape:connector-curvature="0" />  <path    style="display:none;fill:#FFFFFF;stroke:#000000;stroke-width:3;stroke-opacity:1"    d="M221.141,120c0,3.313-2.688,6-6,6l-65.5,20   c-3.313,0-6-2.687-6-6v-26c0-3.313,2.687-6,6-6h65.5c3.313,0,6,2.687,6,6V120z"    id="path25" />  <path    style="fill:green;fill-opacity:1;stroke:none"    d="m 243.87874,235.40338 c 0,5.32638 -4.32156,9.64632 -9.64633,9.64632 L 128.9267,277.20413 c -5.32638,0 -9.64633,-4.31995 -9.64633,-9.64633 v -32.15442 c 0,-5.32638 4.31995,-9.64632 9.64633,-9.64632 l 105.30571,-32.15442 c 5.32638,0 9.64633,4.31995 9.64633,9.64633 v 32.15441 z"    id="path27"    inkscape:connector-curvature="0" /> </g> <g    id="Ebene_1"    style="stroke:#000000;stroke-opacity:1"> </g> </svg></html>



Der Fehler kommt nicht (immer), wenn sich der Zustand während einer Aktivierung des Gerätes nicht ändert, bedeutet:
Normale Einstellung:
Gerät ein -> Wifi Empfang ändert sich -> Ewige Zeile mit dem o.g. inhalt -> Gerät aus -> Wifi ändert sich nicht -> Keine lange Ausgabe

Event on Change reading für das WiFi auf eine große Differenz gebracht:
Gerät ein -> Wifi ändert sich nicht -> Keine lange Ausgabe (in den allermeisten Fällen)
Gerät aus -> Wifi ändert sich nicht -> Keine lange Ausgabe (in den allermeisten Fällen)

es ist zugegeben "unsichtbares" Problem, solange man keinen Log aufmacht, aber mitten auf der Seite ein erneutes HTML zu starten, ist glaube ich nicht so schick :)

Für eine Übersicht sollte sich der Zustand auch ändern dürfen und es ist etwas das nicht hin gehört und ich möchte nicht dass sich Fehler einschleichen, die sich irgendwann summieren (auch wenn es hier noch so banal aussieht)

Wer es geschafft hat bis hierhin zu lesen, dem danke ich schon im Vorfeld vielmals. Ich würde mich wirklich sehr über jeden möglichen Vorschlag freuen :)

List von der Readingsgroup:

Internals:
   CFGFN     
   DEF        <Gerät>,<Verbindung>,<Batterie> (REL_dev_Osram_plus|dev.*):(linkquality|Wifi_RSSI),[Bb]attery
   FUUID      5ddf9a51-f33f-8d79-75ec-3a8b7c404e574fde
   NAME       rg_SYS_ALL_wifi_battery
   NR         1279
   NTFY_ORDER 50-rg_SYS_ALL_wifi_battery
   STATE      Initialized
   TYPE       readingsGroup
   mayBeVisible 1
   CONTENT:
     REL_dev_Osram_plus 1
     dev_Astro  1
     dev_EG_WZ_conditions 1
     dev_KG_S7_SPS 1
     dev_OG_BUE_TK_Temp_Sensor 1
     dev_OG_SZ_bett_links 1
     dev_SYS_DOIFTools 1
     dev_SYS_MSG_Bot 1
     dev_SYS_presence_handy_andreas 1
     dev_SYS_presence_handy_yvonne 1
     dev_SYS_wetter_ext 1
     dev_SYS_zigbee_bridge 1
   CONTENT2:
   DEVICES:
     ARRAY(0x569d670)
     ARRAY(0x5abe9f8)
     ARRAY(0x59ea608)
     ARRAY(0x56618c0)
     ARRAY(0x56b4b68)
     ARRAY(0x55df588)
     ARRAY(0x5a0c150)
     ARRAY(0x5d3ed10)
     ARRAY(0x5aab990)
     ARRAY(0x5cd67d0)
     ARRAY(0x5a9c6a8)
     ARRAY(0x5afb480)
     ARRAY(0x5cd5c88)
   fhem:
     lastDefChange 15
     last_update 1574935239.70949
   helper:
     DEF       
     valueFormat {
if(($READING eq "linkquality") or ($READING eq "Wifi_RSSI"))
{
if($VALUE<15){$VALUE=10}
elsif($VALUE<25){$VALUE=25}
elsif($VALUE<80){$VALUE=75}
elsif($VALUE>=80){$VALUE=100}
else{$VALUE=0}
}
elsif($READING eq "battery" && $VALUE ne "0")
{
if($VALUE eq "ok"){$VALUE=75}
elsif($VALUE<10){$VALUE=0}
elsif($VALUE<45){$VALUE=25}
elsif($VALUE<80){$VALUE=75}
elsif($VALUE>=80){$VALUE=100}
else{$VALUE=0}
}
}
     positions:
       REL_dev_Osram_plus.linkquality 2:1
       dev_OG_BUE_TK_Temp_Sensor.battery 6:2
       dev_OG_BUE_TK_Temp_Sensor.linkquality 6:1
       dev_OG_SZ_bett_links.Wifi_RSSI 7:1
     valueColumn:
       battery    2
       linkquality 1
     valueIcon:
       Wifi_RSSI.10 mqtt@red
       Wifi_RSSI.100 mqtt@green
       Wifi_RSSI.25 mqtt@Tomato
       Wifi_RSSI.75 mqtt@LimeGreen
       battery.0  measure_battery_0@red
       battery.100 measure_battery_100@green
       battery.25 measure_battery_25@orange
       battery.50 measure_battery_50@green
       battery.75 measure_battery_75@green
       battery.low measure_battery_0@red
       battery.ok measure_battery_75@green
       linkquality.10 mqtt@red
       linkquality.100 mqtt@green
       linkquality.25 mqtt@Tomato
       linkquality.75 mqtt@LimeGreen
     values:
       formated:
         undef
         ARRAY(0x5610448)
         ARRAY(0x5d5b068)
       orig:
         undef
         ARRAY(0x5aab6a8)
         ARRAY(0x55e8800)
       prefixsuffix:
         undef
         ARRAY(0x564a810)
         ARRAY(0x593be48)
Attributes:
   DbLogExclude .*
   alias      WiFi / Batterie Status
   room       System->Infos
   valueColumn { linkquality => 1,battery => 2}
   valueFormat {
if(($READING eq "linkquality") or ($READING eq "Wifi_RSSI"))
{
if($VALUE<15){$VALUE=10}
elsif($VALUE<25){$VALUE=25}
elsif($VALUE<80){$VALUE=75}
elsif($VALUE>=80){$VALUE=100}
else{$VALUE=0}
}
elsif($READING eq "battery" && $VALUE ne "0")
{
if($VALUE eq "ok"){$VALUE=75}
elsif($VALUE<10){$VALUE=0}
elsif($VALUE<45){$VALUE=25}
elsif($VALUE<80){$VALUE=75}
elsif($VALUE>=80){$VALUE=100}
else{$VALUE=0}
}
}
   valueIcon  {'linkquality.10' => 'mqtt@red', 'linkquality.25' => 'mqtt@Tomato', 'linkquality.75' => 'mqtt@LimeGreen', 'linkquality.100' => 'mqtt@green', 'Wifi_RSSI.10' => 'mqtt@red', 'Wifi_RSSI.25' => 'mqtt@Tomato', 'Wifi_RSSI.75' => 'mqtt@LimeGreen', 'Wifi_RSSI.100' => 'mqtt@green', 'battery.ok' => 'measure_battery_75@green', 'battery.low' => 'measure_battery_0@red', 'battery.0' => 'measure_battery_0@red','battery.25' => 'measure_battery_25@orange','battery.50' => 'measure_battery_50@green','battery.75' => 'measure_battery_75@green','battery.100' => 'measure_battery_100@green'}


Grüße
Andreas

amenomade

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus