Neuigkeiten:

Am Sonntag den 8.12.2024 kann es ab ca. 8:00 Uhr zu kurzzeitigen Einschränkungen / Ausfällen bei den Diensten des FHEM Vereines kommen.
Die Server müssen mal gewartet und dabei neu gestartet werden ;)

Hauptmenü

InfluxDBLogger und FBDECT Modul

Begonnen von Mikesch, 20 September 2024, 16:09:52

Vorheriges Thema - Nächstes Thema

Mikesch

Hallo zusammen, ich hoffe das ist die richtige Rubrik.

Ich benutze InfluxDBLogger  um in die InfluxDB zu loggen.
Leider wird bei den Fritz Steckdosen das Reading power und temperature ignoriert,
obwohl unter readinginclude im InfluxDBLogger power eingetragen sind.
Das state reading dagegen wird sauber geloggt.

define FBDECT_fb1_08761_0442357 FBDECT fb1:08761_0442357 microphone,switch,powerMeter,tempSensor,switch
attr FBDECT_fb1_08761_0442357 alias FRITZ!DECT 200 - Lampe WZ
attr FBDECT_fb1_08761_0442357 devStateIcon {my $text = sprintf(" aktuell: %.1f W T: %.1f ", ReadingsVal($name,"power","-1"),ReadingsVal($name,"temperature","-1"));;;; my $onl = ReadingsVal($name,"present","no") eq "yes"?"10px-kreis-gruen":"10px-kreis-rot";;;; my $light = ReadingsVal($name,"state","off");;;;"<div><a href=\"http://".ReadingsVal($name,"IPAddress",ReadingsVal($name,"Info2_IPAddress","none"))." \"target=\"_blank\">".FW_makeImage($onl).'</a> <a href="/fhem?cmd.dummy=set '.$name.' toggle&XHR=1">'.FW_makeImage($light)."</a>$text<b></b>"}
attr FBDECT_fb1_08761_0442357 event-min-interval power:120
attr FBDECT_fb1_08761_0442357 eventMap on:on off:off
attr FBDECT_fb1_08761_0442357 icon hue_filled_outlet
attr FBDECT_fb1_08761_0442357 room 01_Maybachstr,FBDECT
attr FBDECT_fb1_08761_0442357 stateFormat {sprintf("T: %.1f Power: %.1f Energy:%.1f", ReadingsVal($name,"temperature",0), ReadingsVal($name,"power",0), ReadingsVal($name,"energy",0))}
attr FBDECT_fb1_08761_0442357 userReadings power { ReadingsVal("FBDECT_fb1_08761_0442357","power",0) }, temperature { ReadingsVal("FBDECT_fb1_08761_0442357","temperature",0) }, energy { ReadingsVal("FBDECT_fb1_08761_0442357","energy",0) }
attr FBDECT_fb1_08761_0442357 webCmd on:off
#   DEF        fb1:08761_0442357 microphone,switch,powerMeter,tempSensor,switch
#   FUUID      65b4eddc-f33f-0742-47dc-8d95962a11293fe4
#   IODev      fb1
#   LASTInputDev fb1
#   MSGCNT     2241
#   NAME       FBDECT_fb1_08761_0442357
#   NR         156
#   STATE      T: 24.5 Power: 5.8 Energy:1759.0
#   TYPE       FBDECT
#   eventCount 2241
#   fb1_MSGCNT 2241
#   fb1_TIME   2024-09-20 16:19:47
#   id         08761_0442357
#   props      microphone,switch,powerMeter,tempSensor,switch
#   READINGS:
#     2024-09-20 16:19:47   AIN             08761 0442357
#     2024-09-20 16:19:47   FBNAME          Lampe
#     2024-09-20 16:19:47   FBPROP          microphone,switch,powerMeter,tempSensor,switch
#     2024-09-20 16:19:47   FBTYPE          FRITZ!DECT 200
#     2024-09-20 16:19:47   ID              17
#     2024-09-19 20:32:17   IODev           fb1
#     2024-09-20 16:19:47   devicelock      no
#     2024-09-20 16:19:47   energy          1759 Wh
#     2024-09-20 16:19:47   fwversion       04.26
#     2024-09-20 16:19:47   locked          no
#     2024-09-20 16:19:47   mode            manuell
#     2024-09-20 16:19:47   power           5.79 W
#     2024-09-20 16:19:47   present         yes
#     2024-09-20 16:19:47   state           on
#     2024-09-20 16:19:47   tempadjust      0.0 C
#     2024-09-20 16:19:47   temperature     24.5 C (measured)
#     2024-09-20 16:19:47   voltage         234.291 V
#
setstate FBDECT_fb1_08761_0442357 T: 24.5 Power: 5.8 Energy:1759.0
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 AIN 08761 0442357
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 FBNAME Lampe
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 FBPROP microphone,switch,powerMeter,tempSensor,switch
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 FBTYPE FRITZ!DECT 200
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 ID 17
setstate FBDECT_fb1_08761_0442357 2024-09-19 20:32:17 IODev fb1
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 devicelock no
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 energy 1759 Wh
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 fwversion 04.26
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 locked no
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 mode manuell
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 power 5.79 W
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 present yes
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 state on
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 tempadjust 0.0 C
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 temperature 24.5 C (measured)
setstate FBDECT_fb1_08761_0442357 2024-09-20 16:19:47 voltage 234.291 V




