Änderung bei userReadings?

Begonnen von hgw77, 17 August 2018, 12:28:29

Vorheriges Thema - Nächstes Thema

hgw77

Hallo,

seit etwas längerer Zeit habe ich kein update des FHEM gemacht (lief alles wunderbar  ;)). Doch gestern war es dann mal wieder an der Zeit. Soweit so gut alles auf dem neuesten Stand aber plötzlich gehen meine userReadings nicht mehr  :-\

Hier ein einfacher Auschnitt:


attr CUL_EM_5 userReadings consumptionDay:consumption monotonic { sprintf("%.3f",ReadingsVal($name,'consumption',0)) }


ich habe ReadingsVal("CUL_EM_5",'consumption',0) per Hand probiert und da kommt ein wert zurück doch irgendwie wird das userReading "consumptionDay" nicht mehr geschrieben wenn ein neuer "consumption" Wert hereinkommt. Habe auch mal das sprintf entfernt doch auch hier ohne Erfolg. Seit dem Update wird "consumptionDay" nicht mehr geschrieben. Wenn ich die Dokumentation konsultiere sieht alles OK aus.

Irgendwelche Ideen?

Viele Grüße HG.

PS: Gibt es einen Weg die userReadings zu debuggen?


hgw77

OK, das hatte ich doch glatt überlesen

ZitatIm April 2016 hat sich die Verarbeitung des Triggers dahingehend geändert, dass die Trigger-Spezifikation jetzt als Regulärer Ausdruck interpretiert wird, damit also z.B. ein avgTemp:temperature geändert werden muss in avgTemp:temperature.*

damit hat sich mein Problem erledigt "consumption" muss auf "consumption.*" geändert werden und dann werden die reading wieder geschrieben :) jetzt heist es Fleißarbeit und alle configs anpassen....

froy.de

Hallo zusammen,

setzen die userReadings noch eine Unterstützung durch das jeweilige Device voraus?

Ich nutze userReadings bei zwei Devices um die Differenz zwischen zwei aufeinander folgenden Readings zu ermitteln und das dann anschließend zu plotten. Bei einem Device (OBIS) klappt das, bei einem anderen Device (mit dem Modbus-Device und speichern als Modul erstellt) klappt das nicht.
Folgende Konfiguration ist bei dem eigenen Device vorhanden:

define ModBusLine Modbus /dev/Waterkotte@9600
define Waterkotte WaterkotteWPCUC 1 120
attr Waterkotte icon sani_earth_source_heat_pump
attr Waterkotte comment Waterkotte AI1+ 5006.03
attr Waterkotte enableControlSet 1
attr Waterkotte alignTime 00:00
attr Waterkotte event-on-update-reading .*, Calc_.*
attr Waterkotte event-on-change-reading OH_.*, Info_.*, Hotwater_.*, Heat_.*, Cool_.*, Measured_.*
attr Waterkotte room Keller
attr Waterkotte group Waterkotte
attr Waterkotte oldreadings OH_.*
attr Waterkotte userReadings Calc_OH_Compr1:OH_Compressor1.* difference { ReadingsVal("Waterkotte", "OH_Compressor1", "");; } , Calc_OH_Cool:OH_Cooling.* difference { ReadingsVal("Waterkotte", "OH_Cooling", "");; },  Calc_OH_DomWtrCompr:OH_DomesticWaterCompressor.* difference { ReadingsVal("Waterkotte", "OH_DomesticWaterCompressor","");; }, Calc_OH_HeatCompr:OH_HeatingCompressor.* difference { ReadingsVal(Waterkotte, "OH_HeatingCompressor","");; }


Leider werden die Calc_OH_.* Readings auch und gerade bei Änderungen der OH_.* Readings weder erstellt noch ins filelog geschrieben.

Im filelog stehen nur die Device Readings, nicht aber die userReadings.
Nachstehend mit grep gefiltert auf "OH_Cool" (müsste OH_Cooling erwischen und auch Calc_OH_Cool...)

2018-08-17_00:51:03 Waterkotte OH_Cooling: 3224.0
2018-08-17_01:51:50 Waterkotte OH_Cooling: 3224.0
2018-08-17_03:19:57 Waterkotte OH_Cooling: 3224.0
2018-08-17_04:37:03 Waterkotte OH_Cooling: 3224.0
2018-08-17_05:37:53 Waterkotte OH_Cooling: 3224.0
2018-08-17_06:47:48 Waterkotte OH_Cooling: 3224.0
2018-08-17_07:48:49 Waterkotte OH_Cooling: 3224.0
2018-08-17_09:00:49 Waterkotte OH_Cooling: 3224.0
2018-08-17_09:59:15 Waterkotte OH_Cooling: 3224.8
2018-08-17_11:11:07 Waterkotte OH_Cooling: 3226.0
2018-08-17_12:19:00 Waterkotte OH_Cooling: 3227.1
2018-08-17_13:59:14 Waterkotte OH_Cooling: 3228.8
2018-08-17_14:29:00 Waterkotte OH_Cooling: 3229.3
2018-08-17_14:38:29 Waterkotte OH_Cooling: 3229.4
2018-08-17_15:22:28 Waterkotte OH_Cooling: 3229.7


Was mache ich falsch?

Danke und Gruß

Marco

CoolTux

Zitat von: froy.de am 17 August 2018, 16:28:58

