Souliss + Node-Red

231 views
Skip to first unread message

g.bonanno

unread,
Oct 26, 2017, 1:59:01 PM10/26/17
to souliss
I'm trying the Michi python library with Node-Red and it works perfectly with Souliss. Send and receive commands and updates from T11 and the aesthetic appearance as well as the programmability are exciting. Currently I use Python 3.5.2 on a Orange Pi PC2 (H5 cpu) and Python 3.5.3 on Raspberry Pi2. Next step is a test on Orange pi Zero (H2 cpu) and move to Python 3.6.2 as suggested. I have no experience on Node-Red, but it seems easy to use.

Di Maio, Dario

unread,
Oct 27, 2017, 1:35:10 PM10/27/17
to sou...@googlegroups.com
Would you share some screenshots?

Thanks,
Dario.

On Thu, Oct 26, 2017 at 7:59 PM, g.bonanno <bona...@gmail.com> wrote:
I'm trying the Michi python library with Node-Red and it works perfectly with Souliss. Send and receive commands and updates from T11 and the aesthetic appearance as well as the programmability are exciting. Currently I use Python 3.5.2 on a Orange Pi PC2 (H5 cpu) and Python 3.5.3 on Raspberry Pi2. Next step is a test on Orange pi Zero (H2 cpu) and move to Python 3.6.2 as suggested. I have no experience on Node-Red, but it seems easy to use.

--
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/10aed93a-c9d0-4245-a84f-5998b38a3501%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

g.bonanno

unread,
Oct 27, 2017, 1:56:28 PM10/27/17
to souliss
1.jpg
2.jpg
3.jpg
4.jpg

Di Maio, Dario

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

I know nothing about NodeRed and Python but this looks very nice!

Have you a quick starting guide?

Dario.

On 27 Oct 2017 19:56, "g.bonanno" <bona...@gmail.com> wrote:

--
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.

g.bonanno

unread,
Oct 27, 2017, 3:59:29 PM10/27/17
to souliss
Hi Dario
You can start with this, but Goole is a good guide.You can start using the RASPBIAN STRETCH WITH DESKTOP distribution that has Node-Red already installed.
Then install the dashboard (npm i node-red-dashboardoard), install mosquitto and mosquitto-clients.
Activate the python library of Michi as he indicated and run:
python3 /home/pi/pysouliss/examples/example_mqtt.py -g <soulissgateway ip address> -m 127.0.0.1
Now you see:
pi@orangepipc2:~$ python3 /home/pi/pysouliss/examples/example_mqtt.py -g 192.168.1.199 -m 127.0.0.1
INFO: Trying to connect to gateway
INFO: 13 nodes found
INFO: Connected to mqtt broker at 127.0.0.1
INFO: Node 0. Added typical 0x14: T14: Pulse Digital Output
INFO: Node 0. Added typical 0x14: T14: Pulse Digital Output
INFO: Node 1. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 2. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 3. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 3. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 3. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 5. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 6. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 8. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 8. Added typical 0x11: T11: ON/OFF Digital Output with Timer Option
INFO: Node 10. Added typical 0x1a: T1A: Digital Input Pass Through
INFO: Node 11. Added typical 0x1a: T1A: Digital Input Pass Through
INFO: Node 0: Typical 0 - T14: Pulse Digital Output updated to off
INFO: Node 0: Typical 1 - T14: Pulse Digital Output updated to off
INFO: Node 5: Typical 0 - T11: ON/OFF Digital Output with Timer Option updated to off

And width mosquitto_sub -v -t '#' you can see the mqtt messages when activate a Souliss node (T11 for example On and then OFF)
pysouliss/8/0 on
pysouliss/8/0/cmd
pysouliss/8/0 off
pysouliss/8/0/cmd

Now there is the connection between Souliss and MQTT using the Python Library.
Node-Red Configuration is accessible at http://ip_raspberry:1880
Node-Red Dashboard is accessible at http://ip_raspberry:1880/ui



----Node-Red configuration
On up right select 'Import/Clipboard' and past this configuration

[{"id":"84525d6f.8d602","type":"mqtt in","z":"e76184db.5c2948","name":"in nodo souliss 8","topic":"pysouliss/8/0","qos":"2","broker":"171cf9c2.d98756","x":160,"y":260,"wires":[["5c52bdd.1a5f544"]]},{"id":"5c52bdd.1a5f544","type":"ui_switch","z":"e76184db.5c2948","name":"","label":"switch","group":"dde0c113.6a5f4","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":330,"y":260,"wires":[["b8684b5f.64f728"]]},{"id":"b8684b5f.64f728","type":"function","z":"e76184db.5c2948","name":"comandi","func":"if (msg.payload === \"on\") \nmsg.payload = new Buffer(\"\\x02\");\nif (msg.payload === \"off\") \nmsg.payload = new Buffer(\"\\x04\");\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":260,"wires":[["6fdb1382.7a683c"]]},{"id":"6fdb1382.7a683c","type":"mqtt out","z":"e76184db.5c2948","name":"","topic":"pysouliss/8/0/cmd","qos":"2","retain":"","broker":"171cf9c2.d98756","x":670,"y":260,"wires":[]},{"id":"171cf9c2.d98756","type":"mqtt-broker","z":"","broker":"192.168.1.62","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"dde0c113.6a5f4","type":"ui_group","z":"","name":"test","tab":"b5806ef4.dfdc4","order":1,"disp":true,"width":"6"},{"id":"b5806ef4.dfdc4","type":"ui_tab","z":"","name":"soggiorno","icon":"dashboard","order":1}]

than Click import and deploy. Now you see the object for a test
With double-click in each block you see the configuration that change for you site
In the firs and last object you can change the address and the topic for MQTT
The first object is the receiver of MQTT from pysouliss
The second is the switch for ON/OFF of T11 souliss. The payload is tranfered to the third block (function)
that convert the on/off payload in \x02 and \x04 fot pysouliss ( and souliss )
The last block send the comand to MQTT and then to pysouliss ( and souliss )

Open http:// ip_raspberry:1880/ui and see the switch that you can move on and off.

Now you can add more block and function from the left menu, configure and deploy.
Can export the configuration and save in a text file as my example, and other.

I'm trying Node-Red for a week, I do not know it, but Google helps.
At moment no other info.

Giuseppe




Reply all
Reply to author
Forward
0 new messages