httpmod.template: bugs, Fragen, Anregungen

Begonnen von Beta-User, 21 Februar 2019, 12:04:17

Vorheriges Thema - Nächstes Thema

OdfFhem

Zitat von: Beta-User am 08 August 2022, 10:32:04
Moin, ich gehe mal davon aus, dass amenomade einfach grade länger im Urlaub ist und das dann irgendwann gerne machen wird:
Den Wechsel zu amenomade habe ich scheinbar nicht mitbekommen - sorry ... mal schauen, was sich noch an den Templates bis zum Einchecken ändert ...

Zitat von: Beta-User am 08 August 2022, 10:32:04
DEVICE (genauer: alle par:-Parameter) kann/muss man "escapen".

Vorübergehend habe ich UPDATABLEMODE wieder in UPDATABLEDEVICESMODE umbenannt:

attr DEVICE updatableDevicesMode UPDATABLEDEVICESMODE
--> DEVICE lautet "TasmotaFirmwareRelease"
--> attr-Anweisung führt zum vorhersehbaren Attribut-Wert "UPDATABLETasmotaFirmwareReleaseSMODE"

attr DEVICE updatableDevicesMode UPDATABLE\DEVICESMODE
--> DEVICE wird nicht mehr eingesetzt
--> attr-Anweisung wird aber quasi 1:1 ausgeführt und es findet keinerlei Ersetzung statt
--> Attribut-Wert lautet "UPDATABLEDEVICESMODE"

Beta-User

Zitat von: OdfFhem am 08 August 2022, 20:49:13
Vorübergehend habe ich UPDATABLEMODE wieder in UPDATABLEDEVICESMODE umbenannt:
Ah, jetzt ist auch bei mir der Groschen gefallen - sowas geht mWn. nicht, die par:-Namen sollten keine "wechselseitigen Bruchstücke" bzw. "DEVICE" enthalten... Dachte, das sollte hinterher (nach Anwendung des attrTemplate) im Klartext so stehen bleiben ::) .
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

OdfFhem

Zitat von: OdfFhem am 08 August 2022, 20:35:04
@all
Da man insbesondere bei Tasmota drei Entwicklungsstände unterstützen will/sollte, bin ich beim devspec auch auf readingList ausgewichen.
Gäbe es eigentlich eine Möglichkeit, alle Geräte mittels list aufzuführen, die eins von drei möglichen Readings haben ?
(heisst übersetzt: ein qualifiziertes DEVICE hat entweder ein Reading namens Version oder INFO1_Version oder Info1_Version)

Irgendwie scheint die Lösung einfach ... Verwendung von Komma führt wohl zum Ziel ...

yersinia

@OdfFhem:
Zitat von: OdfFhem am 08 August 2022, 20:35:04@all
Da man insbesondere bei Tasmota drei Entwicklungsstände unterstützen will/sollte, bin ich beim devspec auch auf readingList ausgewichen.
Gäbe es eigentlich eine Möglichkeit, alle Geräte mittels list aufzuführen, die eins von drei möglichen Readings haben ?
(heisst übersetzt: ein qualifiziertes DEVICE hat entweder ein Reading namens Version oder INFO1_Version oder Info1_Version)
Ich nutze für die JsonMod Version die devspec
readingList~.*tele[/].*INFO.*
was einem list
list readingList~.*tele[/].*INFO.*
entspricht und greife dann kaskadierend drauf zu, zB
my $version = ReadingsVal($dev,"Info1_Version",ReadingsVal($dev,"Version",ReadingsVal($dev,"INFO1_Version","0.0.0")));

Zitat von: OdfFhem am 08 August 2022, 20:35:04Beide Templates noch ein wenig überarbeitet/getestet und Deine Vorschläge einfliessen lassen.

tasmota