define ModBusLine Modbus /dev/Waterkotte@9600
define Waterkotte WaterkotteWPCUC 1 120
attr Waterkotte icon sani_earth_source_heat_pump
attr Waterkotte comment Waterkotte AI1+ 5006.03
attr Waterkotte enableControlSet 1
attr Waterkotte alignTime 00:00
attr Waterkotte event-on-update-reading .*, Calc_.*
attr Waterkotte event-on-change-reading OH_.*, Info_.*, Hotwater_.*, Heat_.*, Cool_.*, Measured_.*
attr Waterkotte room Keller
attr Waterkotte group Waterkotte
attr Waterkotte oldreadings OH_.*
attr Waterkotte userReadings Calc_OH_Compr1:OH_Compressor1.* difference { ReadingsVal("Waterkotte", "OH_Compressor1", "");; } , Calc_OH_Cool:OH_Cooling.* difference { ReadingsVal("Waterkotte", "OH_Cooling", "");; },  Calc_OH_DomWtrCompr:OH_DomesticWaterCompressor.* difference { ReadingsVal("Waterkotte", "OH_DomesticWaterCompressor","");; }, Calc_OH_HeatCompr:OH_HeatingCompressor.* difference { ReadingsVal(Waterkotte, "OH_HeatingCompressor","");; }


Das ist nicht hilfreich. Bitte gebe list DEVICENAME ein und poste dann die Ausgabe hier. DEVICENAME ist natürlich durch Dein Devicenamen zu ersetzen.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

SVLoneStar

#4
Hallo - ich hänge mich hier mal an...UserReadings geht bei mir (seit 2 Tagen) auch nicht mehr.
Das Device heisst Unifi, ein LIST ist hier:


