Logging reed magnetic switch pressed time

Hi guys, maybe this is answered before but i could not find any info about it. As the topic says, i want to log when some switch is pressed, i have magnetic sensors that i also want to log and see when the door was opened etc… In the moment i use rrd4j gor my temp sensors, but i know that this database cant log things such as reed switches.

Any help is appreciated.
Thanks

I use mySQL which can and does log switches :slight_smile:

and :slight_smile: ? Please give me some sample of you code, im going crazy here :smile: .

Thanks in advance

Not sure why, but didn’t get any notification of your reply.

To install mySQL see http://www.homeautomationforgeeks.com/openhab_persistence.shtml

Typical logging looks like:
“2017-01-24 17:47:58”,ON
"2017-01-24 17:48:25",OFF
"2017-01-24 17:48:34",ON
"2017-01-24 17:48:39",OFF
"2017-01-24 17:48:43",ON
"2017-01-24 17:48:48",OFF
"2017-01-24 17:48:58",ON
"2017-01-24 17:51:18",OFF
"2017-01-24 17:51:19",ON
"2017-01-24 17:51:21",OFF
"2017-01-24 17:51:22",ON
"2017-01-24 17:51:24",OFF
"2017-01-24 17:51:27",ON
"2017-01-24 17:58:18",OFF
"2017-01-24 18:20:26",ON
"2017-01-24 18:20:28",OFF
"2017-01-24 18:20:29",ON
"2017-01-24 21:28:30",OFF
"2017-01-24 21:32:33",ON
"2017-01-24 21:35:38",OFF
"2017-01-24 21:35:45",ON
"2017-01-24 21:37:26",OFF
"2017-01-24 21:37:36",ON
"2017-01-25 00:00:01",ON
"2017-01-25 15:56:34",OFF
"2017-01-25 17:28:25",ON
"2017-01-25 18:13:48",OFF
"2017-01-25 18:14:21",ON
"2017-01-26 00:00:01",ON
"2017-01-26 15:53:48",OFF
"2017-01-26 15:53:56",ON
"2017-01-26 19:40:03",OFF
"2017-01-26 19:40:12",ON
"2017-01-26 19:40:15",OFF
"2017-01-26 19:40:17",ON
"2017-01-26 19:52:43",OFF