Autor Thema: How to supress log entries for a periodic "get" command (using an "at" define)  (Gelesen 700 mal)

Offline roelb

  • Developer
  • New Member
  • ****
  • Beiträge: 26
Hey folks,

I'm looking for a way to suppress the output for a "get" command. I am running a periodic "get" on a reading from a device that is an ECMDDevice (which is an FHEM module that does generic serial communication). It's an opentherm gateway (the famous OTGW) by the way.

I need to send the serial device a command to get new reading values. So that's where the periodic get comes in, currently every 10 seconds. However, the output from this get is clogging up my log. Is there a way to suppress the output on a "get" command, or to suppress log output for an "at" command?

Let me get you my current setup:

The OTGW device is defined as follows:

define GEN_OTGW ECMD serial /dev/ttyUSB_OPENTHERM@9600
attr GEN_OTGW classdefs control=/data/fhem/gen_otgw_boiler.class
attr GEN_OTGW partial 1

My dependent boiler device is:

define GEN_BOILER_OT ECMDDevice control
attr GEN_BOILER_OT event-on-change-reading .*
attr GEN_BOILER_OT event-on-update-reading setpoint,maxmodulation
attr GEN_BOILER_OT userReadings diag_status { $_=ReadingsVal($name, 'status','');; m/diag=([01])/;; $1 },\
        flame_status { $_=ReadingsVal($name, 'status','');; m/flame=([01])/;; $1 },\
        dhw_status { $_=ReadingsVal($name, 'status','');; m/dhw=([01])/;; $1 },\
        ch_status { $_=ReadingsVal($name, 'status','');; m/ch=([01])/;; $1 },\
        fault_status { $_=ReadingsVal($name, 'status','');; m/fault=([01])/;; $1 },\
        modulation { $_=ReadingsVal($name, 'status','');; m/modlevel=([0-9]*)/;; $1 },\
        pressure { $_=ReadingsVal($name, 'status','');; m/pressure=([0-9\.]*)/;; $1 },\
        temp_out { $_=ReadingsVal($name, 'status','');; m/tempout=([0-9\.]*)/;; $1 },\
        temp_return { $_=ReadingsVal($name, 'status','');; m/tempreturn=([0-9\.]*)/;; $1 },\
        temp_dhw { $_=ReadingsVal($name, 'status','');; m/dhwtemp=([0-9\.]*)/;; $1 },\
        temp_dhw_max { $_=ReadingsVal($name, 'status','');; m/dhw_tempmax=([0-9\.]*)/;; $1 },\
        temp_dhw_min { $_=ReadingsVal($name, 'status','');; m/dhw_tempmin=([0-9\.]*)/;; $1 },\
        temp_max { $_=ReadingsVal($name, 'status','');; m/ch_tempmax=([0-9\.]*)/;; $1 },\
        temp_min { $_=ReadingsVal($name, 'status','');; m/ch_tempmin=([0-9\.]*)/;; $1 },\
        setpoint_dhw { $_=ReadingsVal($name, 'status','');; m/dhwsetpoint=([0-9\.]*)/;; $1 }

And my periodic read is:

define GEN_BOILER_OT_READ at +*00:00:10 get GEN_BOILER_OT status

Works perfectly, except for the annoying log entry every 10 seconds in fhem.log:

2019.11.29 12:29:48 3: get GEN_BOILER_OT status : status diag=0,flame=0,dhw=0,ch=0,fault=0,modlevel=0.00,pressure=1.80,tempout=51.00,dhwtemp=42.00,tempreturn=51.00,dhw_tempmax=65,dhw_tempmin=35,ch_tempmax=80,ch_tempmin=20,dhwsetpoint=0.00 raw=00000001/00000000,0.00,00000001/00000001,0.00,0/0,0.00,0.00,1.80,0.00,51.00,42.00,1.25,51.00,65/35,80/20,0.00,0.00,0,0,0,0,0,0,0,0

Any ideas?

Offline amenomade

  • Developer
  • Hero Member
  • ****
  • Beiträge: 5534
attr verbose 2 on GEN_BOILER_OT?
FHEM 5.9 Pi 3, EchoDot, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Offline roelb

  • Developer
  • New Member
  • ****
  • Beiträge: 26
Nope, that has no effect at all. I've tried the verbose attribute on both the ECMDDevice (GEN_BOILER_OT) object, as well as on the ECMD (GEN_OTGW) object. But the log entries keep coming.

Offline roelb

  • Developer
  • New Member
  • ****
  • Beiträge: 26

Your hint got me thinking. The verbose attribute needed to change on my periodic "at" object. That works.


attr GEN_BOILER_OT_READ verbose 2
So for anyone who wants to integrate readings from an Opentherm gateway into FHEM, you're welcome to use this solution. In addition to the fhem config above, you will need the ECMD classdef file ("/data/fhem/fen_otgw_boiler.class" in my example), which contains:

get status cmd {"PS=1\r\n"}
get status expect "PS: 1\r\n[0-9]+/[0-9]+,[0-9/.,]+\r\n"
get status postproc { s{PS: 1\r\n(......../.([01])..([01])([01])([01])([01]),[0-9.]*,[01/]*,[0-9.]*,[0-9]*/[0-9]*,[0-9.]*,([0-9.]*),([0-9.]*),[0-9.]*,([0-9.]*),([0-9.]*),[0-9.]*,([0-9.]*),([0-9]*)/([0-9]*),([0-9]*)/([0-9]*),([0-9.]*),[0-9.]*,[0-9,]*)\r\n}{diag=$2,flame=$3,dhw=$4,ch=$5,fault=$6,modlevel=$7,pressure=$8,tempout=$9,dhwtemp=$10,tempreturn=$11,dhw_tempmax=$12,dhw_tempmin=$13,ch_tempmax=$14,ch_tempmin=$15,dhwsetpoint=$16\nraw=$1};; $_;; }

set setpoint cmd {"CS=%temp\r\n"}
set setpoint params temp
set setpoint expect "CS: .*\r\n"
set setpoint postproc { s/^CS: ([0-9\.]*)\r\n$/$1/; $_; }

set maxmodulation cmd {"MM=%percentage\r\n"}
set maxmodulation params percentage
set maxmodulation expect "MM: .*\r\n"
set maxmodulation postproc { $_=~s/^MM: (.*)\r\n$/$1/ or $_=-1;; $_;; }

set init cmd {"PS=1\r\nAD=27\r\nAD=57\r\nAA=48\r\nAA=49\r\nAA=26\r\n"}
set init expect ".*\r\n.*\r\n.*\r\n.*\r\n.*\r\n.*\r\n"
Gefällt mir Gefällt mir x 1 Liste anzeigen