Internals:
   DEF        192.168.2.125 8443 crypt:59515c5f5d crypt:7654544117090d4552525f50 300 default
   NAME       Unifi
   NOTIFYDEV  global
   NR         182
   NTFY_ORDER 50-Unifi
   STATE      connected
   TYPE       Unifi
   VERSION    3.0.4
   .attraggr:
   .attrminint:
   .clientArray:
     UnifiSwitch
   .userReadings:
   READINGS:
     2018-08-18 22:03:54   -AP_AP-Light-1-Me_clients 3
     2018-08-18 22:03:54   -AP_AP-Light-1-Me_essid Wlan4Mi0nly102,Wlan4Mi0nly102
     2018-08-18 22:03:54   -AP_AP-Light-1-Me_locate off
     2018-08-18 22:03:54   -AP_AP-Light-1-Me_state ok
     2018-08-18 22:03:54   -AP_AP-Light-1-Me_utilization 25,2
     2018-08-18 22:03:54   -AP_AP-Pro-1-Me_clients 1
     2018-08-18 22:03:54   -AP_AP-Pro-1-Me_essid Wlan4Mi0nly102,Wlan4Mi0nly102
     2018-08-18 22:03:54   -AP_AP-Pro-1-Me_locate off
     2018-08-18 22:03:54   -AP_AP-Pro-1-Me_state ok
     2018-08-18 22:03:54   -AP_AP-Pro-1-Me_utilization 13,2
     2018-08-18 22:03:54   -AP_SW60-Me_clients 13
     2018-08-18 22:03:54   -AP_SW60-Me_locate off
     2018-08-18 22:03:54   -AP_SW60-Me_poePower 0
     2018-08-18 22:03:54   -AP_SW60-Me_state ok
     2018-08-18 22:03:54   -UC_events      262 (last 24h)
     2018-08-18 22:03:54   -UC_newClients 
     2018-08-18 22:03:54   -UC_unarchived_alerts 3
     2018-08-18 22:03:54   -UC_wlan_accesspoints 2
     2018-08-18 22:03:54   -UC_wlan_guests 0
     2018-08-18 22:03:54   -UC_wlan_state  ok
     2018-08-18 22:03:54   -UC_wlan_users  4
     2018-08-18 22:03:54   -WLAN_Wlan4Mi0nly102_state enabled
     ...
     2018-08-18 22:03:54   S7_Edge         connected
     2018-08-18 22:03:54   S7_Edge_accesspoint AP-Light-1-Me
     2018-08-18 22:03:54   S7_Edge_essid   Wlan4Mi0nly102
     2018-08-18 22:03:54   S7_Edge_hostname Samsung-Galaxy-S7-edge
     2018-08-18 22:03:54   S7_Edge_last_seen 2018-08-18 22:03:45
     2018-08-18 22:03:54   S7_Edge_snr     45
     2018-08-18 22:03:54   S7_Edge_uptime  10033
   accespoints:
     5b1c717ce4b0e63f984d5de2:
       _id        5b1c717ce4b0e63f984d5de2
       _uptime    76998
       bandsteering_mode off
       board_rev  33
       bytes      30013661
       bytes-d    190779
       bytes-r    9084
       cfgversion 32d6a5c911987975
       connect_request_ip 192.168.2.107
       connect_request_port 57717
       device_id  5b1c717ce4b0e63f984d5de2
       fw_caps    196151
       guest-num_sta 0
       guest_token 29183FAE3F7FF82EDC789085921012CD
       hw_caps    0
       inform_ip  192.168.2.125
       inform_url http://192.168.2.125:8080/inform
       ip         192.168.2.107
       known_cfgversion 32d6a5c911987975
       last_seen  1534622625
       led_override default
       license_state registered
       mac        f0:9f:c2:f3:ac:2c
       map_id     5b1c6ee8e4b0e63f984d5dde
       meshv3_peer_mac
       model      U7LT
       name       AP-Light-1-Me
       num_sta    3
       outdoor_mode_override default
       required_version 3.4.1
       rx_bytes   7200911
       rx_bytes-d 67295
       satisfaction 72
       serial     F09FC2F3AC2C
       site_id    5b1c6ee3e4b0e63f984d5dcc
       state      1
       tx_bytes   22812750
       tx_bytes-d 123484
       type       uap
       uptime     76998
       user-num_sta 3
       version    3.9.48.9248
       wifi_caps  16373
       wlangroup_id_na 5b1c6ee8e4b0e63f984d5dd7
       wlangroup_id_ng 5b1c6ee8e4b0e63f984d5dd7
       x          506.61693255821
       x_authkey  2124b0858d8ec628ea046bab086ffa48
       x_fingerprint fc:cc:be:25:be:17:2d:96:ab:31:86:ec:04:42:83:8f
       x_inform_authkey 2124b0858d8ec628ea046bab086ffa48
       x_ssh_hostkey_fingerprint fc:cc:be:25:be:17:2d:96:ab:31:86:ec:04:42:83:8f
       x_vwirekey 153e32d9c3ac757f12ed479ced066072
       y          362.697532670953
       antenna_table:
         HASH(0x3603198)
       config_network:
         ip         192.168.2.126
         type       dhcp
       countrycode_table:
       downlink_table:
         HASH(0x35f62a0)
       ethernet_table:
         HASH(0x35f5c70)
       port_table:
       radio_table:
         HASH(0x362a200)
         HASH(0x3638670)
       radio_table_stats:
         HASH(0x372f430)
         HASH(0x372fb20)
       scan_radio_table:
       ssh_session_table:
       stat:
         ap         f0:9f:c2:f3:ac:2c
         bytes      30013661
         datetime   2018-08-18T17:40:00Z
         duration   8448000
         guest-mac_filter_rejections 0
         guest-rx_bytes 0
         guest-rx_crypts 0
         guest-rx_dropped 0
         guest-rx_errors 0
         guest-rx_frags 0
         guest-rx_packets 0
         guest-tx_bytes 0
         guest-tx_dropped 0
         guest-tx_errors 0
         guest-tx_packets 0
         guest-tx_retries 0
         mac_filter_rejections 0
         o          ap
         oid        f0:9f:c2:f3:ac:2c
         rx_bytes   7200911
         rx_crypts  0
         rx_dropped 0
         rx_errors  0
         rx_frags   0
         rx_packets 37263
         site_id    5b1c6ee3e4b0e63f984d5dcc
         time       1534614000000
         tx_bytes   22812750
         tx_dropped 24
         tx_errors  0
         tx_packets 55834
         tx_retries 12575
         user-mac_filter_rejections 0
         user-rx_bytes 7200911
         user-rx_crypts 0
         user-rx_dropped 0
         user-rx_errors 0
         user-rx_frags 0
         user-rx_packets 37263
         user-tx_bytes 22812750
         user-tx_dropped 24
         user-tx_errors 0
         user-tx_packets 55834
         user-tx_retries 12575
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-rx_bytes 7200911
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-rx_packets 37263
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-tx_bytes 22812750
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-tx_dropped 24
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-tx_packets 55834
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-tx_retries 12575
         user-wifi0-mac_filter_rejections 0
         user-wifi0-rx_bytes 7200911
         user-wifi0-rx_crypts 0
         user-wifi0-rx_dropped 0
         user-wifi0-rx_errors 0
         user-wifi0-rx_frags 0
         user-wifi0-rx_packets 37263
         user-wifi0-tx_bytes 22812750
         user-wifi0-tx_dropped 24
         user-wifi0-tx_errors 0
         user-wifi0-tx_packets 55834
         user-wifi0-tx_retries 12575
         user-wifi1-mac_filter_rejections 0
         user-wifi1-rx_bytes 0
         user-wifi1-rx_crypts 0
         user-wifi1-rx_dropped 0
         user-wifi1-rx_errors 0
         user-wifi1-rx_frags 0
         user-wifi1-rx_packets 0
         user-wifi1-tx_bytes 0
         user-wifi1-tx_dropped 0
         user-wifi1-tx_errors 0
         user-wifi1-tx_packets 0
         user-wifi1-tx_retries 0
         wifi0-mac_filter_rejections 0
         wifi0-rx_bytes 7200911
         wifi0-rx_crypts 0
         wifi0-rx_dropped 0
         wifi0-rx_errors 0
         wifi0-rx_frags 0
         wifi0-rx_packets 37263
         wifi0-tx_bytes 22812750
         wifi0-tx_dropped 24
         wifi0-tx_errors 0
         wifi0-tx_packets 55834
         wifi0-tx_retries 12575
         wifi1-mac_filter_rejections 0
         wifi1-rx_bytes 0
         wifi1-rx_crypts 0
         wifi1-rx_dropped 0
         wifi1-rx_errors 0
         wifi1-rx_frags 0
         wifi1-rx_packets 0
         wifi1-tx_bytes 0
         wifi1-tx_dropped 0
         wifi1-tx_errors 0
         wifi1-tx_packets 0
         wifi1-tx_retries 0
       sys_stats:
         loadavg_1  0.00
         loadavg_15 0.05
         loadavg_5  0.02
         mem_buffer 0
         mem_total  129302528
         mem_used   70651904
       system-stats:
         cpu        1.5
         mem        54.6
         uptime     76998
       uplink:
         ip         0.0.0.0
         mac        f0:9f:c2:f3:ac:2c
         max_speed  1000
         name       eth0
         netmask    0.0.0.0
         num_port   1
         rx_bytes   2613346595
         rx_bytes-r 5475
         rx_dropped 2538
         rx_errors  0
         rx_multicast 0
         rx_packets 2127408
         speed      1000
         tx_bytes   115290946
         tx_bytes-r 3554
         tx_dropped 0
         tx_errors  0
         tx_packets 761742
         type       wire
       uplink_table:
       vap_table:
         HASH(0x367f708)
         HASH(0x36f68b8)
       vwire_table:
       vwire_vap_table:
         HASH(0x3678700)
         HASH(0x35db0d8)
       wlan_overrides:
     5b75f5c6df9942080deaf39f:
       _id        5b75f5c6df9942080deaf39f
       _uptime    77229
       adopt_ip   192.168.2.131
       adopt_url  http://192.168.2.125:8080/inform
       board_rev  26
       bytes      257081480
       bytes-d    0
       bytes-r    0
       cfgversion 036d191b298b5b29
       connect_request_ip 192.168.2.131
       connect_request_port 52314
       device_id  5b75f5c6df9942080deaf39f
       discovered_via l2
       fw_caps    196407
       guest-num_sta 0
       guest_token 453DCC66EE904F65A0B6A224C18BE617
       hw_caps    0
       inform_ip  192.168.2.125
       inform_url http://192.168.2.125:8080/inform
       ip         192.168.2.131
       known_cfgversion 036d191b298b5b29
       last_seen  1534622611
       led_override default
       led_override_color #0000ff
       led_override_color_brightness 100
       license_state registered
       mac        78:8a:20:53:89:33
       meshv3_peer_mac
       model      U7PG2
       name       AP-Pro-1-Me
       num_sta    1
       outdoor_mode_override default
       required_version 3.4.1
       rx_bytes   10279017
       rx_bytes-d 0
       satisfaction 60
       serial     788A20538933
       site_id    5b1c6ee3e4b0e63f984d5dcc
       state      1
       tx_bytes   246802463
       tx_bytes-d 0
       type       uap
       uplink_ap_mac f0:9f:c2:f3:ac:2c
       uptime     77229
       user-num_sta 1
       version    3.9.48.9248
       wifi_caps  16373
       x_authkey  e276227d8a69871e8b0b180f8a4584d7
       x_fingerprint f6:ed:65:9e:ff:88:95:c0:70:a6:97:f7:23:d3:65:47
       x_inform_authkey e276227d8a69871e8b0b180f8a4584d7
       x_ssh_hostkey_fingerprint f6:ed:65:9e:ff:88:95:c0:70:a6:97:f7:23:d3:65:47
       x_vwirekey 2a347ab3cfd195d1fb48bec50f530607
       antenna_table:
         HASH(0x362a590)
       config_network:
         ip         192.168.42.133
         type       dhcp
       countrycode_table:
       downlink_table:
       ethernet_table:
         HASH(0x3878700)
       port_table:
         HASH(0x38c1568)
         HASH(0x38c14d8)
       radio_table:
         HASH(0x3687910)
         HASH(0x38c1bf8)
       radio_table_stats:
         HASH(0x363c860)
         HASH(0x36619c0)
       scan_radio_table:
       ssh_session_table:
       stat:
         ap         78:8a:20:53:89:33
         bytes      257081480
         datetime   2018-08-18T17:40:00Z
         duration   8433000
         guest-mac_filter_rejections 0
         guest-rx_bytes 0
         guest-rx_crypts 0
         guest-rx_dropped 0
         guest-rx_errors 0
         guest-rx_frags 0
         guest-rx_packets 0
         guest-tx_bytes 0
         guest-tx_dropped 0
         guest-tx_errors 0
         guest-tx_packets 0
         guest-tx_retries 0
         mac_filter_rejections 0
         o          ap
         oid        78:8a:20:53:89:33
         rx_bytes   10279017
         rx_crypts  0
         rx_dropped 0
         rx_errors  0
         rx_frags   0
         rx_packets 100798
         site_id    5b1c6ee3e4b0e63f984d5dcc
         time       1534614000000
         tx_bytes   246802463
         tx_dropped 0
         tx_errors  1517
         tx_packets 154350
         tx_retries 15278
         user-mac_filter_rejections 0
         user-rx_bytes 10279017
         user-rx_crypts 0
         user-rx_dropped 0
         user-rx_errors 0
         user-rx_frags 0
         user-rx_packets 100798
         user-tx_bytes 246802463
         user-tx_dropped 0
         user-tx_errors 1517
         user-tx_packets 154350
         user-tx_retries 15278
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-rx_bytes 7035197
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-rx_packets 57033
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-tx_bytes 106547753
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-tx_packets 77753
         user-wifi0-ath0-5b1c717ce4b0e63f984d5de0-tx_retries 2366
         user-wifi0-mac_filter_rejections 0
         user-wifi0-rx_bytes 7035197
         user-wifi0-rx_crypts 0
         user-wifi0-rx_dropped 0
         user-wifi0-rx_errors 0
         user-wifi0-rx_frags 0
         user-wifi0-rx_packets 57033
         user-wifi0-tx_bytes 106547753
         user-wifi0-tx_dropped 0
         user-wifi0-tx_errors 0
         user-wifi0-tx_packets 77753
         user-wifi0-tx_retries 2366
         user-wifi1-ath3-5b1c717ce4b0e63f984d5de0-rx_bytes 3243820
         user-wifi1-ath3-5b1c717ce4b0e63f984d5de0-rx_packets 43765
         user-wifi1-ath3-5b1c717ce4b0e63f984d5de0-tx_bytes 140254710
         user-wifi1-ath3-5b1c717ce4b0e63f984d5de0-tx_errors 1517
         user-wifi1-ath3-5b1c717ce4b0e63f984d5de0-tx_packets 76597
         user-wifi1-ath3-5b1c717ce4b0e63f984d5de0-tx_retries 12912
         user-wifi1-mac_filter_rejections 0
         user-wifi1-rx_bytes 3243820
         user-wifi1-rx_crypts 0
         user-wifi1-rx_dropped 0
         user-wifi1-rx_errors 0
         user-wifi1-rx_frags 0
         user-wifi1-rx_packets 43765
         user-wifi1-tx_bytes 140254710
         user-wifi1-tx_dropped 0
         user-wifi1-tx_errors 1517
         user-wifi1-tx_packets 76597
         user-wifi1-tx_retries 12912
         wifi0-mac_filter_rejections 0
         wifi0-rx_bytes 7035197
         wifi0-rx_crypts 0
         wifi0-rx_dropped 0
         wifi0-rx_errors 0
         wifi0-rx_frags 0
         wifi0-rx_packets 57033
         wifi0-tx_bytes 106547753
         wifi0-tx_dropped 0
         wifi0-tx_errors 0
         wifi0-tx_packets 77753
         wifi0-tx_retries 2366
         wifi1-mac_filter_rejections 0
         wifi1-rx_bytes 3243820
         wifi1-rx_crypts 0
         wifi1-rx_dropped 0
         wifi1-rx_errors 0
         wifi1-rx_frags 0
         wifi1-rx_packets 43765
         wifi1-tx_bytes 140254710
         wifi1-tx_dropped 0
         wifi1-tx_errors 1517
         wifi1-tx_packets 76597
         wifi1-tx_retries 12912
       sys_stats:
         loadavg_1  0.05
         loadavg_15 0.12
         loadavg_5  0.08
         mem_buffer 0
         mem_total  129302528
         mem_used   70893568
       system-stats:
         cpu        3.3
         mem        54.8
         uptime     77229
       uplink:
         anomalies  3
         ap_mac     f0:9f:c2:f3:ac:2c
         auth_time  4270845919
         ccq        1000
         channel    100
         dhcpend_time 0
         dhcpstart_time 24341687
         hostname   Miele-001D63FFFE0A5446
         idletime   0
         mac        f2:9f:c2:f5:ac:2c
         name       ath2
         noise      -99
         radio      na
         rssi       8
         rx_bytes   245593854
         rx_bytes-r 188
         rx_mcast   0
         rx_packets 192564
         rx_rate    13000
         rx_retries 0
         satisfaction 25
         serialno   f0:9f:c2:f3:ac:2c
         signal     -88
         state      11
         tx_bytes   11935498
         tx_bytes-r 294
         tx_combined_retries 505833
         tx_data_mpdu_bytes 16350230
         tx_dropped 616
         tx_dropped_1min 0
         tx_packets 612820
         tx_packets_1min 76
         tx_power   12
         tx_rate    6500
         tx_retries 505833
         tx_retries_1min 37
         tx_rts_retries 0
         tx_success 106371
         tx_total   106987
         tx_total_1min 39
         type       wireless
         uplink_mac f0:9f:c2:f3:ac:2c
         uptime     76928
         vlan_id    0
         rx_tcp_stats:
           goodbytes  3875931
           lat_avg    0
           lat_max    0
           lat_min    4294967295
           stalls     0
         tx_tcp_stats:
           goodbytes  0
           lat_avg    15
           lat_max    20
           lat_min    10
           stalls     0
       uplink_table:
         HASH(0x37ff370)
       vap_table:
         HASH(0x35db000)
         HASH(0x3630968)
       vwire_table:
       vwire_vap_table:
         HASH(0x36f0028)
         HASH(0x358f848)
   alerts_unarchived:
     HASH(0x36688a8)
     HASH(0x373aa20)
     HASH(0x3637bd8)
   clients:
     ...
     5b3fcc4fdf994204b2bf358a:
       _id        5b3fcc4fdf994204b2bf358a
       _last_seen_by_uap 1534622625
       _uptime_by_uap 10033
       ap_mac     f0:9f:c2:f3:ac:2c
       assoc_time 1534612592
       bssid      f0:9f:c2:f4:ac:2c
       bytes-r    1
       ccq        991
       channel    11
       dhcpend_time 0
       essid      Wlan4Mi0nly102
       first_seen 1530907727
       hostname   Samsung-Galaxy-S7-edge
       idletime   5
       ip         192.168.2.119
       last_seen  1534622625
       latest_assoc_time 1534612592
       mac        4c:66:41:43:35:a6
       name       S7 Edge
       noise      -106
       oui        SamsungE
       radio      ng
       radio_name wifi0
       radio_proto ng
       rssi       45
       rx_bytes   965009
       rx_bytes-r 1
       rx_packets 6641
       rx_rate    24000
       satisfaction 85
       signal     -51
       site_id    5b1c6ee3e4b0e63f984d5dcc
       tx_bytes   1650332
       tx_bytes-r 0
       tx_packets 2437
       tx_power   8
       tx_rate    130000
       uptime     10033
       user_id    5b3fcc4fdf994204b2bf358a
       usergroup_id
       vlan       0
     ...
   events:
     HASH(0x387adf8)
     ...
     HASH(0x38bf3a0)
   helper:
     password   crypt:7853544117090d4552525f50
     username   crypt:56535c5f5d
   hotspot:
     voucherCache:
     vouchers:
   httpParams:
     header     Cookie: unifises=nhvIF4NlJJOhTEgTgaJIPJ6hlk4O01gL;\r\nCookie: csrf_token=stParmPZRkid8vmLhapSZ2Tqsm6Pt288;
     ignoreredirects 1
     loglevel   5
     method     POST
     noshutdown 0
     timeout    5
     hash:
     sslargs:
       SSL_verify_mode 0
   unifi:
     CONNECTED  connected
     deprecatedClientNames 0
     eventPeriod 24
     interval   300
     updateStartTime 1534622628.31743
     url        https://192.168.2.125:8443/api/s/default/
     version    4
     connectedClients:
       5b1c72b7e4b0e63f984d5df3 1
       5b1c737ae4b0e63f984d5e09 1
       5b3fcc4fdf994204b2bf358a 1
       5b4900f7df994204b2bf478a 1
       5b4b790fdf994205713bb3dc 1
       5b4b790fdf994205713bb3de 1
       5b4b790fdf994205713bb3e0 1
       5b4b7911df994205713bb3e2 1
       5b4b791edf994205713bb3e4 1
       5b4b7928df994205713bb3e6 1
       5b4b7942df994205713bb3e8 1
       5b4b79aedf994205713bb3ea 1
       5b4b79aedf994205713bb3ec 1
       5b4b79cbdf994205713bb3ee 1
       5b4b880adf994205713bb431 1
       5b4b9ecfdf994205713bb494 1
       5b7827d5df994206bc945250 1
   updateDispatch:
   wlan_health:
     num_adopted 2
     num_ap     2
     num_disabled 0
     num_disconnected 0
     num_guest  0
     num_iot    0
     num_pending 0
     num_user   4
     rx_bytes-r 3485
     status     ok
     subsystem  wlan
     tx_bytes-r 5128
   wlans:
     5b1c717ce4b0e63f984d5de0:
       _id        5b1c717ce4b0e63f984d5de0
       dtim_mode  custom
       dtim_na    3
       dtim_ng    3
       group_rekey 0
       mac_filter_policy allow
       minrate_na_beacon_rate_kbps 6000
       minrate_na_data_rate_kbps 6000
       minrate_na_mgmt_rate_kbps 6000
       minrate_ng_beacon_rate_kbps 1000
       minrate_ng_data_rate_kbps 1000
       minrate_ng_mgmt_rate_kbps 1000
       name       Wlan1
       security   wpapsk
       site_id    5b1c6ee3e4b0e63f984d5dcc
       usergroup_id 5b1c6ee8e4b0e63f984d5dd6
       wep_idx    1
       wlangroup_id 5b1c6ee8e4b0e63f984d5dd7
       wpa_enc    ccmp
       wpa_mode   wpa2
       x_iapp_key 6096d2d3e7f41591566d151971ba742a
       bc_filter_list:
       mac_filter_list:
       schedule:
Attributes:
   deprecatedClientNames 0
   icon       it_nas
   room       9 - Unifi
   userReadings -AP_AP-Light-1-Me_HrfUtil:-AP_AP-Light-1-Me_utilization.* {
    my $var = ReadingsVal("Unifi","-AP_AP-Light-1-Me_utilization","0");
    my $find = ",";
    my $replace = ".";
$var =~ s/$find/$replace/g;
} $var,
-AP_AP-Pro-1-Me_HrfUtil:-AP_AP-Pro-1-Me_utilization.* {
    my $var2 = ReadingsVal("Unifi","-AP_AP-Pro-1-Me_utilization","0");
    my $find = ",";
    my $replace = ".";
$var2 =~ s/$find/$replace/g;
} $var2


Ein paar Clients habe ich entfernt, damit das LIST nicht zu lange wird.

Es geht mir darum, die Readings-Werte -AP_AP-Light-1-Me_utilization und -AP_AP-Pro-1-Me_utilization von der Darstellung mit Komma als Dezimaltrennzeichen in eine Darstellung mit Punkt als Dezimaltrennzeichen zu wandeln. Dazu möchte ich diese Werte in zwei neue UserReadings -AP_AP-Light-1-Me_HrfUtil bzw -AP_AP-Pro-1-Me_HrfUtil schreiben.

