💾 Archived View for gmi.bacardi55.io › blog › 2017 › 03 › 15 › entering-the-domotic-game captured on 2024-07-08 at 23:24:18. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Posted on 2017-03-15
So far, most of the things I do with Kalliope could be considered as not really domitic (maybe more domogeek ^^).
Indeed, so far I use Kalliope to:
The last 2 items could be considered as domotic, but I consider them as media management, but the line is grey :)
1: https://github.com/bacardi55/google-calendar
2: https://github.com/bacardi55/kalliope-gmaps
3: https://github.com/bacardi55/kalliope-uber
4: https://github.com/kalliope-project/kalliope_neuron_rss_reader
5: https://github.com/bacardi55/kalliope-web-scraper
6: https://github.com/bacardi55/kalliope-starter55/blob/master/script/reminder.py
7: https://github.com/bacardi55/kalliope-repeat
8: https://github.com/bacardi55/kalliope-mpd
11: https://github.com/bacardi55/kalliope-starter55/blob/master/script/find-episode.sh
Usage are legions and I don't intend to describe all of them here, just the one I'm going to use. Bear in mind than I'm just starting so my knowledge is limited and the devices I have are not numerous :).
I have several ideas to start with, like managing internal sensors (temp, light, motion detector, …) or managing switches (Lamp, electric plug, …)
But first, I needed to find the basic of all this: How to manage these devices from a central control point. I read online some documentation, about protocol and devices and finally end up choosing device compatible with the z-wave protocol, as there is the openzwave opensource lib that seems to work well. Main issue of Z-wave is that the company behind it are owner of the z-wave chip.
I let you read online additional info on z-wave if you wish, there are a lot about it.
So I ended up buying a usb stick z-wave controller and a z-wave multi sensor (temp/hum, light, motion detection) to start poking at it. But I still needed an app to manage all the z-wave devices.
For this, 2 solutions:
I think that the simplest, yet most powerful approach was to choose the 2nd option, and choose a software that was exactly meant to manage domotic device. I could have choose several: jeedom[13], openhab[14], Home-Assistant.io[15], …
I ended up choosing Domoticz[16], very light and powerful app in C++ with a web app and a mobile app. It was very easy to install on an old rpiB+ and to setup my z-wave sensor.
It also provide APIs[17] to do a lot of actions so that kalliope could send action :)
17: https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s#Retrieve_status_of_specific_device
APIs provide options to (non exhaustive, go to their doc page for full API endpoints):
That's the main I'll start poking at, in that order!
I did find online an old python code[18] to manage domoticz. I also found a more recent fork of it here[19] that worked well.
18: https://github.com/EirikAskheim/pymoticz/network
19: https://github.com/wackoracoon/pymoticz
Only issue is that is was forcing the use of http and didn't allow https. So I forked it[20] to add https support. There is pull request here[21] to merge it.
20: https://github.com/bacardi55/pymoticz
21: https://github.com/wackoracoon/pymoticz/pull/1
As you would have guess, a neuron is coming up. You can find it in a draft mode on github[22]. For now, it is very limited but in development. It does include directly the pymoticz library so no manual addition needed there.
22: https://github.com/bacardi55/kalliope-domoticz
For now, you can only request data value from a device. So for example, I can retrieve the temperature and the light level from the sensor.
Brain example
--- - name: "domoticz-get-temp-living-room" signals: - order: "living room temperature" neurons: - domoticz: host: "{{domoticz_host}}" action: "get_device" device: "6" ssl_verify: "False" say_template: "Living temperature is {{devices[0]['Temp'] | safe}} degrees and humidity is {{devices[0]['Humidity'] | safe}} %" - name: "domoticz-get-lux-living-room" signals: - order: "brightness in living room" neurons: - domoticz: host: "{{domoticz_host}}" action: "get_device" device: "5" ssl_verify: "False" say_template: "Living room brightness is {{devices[0]['Data'] | safe}}"
As I said above, there are a lot to be able to do: set on/off devices, get / set scenes and groups, … A lot of fun to have marrying Kalliopé and domoticz :)
Stay tuned!