Autor Thema: Adding entries to a logfile?  (Gelesen 836 mal)

Offline jacko

  • New Member
  • *
  • Beiträge: 22
Adding entries to a logfile?
« am: 28 September 2022, 14:01:55 »
I have defined various filelogs to capture device events as they happen. However I would like to capture that status of some devices at the start of each day log.

Is there a generic way to add a log entry to match the device event entries?

So the logfile would look like this (with an initial daily entry and a later device event)
2022-09-28_00:00:01 DoorSensor off
...
2022-09-28_09:26:25 DoorSensor on

Thanks for any pointers.

Offline rudolfkoenig

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 26043
Antw:Adding entries to a logfile?
« Antwort #1 am: 28 September 2022, 14:10:53 »
FileLogs are protocolling events.
One can generate arbitrary events with the trigger command.

Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19683
Antw:Adding entries to a logfile?
« Antwort #2 am: 28 September 2022, 14:15:27 »
Additionally - in case your request is wrt. to generation of "full" plots using SVG: You may have a look at logProxy (especially https://wiki.fhem.de/wiki/LogProxy#Erweitern_des_zu_plottenden_Bereichs_um_ausserhalb_liegende_Anfangs-_und_Endwerte)
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Offline jacko

  • New Member
  • *
  • Beiträge: 22
Antw:Adding entries to a logfile?
« Antwort #3 am: 29 September 2022, 09:00:30 »
The trigger cmd is exactly what I was looking for. And yes, it was in relation to an SVG graph so the pointer to the LogProxy command is appropriate, but I think I need some time to get my head around that.
Many thanks.