#Contributed by OdfFHEM, see https://forum.fhem.de/index.php/topic,97694.msg992348.html#msg992348
name:tasmota_firmware_updates
filter:TYPE=HTTPMOD
desc: Check Tasmota homepage for available new firmware files<br>Define a HTTPMOD device like <br>define tasmotaupdates HTTPMOD https://github.com/arendst/Tasmota/tags 86400<a href="https://forum.fhem.de/index.php/topic,97694.msg992308.html#msg992308">Source: Forum</a>.
order:TECHZ06
par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )}
par:UPDATABLEMODE;Actual mode for updatableDevices, defaults to onlyUpdatable; {AttrVal("DEVICE","updatableDevicesMode","onlyUpdatable")}
par:INTERVAL;Actual interval for updating, defaults to one week; {InternalVal("DEVICE","Interval","604800")}
defmod DEVICE HTTPMOD https://api.github.com/repos/arendst/Tasmota/releases/latest INTERVAL
attr DEVICE userattr reading01JSON reading01Name reading01OExpr reading02JSON reading02Name reading02OExpr updatableDevicesMode:onlyUpdatable,all
attr DEVICE enableControlSet 1
attr DEVICE event-on-change-reading .*
attr DEVICE event-on-update-reading LAST_ERROR,MATCHED_READINGS
attr DEVICE handleRedirects 0
deleteattr DEVICE reading01Regex
attr DEVICE reading01JSON tag_name
attr DEVICE reading01Name latestVersion
attr DEVICE reading01OExpr $val =~ m/^v(\d+).(\d+).(\d+)$/ ;; "$1.$2.$3"
deleteattr DEVICE reading02Regex
attr DEVICE reading02JSON published_at
attr DEVICE reading02Name latestDate
attr DEVICE reading02OExpr $val =~ m/^(.{4})-(.{2})-(.{2})T..:..:..Z$/ ;; "$3.$2.$1"
attr DEVICE showError 1
attr DEVICE showMatched 1
attr DEVICE stateFormat { \
  my $ret ="";;\
  $ret .= '<div style="text-align:left;;">';;\
  my $lastCheck = POSIX::strftime("%d.%m.%Y, %H:%M",localtime(time_str2num(ReadingsTimestamp($name,"MATCHED_READINGS","1970-01-01 00:00:00"))));;\
  $ret .= '<div style="text-align:left;;">last <a title="versions" href="'.InternalVal($name,"MainURL","unknown").'" target="_blank">tasmota</a>-check => '.$lastCheck.' ...</div>';;\
  $ret .= '<br><pre>';;\
  $ret .= "| device                           | current |   new   |  released  |<br>";;\
  $ret .= "---------------------------------------------------------------------<br>";;\
  my $check = ReadingsVal($name,"updatableDevices","error => no or wrong data from server!");;\
  if($check eq "no updates needed!") {\
    $ret .= '| <b style="color:green;;">';;\
    $ret .= sprintf("%-65s",$check);;\
    $ret .= '</b> |';;\
  } elsif($check eq "error => no or wrong data from server!") {\
    $ret .= '| <b style="color:red;;">';;\
    $ret .= sprintf("%-65s",$check);;\
    $ret .= '</b> |';;\
  } else {\
    my @devices = split(',',$check);;\
    foreach my $devStr (@devices) {\
      my ($dev,$old,$new,$date) = $devStr =~ m/^([^\s]+)\s\(([^\s]+)\s\|\s([^\s]+)\s\|\s([^\)]+)\)$/;;\
      $ret .= '| <a href="/fhem?detail='.$dev.'"><b>';;\
      $ret .= sprintf("%-32s",AttrVal($dev,"alias",$dev));;\
      $ret .= '</b></a> | ';;\
      $ret .= '<b style="color:lightgray;;">';;\
      $ret .= '<a href="http://'.ReadingsVal($dev,"Info2_IPAddress",ReadingsVal($dev,"INFO2_IPAddress",ReadingsVal($dev,"IPAddress","0.0.0.0"))).'/up" target="_blank">';;\
      $ret .= sprintf("%7s",$old);;\
      $ret .= '</a></b> | ';;\
      $ret .= '<a href="https://github.com/arendst/Tasmota/releases/tag/v'.$new.'" target="_blank">';;\
      $ret .= '<b style="color:red;;">';;\
      $ret .= sprintf("%7s",$new);;\
      $ret .= '</b></a> | ';;\
      $ret .= '<a href="https://github.com/arendst/Tasmota/releases/tag/v'.$new.'" target="_blank">';;\
      $ret .= '<b>';;\
      $ret .= sprintf("%-10s",$date);;\
      $ret .= '</b></a>';;\
      $ret .= " |<br>";;\
    }\
  }\
  $ret .= '</pre><br>';;\
  my $nextCheck = POSIX::strftime("%d.%m.%Y, %H:%M",localtime(InternalVal($name,".TRIGGERTIME",0)));;\
  $ret .= '<div style="text-align:left;;">... next <a title="versions" href="'.InternalVal($name,"MainURL","unknown").'" target="_blank">tasmota</a>-check => '.$nextCheck.'</div>';;\
  $ret .= '</div>';;\
  return $ret;;\
}
attr DEVICE timestamp-on-change-reading .*
attr DEVICE updatableDevicesMode UPDATABLEMODE
attr DEVICE userReadings updatableDevices:MATCHED_READINGS.* {\
  my $ret = "";;\
  if (ReadingsVal($name,"MATCHED_READINGS","") eq "") {\
    $ret = "error => no or wrong data from server!";;\
  } else {\
    my $VERSION = ReadingsVal($name,"latestVersion","unknown");;\
    my $DATE = ReadingsVal($name,"latestDate","unknown");;\
    foreach my $dev (devspec2array("TYPE=MQTT[2]?_[D]EVICE:FILTER=readingList~.*tele[/].*INFO.*")) {\
      my $version = ReadingsVal($dev,"Info1_Version",ReadingsVal($dev,"INFO1_Version",ReadingsVal($dev,"Version","0.0.0")));;\
      $version =~ m/([0-9.]*).*/;;\
      $version = $1;;\
      if ( AttrVal($name,"updatableDevicesMode","onlyUpdatable") eq "all" || $version ne $VERSION ) {\
        $ret .= "," if($ret ne "");;\
        $ret .= $dev." (".$version." | ".$VERSION." | ".$DATE.")";;\
      }\
    }\
  }\
  return ($ret eq "")?"no updates needed!":$ret;;\
}
attr DEVICE webCmd reread
attr DEVICE room WHICHROOM
attr DEVICE model tasmota_firmware_updates
setreading DEVICE attrTemplateVersion 20220808
Passt & sieht gut aus!
viele Grüße, yersinia
----
FHEM 6.3 (SVN) on RPi 4B with RasPi OS Bullseye (perl 5.32.1) | FTUI
nanoCUL->2x868(1x ser2net)@tsculfw, 1x433@Sduino | MQTT2 | Tasmota | ESPEasy
VCCU->14xSEC-SCo, 7xCC-RT-DN, 5xLC-Bl1PBU-FM, 3xTC-IT-WM-W-EU, 1xPB-2-WM55, 1xLC-Sw1PBU-FM, 1xES-PMSw1-Pl

rudolfkoenig

ZitatGäbe es eigentlich eine Möglichkeit, alle Geräte mittels list aufzuführen, die eins von drei möglichen Readings haben ?
(heisst übersetzt: ein qualifiziertes DEVICE hat entweder ein Reading namens Version oder INFO1_Version oder Info1_Version)


fhem> define d1 dummy
fhem> setreading d1 Version 1
fhem> define d2 dummy
fhem> setreading d2 INFO1_Version 2
fhem> define d3 dummy
fhem> setreading d3 Info1_Version 3
fhem> list .* Version Info1_Version INFO1_Version
d1                   2022-08-09 08:52:13   Version         1
d2                   2022-08-09 08:52:13   INFO1_Version   2
d3                   2022-08-09 08:52:13   Info1_Version   3


Ich vermute aber, dass man hier eigentlich devspec und nicht list braucht, und dieser Vorschlag nicht weiterhilft.

OdfFhem

Zitat von: rudolfkoenig am 09 August 2022, 08:58:44
Ich vermute aber, dass man hier eigentlich devspec und nicht list braucht, und dieser Vorschlag nicht weiterhilft.

Stimmt, letztlich suche ich eine devspec - finde bzw. teste diese allerdings meist mittels list.

Die hier verwendete devspec führt zum selben Ergebnis bei den drei dummys.

list Version!=,INFO1_Version!=,Info1_Version!= Version INFO1_Version Info1_Version

Nach diesem devspec-Muster würde ich das Template anpassen ...

yersinia

Zitat von: OdfFhem am 13 August 2022, 06:18:02Die hier verwendete devspec führt zum selben Ergebnis bei den drei dummys.

list Version!=,INFO1_Version!=,Info1_Version!= Version INFO1_Version Info1_Version

Nach diesem devspec-Muster würde ich das Template anpassen ...
Spuckt bei mir neben den Tasmota-Devices auch das hminfo device aus, da
Internals:
   FUUID      5c443cf2-f33f-3151-5ba5-4115d6f1ec7f06fd
   NAME       hm
   NR         78
   NTFY_ORDER 50-hm
   STATE      updated:2022-06-27 14:34:11
   TYPE       HMinfo
   Version    01 ##<==== DESWEGEN
viele Grüße, yersinia
----
FHEM 6.3 (SVN) on RPi 4B with RasPi OS Bullseye (perl 5.32.1) | FTUI
nanoCUL->2x868(1x ser2net)@tsculfw, 1x433@Sduino | MQTT2 | Tasmota | ESPEasy
VCCU->14xSEC-SCo, 7xCC-RT-DN, 5xLC-Bl1PBU-FM, 3xTC-IT-WM-W-EU, 1xPB-2-WM55, 1xLC-Sw1PBU-FM, 1xES-PMSw1-Pl

OdfFhem

@yersinia