Ich hatte das userReading vor ein paar Tage angelegt (https://forum.fhem.de/index.php/topic,90276.0.html), das hat auch funktioniert (seltsamerweise auch ohne den abschliessenden RegEx-Part). Nach einem Update vor 2 Tagen funktionierte das userReading nicht mehr.
Nach Durchlesen dieses Themas hier habe ich den RegEx-Teil (:-AP_AP-Light-1-Me_utilization.*) ergänzt...geht aber trotzdem nicht.

Was mache ich falsch? Danke!!
FHEM 21222 auf Gigabyte NUC, CubieTruck & RasPis (Test)
CUL 868MHz, nanoCUL 868MHz, nanoCUL 433MHz, JeeLink Clone, JeeLink Classic, HM-CFG-USB2, Rademacher
Devices: FHT, FS20, KS300, MAX, IT, HMS100, LaCrosse, PCA301, Revolt, HomeMatic, ESA2000, UNIRoll, Sonos, Duofern, Tasmota, MySensors

Wzut

Zitat von: SVLoneStar am 18 August 2018, 22:36:59

} $var,
--- snipp ---
} $var2

Was mache ich falsch? Danke!!

schau mal genau da hin :)
Maintainer der Module: MAX, MPD, UbiquitiMP, UbiquitiOut, SIP, BEOK, readingsWatcher

