Yo! This project is still a Work In Progress. Instructions, board layouts and BOM might change!
MySensors Mini Scene Controller
License:
GPL 3.0
Created:
9 years ago
Updated:
9 years ago
Views:
4712
1 Collect
3 Comments
Share
68 Download (659.23 kB)
Donate to support Open Hardware

Description:

This is a battery powered Mini Scene Controller with a display for the MySensors library.

Features:

  • Uses MySensors Library
  • SSD1306 OLED display
  • Can change the button text from the controller
  • Displays Time, Date, and Temperature
  • Displays requested scene status

The thing

The display from the front From the back Mounted in a blank switch panel Mounted in a blank switch panel The basic display showing the button text, time, date, & temperature Scene Started/Stopped status

Display Library

The available libraries for the SSD1306 use a graphics buffer using 1K of memory as well as the memory to operate the library, there was insufficient memory for the MySensors library and to do anything useful. To get around this, I have cut down the Adafruit SSD1306 & GFX libraries to remove the graphics buffer and and functionality that needed it (mostly graphics) and changed the render code to directly operate with the SSD1306 controller. This leaves a library that will allow you to display scaled text (using the built in 5x7 LCD font only) and basic bit map graphics that aligns with the text rows.

Configuration:

Variable1,2,3,4 on the controller provide the button text for the buttons. CurrentTemperature provides the temperature. This needs to be copied from another sensor. This can be done by watching a variable from one of the temperature sensors by adding the following code to your Vera startup lua.

local TEMP_SENSOR = 194
local SCENE_CONTROLLER = 202

luup.variable_watch( "Copy_Temp", "urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", TEMP_SENSOR )

function Copy_Temp( lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
  luup.variable_set("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", lul_value_new, SCENE_CONTROLLER)
end

Building:

As this is a battery powered device, remember to remove the 2 LEDs and the voltage regulator from the arduino to save power. The code spends most of its time sleeping to do the rest.

Schematic