Die sich nach dem devspec-Muster ergebende Anpassung sähe ungefähr so aus:

list TYPE=MQTT[2]?_[D]EVICE:FILTER=readingList~.*tele[/].*INFO.*:FILTER=Version!=,TYPE=MQTT[2]?_[D]EVICE:FILTER=readingList~.*tele[/].*INFO.*:FILTER=INFO1_Version!=,TYPE=MQTT[2]?_[D]EVICE:FILTER=readingList~.*tele[/].*INFO.*:FILTER=Info1_Version!=


Damit sollten sich nur in Frage kommende Geräte qualifizieren und die kaskadierende Ermittlung der installierten Version zum Erfolg führen ...

OdfFhem

Templates für tasmota bzw. zigbee2mqtt überarbeitet:
- das Attribut stateFormat legt jetzt nur noch den Inhalt von STATE fest
- das Attribut devStateIcon legt die anzuzeigende (Tabellen)Information fest


#Contributed by OdfFHEM
name:tasmota_firmware_updates
filter:TYPE=HTTPMOD
desc: Check Tasmota homepage for available new firmware files<br>Define a HTTPMOD device like <br>define tasmotaupdates HTTPMOD https://github.com/arendst/Tasmota/tags 86400<a href="https://forum.fhem.de/index.php/topic,97694.msg992308.html#msg992308">Source: Forum</a>.
order:TECHZ06
par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )}
par:UPDATABLEMODE;Actual mode for updatableDevices, defaults to onlyUpdatable; {AttrVal("DEVICE","updatableDevicesMode","onlyUpdatable")}
par:INTERVAL;Actual interval for updating, defaults to one week; {InternalVal("DEVICE","Interval","604800")}
defmod DEVICE HTTPMOD https://api.github.com/repos/arendst/Tasmota/releases/latest INTERVAL
attr DEVICE userattr reading01JSON reading01Name reading01OExpr reading02JSON reading02Name reading02OExpr updatableDevicesMode:onlyUpdatable,all
attr DEVICE devStateIcon {\
  my $ret ="";;\
  $ret .= '<div style="text-align:left;;">';;\
  my $lastCheck = POSIX::strftime("%d.%m.%Y, %H:%M",localtime(time_str2num(ReadingsTimestamp($name,"MATCHED_READINGS","1970-01-01 00:00:00"))));;\
  $ret .= '<div style="text-align:left;;">last <a title="versions" href="'.InternalVal($name,"MainURL","unknown").'" target="_blank">tasmota</a>-check => '.$lastCheck.' ...</div>';;\
  $ret .= '<br><pre>';;\
  my $check = ReadingsVal($name,"updatableDevices","error => no or wrong data from server!");;\
  if($check eq "no updates needed!") {\
    $ret .= '<b style="color:green;;">';;\
    $ret .= sprintf("%-68s",$check);;\
    $ret .= '</b>';;\
  } elsif($check eq "error => no or wrong data from server!") {\
    $ret .= '<b style="color:red;;">';;\
    $ret .= sprintf("%-68s",$check);;\
    $ret .= '</b>';;\
  } else {\
    $ret .= "| device                           | current |   new   |  released  |<br>";;\
    $ret .= "---------------------------------------------------------------------<br>";;\
    my @devices = split(',',$check);;\
    splice(@devices, 0, 1);;\
    foreach my $devStr (@devices) {\
      my ($dev,$old,$new,$date,$updatable) = $devStr =~ m/^([^\s]+)\s\(([^\s]+)\s\|\s([^\s]+)\s\|\s([^\)]+)\s\|\s([^\)]+)\)$/;;\
      $ret .= '| <a href="/fhem?detail='.$dev.'"><b>';;\
      $ret .= sprintf("%-32s",AttrVal($dev,"alias",$dev));;\
      $ret .= '</b></a> | ';;\
      $ret .= '<b>';;\
      $ret .= '<a href="http://'.ReadingsVal($dev,"Info2_IPAddress", ReadingsVal($dev,"INFO2_IPAddress", ReadingsVal($dev,"IPAddress","0.0.0.0"))).'/up" target="_blank">';;\
      $ret .= sprintf("%7s",$old);;\
      $ret .= '</a></b> | ';;\
      $ret .= '<a href="https://github.com/arendst/Tasmota/releases/tag/v'.$new.'" target="_blank">';;\
      $ret .= '<b'.(($updatable eq "0")?'':' style="color:red;;"').'>';;\
      $ret .= sprintf("%7s",$new);;\
      $ret .= '</b></a> | ';;\
      $ret .= '<a href="https://github.com/arendst/Tasmota/releases/tag/v'.$new.'" target="_blank">';;\
      $ret .= '<b>';;\
      $ret .= sprintf("%-10s",$date);;\
      $ret .= '</b></a>';;\
      $ret .= " |<br>";;\
    }\
  }\
  $ret .= '</pre><br>';;\
  my $nextCheck = POSIX::strftime("%d.%m.%Y, %H:%M",localtime(InternalVal($name,".TRIGGERTIME",0)));;\
  $ret .= '<div style="text-align:left;;">... next <a title="versions" href="'.InternalVal($name,"MainURL","unknown").'" target="_blank">tasmota</a>-check => '.$nextCheck.'</div>';;\
  $ret .= '</div>';;\
  return $ret;;\
}
attr DEVICE enableControlSet 1
attr DEVICE event-on-change-reading .*
attr DEVICE event-on-update-reading LAST_ERROR,MATCHED_READINGS
attr DEVICE handleRedirects 0
deleteattr DEVICE reading01Regex
attr DEVICE reading01JSON tag_name
attr DEVICE reading01Name latestVersion
attr DEVICE reading01OExpr $val =~ m/^v(\d+).(\d+).(\d+)$/ ;; "$1.$2.$3"
deleteattr DEVICE reading02Regex
attr DEVICE reading02JSON published_at
attr DEVICE reading02Name latestDate
attr DEVICE reading02OExpr $val =~ m/^(.{4})-(.{2})-(.{2})T..:..:..Z$/ ;; "$3.$2.$1"
attr DEVICE showError 1
attr DEVICE showMatched 1
attr DEVICE stateFormat {\
  my $ret ="";;\
  my $check = ReadingsVal($name,"updatableDevices","error => no or wrong data from server!");;\
  if($check eq "no updates needed!") {\
    $ret .= sprintf("%s",$check);;\
  } elsif($check eq "error => no or wrong data from server!") {\
    $ret .= sprintf("%s",$check);;\
  } else {\
    $ret .= sprintf("%s update(s) needed",(split(',',$check))[0]);;\
  }\
  return $ret;;\
}
attr DEVICE timestamp-on-change-reading .*
attr DEVICE updatableDevicesMode UPDATABLEMODE
attr DEVICE userReadings updatableDevices:MATCHED_READINGS.* {\
  my $ret = "";;\
  if (ReadingsVal($name,"MATCHED_READINGS","") eq "") {\
    $ret = "error => no or wrong data from server!";;\
  } else {\
    my $VERSION = ReadingsVal($name,"latestVersion","unknown");;\
    my $DATE = ReadingsVal($name,"latestDate","unknown");;\
    my $updatableCounter = 0;;\
    my $devspec = "TYPE=MQTT[2]?_[D]EVICE:FILTER=readingList~.*tele[/].*INFO.*:FILTER=Version!=";;\
    $devspec .= ",TYPE=MQTT[2]?_[D]EVICE:FILTER=readingList~.*tele[/].*INFO.*:FILTER=INFO1_Version!=";;\
    $devspec .= ",TYPE=MQTT[2]?_[D]EVICE:FILTER=readingList~.*tele[/].*INFO.*:FILTER=Info1_Version!=";;\
    foreach my $dev (devspec2array($devspec)) {\
      my $version = ReadingsVal($dev,"Info1_Version", ReadingsVal($dev,"INFO1_Version", ReadingsVal($dev,"Version","0.0.0")));;\
      $version =~ m/([0-9.]*).*/;;\
      $version = $1;;\
      my $updatable = ($version ne $VERSION)?"1":"0";;\
      if ( AttrVal($name,"updatableDevicesMode","onlyUpdatable") eq "all" || $updatable ne "0" ) {\
        $ret .= "," if($ret ne "");;\
        $ret .= $dev." (".$version." | ".$VERSION." | ".$DATE." | ".$updatable.")";;\
      }\
      $updatableCounter += 1 if ($updatable ne "0");;\
    }\
    $ret = $updatableCounter.",".$ret if($ret ne "");;\
  }\
  return ($ret eq "")?"no updates needed!":$ret;;\
}
attr DEVICE webCmd reread
attr DEVICE room WHICHROOM
attr DEVICE model tasmota_firmware_updates
setreading DEVICE attrTemplateVersion 20220828
set DEVICE reread



