Python library for controlling souliss gateway

251 views
Skip to first unread message

Michi

unread,
Aug 14, 2017, 1:22:12 PM8/14/17
to souliss
Hi all.

I have been working these days on a python library that communicates with a souliss gateway, get typical updates and send functional codes. It's not finished yet (not all the typicals are implemented), but I would like to share with you and get some feedback about the path it should be going to. We had been testing it in the spanish forum (Juan Pinto one of them, of course, thank you again ;) and I thing it should work on a normal network.

My final purpose is to integrate Souliss with HomeAssistant (kind of OpenHab written in python), but not with a "closed binding". Instead, I would like to code a simple python program that publish node changes (through MQTT), and listen to MQTT messages to send commands to the gateway. There will be no need to change arduino/esp code in the nodes (keeping Souliss outside MQTT handling). So, any MQTT compatible automation system (including HomeAssistant) would work out of the box.

If you are interested, the library is in https://github.com/maoterodapena/pysouliss . It works with python 3.6.2. Just clone the repository and :

python main.py -g <ip souliss gateway> -v

It will request the database to the gateway and gather information about all the nodes. The last -v is for verbose, just for troubleshotting. You will see every change on the souliss network. Something like this:

$ python main.py -g 192.168.2.80
INFO: Trying to connect to gateway
INFO: 3 nodes found
INFO: Node 0. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 0: Typical 0 - T11: ON/OFF Digital Output with Timer Option updated to off
INFO: Node 1. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 1. Added typical 0x12: T12: ON/OFF Digital Output with AUTO mode
INFO: Node 1. Added typical 0x13: T13: Digital Input Value
INFO: Node 1. Added typical 0x15: T15: RGB Light
INFO: Node 1. Added typical 0x16: T16: RGB LED Strip
INFO: Node 1. Added typical 0x58: T58: Pressure measure (0, 1500) hPa
INFO: Node 1. Added typical 0x53: T53: Humidity measure (0, 100)
INFO: Node 1. Added typical 0x52: T52: Temperature measure (-20, +50) C
INFO: Node 1: Typical 0 - T11: ON/OFF Digital Output with Timer Option updated to on
INFO: Node 1: Typical 1 - T12: ON/OFF Digital Output with AUTO mode updated to off
INFO: Node 1: Typical 2 - T13: Digital Input Value updated to off
INFO: Node 1: Typical 3 - T15: RGB Light updated to 00:00
INFO: Node 1: Typical 4 - T16: RGB LED Strip updated to 00:00:00:00
INFO: Node 1: Typical 5 - T58: Pressure measure (0, 1500) hPa updated to 66.0 hPa
INFO: Node 1: Typical 6 - T53: Humidity measure (0, 100)  updated to 41.0 %
INFO: Node 1: Typical 7 - T52: Temperature measure (-20, +50) C updated to 16.0 C
INFO: Node 1: Typical 7 - T52: Temperature measure (-20, +50) C updated to 17.0 C
INFO: Node 2. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 2. Added typical 0x12: T12: ON/OFF Digital Output with AUTO mode
INFO: Node 2. Added typical 0x13: T13: Digital Input Value
INFO: Node 2. Added typical 0x15: T15: RGB Light
INFO: Node 2. Added typical 0x16: T16: RGB LED Strip
INFO: Node 2. Added typical 0x58: T58: Pressure measure (0, 1500) hPa
INFO: Node 2. Added typical 0x53: T53: Humidity measure (0, 100)
INFO: Node 2. Added typical 0x52: T52: Temperature measure (-20, +50) C
INFO: Node 2: Typical 0 - T11: ON/OFF Digital Output with Timer Option updated to on
INFO: Node 2: Typical 1 - T12: ON/OFF Digital Output with AUTO mode updated to off
INFO: Node 2: Typical 2 - T13: Digital Input Value updated to off
INFO: Node 2: Typical 3 - T15: RGB Light updated to 00:00
INFO: Node 2: Typical 4 - T16: RGB LED Strip updated to 00:00:00:00
INFO: Node 2: Typical 5 - T58: Pressure measure (0, 1500) hPa updated to 66.0 hPa
INFO: Node 2: Typical 6 - T53: Humidity measure (0, 100)  updated to 41.0 %
INFO: Node 2: Typical 7 - T52: Temperature measure (-20, +50) C updated to 17.0 C
INFO: Node 1: Typical 5 - T58: Pressure measure (0, 1500) hPa updated to 67.0 hPa
INFO: Node 1: Typical 6 - T53: Humidity measure (0, 100)  updated to 42.0 %
INFO: Node 2: Typical 5 - T58: Pressure measure (0, 1500) hPa updated to 67.0 hPa
INFO: Node 2: Typical 6 - T53: Humidity measure (0, 100)  updated to 42.0 %

There are also a few examples. To run these examples, you will need to install the library with pip install -e /path/to/the/repository

$ python examples/autogen_openhab_items.py -g 192.168.2.80 -o /etc/openhab/items/souliss.items
This will generate an "openhab compatible" items file after exploring all nodes in the network, something like this:

Group gSouliss      "Souliss"       <sun>
Group Node_0 "Node 0"     <sun> (gSouliss)
Switch switch_T11_0_0 "switch_T11_0_0" <switch> (Switches, Node_0) {souliss="T11:0:0"}
Group Node_1 "Node 1"     <sun> (gSouliss)
Switch switch_T11_1_0 "switch_T11_1_0" <switch> (Switches, Node_1) {souliss="T11:1:0"}
Switch switch_T12_1_1 "switch_T12_1_1" <switch> (Switches, Node_1) {souliss="T12:1:1"}
Switch switch_T13_1_2 "switch_T13_1_2" <switch> (Switches, Node_1) {souliss="T13:1:2"}
Number pressure_1_5 "Pressure [%.1f] W_1_5" <pressure> (Measures, Node_1) {souliss="T58:1:9"}
Number humidity_1_6 "Humidity [%.1f]_1_6" <humidity> (Temperature, Measures, Node_1) {souliss="T53:1:11"}
Number temperature_1_7 "Temperature [%.1f °C]_1_7" <temperature> (Temperature, Measures, Node_1) {souliss="T52:1:13"}
Group Node_2 "Node 2"     <sun> (gSouliss)
Switch switch_T11_2_0 "switch_T11_2_0" <switch> (Switches, Node_2) {souliss="T11:2:0"}
Switch switch_T12_2_1 "switch_T12_2_1" <switch> (Switches, Node_2) {souliss="T12:2:1"}
Switch switch_T13_2_2 "switch_T13_2_2" <switch> (Switches, Node_2) {souliss="T13:2:2"}
Number pressure_2_5 "Pressure [%.1f] W_2_5" <pressure> (Measures, Node_2) {souliss="T58:2:9"}
Number humidity_2_6 "Humidity [%.1f]_2_6" <humidity> (Temperature, Measures, Node_2) {souliss="T53:2:11"}
Number temperature_2_7 "Temperature [%.1f °C]_2_7" <temperature> (Temperature, Measures, Node_2) {souliss="T52:2:13"}

You will need to add a line on sitemap, Group item=gSouliss label="Souliss" icon="firstfloor"

Note that not all Typicals are implemented. It's just an example, but, of course, I'm open to suggestions if you find it useful.

$ python examples/example_mqtt.py  -g <ip_souliss_gateway> -m <mqtt_broker> -v

This is a "proof of concept". The script explore all nodes and publish all topics as 'pysouliss/<node>/<typical>. You can see the MQTT messages when a switch or sensor is updated (so you can subscribe any other application to show states). And you can send commands with the topic 'pysouliss/<node>/<typical>/cmd with the souliss command on the mqtt payload (only works with simple switches now :(

For instance, to toggle the T11 switch on node 0, typical 0, if you are using mosquitto:
$ mosquitto_pub -t 'pysouliss/0/0/cmd' -m $'\x01'

And that is all for now. Please, feel free to give opinions, advices...

Thanks in advance.

Di Maio, Dario

unread,
Aug 14, 2017, 6:12:22 PM8/14/17
to sou...@googlegroups.com
That's great!

Hope you wish to move this code under the main souliss repository and join the team.

Regards,
Dario.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+unsubscribe@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/04a5adb5-71d5-4bf2-8350-e5d62dda099a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fulvio Spelta

unread,
Aug 15, 2017, 5:13:51 AM8/15/17
to souliss
Very good work !!!

Michi

unread,
Aug 17, 2017, 9:46:26 AM8/17/17
to souliss
Thank you! Of course I'll be glad to join the team. So... if this is a new repository... How I should proceed? Should I create a new "pysouliss" repo and upload directly the current version? (and then fork in my personal account and merge changes, as the wiki says for the current repositories?)
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.

Di Maio, Dario

unread,
Aug 20, 2017, 3:12:02 AM8/20/17
to sou...@googlegroups.com
Hi Michi,

just had a quick chat with developer from Freedomotic and they will have a try with PySouliss to control Souliss over MQTT :)

They will start in a couple of weeks once the Souliss Demo is back online, I will ask them to open a topic to discuss about in case of problems.

Dario.

Jammoyano

unread,
Aug 20, 2017, 4:30:22 PM8/20/17
to souliss
Congrats Michi .... You've done a very good work and you know I love it ;-)

Its a very good new to know here will be possible "control" souliss with MQTT in order to make it more and more powerfull.

Bye!!

Michi

unread,
Aug 21, 2017, 4:59:29 AM8/21/17
to souliss
Great! Please, keep in mind that the project is in a very inmature state... These days, I have little time to work on it but in september I will be fully available to improve it.

Juan Pinto

unread,
Aug 21, 2017, 5:52:28 PM8/21/17
to souliss
Good Work Michi :P

Thanks.
Juan

Domenico Carvetta

unread,
Aug 22, 2017, 6:41:40 AM8/22/17
to souliss
Excellent from my side.
Keep us posted! 

Dario Cdj

unread,
Aug 22, 2017, 1:26:05 PM8/22/17
to souliss
Wonderful and very appreciated work, welcome on board :)

Lorenzo Giordano

unread,
Sep 5, 2017, 7:20:39 AM9/5/17
to souliss
Good news and excellent work. 
This can be a different way to connect souliss with Openhab using maybe the MQTT binding instead with an autodiscovery function.
Let's keep us informed on your progress .. As soon as I have time I will test you work

Regards
Lorenzo

Di Maio, Dario

unread,
Oct 27, 2017, 2:12:38 PM10/27/17
to sou...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+unsubscribe@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

Livio Merola

unread,
Mar 4, 2020, 5:45:12 AM3/4/20
to souliss
Hi Michi,

is the project still alive?

I installed it on HA and recieve the following error when I give the command 

python3 main.py -g <ip souliss gateway> -v (I changed the ip with the one of my gateway)

the error is the one showed in the attached image;

furthermore the tipycal T22 is not implemented yet..

Did you make a further step in the implementation?

how did you integrate souliss in your HA?

thanks in advance for your support.

Regards

Livio

2020-03-04 11_35_43-Home Assistant.png

Reply all
Reply to author
Forward
0 new messages