My smart automated home (part I)

Since I had a water leak in my former apartment, I started to think about how to measure (and alert) things like (excessive) water usage.
I bought a fluksometer (https://www.flukso.net/) which should be capable to do just that (measure power, water and gas consumption). I only use the water and gas consumption measurement since I already have a Smappee device (http://www.smappee.com/) as well. Just a sidenote here: the smappee should be more accurate in measuring the power consumption since it also measures the voltage and phase shift accurately, 2 factors that also make a difference in measuring power, while the flukso meter is powered by a poweradapter and hence has no clue what the voltage or phase shift is).
I was just out of luck and did not have a “grenade” type of water meter, so I can’t use the reed contact method as described on this page: https://www.flukso.net/content/water-probe

My water meter is a sensus, has as far as I know no magnets in there, so I had to find another way. Asking around on the forum and looking through Google gave me this:
http://dribibu.xs4all.nl/home-en/33-flukso-and-energy-monitoring/320-watermeter-and-flukso.html

Which I rebuilt using this with a piece of wood.
http://www.dx.com/p/meeeno-track-sensor-brick-module-for-arduino-orange-works-with-official-arduino-boards-213949#.VtQvGnUrKAl

Had to test a bit with adjusting the potentiometer till it clearly saw a difference between the metallic and non metallic side of the disk (and added a piece of clear scotch tape to the glass above the meter as suggested on the site, to avoid reflection of the glass itself … ).
Hooked it up to pins 6a (Vcc), and 3 – (gnd) 3+ (signal) and I saw pulses in the MQTT page of the flukso meter.

I also installed the gas probe, which was simply a reed contact you can put in a slot on the bottom of the gas meter (it needs to be put in quite tight though, so it was a bit touch and feel until it worked.

The result can be seen here:

https://goo.gl/photos/C5vdY2TMFA7MN4UJ7

Now a bit of a rant against the fluksometer:

  • The site feels a bit old, there is no way to hide or turn off the power graph (which I don’t use because I don’t measure power with it.
  • The site only shows graphs and no real numeric values for daily use etc …
  • There is no real way to set alerts or alert thresholds if you consume a lot or too much vs a limit.

The device however does MQTT and as I had seen some things around that through Jan-Piet Mens (http://jpmens.net/) presentations on Loadays (http://loadays.org/) I thought well maybe I could maybe start to log the pulses on another device and start to process them some other way… (more on that in part II)

Posted in Uncategorized | Leave a comment

live adding a new disk to linux running in VMware

  • In VMware create a new disk (we assume this is the 2nd disk ~ sdb here)
  • Let’s rescan the bus so linux recognizes it

    # echo “- – -” > /sys/class/scsi_host/host0/scan

  • Now we partition the new disk

    # fdisk /dev/sdb

  • set the type to be 8e (lvm)
  • Then we check what the name is of the volumegroup

    # vgdisplay

  • and we add the disk to the volumegroup

    vgextend vg00 /dev/sdb1

  • then we add the new space to a certain logical volume (say var)

    # lvextend /dev/vg00/lv_var /dev/sdb1

  • and we resize the filesystem in this logical volume

    # resize2fs /dev/vg00/lv_var

Posted in CentOS, VMware | Leave a comment

set disk scheduler to NOOP on linux running in VMware

  • check the current disk scheduler:

    # cat /sys/block/sda/queue/scheduler

  • set the current disk scheduler to NOOP:

    # echo “noop” > /sys/block/sda/queue/scheduler

  • change it also in the bootloader:

    # grubby –update-kernel=ALL –args=’elevator=noop’

Posted in CentOS, VMware | Leave a comment

CentOS 5 rescue mode fsck on LVM

  • boot with CentOS 5 dvd or the first CD in rescue mode
  • skip the mounting part
  • first scan for our volume groups:

    # lvm vgscan

  • then activate the logical volumes:

    # lvm lvchange -ay

  • now you should see your volumegroup and logical volumes under /dev/ and can use them as usual.
Posted in CentOS | Leave a comment