[patch] 47_OBIS.pm - Fix warning when device type none

Begonnen von dennisk, 29 November 2023, 11:51:04

Vorheriges Thema - Nächstes Thema

dennisk

Since a recent change, where the module 47_OBIS.pm has no device type configured and just echoes the processed input, I have a warning in the log during initialization:
PERL WARNING: Use of uninitialized value in numeric gt (>) at /usr/share/fhem/FHEM/47_OBIS.pm line 643.The anonymized raw definition is:
defmod obis OBIS none
attr obis stateFormat {sprintf("%.0f kWh", (ReadingsVal($name,"total_consumption",0) / 1000) )}

setstate obis 23337 kWh
setstate obis 2023-11-29 11:42:12 ManufID XXX
setstate obis 2023-11-29 11:42:12 PublicKey xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx
setstate obis 2023-11-29 11:42:12 Serial xx-xx-xx-xx-xx-xx-xx-xx-xx-xx
setstate obis 2023-11-29 11:42:12 power 1234.5
setstate obis 2023-11-29 11:42:12 total_consumption 123456789.5
setstate obis 2023-11-29 11:42:12 total_consumption_Ch1 123456789.5
setstate obis 2023-11-29 11:42:12 total_consumption_Ch2 0


Attached patch file fixes the warning in my installation. However, as I do not have any other SML devices, I cannot test, if the patch has any side effects for other configurations.
I hope, I have understood the code correctly and have proposed an appropriate fix. If there are any remarks or questions, please ask.

dennisk

Just wanted to ask again, if this small patch could be incorporated, or if there are any questions or if I should change something?

Thanks and best

dennisk

It seems, that my first approach was wrong and the message reappeared. Now another try, which seems to work so far - at least the message does not appear (again) after a restart. I uploaded a modified patch file.

dennisk

So far, after some further restarts, the warning is gone. The module is also working as expected. So, I would like to ask again, if this small patch can be integrated? @gvzdus?
thanks and best

dennisk

Weiß jemand, was mit gvzdus los ist? Hier reagiert er nicht, auf PMs auch nicht.

dennisk

Hallo gvzdus,

nochmal die Nachfrage, ob der Patch aufgenommen werden könnte, um die bei mir sonst auftretende Warnung loszuwerden?

Vielen Dank und beste Grüße
dennisk

dennisk

Hallo gvzdus,

erneut die Frage, ob der kleine Patch aufgenommen werden kann. Bis heute habe ich diese Warnung nicht mehr gesehen und keine anderen Auffälligkeiten bemerkt.
Die Aufnahme oder zumindest eine Rückmeldung wären toll.

Vielen Dank und beste Grüße
dennisk

KölnSolar

RPi3/2 buster/stretch-SamsungAV_E/N-RFXTRX-IT-RSL-NC5462-Oregon-CUL433-GT-TMBBQ-01e-CUL868-FS20-EMGZ-1W(GPIO)-DS18B20-CO2-USBRS232-USBRS422-Betty_Boop-EchoDot-OBIS(Easymeter-Q3/EMH-KW8)-PCA301(S'duino)-Deebot(mqtt2)-zigbee2mqtt

dennisk

Ja, schon diverse Male, mit dem letzten Post grade auch wieder parallel. Ich hoffe natürlich, dass bei gvzdus alles in Ordnung ist. Aber ohne jede Rückmeldung, keine Ahnung.