SVLoneStar

Hallo,
sorry, ich seh's nicht...
Es gibt im Device zwei Readings (R1 und R2), beide sollen in userReadings (UR1 und UR2) von Komma auf Punkt umgestellt werden.
Das erste Reading wird in $var verarbeitet, das zweite in $var2.
UR1:R1.* {
    my $var = ReadingsVal("Unifi",R1,"0");
    ---snip---
    $var =~ s/$find/$replace/g;
} $var,
UR2:R2.* {
    my $var2 = ReadingsVal("Unifi",R2,"0");
    my $find = ",";
    my $replace = ".";
$var2 =~ s/$find/$replace/g;
} $var2


Was übersehe ich? Ich die Syntax von userReadings anders als von mir verwendet? DANKE!!
FHEM 21222 auf Gigabyte NUC, CubieTruck & RasPis (Test)
CUL 868MHz, nanoCUL 868MHz, nanoCUL 433MHz, JeeLink Clone, JeeLink Classic, HM-CFG-USB2, Rademacher
Devices: FHT, FS20, KS300, MAX, IT, HMS100, LaCrosse, PCA301, Revolt, HomeMatic, ESA2000, UNIRoll, Sonos, Duofern, Tasmota, MySensors

amenomade

Zitat von: SVLoneStar am 19 August 2018, 16:17:46
Was übersehe ich? Ich die Syntax von userReadings anders als von mir verwendet? DANKE!!

Ja
Zitat von: CommandRef<reading>[:<trigger>] [<modifier>] { <perl code> }
Was sollen $var1 und $var2 ausserhalb des Perl Codes bedeuten?
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

SVLoneStar

Oh Mann. Danke.
Das sollte der Returnwert der Fn sein...ist natürlich Blödsinn, ich hatte das aus einem anderen Thread hier so übernommen. Natürlich falsch.
Geändert in
UR1:R1.* {
    my $var = ReadingsVal("Unifi",R1,"0");
    ---snip---
    return $var;
},
UR2:R2.* {
    my $var2 = ReadingsVal("Unifi",R2,"0");
    ---snip---
    return $var2;
}