#Contributed by OdfFHEM
name:zigbee2mqtt_daemon_updates
filter:TYPE=HTTPMOD
desc: Check zigbee2mqtt homepage for new versions of the deamon software.<br>Define a HTTPMOD device like <br>define zigbee2mqtt_updates HTTPMOD https://github.com/Koenkk/zigbee2mqtt/tags 604800<br><a href="https://forum.fhem.de/index.php/topic,97694.msg998835.html#msg998835">Source: Forum</a>.
order:TECHZ07
par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )}
par:INTERVAL;Actual interval for updating, defaults to one day; {InternalVal("DEVICE","Interval",604800)}
par:UPDATABLEMODE;Actual mode for updatableDevices, defaults to onlyUpdatable; {AttrVal("DEVICE","updatableDevicesMode","onlyUpdatable")}
defmod DEVICE HTTPMOD https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest INTERVAL
attr DEVICE userattr reading01JSON reading01Name reading01OExpr reading02JSON reading02Name reading02OExpr updatableDevicesMode:onlyUpdatable,all
attr DEVICE devStateIcon {\
  my $ret ="";;\
  $ret .= '<div style="text-align:left">';;\
  my $lastCheck = POSIX::strftime("%d.%m.%Y, %H:%M",localtime(time_str2num(ReadingsTimestamp($name,"MATCHED_READINGS","1970-01-01 00:00:00"))));;\
  $ret .= '<div style="text-align:left;;">last <a title="versions" href="'.InternalVal($name,"MainURL","unknown").'" target="_blank">zigbee2mqtt</a>-check => '.$lastCheck.' ...</div>';;\
  $ret .= '<br><pre>';;\
  my $check = ReadingsVal($name,"updatableDevices","error => no or wrong data from server!");;\
  if($check eq "no updates needed!") {\
    $ret .= '<b style="color:green">';;\
    $ret .= sprintf("%-65s",$check);;\
    $ret .= '</b>';;\
  } elsif($check eq "error => no or wrong data from server!") {\
    $ret .= '<b style="color:red">';;\
    $ret .= sprintf("%-65s",$check);;\
    $ret .= '</b>';;\
  } else {\
    $ret .= "| device                           | current |   new   |  released  |<br>";;\
    $ret .= "---------------------------------------------------------------------<br>";;\
    my @devices = split(',',$check);;\
    splice(@devices, 0, 1);;\
    foreach my $devStr (@devices) {\
      my ($dev,$old,$new,$date,$updatable) = $devStr =~ m/^([^\s]+)\s\(([^\s]+)\s\|\s([^\s]+)\s\|\s([^\)]+)\s\|\s([^\)]+)\)$/;;\
      $ret .= '| <a href="/fhem?detail='.$dev.'"><b>';;\
      $ret .= sprintf("%-32s",$dev);;\
      $ret .= '</b></a> | ';;\
      $ret .= '<b>';;\
      $ret .= sprintf("%7s",$old);;\
      $ret .= '</b> | ';;\
      $ret .= '<a href="https://github.com/Koenkk/zigbee2mqtt/releases/tag/'.$new.'" target="_blank">';;\
      $ret .= '<b'.(($updatable eq "0")?'':' style="color:red;;"').'>';;\
      $ret .= sprintf("%7s",$new);;\
      $ret .= '</b></a> | ';;\
      $ret .= '<a href="https://github.com/Koenkk/zigbee2mqtt/releases/tag/'.$new.'" target="_blank">';;\
      $ret .= '<b>';;\
      $ret .= sprintf("%-10s",$date);;\
      $ret .= '</b></a>';;\
      $ret .= " |<br>";;\
    }\
  }\
  $ret .= '</pre><br>';;\
  my $nextCheck = POSIX::strftime("%d.%m.%Y, %H:%M",localtime(InternalVal($name,".TRIGGERTIME",0)));;\
  $ret .= '<div style="text-align:left;;">... next <a title="versions" href="'.InternalVal($name,"MainURL","unknown").'" target="_blank">zigbee2mqtt</a>-check => '.$nextCheck.'</div>';;\
  $ret .= '</div>';;\
  return $ret;;\
}
attr DEVICE enableControlSet 1
attr DEVICE event-on-change-reading .*
attr DEVICE event-on-update-reading LAST_ERROR,MATCHED_READINGS
attr DEVICE handleRedirects 0
deleteattr DEVICE reading01Regex
attr DEVICE reading01JSON tag_name
attr DEVICE reading01Name latestVersion
attr DEVICE reading01OExpr $val =~ m/^(\d+).(\d+).(\d+)$/ ;; "$1.$2.$3"
deleteattr DEVICE reading02Regex
attr DEVICE reading02JSON published_at
attr DEVICE reading02Name latestDate
attr DEVICE reading02OExpr $val =~ m/^(.{4})-(.{2})-(.{2})T..:..:..Z$/ ;; "$3.$2.$1"
attr DEVICE showError 1
attr DEVICE showMatched 1
attr DEVICE stateFormat {\
  my $ret ="";;\
  my $check = ReadingsVal($name,"updatableDevices","error => no or wrong data from server!");;\
  if($check eq "no updates needed!") {\
    $ret .= sprintf("%s",$check);;\
  } elsif($check eq "error => no or wrong data from server!") {\
    $ret .= sprintf("%s",$check);;\
  } else {\
    $ret .= sprintf("%s update(s) needed",(split(',',$check))[0]);;\
  }\
  return $ret;;\
}
attr DEVICE updatableDevicesMode UPDATABLEMODE
attr DEVICE timestamp-on-change-reading .*
attr DEVICE userReadings updatableDevices:MATCHED_READINGS.* {\
  my $ret = "";;\
  if (ReadingsVal($name,"MATCHED_READINGS","") eq "") {\
    $ret = "error => no or wrong data from server!";;\
  } else {\
    my $VERSION = ReadingsVal($name,"latestVersion","unknown");;\
    my $DATE = ReadingsVal($name,"latestDate","unknown");;\
    my $updatableCounter = 0;;\
    my $devspec = "TYPE=MQTT[2]?_[D]EVICE:FILTER=NAME=.*zigbee.*bridge.*";;\
    foreach my $dev (devspec2array($devspec)) {\
      my $version = ReadingsVal($dev,"version","0.0.0");;\
      $version =~ m/([0-9.]*).*/;;\
      $version = $1;;\
      my $updatable = ($version ne $VERSION)?"1":"0";;\
      if (AttrVal($name,"updatableDevicesMode","onlyUpdatable") eq "all" || $updatable ne "0") {\
        $ret .= "," if($ret ne "");;\
        $ret .= $dev." (".$version." | ".$VERSION." | ".$DATE." | ".$updatable.")";;\
      }\
      $updatableCounter += 1 if ($updatable ne "0");;\
    }\
    $ret = $updatableCounter.",".$ret if($ret ne "");;\
  }\
  return ($ret eq "")?"no updates needed!":$ret;;\
}
attr DEVICE webCmd reread
attr DEVICE room WHICHROOM
attr DEVICE model zigbee2mqtt_daemon_updates
setreading DEVICE attrTemplateVersion 20220828
set DEVICE reread