define influxDB InfluxDBLogger http://localhost:8086 FHEM-bucket FBDECT_fb1_11657_0514733,NC_WS_83,CUL_TX_8,FBDECT_fb1_08761_0442357,NC_WS_92,NC_WS_93,NC_WS_94,LaCrosse_00,LaCrosse_10,LaCrosse_2C,LaCrosse_2E,LaCrosse_3A,LaCrosse_32attr influxDB alias influxDB
attr influxDB alias influxDB
attr influxDB api v2
attr influxDB comment <html><a href='http://192.168.5.181:8086/' target='_blank'>http://192.168.5.181:8086/</a></html>
attr influxDB conversions true|on|yes|open|opened=1,false|off|no|close|closed=0
attr influxDB fields $READINGNAME=$READINGVALUE
attr influxDB measurement $DEVICE
attr influxDB org none
attr influxDB readingInclude (Power|power|dew|lux|temperature|humidity|pressure|illuminance|gas|dewpoint|battery|event|last|state|total)
attr influxDB room 01_Maybachstr,FBDECT,IT,MQTT2_DEVICE
attr influxDB security token
attr influxDB tags device={my $str = AttrVal($device,"alias",$device);; $str =~ s/\s/_/g;; return $str;;}
#   DATABASE   FHEM-bucket
#   DEF        http://localhost:8086 FHEM-bucket FBDECT_fb1_11657_0514733,NC_WS_83,CUL_TX_8,FBDECT_fb1_08761_0442357,NC_WS_92,NC_WS_93,NC_WS_94,LaCrosse_00,LaCrosse_10,LaCrosse_2C,LaCrosse_2E,LaCrosse_3A,LaCrosse_32attr influxDB alias influxDB
#   FUUID      659c2dc0-f33f-0742-930d-fed8647740cd6513
#   NAME       influxDB
#   NOTIFYDEV  FBDECT_fb1_11657_0514733,NC_WS_83,CUL_TX_8,FBDECT_fb1_08761_0442357,NC_WS_92,NC_WS_93,NC_WS_94,LaCrosse_00,LaCrosse_10,LaCrosse_2C,LaCrosse_2E,LaCrosse_3A,LaCrosse_32attr
#   NR         104
#   NTFY_ORDER 50-influxDB
#   STATE      Statistics: t=11274600 s=11162485 f=112026 e=31659896
#   TYPE       InfluxDBLogger
#   URL        http://localhost:8086
#   eventCount 176827
#   READINGS:
#     2024-09-20 16:04:08   dropped_writes  10690546
#     2024-09-20 16:04:08   dropped_writes_last_message LaCrosse_2C battery ok
#     2024-09-20 15:19:02   failed_writes   112026
#     2024-09-20 15:19:02   failed_writes_last_error read from http://localhost:8086 timed out
#     2024-09-20 16:04:09   state           Statistics: t=11274600 s=11162485 f=112026 e=31659896
#     2024-09-20 16:04:09   succeeded_writes 11162485
#     2024-09-20 16:04:08   total_events    31659896
#     2024-09-20 16:04:08   total_writes    11274600
#
setstate influxDB Statistics: t=11274600 s=11162485 f=112026 e=31659896
setstate influxDB 2024-09-20 16:04:08 dropped_writes 10690546
setstate influxDB 2024-09-20 16:04:08 dropped_writes_last_message LaCrosse_2C battery ok
setstate influxDB 2024-09-20 15:19:02 failed_writes 112026
setstate influxDB 2024-09-20 15:19:02 failed_writes_last_error read from http://localhost:8086 timed out
setstate influxDB 2024-09-20 16:04:09 state Statistics: t=11274600 s=11162485 f=112026 e=31659896
setstate influxDB 2024-09-20 16:04:09 succeeded_writes 11162485
setstate influxDB 2024-09-20 16:04:08 total_events 31659896
setstate influxDB 2024-09-20 16:04:08 total_writes 11274600



Hier ein Blick auf die InfluxDB beim FBDECT und LaCrosse Device.
Ich kann nicht verstehen warum es bei LaCrosse funktioniert und beim FBDECT nicht.

Mein Verdacht ist das die Werte ein Sting sind, weil bei power 5.79 W und bei temperature 24.5 C (measured) angezeigt wird. Aber stateFormat bekommt es ja auch hin "reine" Werte anzuzeigen.