Recording a Devices state change to csv file for MatPlotLib

Posted on
Fri Sep 06, 2019 6:15 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Recording a Devices state change to csv file for MatPlotLib

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?

Posted on
Sun Sep 08, 2019 3:01 pm
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

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

Had a play around with MatPlotlib and made this.

Chart - 1Min - Motion.png
Chart - 1Min - Motion.png (30.3 KiB) Viewed 1251 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 :-)

Posted on
Sun Sep 08, 2019 3:31 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

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

That's great. Nice job!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Sep 20, 2019 3:18 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

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

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 1140 times


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

Posted on
Fri Sep 20, 2019 5:39 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

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

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).

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests