Smarthome Extravaganza – Part 7 | Janne Honkonen | Professional profile and official site - Janne Honkonen - Official pages of the Janne Honkonen, visual artist

Smarthome Extravaganza – Part 7

On this episode of Smarthome Extravaganza: Janne changes his smarthome electricity system, writes an article after so many months and possibly, drinks coffee and goes to loo afterwards. This and more on next: Smarthome Extravaganza, part VII.

Recap

Last we were here: Our smarthome system was running self-built and coded Raspberry Pi 3 based artificial-ish home management system which used Telldus Duo as a controller an 433mhz radio frequency based system because it was a cheaper and faster solution. Now things have changed a little.

The summer nights

Summer came, went, and most of the time our smarthome system “Karhu” (translates as “Bear”) was offline due the fact that a) we did not need any automated lights during summertime and b) my partially finished read-only mysql-independent addition to system which I was too occupied to finish.

In other words, my upgrade to the smarthome system I was developing went sour because I went to change system to be read-only (to save the SD) and because of that I had to get rid off from MySQL DB because it did not work well (at all) with read-only systems, so I went, and designed NanaDB, a database system based on memory-cached JSON files which read all the needed configs from the shared memory (/run/shm) during runtime, and only used SD card when storing changes.

All the NanaDB files were rebuilt on every boot to the /run/shm which enabled very fast and very system-saving built but I was dissatisfied with the after-configuration because I had no time (because of the summer) to make a proper GUI config system to it because earlier version was based on MySQL solution. So, system was left to stall during summer time.

When the autumn started to sneak in, it was time again to consider to kick back the system, but as I remember where I had left the system and was pondering the fact that the 433mhz based control system was not as reliable as needed because of the one-way communication only (controller only sends commands but does not receive statuses from the power-sockets) I could not trust it to handle my house’s critical systems such as heating with electric radiators.

For these reasons, I had to ponder more reliable solution.

Alas, the Z-Wave

I had prior knowledge of the Z-wave system, which is a similar system to 433mhz, but both works on the higher frequencies (868.42 MHz) which is more noise-free, but also has two-way communications with the controller with the added bonus that every Z-wave device work as a repeater themself, one of the main reasons to switch from 433mhz systems.

Only thing this meant, was that I had to replace all my 433mhz device with Z-Wave devices, including controller and power sockets. As I already had good base knowledge of linux, smarthome development and had Telldus Duo to keep receiving my temperature data from Proove thermometers, I felt confident to order Z-wave UZB1 stick for the Raspberry which would act as a controller for the Z-wave devices which I bought a small set of them.

Changing the pace

After a about week of fighting with the long-overdue libraries for Linux and old non-reliable software, I gave up. Normally I would have fought even for a month until giving up with the redundant linux libraries for OpenZWave but with my current life, I have a family, a small loving son and a beautiful loving wife, whom I felt was not getting enough of my attention, so I decided to focus my interest of them and ordered cheap-ish (and way too simple) solution by getting a Telldus Live controller, which provided web-based online controller, offline support but no direct control from Raspberry to controller, which was sad.

But so much for the quality

Now, Telldus Live system ain’t half-bad. But it ain’t half-good either. Considering that it is a company with several developers and paying customer, I was amazed how simple and overly-simplified service they are providing missing several key elements and features which my own earlier 433mhz system had. Also their web-based GUI has several issues which proper reliable ajax-based content loading, their app is just terrible (you cannot do any configure with the app, it does not update real time etc.) and there are also other problems.

Without trying to sound arrogant, the original smarthome GUI and PHP-based controller software I made in three days for the 433mhz, was much more reliable, faster, had more options and was with every way better than the solution Telldus is providing for the Telldus live.

When next I have extra time for the UZB1, or if the Telldus provides similar system with API as they did with Telldus DUO, I will certainly switch off from the Telldus Live and make a newer version of the Karhu smarthome systems, for both improved offline controlling, not need for a online operation and much, much more better possibilities and design than with the commericial Telldus Live – systme.

Few ideas

My earlier system, now powered down, was based on IQRules, a artificial-ish rule, which did not need so much of IF-sentences what every smarthome operator is providing but was more a smarter solution, my upcoming system will be even more smarter.

Instead of using stupid and user-dependent IF-THEN systems what all the other systems provide, my system will be based on problem-and-solution logic which operates my home. As most of the design is in my head, it is hard to express on written, but I will try to describe it a little bit:

Try to stay with me

User only needs to create first basic setups for the smarthome: For example, the new system will always trying to reach so called buoyant level with the home. It works like this: There is a buoyant level for each section of the home: For the temperature in different rooms, motion detection, light level etc and there are devices which enable system trying to reach the buoyant level.

Buoyant level is defined as a value zero (0) for all the devices. I could setup +20.5c as a buoyant level zero for our living room, and a devices helping to change it would be any heating devices which’s heat can reach out living room. For example living room’s radiator value-of-effect would be +1, where as our library room’s radiator (next to living room) would be +0.75 as it does not warm so much of our living room.

Our kitchen’s radiator value would be +0.3 with this logic as the heat does not reach living room as much as it does from the other radiators.

Logic example

Now the logic works like this: If the living room’s temperature drops, lets say, to +20c, logic tries to find strongest solution to correct the buoyancy which is now under zero (-0.5), it finds living room’s radiator (+1 value) as a strongest solution, and turns it on, and after it reaches the buoyancy (+20.5c = value 0) it turns off any devices contributing to the buoyancy change.

Well, you say, this is just the same as IF-THEN logic with other systems? Well, in other systems, there are usually based with if-living-room-too-cold-turn-living-room-heat but what if, for some reason, living room’s radiator is broken? Controller does it’s best to turn it on but as it is just a IF-THEN controller, it does not help.

In situation of broken-radiator, my logic detects that temperature keeps dropping, now already under +19c in certain time although earlier correct strong solution (broken radiator at living room) is turned on, it seeks additional solution with next best help, which is, library room’s radiator with (+0.75 value) and turns it on. Radiator from the library room then heats up both room.

But what if the radiator from the library room is also broken? Temperature in living room keeps dropping and the two solutions logic have located do not help, it finds additional solutions, which in this case is kitchen’s radiator (+0.3). which it turns also on.

Other usages

The same mathematical logic can be also used for lighting: Room is too dark (value under 0) so to correct it logic finds devices which contributes to value (i.e. light switch) which lit up room. If logic then notices that the one lamp turned on does not help enough (in specified time limit) it turns on more lights to lit the room better.

The same logic can be used to any other smart home devices, and what is best, it can be used with any neural networks as the data provided and used by the logic is simply all and all values zero and trying to reach zero. One could easily train a neutral network using the logic I have designed.

Interested? Amazed? Confused?

If the design I so poorly tried to describe sounds like an idea to use or you would like to use it, be my guest. I really would like to hear what people have developed, and if you are so brave to make an commercial solution from it, I would be much appreciate to hire me or at least give me some royalties 🙂 Some ideas can be patented, but I really hate that ideology so if you got some good ideas from my content, tell me of them 🙂

*

© Janne Honkonen - www.jannehonkonen.com