DasQ

hi,

da ich heut drüber gestolpert bin, dacht ich ich verlink das mal hier, da des template für easyoil nimmer stimmt.

Zitat von: yersinia am 20 Juli 2021, 10:40:16
Da esyoil sich nicht mehr abfragen lässt, habe ich den Weg via check24 gefunden - lustigerweise nutzt check24 nach Angaben auf deren Webseite den Service von esyoil. Anbei die neue & erweiterte raw:
defmod Heizoel_esyoil HTTPMOD https://www.check24.de/heizoel/?c24_calculate=calculate&zipcode=%%PLZ%%&amount=%%MENGE%%&up=%%ENTLADESTELLEN%%&prod=%%OILGRADE%%&payment_type=%%PAYMENT%%&%%ANHANGER%%&%%SCHLAUCHLAENGE%%&%%EXPRESS%% 3600
attr Heizoel_esyoil userattr replacement03Value:1,2,3,4,5,6,7,8,9,10 replacement04Value:hose=,hose=hose_l,hose=hose_xl replacement05Value:short_vehicle=,short_vehicle=short_vehicle replacement06Value:8,4 replacement07Value:1,2,3,4,6 replacement08Value:express=,express=1
attr Heizoel_esyoil enableControlSet 1
attr Heizoel_esyoil reading010Name Heizoelpreis
attr Heizoel_esyoil reading010OExpr $val =~ s/,/\./;; $val;;
attr Heizoel_esyoil reading010Regex ([\d\,]+)\&nbsp\;;\&euro\;;
attr Heizoel_esyoil replacement01Mode text
attr Heizoel_esyoil replacement01Regex %%PLZ%%
attr Heizoel_esyoil replacement01Value 12345
attr Heizoel_esyoil replacement02Mode text
attr Heizoel_esyoil replacement02Regex %%MENGE%%
attr Heizoel_esyoil replacement02Value 5000
attr Heizoel_esyoil replacement03Mode text
attr Heizoel_esyoil replacement03Regex %%ENTLADESTELLEN%%
attr Heizoel_esyoil replacement03Value 1
attr Heizoel_esyoil replacement04Mode text
attr Heizoel_esyoil replacement04Regex %%SCHLAUCHLAENGE%%
attr Heizoel_esyoil replacement04Value hose=
attr Heizoel_esyoil replacement05Mode text
attr Heizoel_esyoil replacement05Regex %%ANHAENGER%%
attr Heizoel_esyoil replacement05Value short_vehicle=
attr Heizoel_esyoil replacement06Mode text
attr Heizoel_esyoil replacement06Regex %%OILGRADE%%
attr Heizoel_esyoil replacement06Value 8
attr Heizoel_esyoil replacement07Mode text
attr Heizoel_esyoil replacement07Regex %%PAYMENT%%
attr Heizoel_esyoil replacement07Value 2
attr Heizoel_esyoil replacement08Mode text
attr Heizoel_esyoil replacement08Regex %%EXPRESS%%
attr Heizoel_esyoil replacement08Value express=
attr Heizoel_esyoil stateFormat { my $price = 0.0;;\
$price = (AttrNum($name,"replacement02Value",0)*ReadingsNum($name,"Heizoelpreis",0))/100;;\
#my $lastCheck = POSIX::strftime("%d.%m. %H:%M",localtime(time_str2num(ReadingsTimestamp($name,"Heizoelpreis","2000-01-01 00:00:00"))));;\
#my $lastCheck = FmtDateTime(InternalVal($name,".LastUpdate",0));;\
my $lastCheck = ReadingsTimestamp($name,"Heizoelpreis","");;\
my $ret = "<div style=\"text-align: left;;\">".$lastCheck.":";;\
my $link = "https://www.check24.de/heizoel/?c24_calculate=calculate";;\
$link .= "&zipcode=".AttrVal($name,"replacement01Value","");;\
$link .= "&amount=".AttrVal($name,"replacement02Value","");;\
$link .= "&up=".AttrVal($name,"replacement03Value","");;\
$link .= "&".AttrVal($name,"replacement04Value","");; #hose length\
$link .= "&".AttrVal($name,"replacement05Value","");; #short vehicle\
$link .= "&prod=".AttrVal($name,"replacement06Value","");; # product 8 = normal schwefelarm 4 = premium schwefelarm\
$link .= "&payment_type=".AttrVal($name,"replacement07Value","");; # 1 = Barzahlung, 2 = EC-Karte, 3 = Vorkasse, 4 = Lastschrift, 5 = Wärmekonto, 6 = Rechnung, 10 = Ratenkauf\
$link .= "&".AttrVal($name,"replacement08Value","");; #express;;\
$ret .= "&nbsp;;<a href=\"".$link."\" rel=\"noopener noreferrer\" target=\"_blank\" style=\"font-weight:bold;;\">";;\
$ret .= ReadingsVal($name,"Heizoelpreis","-");;\
$ret .= "&euro;;</a>/100l";;\
$ret .= "&nbsp;;(".AttrVal($name,"replacement02Value","0")."l = ";;\
$ret .= sprintf("%.2f",$price);;\
$ret .= "&euro;;)</div>";;\
return $ret;;\
}
attr Heizoel_esyoil timeout 10
attr Heizoel_esyoil webCmd reread

