browser icon
You are using an insecure version of your web browser. Please update your browser!
Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.

Tagged With: Display

DsBox Light Switches as part of my Home Automation

Summary

After 40+ weekends my DIY smart light switches are working as part of my home automation. There is more to do but i’m pleased with what they do so far.  I’ve now built 5 switches – one for each room of my apartment except the bathroom.  These detect motion as i walk in and out of each room. The switches get/set attributes on a central mysql database and run an evolving logic python script that

  • switches hue lights on in rooms during “evening/night” when there is motion
  • maintains a ranked list of rooms by last activity seen
  • keeps the light on in the most recent room with activity , and switches of other rooms after a period of inactivity.
  • start/stop video recording of activity each room

The shared database allows for global or per room or per switch configuration of of sunrise/sunset times as well as other configurations. It also means a Grafana server can display metrics on switches and room occupancy. The shared mysql database and Grafana server run as docker containers running on a Synology NAS that also provides storage for video recordings and a central syslog service.

Future work to switches

  • Adding the capacitive touch/dial to each switch so that they can be manually adjusted up/down/off etc. For the moment I’ve used a dummy cover until i can perfect the capacitive dial design.
  • Remount some of the fisheye camera modules which are not centered as i would line them
  • Adding/Evolving logic scripts to learn the appropriate brightness for each room at different times, to simulate activity when i am away based on observed usage, to track how long i spend working/sleeping/relaxing
  • Auto update the sunrise/sunset times from https://sunrise-sunset.org/api
  • Adding image recognition to the camera in the kitchen to read barcodes for shopping lists
  • As screens improve i’d like to replace the 8×8 led matrix with a e-ink display. I do not think the tech is where i want it yet. in another 12 months I’ll re-evaluate
  • Enabling me to view the Cameras remotely when i’m out to see if i left the oven on etc

The switches are the first of my DsBox projects based on small cheap compute modules working together to provide Home Automation.  Eventually I may build a small AI to run distributed across the boxes. Its name will be “Leo” as a tribute to a tv character I admired.

Assembly and mounting of the switches

Categories: HomeAutomation | Tags: , , , , , , , | Leave a comment

Prototype #1 of my smart light switch box

Putting the first prototype together

To prototype some ideas, I took an old lunchbox in the shape of a well known toy brick. I cut holes in the base and in some some studs from the lid. The base I stuck on the office wall over the light switch. In the lid of the prototype i put a camera with fish eye lens, a 8×8 led matrix, a PIR motion circuit all connected to a Raspberry Pi. Sliding the lunchbox lid onto the base and connecting a USB power line , my first smart lightswitch box prototype was ready for testing.

So far I have test software that from a pi command line via ssh can…

  • turn my hue lights on and off
  • detect motion in the room including when i am sitting at a desk
  • take fisheye pictures of the room

 

Next

Next on my todo list is a python script to act as logic to…

  • turn the office light on in the evening when there  is motion so i dont need to
  • fade off when there is period without motion to save electricity
  • blink the lights red to remind me to take a break when i am in front of the pc too long
  • possibly record a short snippet of video at the start of each detected motion ( ie when i enter the room )  so that i have a record of activity

I’ve also been prototyping some 3D printed objects for

  • Holding the camera, PIR,Matrix on the outside of the box
  • Mounting the Circuits and Pi inside the box

I hope to have the 2nd prototype ready at the start of July…

Categories: HomeAutomation | Tags: , , , , , , | Leave a comment