[Patch] Log change of Device Values

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
hhg
Starting Member
Starting Member
Posts: 20
Joined: Sun Jul 18, 2010 6:45 pm
Location: Denmark

[Patch] Log change of Device Values

Post by hhg »

Hi

To help me keep an overview of what is going on in my system, I have added a table to log value changes of devices. And to see the log, a new tab to Edit Device:
device_log.png
device_log.png (52.85 KiB) Viewed 3414 times
It's a work in progress. I'm not entirely satisfied with the functionality of this log display, and not sure it's the right place to monitor device changes. But the log was very handy when I was debugging my event set-up, so I thought I would share it now.

Attached is the sql for the table and a patch against release 415.

Regards
hhg
Attachments
logvalues-20100925.patch.tar.gz
(2.54 KiB) Downloaded 323 times
devices_log.sql.tar.gz
(322 Bytes) Downloaded 327 times
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: [Patch] Log change of Device Values

Post by RDNZL »

Hi hhg,

a very good idea!

I have kept your device log window in the device editor, for editing/deleting/quick look.
It's just small browserdata stuff anyway.
But I also added a window to the logs page, here it shows all devices with log enabled, and the values are calibrated/divided.

See screenshot below.

It would be even better if we have just one table devices_log with just one value in it, but with a field the number/position of that value.
So we can store not only 4 but all values of devices in it (dynamic number), and we fetch them with left joins...

Something like this to get the idea...

Code: Select all

CREATE TABLE `devices_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deviceid` bigint(11) NOT NULL,
  `value` varchar(32) NOT NULL,
  `fieldno` int(11),
  `lastchanged` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `devicesid_date` (`deviceid`,`lastchanged`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
If that works good for log values, we can convert all devices code to have a dynamic number of fields... so we get rid of the 4 basic restriction...
Do you have the sql skill and time to experiment with that?

Included in 0.1.188 (not yet released) are Onkyo receiver support (code by me), switching, volume set etc works.

And Anel PwrCtrl interface support http://www.anel-elektronik.de/index.html written by Daniel.
Reading of IR remotes via Squeezebox players (didn't even know that this was possible lol)
I'm so busy with Daniels work, he keeps sending in code :mrgreen: :wink:

So now we have SqueezeBox, Denon and Onkyo Receiver support, so I also started with some audio control panels...

domotiga-devices-log.png
domotiga-devices-log.png (128.33 KiB) Viewed 3398 times
Regards, Ron.
hhg
Starting Member
Starting Member
Posts: 20
Joined: Sun Jul 18, 2010 6:45 pm
Location: Denmark

Re: [Patch] Log change of Device Values

Post by hhg »

Hi Ron

Very nice Log Window.

I agreed about we need to get rid of the 4 value limitation, but that will also mean that we will be storing several records per value update for devices like your NAS or Oregon sensors etc. It won't be easy, and we should probraly also remove the values fields etc. from the device table, so it only contain "not-moving" "master" device data, and the values is in the log table.
A pretty big refactoring of the system....

For the moment I'm working on a primitive webscraping based integration to my IHC System.
IHC (Intelligent House Controller) from the Danish company Lauritz Knudsen A/S (http://www.lk.dk), a Schneider Electric subsidiary, consist of a central controller (with a web server) connected to wired input and output modules, and to wireless modules.
More info, in Danish, at http://www.lk.dk/Lauritz+Knudsen/profes ... ntrol.page?

Regards
hhg
Post Reply

Return to “DomotiGa Forum”