Category Archives: Misc

Ubuntu 14.01 LTS (Trusty Tahr)

After months of clicking the “remind me later” button when prompted to upgrade, I finally too the plunge.
And as I feared, things went wrong 🙁

  • Once the upgrade complete, I was greeted with a grey screen when opening VNC (I do everything “headless”)
    • Even with changes to the vnc startup file, I’d end up with no unity launcher and no task bar
  • The keyboard was messed up:
    • Impossible to type ‘s’
    • Typing ‘d’ minimised everything
    • ‘up’ maximized the window (no access to previous command in the terminal)
  • Apache was not working anymore

Needless to say I was not a happy bunny.

After hours of “googling” (I know there’s no such word), endless changes to vnc config, dconf, and reboot, I finally managed to fix everything:

  • The fix for the grey screen / lack of unity launcher / lack of task bar was settled by changing my ~/.vnc/xstartup with the below:
    • #!/bin/sh
      
      def
      export XKL_XMODMAP_DISABLE=1
      unset SESSION_MANAGER
      unset DBUS_SESSION_BUS_ADDRESS
      
      vncconfig -iconic &
      x-window-manager &
      gnome-panel &
      gnome-settings-daemon &
      metacity &
      nautilus -n &
      gnome-terminal &
      gnome-session -session=ubuntu &
    • This didn’t fully resolve the issue as the look and feel is the old, pre-unity desktop, with top and bottom bars, no side launcher. But at least I can work with that for now.
  • I fixed the keyboard layout with the dconf tool:
    • If not yet installed, type
      sudo apt-get install dconf-tools
    • Then type
      dconf-editor

      and you should get this:

    • dconf-01Go to desktop > ibus > general and tick the box “use-system-keyboard-layout“:
    • dconf-02Then go to org > gnome > desktop > vm > keybindings and replace any entry with the work “super” with “[]”:
  • dconf-03Websites have a new path under Apache. Whereas it used to be under /var/www/, the default path is now /var/www/html/.
      • Of course as I upgraded, I decided to keep my settings, which pretty much rendered everything useless.
      • I ended up completely removing Apache and reinstalling it with these commands:
      • sudo apt-get update
        sudo apt-get purge apache2
        sudo apt-get install apache2
      • All I had left to do was to more the content of /var/www/ to /var/www/html/

Everything is now working again 🙂




OWL Individual Appliance Monitor

With a cheap OWL CM119 Energy Monitor, and thanks to an idea picked from pictures found on Flickr, I built my own appliance monitor:

OWL CM119

OWL CM119

Pictures from Flickr showing steps to create the monitor:

OWL_IAM_1 OWL_IAM_2 OWL_IAM_3

And this is what I ended up with:OWL_IAM_4

And with the benefit of communication via 433MHz and being supported by the RFXTrx433, I don’t even need to use the OWL base, I just needed to enable the Oregon Mode in DomotiGa to start receiving the data. (See RFXTrx433 post for instructions).

Very handy to automate tasks based on the status of an appliance…

So in DomotiGa, this is what I did to automate based on power consumption under Events:

  1. Trigger:
    1. Trigger Type: Device Lastseen
  2. Conditions:
      1. CInt(Dev_50_Value2) >20 (this is to cater for devices in standby mode, create another condition with <20 for the Off State. value may need to be amended)
  3. Events:
      1. Use the trigger and condition created above, and add your actions



Current Cost’s IAM

Having moved one of my PIR‘s in the living room to automate the lights in here too, I quickly realised there was a major flaw: when I watch the TV, I tend to move very little. This results in the lights turning off when I want them to stay on.

I had to find a better solution than waving my arms every 5 min or so to keep the lights on.

I found out Current Cost do IAMs or Individual Appliance Monitors. They look like this (I ended up with a European version with a couple of adapters to get it to work here in the UK):

Current Cost IAM

Current Cost IAM

Since my Current Cost Classic monitor did not support this, I bought a 2nd hand one that does from eBay: the EnviR:

Current Cost EnviR

Current Cost EnviR

The neat result is that the IAM, although not natively supported by DomotiGa (at the time of writing), is actually correctly detected since Current Cost use the same format on the serial port 🙂

It was then very simple to add an event in DomotiGa to check IF there is no motion detected on the PIR AND the power consumption of the TV is less than 20 watts (the TV uses about 12-14watts in standby), THEN I switch the light off.

SmartVISU - TV Monitor

SmartVISU – TV Monitor (screenshot from mobile interface)

For the record, the Current Cost returns a string, not a number, in the format ‘00000‘, so in DomotiGa I had to convert this to a number for my IF statement:

CInt(devicename_value2) < 20

 




Wireless Temperature & Humidity Sensor

During the winter months, I tend to use a dehumidifier, with a timer.

I recently “upgraded” the timer and replaced it with one of my HomeEasy Sockets, controlled remotely via DomotiGa.

However I was looking to take it to the next level by making the dehumidifier a bit smarter so it would only work when the relative humidity is too high.

I’ve therefore purchased a Cresta TS34C Wireless Thermo-Hygro Sensor (From HERE):

Cresta TS34C Wireless Thermo-Hygro Sensor

Cresta TS34C Wireless Thermo-Hygro Sensor

The data is received wirelessly via my RFXTrx433

I am currently logging the temperature and humidity levels in order to set Start and Stop times via DomotiGa. Looks to become as follows:

On: RH > 70%
Off: RH < 50%

This will also be done only within specific times during the day so I don’t get awaken at night by the dehumidifier of course.

And because there are 5 channels on the sensor, I can use more than 1 concurrently, so I have another sensor outside to replace the old DHT22 which is starting to show signs of age. It’s also placed in a better location as the sensor is wireless so the readings should be more accurate.




