Skip to main content ramblings of a lost one

Posts on Home-Mon

  1. Home Assistant

    A long time ago i setup & wrote my own home monitoring system using wireless temperature sensors and a current clamp across the incoming feed to the house for electricity monitoring (take a look at the projects section for flask socketio) Using it i was able to educate the step-son about taking 90 minute long showers without contributing to the bills1 i then moved house leaving the current clamp hardware in place duh then what with getting the house sorted, travelling for work and subsequent long hours on my return i never set it up again besides the long shower taker had buggered off saving me loads of cash :-)

  2. Querying the SQL

    This is taken from a previous website post but the problem still remains, my home monitoring system has 4 zone with a wireless temperature sensor in each. They all wake up individually on a periodic basis and each time one sensor outputs data the main program writes an entry into the SQL database for all zones so only the sensor currently transmitting has new data and the previous readings from the other sensors are stored with the new.

  3. Pandas SQL and pain

    I’ve left the home monitoring system alone for a few years, its just sat quietly in the garage collating data into an SQL database, the only changes made recently were to move everything onto a Pi4 and add an additional camera into the motioneye system running on the same Pi. So as its a slow day i decided now was the time to update it or rather start work on it. One thing i wanted to do was re-instigate the live readings and an auto graph element and for this i needed to extract data - simple i got my old code somewhere …. somewhere … maybe.

  4. comparing data

    After getting bokeh to graph data I started trying to compare years/months against each other eg June 2019 vs 2018 but this did not quite go to plan especially as i had forgotten that despite dragelec running for almost 5yrs the SQL recording only started in Aug 2018…

    There is another issue; the way the data is recorded; i store values everytime a signal is output from one of the sensors this means when interrogating the data i can have a different number of values per day so a straight forward export of data does not work.

  5. a year of data

    Xmas is a pretty dead time for me, so i finally got round to programming something to export the data from the sql db and then more importantly graph it.

    I have struggled for ages trying to use matplotlib and was close to giving up then i stumbled across bokeh and magic happened, a gift at xmas time :smile: in short a few simple lines of code and i now have a scalable graph of data that works on this site as well as the dashboard monitor. Below is an image of the output;

  6. it got warmer

    I thought it was warm in the garage a few weeks ago but perhaps not as warm as today 25th July 2019. The temperature sensor in the garage recorded 45.11degC and a minimum for the entire day of 17.28degC makes me reconsider keeping the old netgear router in there!

    The min/max for the 3 days (ok not full data available yet for today)

    DATE MIN MAX
    2019.07.25 17.28 45.11
    2019.07.26 20.32 29.85
    2019.07.27 17.19 20.27

    on a different note i need to figure out how to link posts, all my files are written in org with the date as the file name 20190727.org and then hugo simply converts them but i still havent figured out how to get a working link from for example the file with the date shown to another dated file

  7. poor choice made at DB creation

    OK i’ve been ignoring brexit and the fact our politicians were granted a delay and promptly went on holiday :rage: so in an effort to further distract from the failings of my government i took a little jaunt into utilising the data i’ve been recording for the last 9 months and its at this point i realise that perhaps whilst my data is readable to me i should have stored dates/times in a different format to allow for automated data analysis.

  8. Getting colder

    Brrrrr ok we dont have the snow yet here and we definitely do not have the polar vortex weather being experienced in the States but it got pretty cold this morning.

    This is recorded by dragelec and is the temperature inside my garage

    DATE TIME degC
    2019-02-03 06:28:33 -6.87
    2019-02-03 06:34:31 -7.21
    2019-02-03 06:35:24 -7.21
    2019-02-03 06:37:16 -7.21
    2019-02-03 06:49:30 -6.87
    2019-02-03 06:53:38 -6.87
    2019-02-03 06:58:33 -6.87
    2019-02-03 07:04:31 -7.35
    2019-02-03 07:05:17 -7.35
    2019-02-03 07:07:13 -7.35
    2019-02-03 07:19:32 -7.42
    2019-02-03 07:23:30 -7.42
    2019-02-03 07:28:30 -7.42
    2019-02-03 07:34:33 -7.49
    2019-02-03 07:35:11 -7.49
    2019-02-03 07:37:08 -7.49
    2019-02-03 07:49:33 -7.21
    2019-02-03 07:53:24 -7.21
    2019-02-03 07:58:31 -7.21
    2019-02-03 08:04:33 -7.14

    Yes i cheated, i exported the sql data manually and graphed it in LibreOffice i really need to program this so its automatic but hey thats another task to do :)

  9. Learning SQL and some poor python

    Since converting to storing the data in sqlite form i’ve been learning how to extract specific sections of data so i can then learn how to graph it and ultimately serve it on the home dashboard and during these experiments i can see my decode routine is not quite as efficient as i originally thought as it lets through non-numeric data so lets look at the sql extraction code and then the decode issue;

  10. home monitor conversion

    I finally have some ‘free’ time so i upgraded a few things on the pi server but not without issues,

    From jessie to stretch - network drive

    For some reason the old command for mounting a network drive on the pi which worked on jessie did not work under stretch. I kept getting a host is down fault yet it was clearly not. The line i had in fstab before was;

  11. Slow progress

    Its been a very quiet period in terms of programming, website updates etc but things have been moving slowly. I was never happy with the home made dashboard nor the background program so over the last few weeks i’ve been (time permitting) changing and tweaking such that the dashboard uses an LCARS CSS template and i’m much happier with it. The python backend has been tweaked and temperatures are moving to an sql storage of values to allow historic data analysis.

  12. shortening the code

    The module i wrote for decoding the sensor data stream bugged me it was too repetitive with multiple if statements ie;

    python code snippet start