-
Late update
12/06/2018 at 11:34 • 0 commentsIt's been a while since my last update, probably becauseI haven't doing much about this project.
The thing is that things evolve and now where I said I was using openhub, I'd say I would be using HomeAssistant, that seems to be much easier to configure, and it looks like it's becoming something like an standard for Home Automation in the DIY world.
So, apart from that change, things should be more or less the same, and the problems that were unsolved are in the same status right now. Those problems are mainly those that may ocur in an unexpected event like:
- what happens when there's an unexpected reboot?
- what if the raspberry pi stops working?
- what if the ESP8266 stops working?
and so on...
Hope this helps.
-
Video of the prototype
08/04/2016 at 21:25 • 0 commentsKeep the anotations on:
-
What will be the future of this project?
08/04/2016 at 21:02 • 0 commentsMy initial idea was to keep things as simple as possible. I think micropython is perfect for that.
I started with a thermostat because it has inputs (temperature & humidity), and different outputs (oled 128x64 screen and a relay to turn on/off), and I think it's just one of the most complicated things you will need at home. The rest, starting from this point, would be just easier.
So this is only the beggining. My idea is to make some "typical configurations" of modules that can be used as light switches, light shaders, blinds controllers, appliance controllers, presence control, valve control...
The second phase would be to find a way to integrate all this in a conventional home, without much disturbance. The old switches should work, but you should be able to control the lights from OpenHab. I have some ideas about this that will discuss in the future.
The most important part of the project would be OpenHab. There's where all the "intelligence" should be.
So... why is my project different to others out there doing the same thing?
Because I keep things simple and tidy. The things I'm using are cheap and the less things I can use, the better. (For example, Instead of using RF, I use WiFi). -
OpenHab Configuration
08/03/2016 at 22:44 • 0 commentsOnce you have your openhab installed, you will need to use the MQTT Binding addon in order to use MQTT with openhab.
In your openhab configuration file (probably "openhab_default.cfg") you have to include the configuration of the MQTT browser. I've included:
mqtt:mosquitto.url=tcp://localhost:1883
mqtt:mosquitto.clientId=openhab
mqtt:mosquitto.qos=1
mqtt:mosquitto.retain=true
mqtt:mosquitto.async=falseI'm using message retain and qos=1 so everytime I read the MQTT from the ESP8266 there's always an ON or OFF message (that the esp8266 obeys).
In the items folder, in the config file, you can add something like this:
/* MQTT Sensors */
Number Temperature_GF_Living "Temperature [%.1f °C]" <temperature> (Temperature, GF_Living) {mqtt="<[mosquitto:/sensor1/tem:state:default]";}
Number Humidity_GF_Living "Humidity [%.1f %%]" <water> (Humidity, GF_Living) {mqtt="<[mosquitto:/sensor1/hum:state:default]";}
Switch Light_GF_Living "Led" (GF_Living, Lights) {mqtt=">[mosquitto:/sensor1/led:command:on:on],>[mosquitto:/sensor1/led:command:off:off]";}Restart openhab and everything should work.
-
How did I start all this?
08/03/2016 at 11:16 • 0 commentsMi first step was to make things work, one thing at a time.
I started with the DHT22. Very easy in micropython as the library is already included.
Then I stepped to the OLED 0,96" screen. Try to show some simple messages using the library from https://github.com/micropython/micropython/tree/master/drivers/display
Then I stepped to MQTT. Once you understand the way it works, it won't be problematic but when I put everything together had some memory issues. I had to keep the OLED out for a while until I figured out how to maintain my memory usage low.
The best tutorial I've found to understand MQTT is this one: https://www.linux.com/news/mqtt-building-open-internet-things
The last thing is OpenHab. I'm into this at the moment...
-
Automation and data storage
08/03/2016 at 11:07 • 0 commentsThat is why I'm using OpenHab: automation (boiler on/off) and data storage (sql database) will be done in this side, as it is an open solution for home automation.
-
Interruptions
08/03/2016 at 11:05 • 0 commentsI'm not using interruptions at themoment, so I receive messages in the ESP8266 every loop of the main program (every 10s)
I've resolved this using persistence in the MQTT messages sent to the ESP8266 (messages that at the moment just turn on or off the led on the ESP). So... it works. It isn't the best way, but it just does.
I'm sure this could make use of interruptions, but I may need some help with that.
-
Problem when MQTT Broker connection lost
08/03/2016 at 11:01 • 0 commentsAs for the MQTT broker connection, it seems like the functions I'm using havesome problems if the connection to the server is lost.
I'll have to take a look and try these:
https://github.com/micropython/micropython-lib/tree/master/umqtt.robust