Skip to content
Jesús Alberto Martínez Mendoza edited this page Apr 12, 2019 · 5 revisions

About Energy Berry project

"Wireless System for energy saving applied to domotics" is a project that includes hardware/software modules. The system has hardware modules (ESP32) which we call berries, these have the ability to control switches and sense variables such as brightness in order to save electricity.

Each berry is controlled from the mobile application, but also the ESP32 works autonomously using its interal RTC.

Software

The project has 3 main modules which will be explained below. The whole project is developed with Zerynth ❤️

Communication

This module is in charge of receive/send data using BLE and Wifi. For BLE it uses the Current Time GATT Service 'cause it allow us to do the communication using Strings.

Example
connection = BerryConnection()

def myBluetoothHandler(msg):
  # Your code here

connection.onNewBLEMessage(myBluetoothHandler)
connection.onWifiConnected(_yourHandler)
connection.sendMessage("deviceUUID", "Hello world")

...

Parser

This module receives a string and outputs a deviceId, instruction and timestamp.

Example
parser = BerryParser()

parser.convert("1|On|Now") # Turn on device 1 right now
parser.convert("2|Off|1555086833") # Turn off device 2 at timestamp 1555086833

print(parser.convert("1|80|1555086833")) # { deviceId : 1, dimmerValue: 80, timestamp: 1555086833 }

Energy meter (Using Hall Effect)

Aquí se la va a rifar Granja con el example :P