Hauptmenü

suppressReading

Begonnen von uwirt, 29 Mai 2024, 10:31:53

Vorheriges Thema - Nächstes Thema

uwirt

Ich wollte readings mit suppressReadings nicht anzeigen lassen. Nur leider habe ich das wohl nicht richtig verstanden. Die Readings die ich nicht angezeigt haben möchte beginnen alle mit RPI_HQCam_Allsky_. RPI_HQCam .* funktioniert schon mal nicht.

define Sarastro_RPI_HQCam_Allsky HTTPMOD http://127.0.0.1/html/getState_RPI_HQCam_Allsky.json 600
attr Sarastro_RPI_HQCam_Allsky userattr
attr Sarastro_RPI_HQCam_Allsky comment memUsage: MB\
cpuUsage: %
attr Sarastro_RPI_HQCam_Allsky devStateStyle style="text-align:right"
attr Sarastro_RPI_HQCam_Allsky enableCookies 1
attr Sarastro_RPI_HQCam_Allsky extractAllJSON 1
attr Sarastro_RPI_HQCam_Allsky room RPI
attr Sarastro_RPI_HQCam_Allsky stateFormat T: temp °C
attr Sarastro_RPI_HQCam_Allsky userReadings cpu_usage:RPI_HQCam_Allsky_cpuUsage.* { ReadingsVal($name,'RPI_HQCam_Allsky_cpuUsage',0)},\
mem_usage:RPI_HQCam_Allsky_memUsage.* { ReadingsVal($name,'RPI_HQCam_Allsky_memUsage',0)},\
cpu_temp:RPI_HQCam_Allsky_temp.* { ReadingsVal($name,'RPI_HQCam_Allsky_temp',0) =~ m{temp=([0-9.]+)}x;; $1}, volt:RPI_HQCam_Allsky_volt.* { ReadingsVal($name,'RPI_HQCam_Allsky_volt',0) =~ m{volt=([0-9.]+)}x;; $1}, frequency:RPI_HQCam_Allsky_freq.* { ReadingsVal($name,'RPI_HQCam_Allsky_freq',0) =~ m{frequency\(48\)=([0-9.]+)}x;; $1}
#   BUSY       0
#   DEF        http://127.0.0.1/html/getState_RPI_HQCam_Allsky.json 600
#   FUUID      66545aa7-f33f-fd73-c5e4-0b93f9a6973ad6fd
#   Interval   600
#   MainURL    http://127.0.0.1/html/getState_RPI_HQCam_Allsky.json
#   ModuleVersion 4.2.0 - 11.8.2023
#   NAME       Sarastro_RPI_HQCam_Allsky
#   NOTIFYDEV  global
#   NR         250
#   NTFY_ORDER 50-Sarastro_RPI_HQCam_Allsky
#   STATE      T: temp °C
#   TYPE       HTTPMOD
#   eventCount 59
#   value     
#   HttpUtils:
#     NAME       
#     addr       http://127.0.0.1:80
#     auth       0
#     buf       
#     code       200
#     compress   1
#     conn       
#     data       
#     displayurl http://127.0.0.1/html/getState_RPI_HQCam_Allsky.json
#     header     
#     host       127.0.0.1
#     httpheader HTTP/1.1 200 OK
#Date: Wed, 29 May 2024 08:29:51 GMT
#Server: Apache/2.4.52 (Ubuntu)
#Last-Modified: Wed, 29 May 2024 08:20:59 GMT
#ETag: "1d8-619936e274902"
#Accept-Ranges: bytes
#Content-Length: 472
#Connection: close
#Content-Type: application/json
#     httpversion 1.0
#     hu_blocking 0
#     hu_filecount 1
#     hu_port    80
#     hu_portSfx
#     ignoreredirects 1
#     loglevel   4
#     path       /html/getState_RPI_HQCam_Allsky.json
#     protocol   http
#     redirects  0
#     timeout    2
#     url        http://127.0.0.1/html/getState_RPI_HQCam_Allsky.json
#     sslargs:
#   OLDREADINGS:
#   QUEUE:
#   READINGS:
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_boot 2024-05-27 15:21:31
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_cpuUsage 1.5
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_date 2024-05-29T08:20:01+00:00
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_freq frequency(48)=1800404352
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_load  10:20:01 up 1 day, 18:58,  0 users,  load average: 0.36, 0.15, 0.11
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_memUsage 132
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_powerLed 255
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_temp temp=55.0'C
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_throttled throttled=0x0
#     2024-05-29 10:29:51   RPI_HQCam_Allsky_volt volt=0.9260V
#     2024-05-29 10:29:51   cpu_temp        55.0
#     2024-05-29 10:29:51   cpu_usage       1.5
#     2024-05-29 10:29:51   frequency       1800404352
#     2024-05-29 10:29:51   mem_usage       132
#     2024-05-29 10:29:51   volt            0.9260
#   REQUEST:
#     context    reading
#     data       
#     header     
#     ignoreredirects 0
#     num        unknown
#     retryCount 0
#     type       update
#     url        http://127.0.0.1/html/getState_RPI_HQCam_Allsky.json
#   defptr:
#     readingBase:
#       RPI_HQCam_Allsky_boot reading
#       RPI_HQCam_Allsky_cpuUsage reading
#       RPI_HQCam_Allsky_date reading
#       RPI_HQCam_Allsky_freq reading
#       RPI_HQCam_Allsky_load reading
#       RPI_HQCam_Allsky_memUsage reading
#       RPI_HQCam_Allsky_powerLed reading
#       RPI_HQCam_Allsky_temp reading
#       RPI_HQCam_Allsky_throttled reading
#       RPI_HQCam_Allsky_volt reading
#     readingNum:
#       RPI_HQCam_Allsky_boot unknown
#       RPI_HQCam_Allsky_cpuUsage unknown
#       RPI_HQCam_Allsky_date unknown
#       RPI_HQCam_Allsky_freq unknown
#       RPI_HQCam_Allsky_load unknown
#       RPI_HQCam_Allsky_memUsage unknown
#       RPI_HQCam_Allsky_powerLed unknown
#       RPI_HQCam_Allsky_temp unknown
#       RPI_HQCam_Allsky_throttled unknown
#       RPI_HQCam_Allsky_volt unknown
#     readingOutdated:
#     requestReadings:
#       update:
#         RPI_HQCam_Allsky_boot reading unknown
#         RPI_HQCam_Allsky_cpuUsage reading unknown
#         RPI_HQCam_Allsky_date reading unknown
#         RPI_HQCam_Allsky_freq reading unknown
#         RPI_HQCam_Allsky_load reading unknown
#         RPI_HQCam_Allsky_memUsage reading unknown
#         RPI_HQCam_Allsky_powerLed reading unknown
#         RPI_HQCam_Allsky_temp reading unknown
#         RPI_HQCam_Allsky_throttled reading unknown
#         RPI_HQCam_Allsky_volt reading unknown
#   hmccu:
#
setstate Sarastro_RPI_HQCam_Allsky T: temp °C
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_boot 2024-05-27 15:21:31
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_cpuUsage 1.5
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_date 2024-05-29T08:20:01+00:00
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_freq frequency(48)=1800404352
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_load  10:20:01 up 1 day, 18:58,  0 users,  load average: 0.36, 0.15, 0.11
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_memUsage 132
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_powerLed 255
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_temp temp=55.0'C
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_throttled throttled=0x0
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 RPI_HQCam_Allsky_volt volt=0.9260V
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 cpu_temp 55.0
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 cpu_usage 1.5
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 frequency 1800404352
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 mem_usage 132
setstate Sarastro_RPI_HQCam_Allsky 2024-05-29 10:29:51 volt 0.9260


FHEM / Ubuntu / fitlet2
HomeMatic: CCU3|HmIP-STHD|HmIP-PCBS|HmIP-PCBS2|HmIP-PCBS-BAT|HM-WDC7000|HM-WDS100-C6-O|HM-WDS40|HM-LC-Sw1-FM|HM-LC-RGBW-WM|HM-ES-PMSw1-Pl|HM-ES-TX-WM
NAS: DS218+|DS209j|DS216+II|DS412+
Devices: Panasonic Webcams|Withings|Gardena Smart|Tuya

betateilchen

Warum benutzt Du HTTPMOD um json Daten zu verarbeiten, benutzt dann extractAllJson, um alle readings zu erzeugen und entscheidest Dich dann, dass Du die readings gar nicht sehen möchtest?

Für mich ist das völlig absurd.

Verwende besser JsonMod, dann kannst Du genau die readings erzeugen lassen, die Du auch verwenden möchtest und kannst Dir das ganze Geraffel mit den userReadings ersparen.

Du benutzt doch (hoffentlich) auch nicht Excel, um einen Brief zu schreiben, oder?
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!