Sound & Text-To-Speech

I was looking to add sound to my DomotiGa installation so I could generate audio alerts and updates.
Since my server does not have any audio out socket, I’ve purchased some USB Speakers: Sweex 2.0 Speaker Set Purephonic USB Speakers:

Sweex 2.0 Speaker Set Purephonic USB Speakers

Sweex 2.0 Speaker Set Purephonic USB Speakers

There was only 1 glitch which took me a whole afternoon to sort. For some reason my user was not part of the audio group so I could not get any sound out.

I eventually realised this and sorted it with this command:

sudo adduser [user] audio

And to control the volume, I use this command:

amixer sset Master 50%

 

I have then recorded a few voice announcements using TTS (Text-To-Speech) that I can use with events such as:

  • “Alert: Front CCTV connection Lost”
  • “Alert: CurrentCost connection lost”
  • “Mood Scene: Movies, Activated”
  • and the geeky “Good Morning” 😎



Dimmable LEDs

The first LEDs I got to replace running expensive halogens were not the best. Although they were really bright (520 lumen) their angle was only about 30º and they didn’t dim that much. So it resulted in a darker room than with the old halogens (which were less bright at 400 lumen)

I got new sets of LEDs. This time I spent much attention to getting ones with a wide beam angle. One thing to note: even though they dim much more than the first ones I got, they still don’t dim all the way down to off like halogens would, probably down to about 30-40%. (They work also very well with the LightWaveRF switches that I use to control them)

I chose 4.5 Watt GU10 COB Bulb – Wide Beam Angle for the living room:

4.5 Watt GU10 COB Bulb - Wide Beam Angle

4.5 Watt GU10 COB Bulb – Wide Beam Angle

and 4 Watt GU10 LED Bulb – Wide Beam Angle for the kitchen:

4 Watt GU10 LED Bulb - Wide Beam Angle

4 Watt GU10 LED Bulb – Wide Beam Angle

Not only these are much cheaper to run than halogens (less than a 1/10), but because of their wide angle, they end up being actually much brighter too, even the kitchen ones which are only on 320 lumen (VS. 400 lumen for halogens). RESULT !




Charts

I’ve been collecting data from my different sensors:

  • Power consumption & kitchen room temperature from CurrentCost
  • Outdoor temperature & humidity via a DHT22 sensor connected to my Raspberry Pi
  • Server hard drive temperature via HDDTemp

Logging data is good but if you can’t look at it what’s the point?

I’ve therefore implemented charts on my SmartVISU page. This is achieved by using the adapted DomotiCharts script off the original Highcharts plugin.

The result is a nice chart that integrates really well with the look and feel of SmartVISU:

Temperature chart

Temperature chart




SmartVISU

With the recent additions of the RFXtrx, the LightWaveRF switches, the HomeEasy Remote Controlled sockets and the CurrentCost energy monitor, I have updated SmartVISU to take full advantage of these devices.

I’ve also updated the original template to use “my own” weather satellite images (as opposed to the original German ones):

And I’ve added a quick link to view my CCTV Camera feeds in real time.

To see the end result, click on the below pictures.

SmartVISU Control Center (Jan 2015)

SmartVISU Control Center (Jan 2015)

SmartVISU Weather Center

SmartVISU Weather Center

SmartVISU CCTV Stream

SmartVISU CCTV Stream




Server Upgrade

Having quickly realised that my Raspberry Pi was not powerful enough to run all the things I wanted (this wordpress blog, checking the multiple sensors connected to the GPIO ports and displaying their status on a php page), I used an old spare HP Compaq D530u desktop computer as my “server”:

HP Compaq D530u

HP Compaq D530u

Although it’s been running fine for a while, since the addition of DomotiGa, and due to its old age (and probably dust) it’s not really up to the task anymore (it did crash a few times due to overheating etc). I’ve therefore decided to upgrade my gear to something that’s closer to a real server than a desktop computer.

I’ve purchased a brand spanking new HP Proliant G7 N54L server:

HP Proliant G7 N54L

HP Proliant G7 N54L

 

I’ve now installed Ubuntu Server x64 on it and transferred all applications, MySQL databases, files, etc.

It comes with a 250GB SATA hard-drive which is much better than the 40GB PATA one I had before, and I still have space for another 3 (when I decide to use it as a NAS too).

Not only it is quicker than the old HP Compaq D530u, it’s much quieter too 🙂

I did have to change from tightvncserver to vnc4server. Tightvncserver would crash within 30 min or so and the only option would end up connecting via SSH to attempt to kill and restart the service. Since the installation of the alternative vnc4server, I’ve not experienced a single crash 😎




LightWaveRF Switches

OK I can make the buzzer beep if I forget the lights at night (see code from this post).

But that’s a little bit reactive, and still requires me to “move” and manually switch the light off. What would be better would be to switch the lights off altogether without requiring me to lift a finger.

This is where LightWaveRF comes into play. Not only they look really sleek, they fit in a standard connection box and are relatively cheap (when comparing with other standards).

I therefore bought a couple: 1 x 1 gang for the living room, 1 x 2 gang for the kitchen:

LightWaveRF 1 Gang Switch

LightWaveRF 1 Gang Switch

LightWaveRF 2 Gang Switch

LightWaveRF 2 Gang Switch

The way I chose to control them is to pair them with an RFXtrx transceiver via DomotiGa (see this post for more info).

I’ve still got to install the kitchen switch, but for now, I can control the living room lights from anywhere in the world !

LightWaveRF Switch via SmartVISU

LightWaveRF Switch via SmartVISU

I’ve also got some dimmable LEDs, but it turns out I can only dim them down to 50% instead of 0% (not much difference to be honest) so I might be looking for better ones soon. Watch this space 🙂