Geht.
Nochmal Danke & sorry.
Thread-Titel kann ich nicht ändern. War ja auch nicht mein Thread.
Ich wünsche dem TE auch eine baldige Lösung.
FHEM 21222 auf Gigabyte NUC, CubieTruck & RasPis (Test)
CUL 868MHz, nanoCUL 868MHz, nanoCUL 433MHz, JeeLink Clone, JeeLink Classic, HM-CFG-USB2, Rademacher
Devices: FHT, FS20, KS300, MAX, IT, HMS100, LaCrosse, PCA301, Revolt, HomeMatic, ESA2000, UNIRoll, Sonos, Duofern, Tasmota, MySensors

froy.de

Zitat von: CoolTux am 17 August 2018, 16:39:28
Das ist nicht hilfreich. Bitte gebe list DEVICENAME ein und poste dann die Ausgabe hier. DEVICENAME ist natürlich durch Dein Devicenamen zu ersetzen.
Hallo CoolTux,

wegen Urlaub dauert es etwas länger, aber hier die angefragte Ausgabe:


Internals:
   DEF        1 120
   DEST       
   INTERVAL   120
   IODev      ModBusLine
   MODBUSID   1
   ModuleVersion 3.7.3 - 22.12.2017
   NAME       Waterkotte
   NOTIFYDEV  global
   NR         35
   NTFY_ORDER 50-Waterkotte
   PROTOCOL   RTU
   STATE      ???
   TRIGGERTIME 1535881080
   TRIGGERTIME_FMT 2018-09-02 11:38:00
   TYPE       WaterkotteWPCUC
   TimeAlign  1534456800
   TimeAlignFmt 2018-08-17 00:00:00
   OLDREADINGS:
     2018-09-01 19:46:08   OH_Compressor1  12737.3
     2018-08-30 17:06:17   OH_Cooling      3322.7
     2018-09-02 07:00:13   OH_DomesticWaterCompressor 2915.7
     2018-09-01 03:54:02   OH_HeatingCompressor 9832.5
   READINGS:
     2018-09-02 10:42:07   Auxiliary_AuxiliaryHeatMode off
     2018-09-02 05:54:02   Auxiliary_AuxiliaryHeatTempLimitSourceIn -2.0
     2018-09-02 10:10:19   Calc_OH_Compr1  0
     2018-09-02 11:04:19   Calc_OH_Cool    0
     2018-09-02 11:22:20   Calc_OH_DomWtrCompr 0.200000000000273
     2018-09-02 11:12:02   Calc_OH_HeatCompr 0
     2018-09-02 10:24:13   Cool_CoolCharacteristicSetPoint 21.5
     2018-09-02 11:24:07   Cool_CoolOff    active
     2018-09-02 11:22:18   Cool_CoolReturnTemp 46.5
     2018-09-02 01:40:00   Cool_CoolReturnTempHyst 2.0
     2018-09-02 10:30:24   Cool_CoolReturnTempNominal 21.0
     2018-09-01 17:12:22   Cool_CoolTimeOff 00:00
     2018-09-01 17:50:15   Cool_CoolTimeOn 00:00
     2018-09-01 23:14:15   Heat_AuxilaryMaxDifference 0.0
     2018-09-01 17:02:10   Heat_AuxilaryModeHeating 0
     2018-09-01 23:02:07   Heat_HeatCharacteristicSetPoint 18.0
     2018-09-02 01:42:22   Heat_HeatCharacteristicsGradient 25.0
     2018-09-02 02:14:27   Heat_HeatCharacteristicsLimit 40.0
     2018-09-01 23:48:00   Heat_HeatCharacteristicsSetPointBaseTemp 21.5
     2018-09-02 11:10:18   Heat_HeatIncreaseOff inactive
     2018-09-02 01:46:15   Heat_HeatIncreaseSetPtOffset -4.0
     2018-09-01 17:34:21   Heat_HeatIncreaseTimeOff 03:30
     2018-09-01 17:38:15   Heat_HeatIncreaseTimeOn 22:30
     2018-09-02 10:38:15   Heat_HeatOff    active
     2018-09-02 11:14:08   Heat_HeatReturnTemp 41.3
     2018-09-02 11:20:13   Heat_HeatReturnTempNominal 21.7
     2018-09-01 23:04:18   Heat_HeatTempHyst 2.0
     2018-09-01 16:52:00   Heat_HeatTimeOff 00:00
     2018-09-01 17:04:31   Heat_HeatTimeOn 00:00
     2018-09-01 17:56:21   Heat_RoomTempFactor 768
     2018-09-02 11:12:10   Heat_RoomTempNominal 21.5
     2018-09-02 10:52:10   Hotwater_DWNumberOfCompressors 1
     2018-09-02 10:34:12   Hotwater_DomesticWaterOff false
     2018-09-02 11:22:10   Hotwater_DomesticWaterTempActual 45.2
     2018-09-02 11:26:00   Hotwater_DomesticWaterTempHyst 5.0
     2018-09-02 11:28:15   Hotwater_DomesticWaterTempNominal 50.0
     2018-09-02 10:32:05   Hotwater_DomesticWaterTimeDelayOnSolar 1
     2018-09-02 10:58:08   Hotwater_LegionellaSchedule -------P
     2018-09-02 11:20:02   Hotwater_LegionellaTempNominal 61.0
     2018-09-02 10:50:24   Hotwater_LegionellaTimeOff 00:00
     2018-09-02 11:28:11   Hotwater_LegionellaTimeOn 00:00
     2018-09-02 00:14:12   Info_FirmwareDate May 28 2010
     2018-09-01 19:46:13   Info_FirmwareVersion C 01.04.00
     2018-09-01 19:04:06   Info_ManufSerialNum WE110135
     2018-09-01 18:18:22   Info_ManufType  AI100630
     2018-09-02 11:34:17   Info_OperatingState 00000000
     2018-09-02 10:16:09   Measured_CondensationPress 10.1
     2018-09-02 10:30:22   Measured_CondensationTemp 23.2
     2018-09-02 10:38:00   Measured_DomesticWaterTemp 46.2
     2018-09-02 11:18:00   Measured_EvaporationPress 4.7
     2018-09-02 10:48:21   Measured_EvaporationTemp 28.2
     2018-09-02 11:04:25   Measured_FlowTemp 26.1
     2018-09-02 11:32:10   Measured_HeatSourceIn 12.8
     2018-09-02 10:52:05   Measured_HeatSourceOut 24.9
     2018-09-02 11:36:12   Measured_OutdoorTemp 16.2
     2018-09-02 09:20:02   Measured_OutdoorTemp1h 16.2
     2018-09-02 10:48:00   Measured_OutdoorTemp24h 18.4
     2018-09-02 10:50:00   Measured_ReturnTemp 26.1
     2018-09-02 09:48:02   Measured_ReturnTempNominal 21.9
     2018-09-02 11:36:07   Measured_RoomTemp 0.0
     2018-09-02 11:12:21   Measured_RoomTemp1h -40.0
     2018-09-02 10:22:16   Measured_SuctionGasTemp 29.5
     2018-09-02 10:10:19   OH_Compressor1  12737.6
     2018-09-02 10:50:09   OH_Compressor2  0.0
     2018-09-02 11:04:19   OH_Cooling      3323.3
     2018-09-02 10:06:12   OH_DomesticWaterAuxiliary 0.0
     2018-09-02 11:22:20   OH_DomesticWaterCompressor 2915.9
     2018-09-02 10:36:00   OH_HeatingAuxiliary 205.9
     2018-09-02 11:12:02   OH_HeatingCompressor 9833.1
     2018-09-02 10:10:05   OH_PoolCompressor 0.0
     2018-09-02 10:54:17   OH_Solar        0.0
     2018-09-02 10:58:14   System_COP      0.0
     2018-09-02 11:34:05   System_LCDLine1 M301: Kühlung   
     2018-09-02 11:32:00   System_LCDLine2 Kein Bedarf     
     2018-09-02 11:28:07   System_PowerElectric 1.9
     2018-09-02 11:16:12   System_PowerThermal 7.2
   helper:
     lrecv      1535880983.0653
     lsend      1535880983.03549
   lastRead:
     c1009      1535877495.81342
     c1329      1535879418.04824
     c1409      1535814130.64108
     c1457      1535880247.78829
     c1633      1535877252.20583
     c1857      1535878330.13067
     c1873      1535877125.81297
     c2577      1535877727.82521
     h1025      1535814271.89343
     h1041      1535813520.05429
     h1057      1535835727.37156
     h1089      1535838480.07455
     h1121      1535845342.51046
     h1153      1535847267.07951
     h1185      1535879648.75037
     h1217      1535880013.79361
     h1249      1535835858.69136
     h1281      1535879530.5608
     h1313      1535817381.14874
     h1345      1535816295.05163
     h1361      1535816061.27679
     h1425      1535836455.86153
     h1473      1535817015.01036
     h1489      1535814742.97449
     h1505      1535876653.65861
     h1537      1535880138.14011
     h1569      1535877024.91243
     h1601      1535845200.10654
     h1665      1535813297.23547
     h1713      1535880495.42698
     h1745      1535880360.06061
     h1777      1535878688.10554
     h1793      1535880491.90858
     h1809      1535878224.04882
     h1825      1535880002.79044
     h2593      1535860442.33137
     h4689      1535823973.89838
     h4817      1535840052.68429
     h4945      1535818702.99134
     h5073      1535821446.27873
     h5457      1535880857.73542
     h5521      1535880845.48507
     h5649      1535880720.21087
     i1377      1535845575.86644
     i1681      1535880130.39943
     i2625      1535875819.0879
     i2657      1535878209.92691
     i2689      1535879522.32348
     i2721      1535877360.04824
     i2753      1535879059.19434
     i2785      1535880140.8909
     i2817      1535875572.6816
     i2849      1535875805.54173
     i2881      1535878457.66012
     i433       1535880972.81473
     i4497      1535880487.43036
     i4529      1535879772.60083
     i4561      1535878694.07069
     i465       1535872802.78717
     i497       1535878080.04711
     i529       1535880730.62226
     i561       1535878325.57302
     i593       1535878101.66945
     i625       1535876536.82975
     i657       1535879880.04311
     i689       1535874482.72322
     i721       1535878200.04321
     i753       1535879065.97533
     i785       1535877022.67374
     i817       1535876169.08215
     i849       1535880967.81593
     i881       1535879541.40412
     i913       1535877480.04465