Dabei sind

  • replacement01Value => Postleitzahl
  • replacement02Value => Bestellmenge
  • replacement03Value => Entladestellen
  • replacement04Value => Schlauchlänge (hose= = egal; hose=hose_l = 60m; hose=hose_xl = 80m)
  • replacement05Value => Tankwagen mit/ohne Anhänger (short_vehicle= = mit Anhänger möglich; short_vehicle=short_vehicle = ohne Anhänger)
  • replacement06Value => Ölsorte (8 = normal schwefelarm; 4 = premium schwefelarm)
  • replacement07Value => Zahlart (1 = Bar; 2 = EC-Karte; 3 = Vorkasse; 4 = Lastschrift; 6 = Rechnung)
  • replacement08Value => Expresslieferung (express= = nein; express=1 = ja)



EDIT: @amenomade: ein Vorschlag für das Template:
#Contributed by subseven & yersinia, see https://forum.fhem.de/index.php/topic,107189.msg1167281.html#msg1167281
name:fuel_oil_check_esyoil
filter:TYPE=HTTPMOD
desc: checks fuel oil prices via check24.de (service provided by esyoil.com)<br />Define a HTTPMOD device like<br />define heizoelpreis HTTPMOD https://www.check24.de/heizoel/?c24_calculate=calculate&zipcode=%%PLZ%%&amount=%%MENGE%%&up=%%ENTLADESTELLEN%%&prod=%%OILGRADE%%&payment_type=%%PAYMENT%%&%%ANHANGER%%&%%SCHLAUCHLAENGE%%&%%EXPRESS%% 3600<br />Maintain Attributes for ZIP (PLZ), order volume (Bestellmenge), unloading points (Entladestellen), hose length (Schlauchlaenge), truck trailer accessibility (mit Anhaenger moeglich), oilgrade (Oelsorte), payment method (Zahlart) and express delivery (Expresslieferung) before senseful values can be retrieved.<br />Further information and documentation can be found in <a href="https://forum.fhem.de/index.php/topic,107189.msg1167281.html#msg1167281">this FHEM forum thread</a>
par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD")}
par:INTERVAL;Actual interval for updating, defaults to hourly (3600s); {InternalVal("DEVICE","Interval","3600")}
par:ZIPCODE;German ZIP Code / deutsche Postleitzahl; {AttrVal("DEVICE","replacement01Value","12345")}
par:ORDERVOLUME;fuel order volume in litre / Bestellmenge in Liter; {AttrVal("DEVICE","replacement02Value","5000")}
defmod DEVICE HTTPMOD https://www.check24.de/heizoel/?c24_calculate=calculate&zipcode=%%PLZ%%&amount=%%MENGE%%&up=%%ENTLADESTELLEN%%&prod=%%OILGRADE%%&payment_type=%%PAYMENT%%&%%ANHANGER%%&%%SCHLAUCHLAENGE%%&%%EXPRESS%% INTERVAL
attr DEVICE userattr replacement03Value:1,2,3,4,5,6,7,8,9,10 replacement04Value:hose=,hose=hose_l,hose=hose_xl replacement05Value:short_vehicle=,short_vehicle=short_vehicle replacement06Value:8,4 replacement07Value:1,2,3,4,6 replacement08Value:express=,express=1
attr DEVICE enableControlSet 1
attr DEVICE reading010Name Heizoelpreis
attr DEVICE reading010OExpr $val =~ s/,/\./;; $val;;
attr DEVICE reading010Regex ([\d\,]+)\&nbsp\;;\&euro\;;
attr DEVICE replacement01Mode text
attr DEVICE replacement01Regex %%PLZ%%
attr DEVICE replacement01Value ZIPCODE
attr DEVICE replacement02Mode text
attr DEVICE replacement02Regex %%MENGE%%
attr DEVICE replacement02Value ORDERVOLUME
attr DEVICE replacement03Mode text
attr DEVICE replacement03Regex %%ENTLADESTELLEN%%
attr DEVICE replacement03Value 1
attr DEVICE replacement04Mode text
attr DEVICE replacement04Regex %%SCHLAUCHLAENGE%%
attr DEVICE replacement04Value hose=
attr DEVICE replacement05Mode text
attr DEVICE replacement05Regex %%ANHAENGER%%
attr DEVICE replacement05Value short_vehicle=
attr DEVICE replacement06Mode text
attr DEVICE replacement06Regex %%OILGRADE%%
attr DEVICE replacement06Value 8
attr DEVICE replacement07Mode text
attr DEVICE replacement07Regex %%PAYMENT%%
attr DEVICE replacement07Value 2
attr DEVICE replacement08Mode text
attr DEVICE replacement08Regex %%EXPRESS%%
attr DEVICE replacement08Value express=
attr DEVICE stateFormat { my $price = 0.0;;\
$price = (AttrNum($name,"replacement02Value",0)*ReadingsNum($name,"Heizoelpreis",0))/100;;\
my $lastCheck = ReadingsTimestamp($name,"Heizoelpreis","");;\
my $ret = "<div style=\"text-align: left;;\">".$lastCheck.":";;\
my $link = "https://www.check24.de/heizoel/?c24_calculate=calculate";;\
$link .= "&zipcode=".AttrVal($name,"replacement01Value","");;\
$link .= "&amount=".AttrVal($name,"replacement02Value","");;\
$link .= "&up=".AttrVal($name,"replacement03Value","");;\
$link .= "&".AttrVal($name,"replacement04Value","");; #hose length\
$link .= "&".AttrVal($name,"replacement05Value","");; #short vehicle\
$link .= "&prod=".AttrVal($name,"replacement06Value","");; # product 8 = normal schwefelarm 4 = premium schwefelarm\
$link .= "&payment_type=".AttrVal($name,"replacement07Value","");; # 1 = Barzahlung, 2 = EC-Karte, 3 = Vorkasse, 4 = Lastschrift, 5 = Wärmekonto, 6 = Rechnung, 10 = Ratenkauf\
$link .= "&".AttrVal($name,"replacement08Value","");; #express;;\
$ret .= "&nbsp;;<a href=\"".$link."\" rel=\"noopener noreferrer\" target=\"_blank\" style=\"font-weight:bold;;\">";;\
$ret .= ReadingsVal($name,"Heizoelpreis","-");;\
$ret .= "&euro;;</a>/100l";;\
$ret .= "&nbsp;;(".AttrVal($name,"replacement02Value","0")."l = ";;\
$ret .= sprintf("%.2f",$price);;\
$ret .= "&euro;;)</div>";;\
return $ret;;\
}
attr DEVICE timeout 10
attr DEVICE webCmd reread
attr DEVICE room WHICHROOM
attr DEVICE model fuel_oil_check_esyoil
setreading DEVICE attrTemplateVersion 20210720


