This is a battery powered Mini Scene Controller with a display for the MySensors 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.
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
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.
|Qty||Value||Device||Package||Parts||Description||MF||MPN||Aliexpress or ebay link|
|1||SSD1306 OLED Display||SSD1306 OLED Display||https://www.aliexpress.com/item//32357566914.html|
|1||Arduino Pro Mini||Arduino Pro Mini 3.3V||https://www.aliexpress.com/item//32341802160.html|
|4||1n914||Small Signal Diode|
|1||2xAAA battery holder|