Page 1 of 1

Recording a Devices state change to csv file for MatPlotLib

PostPosted: Fri Sep 06, 2019 6:15 am
by Busta999
I am revisiting an idea........

Can't remember if I have raised it before.

Is there a way to record a Device state change to a CSV that MatPlotLib could read to create a graph?

The things I am looking at are :-

Motion Sensors - On/Off
Heating - On/Off
Hot Water On/Off

The Hot Water is fairly easy, it tends to be one for over an hour when it comes on and as such would be picked up by a 15 minute sampling cycle.

The Motion Sensors and Heating tend to be on for shorter periods, Motion Sensors for a couple of minutes, the Heating for 5 minutes to tweak rooms to temp.

Any ideas or just ramp up a MatPlotLib cycle to every minute?

Re: Recording a Devices state change to csv file for MatPlot

PostPosted: Sun Sep 08, 2019 3:01 pm
by Busta999
Had a play around with MatPlotlib and made this.

Chart - 1Min - Motion.png
Chart - 1Min - Motion.png (30.3 KiB) Viewed 1278 times


Shows activity in 8 monitored places around the house.

Some of it is the dogs wandering around, but will help in confirming assumptions I made on when and where to heat the house to 20C and where not to.

Had fun doing this :-)

Re: Recording a Devices state change to csv file for MatPlot

PostPosted: Sun Sep 08, 2019 3:31 pm
by DaveL17
That's great. Nice job!

Re: Recording a Devices state change to csv file for MatPlot

PostPosted: Fri Sep 20, 2019 3:18 am
by Busta999
I have been tweaking it to look a bit easier on the eye.

The colour coding is standardised for all graphs/charts - i.e. Banana = Lounge

Makes identifying rooms quicker when moving between charts.

Chart - 1Min - Motion.png
Chart - 1Min - Motion.png (34.13 KiB) Viewed 1167 times


Not sure how long I'll let it run but gives me pretty useful data about occupancy levels, for heating etc.

Re: Recording a Devices state change to csv file for MatPlot

PostPosted: Fri Sep 20, 2019 5:39 am
by DaveL17
Nice! I like the tweaks you've added to this chart.

I love it when folks share their charts to give others ideas (including me).