in wie weit des noch aktuell ist kann ich nicht sagen, aber es funktioniert.
Fhem on MacMini/Ubuntu.
Absoluter Befürworter der Konsequenten-Kleinschreibung https://de.wikipedia.org/wiki/Kleinschreibung
Infos zu Klimawandel http://www.globalcarbonatlas.org

DasQ

hi,

ich nochmals.

also mir ist jetzt aufgefallen das mit dem single tankstellen template mir haufenweise "fehler" im log auf tauchen.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211973) line 1.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211974) line 1.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211976) line 1.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211977) line 1.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211979) line 1.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211980) line 1.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211988) line 1.

2022.11.14 18:09:29 2: Undefined subroutine &main::KraftstoffLP called at (eval 211989) line 1.


jetzt kann ich nicht sagen ob es aus meiner readingsgroup kommt oder aus dem httpmod

list httpmod
Internals:
   BUSY       0
   DEF        http://www.clever-tanken.de/tankstelle_details/56801 600
   FUUID      636b8658-f33f-5aff-a325-145c63a4b51896eb
   Interval   600
   MainURL    http://www.clever-tanken.de/tankstelle_details/56801
   ModuleVersion 4.1.14 - 19.8.2022
   NAME       Tankstelle_Avia_Wiggensbach
   NOTIFYDEV  global
   NR         182
   NTFY_ORDER 50-Tankstelle_Avia_Wiggensbach
   STATE      E5: 1.929 € / E10: 1.869 € / D: 2.049 €
   TYPE       HTTPMOD
   eventCount 435
   value     
   CompiledRegexes:
   HTTPCookieHash:
     csrftoken;:
       Name       csrftoken
       Options    expires=Mon, 13 Nov 2023 17:46:02 GMT; Max-Age=31449600; Path=/; SameSite=Lax
       Path       
       Value      z9fwKPApgMklmhne1mSiuPb7E8Okg5tlfHX8JodIJhFS3eZE31MQVXNfJV8aInQd
   HttpUtils:
     NAME       
     addr       https://www.clever-tanken.de:443
     auth       0
     code       200
     compress   1
     conn       
     data       
     displayurl https://www.clever-tanken.de/tankstelle_details/56801
     header     Cookie: csrftoken=z9fwKPApgMklmhne1mSiuPb7E8Okg5tlfHX8JodIJhFS3eZE31MQVXNfJV8aInQd
     host       www.clever-tanken.de
     httpheader HTTP/1.1 200 OK
Date: Mon, 14 Nov 2022 17:46:02 GMT
Server: Apache/2.4.29 (Ubuntu)
Vary: Cookie,Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Set-Cookie: csrftoken=z9fwKPApgMklmhne1mSiuPb7E8Okg5tlfHX8JodIJhFS3eZE31MQVXNfJV8aInQd; expires=Mon, 13 Nov 2023 17:46:02 GMT; Max-Age=31449600; Path=/; SameSite=Lax
Connection: close
     httpversion 1.0
     hu_blocking 0
     hu_filecount 1
     hu_port    443
     hu_portSfx
     ignoreredirects 1
     loglevel   4
     path       /tankstelle_details/56801
     protocol   https
     redirects  0
     timeout    10
     url        https://www.clever-tanken.de/tankstelle_details/56801
     sslargs:
   QUEUE:
   READINGS:
     2022-11-14 18:46:02   Diesel          2.049
     2022-11-14 18:46:02   SuperE10        1.869
     2022-11-14 18:46:02   SuperE5         1.929
     2022-11-09 11:57:06   attrTemplateVersion 20201129
     2022-11-14 18:46:02   city            Wiggensbach
     2022-11-14 18:46:02   street          Kempter Str. 11
     2022-11-14 18:46:02   zip             87487
   REQUEST:
     context    reading
     data       
     header     
     ignoreredirects 0
     num        unknown
     priority   1
     retryCount 0
     type       update
     url        https://www.clever-tanken.de/tankstelle_details/56801
   defptr:
     readingBase:
       Diesel     reading
       SuperE10   reading
       SuperE5    reading
       city       reading
       street     reading
       zip        reading
     readingNum:
       Diesel     01
       SuperE10   02
       SuperE5    03
       city       09
       street     07
       zip        08
     readingOutdated:
     requestReadings:
       update:
         Diesel     reading 01
         SuperE10   reading 02
         SuperE5    reading 03
         city       reading 09
         street     reading 07
         zip        reading 08
Attributes:
   enableControlSet 1
   group      Kraftstoffe
   model      clever_tanken_single_station
   reading01Name Diesel
   reading01Regex <div class=\"price-type-name\">Diesel</div>[\S\s\r\n]*?<span id=\"current-price-\d+\">(\d.\d{2}</span>[\S\s\r\n]*?<sup id=\"suffix-price-\d\">[\d]+)</sup>
   reading02Name SuperE10
   reading02Regex <div class=\"price-type-name\">Super E10</div>[\S\s\r\n]*?<span id=\"current-price-\d+\">(\d.\d{2}</span>[\S\s\r\n]*?<sup id=\"suffix-price-\d\">[\d]+)</sup>
   reading03Name SuperE5
   reading03Regex <div class=\"price-type-name\">Super E5</div>[\S\s\r\n]*?<span id="current-price-\d+">(\d.\d{2}</span>[\S\s\r\n]*?<sup id=\"suffix-price-\d\">[\d]+)</sup>
   reading07Name street
   reading07Regex "streetAddress">(.*)<
   reading08Name zip
   reading08Regex "http://schema.org/postalCode">(.*)<
   reading09Name city
   reading09Regex "http://schema.org/addressCountry">(.*)<
   readingOExpr $val =~ s/<[\d\D]+>//;$val
   room       all
   stateFormat E5: SuperE5 € / E10: SuperE10 € / D: Diesel €
   timeout    10
   userattr   reading04Name reading04Regex
   verbose    2


list readingsgroup