Attributes:
   IODev      ModBusLine
   alignTime  00:00
   comment    Waterkotte AI1+ 5006.03
   enableControlSet 1
   event-on-change-reading OH_.*, Info_.*, Hotwater_.*, Heat_.*, Cool_.*, Measured_.*
   event-on-update-reading .*, Calc_.*
   group      Waterkotte
   icon       sani_earth_source_heat_pump
   oldreadings OH_.*
   room       Keller
   userReadings Calc_OH_Compr1:OH_Compressor1.* difference { ReadingsVal($name, "OH_Compressor1", 0); } ,
Calc_OH_Cool:OH_Cooling.* difference { ReadingsVal($name, "OH_Cooling", 0); },
Calc_OH_DomWtrCompr:OH_DomesticWaterCompressor.* difference { ReadingsVal($name, "OH_DomesticWaterCompressor",0); },
Calc_OH_HeatCompr:OH_HeatingCompressor.* difference { ReadingsVal($name, "OH_HeatingCompressor",0); }
   userattr   alignTime comment enableControlSet event-on-change-reading event-on-update-reading icon oldreadings userReadings


Offenbar war ich zu ungeduldig: ca. 1 - 2 Tage nach meinem Post wurden die userReadings dann wie gewünscht angelegt und mit Daten gefüllt. Funktioniert also offenbar.

Danke und Gruß