Internals:
   DEF        <Tankstelle>,<Diesel>,<Super E5>,<Super E10>,<PLZ>,<Ort>,<Straße> Tankstelle_.*:Diesel,SuperE5,SuperE10,zip,city,street
   FUUID      636a618e-f33f-5aff-8fc7-eb87da630dbfce73
   NAME       rg_Kraftstoffpreise
   NR         169
   NTFY_ORDER 50-rg_Kraftstoffpreise
   STATE      Initialized
   TYPE       readingsGroup
   changed    0
   mayBeVisible 1
   CONTENT:
     Tankstelle_Avia_Wiggensbach 1
     Tankstelle_Fenepark 1
     Tankstelle_Jet_LinderStr 1
     Tankstelle_Kaufmarkt_WaHo 1
     Tankstelle_Ran 1
   CONTENT2:
   DEVICES:
     ARRAY(0x55a0e010ae78)
     ARRAY(0x55a0e030b598)
     ARRAY(0x55a0dfc73140)
     ARRAY(0x55a0dfea7a70)
     ARRAY(0x55a0dfa7f008)
     ARRAY(0x55a0df9dd228)
   fhem:
     lastDefChange 7
     last_update 1668347742.16653
   helper:
     DEF       
     valueFormat {"$1<sup>$2</sup> €" if ($READING=~/^Super|Diesel/ && $VALUE=~/^(\d\.\d\d)(\d)$/)}
     valueStyle {'style="color:green;font-weight:bold"' if ($READING=~/^Super|Diesel/ && $VALUE eq KraftstoffLP($READING))}
     cellStyle:
       r:1        style="font-weight:bold"
     positions:
       Tankstelle_Avia_Wiggensbach.Diesel 2:1
       Tankstelle_Avia_Wiggensbach.SuperE10 2:3
       Tankstelle_Avia_Wiggensbach.SuperE5 2:2
       Tankstelle_Avia_Wiggensbach.city 2:5
       Tankstelle_Avia_Wiggensbach.street 2:6
       Tankstelle_Avia_Wiggensbach.zip 2:4
       Tankstelle_Fenepark.Diesel 3:1
       Tankstelle_Fenepark.SuperE10 3:3
       Tankstelle_Fenepark.SuperE5 3:2
       Tankstelle_Fenepark.city 3:5
       Tankstelle_Fenepark.street 3:6
       Tankstelle_Fenepark.zip 3:4
       Tankstelle_Jet_LinderStr.Diesel 4:1
       Tankstelle_Jet_LinderStr.SuperE10 4:3
       Tankstelle_Jet_LinderStr.SuperE5 4:2
       Tankstelle_Jet_LinderStr.city 4:5
       Tankstelle_Jet_LinderStr.street 4:6
       Tankstelle_Jet_LinderStr.zip 4:4
       Tankstelle_Kaufmarkt_WaHo.Diesel 5:1
       Tankstelle_Kaufmarkt_WaHo.SuperE10 5:3
       Tankstelle_Kaufmarkt_WaHo.SuperE5 5:2
       Tankstelle_Kaufmarkt_WaHo.city 5:5
       Tankstelle_Kaufmarkt_WaHo.street 5:6
       Tankstelle_Kaufmarkt_WaHo.zip 5:4
       Tankstelle_Ran.Diesel 6:1
       Tankstelle_Ran.SuperE10 6:3
       Tankstelle_Ran.SuperE5 6:2
       Tankstelle_Ran.city 6:5
       Tankstelle_Ran.street 6:6
       Tankstelle_Ran.zip 6:4
     values:
       formated:
         undef
         ARRAY(0x55a0dfe6bbe0)
         ARRAY(0x55a0e00f1b80)
         ARRAY(0x55a0dfc68b80)
         ARRAY(0x55a0dfe6bb98)
         ARRAY(0x55a0e0477cd8)
         ARRAY(0x55a0e037e628)
       orig:
         undef
         ARRAY(0x55a0df9dbbc8)
         ARRAY(0x55a0e04834b0)
         ARRAY(0x55a0dfc7fb88)
         ARRAY(0x55a0e02ca5c8)
         ARRAY(0x55a0e041ced8)
         ARRAY(0x55a0e02e64e8)
       prefixsuffix:
         undef
         ARRAY(0x55a0dfa21158)
         ARRAY(0x55a0e04e2a40)
         ARRAY(0x55a0dfe65cd0)
         ARRAY(0x55a0dfd9a9f8)
         ARRAY(0x55a0df9dc4b0)
         ARRAY(0x55a0dfd69038)
Attributes:
   alias      Kraftstoffpreisübersicht
   cellStyle  {"r:1" => 'style="font-weight:bold"'}
   group      Kraftstoffe
   room       INFO
   valueFormat {"$1<sup>$2</sup> €" if ($READING=~/^Super|Diesel/ && $VALUE=~/^(\d\.\d\d)(\d)$/)}
   valueStyle {'style="color:green;font-weight:bold"' if ($READING=~/^Super|Diesel/ && $VALUE eq KraftstoffLP($READING))}


für nenn tip wär ich sehr dankbar

Fhem on MacMini/Ubuntu.
Absoluter Befürworter der Konsequenten-Kleinschreibung https://de.wikipedia.org/wiki/Kleinschreibung
Infos zu Klimawandel http://www.globalcarbonatlas.org

Otto123

Hi,

da es nur 2x in Deiner ReadingsGroup steht, kann es nur daher kommen ;)

ZitatvalueStyle {'style="color:green;font-weight:bold"' if ($READING=~/^Super|Diesel/ && $VALUE eq KraftstoffLP($READING))}

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

DasQ

Danke  ;)

nachdem ichs hier gepostet hatte, hab ich nochmals selber gesucht und auch gefunden ... wenn man schon blind aus dem wiki kopiert sollte man halt auch alles kopieren. der part zur "99_myUtils.pm" fehlte ganz einfach ... ich seckel.

Farbliche Hervorhebung

Folgender Code kommt in 99_myUtils.pm

###########################################################################################
### Funktion für Ermittlung vom niedrigsten Preis für readingsGroup rg_Kraftstoffpreise ###
###########################################################################################
# damit die Funktion richtig funktioniert müssen alle Tankstellennamen mit "Tankstelle_"
# beginnen oder entsprechend devspec2array auf die eigenen Namen anpassen

sub KraftstoffLP($) {
  my ($r) = @_;
  return (sort map {ReadingsNum($_,$r,999)} devspec2array("Tankstelle_.*"))[0];
}



sorry fürs off topic
Fhem on MacMini/Ubuntu.
Absoluter Befürworter der Konsequenten-Kleinschreibung https://de.wikipedia.org/wiki/Kleinschreibung
Infos zu Klimawandel http://www.globalcarbonatlas.org

50watt

Ich schlage folgende Änderung für das HTTPMOD template "zigbee2mqtt_daemon_updates" vor:
Statt (templateVersion: 20201129)
attr DEVICE reading01Regex commit-title">[\w\W]*?[\w\W]*?(\d*\.\d*\.\d*)[\w\W]*?
das:
attr DEVICE reading01Regex <a href=\"\/Koenkk\/zigbee2mqtt\/releases\/tag\/*?(\d*\.\d*\.\d*)[\w\W]*?</a>
Damit funktioniert (für mich) die Abfrage für die "latestVersion" von zigbee2mqtt wieder.
RaspberryPi, EnOcean PI
Sonos Play1, Connect
Eltako FT55, FSB61, FAM12, FSR12-4x