[BTicino/OpenWebNet] New openHAB2 binding ready for testing

bticino
openhab2
openwebnet
Tags: #<Tag:0x00007fd314cbd2b8> #<Tag:0x00007fd314cbd038> #<Tag:0x00007fd314cbcea8>

(Massimo) #1

Hello community,

I’m happy to announce the first version of the new BTicino (Legrand) / OpenWebNet binding for openHAB 2.
This is the first known openHAB 2 binding for BTicino/Legrand gateways and devices to support both BUS/SCS and BTicino ZigBee (using USB dongle).

  • WHO=1 Lighting (switches/dimmers)
  • WHO=2 Automation (shutters)

are supported so far; other functionalities/devices will be added soon - hopefully with your help.
The final goal is to integrate all the functionalities available in the 1.x version of the BTicino binding.

Please test it in your environment and give me your feedback :slight_smile: !

cheers,
Massimo

Features:

  • first openHAB 2 binding to support BUS/SCS gw and devices
  • auto-discovery of BUS/SCS and ZigBee devices
  • BTicino BUS/SCS + ZigBee support in one single binding
  • support for lights and dimmers
  • support for automation (roller shutters), both on BUS and ZigBee, with position feedback and goto Percent. Auto-calibration
  • auto-discovery of BTicino ZigBee USB dongle. Auto-discovery of BUS gateway in progress, help/testers needed!
  • support for gateways with text passwords (HMAC authentication), like MyHOMEServer1

Installation:

Since it’s still in development stage and not part of the official distribution, to install the binding copy the following JAR file to your openHAB2 addons folder (on Linux or RaspberryPi the folder is under: /usr/share/openhab2/addons/):

Also, from openHAB 2.3.0 on wards some features dependencies must be activated manually from Karaf console:

  1. go to Karaf console
  2. Type:
    feature:install openhab-transport-serial
  3. and if you are using openHAB 2.4.0-SNAPSHOT also type:
    feature:install esh-io-transport-upnp

The binding should now be installed: check in PaperUI > Configuration > Bindings.

How to upgrade from previous release version

The previous version of the binding must be uninstalled using Karaf console (is not enough update the binding jar file).

  1. go to Karaf console
  2. bundle:list to list all bundles and note the bundle id for OpenWebNet Binding
  3. bundle:uninstall to remove previous version of the binding
  4. copy the new JAR version to /addons/ folder
  5. the new version of the binding should now be installed (check from PaperUI > Configuration > Bindings, reload a couple of times if necessary)

Documentation:

For configuration and more details see the binding README

Screenshots:

BUS/SCS + ZigBee discovery

Control BUS/SCS + ZigBee devices (shutters, switch and dimmer)

Source code:


BTICINO: Enhanced Binding for Testing (Heating Control, Automation, Door Entry, Dimmers)
Updates to bticino binding to support gateway's passwords
(Fabian) #2

Hello Massimo,

thanks for your great work. As a total noob I have been waiting for a easy-to-use-binding for months.

I just had a quick test of it this morning. It was easy to install and get to work. All switches have been detected quick. Every switch I tested worked. When using another app or the physical switch the binding does not detect the change direct - a switched on light is shown as off. In my noob-opinion that would be necessary to get some automation done (for example: the light in the hall is often forgotten to switch off and needs a timer. If the binding doesn´t know the status it´s not possible to tell it to switch off — btw. do you know a easy way to realise a timer?)

I´m looking forward for the next version and the integration of the automation.

regards.

Faro


(Massimo) #3

Hi @Faro, thanks for testing and for your feedback!

Your feedback is very important since the BUS/SCS integration was only partially tested so far.
To understand better why feedback from network does not work for you, would you be able to:

  1. set log level to DEBUG:
    • from Karaf console (more info here):
      • log:set DEBUG org.openhab.binding.openwebnet
      • log:set DEBUG org.openwebnet
  2. stop openhab
  3. start openhab
  4. switch ON a light from PaperUI (or HABPanel / Basic / Classic UI)
  5. switch the same light OFF from the physical switch

and send me the log?

thanks!
Massimo


(Arnaud) #4

Hi Massimo,
I’ve test your binding with the scs bus and the zigbee dongle 3578.
Items bus Scs:
F454 => Webserver
F411/2 => Lighting or Automation Actuator
Items Zigbee:
3578 => Dongle USB Bticino
088306 => Lighting Actuator
067263 => Automation Actuator (Celiane)

The lighting actuators bus and lighting actuators zigbee works in openhab.
But the status of the actuators (SCS) bus is not updated when using a button on the SCS bus => NOK
The status of the actuators zigbee is updated for using a remote control (zigbee) for example => OK

Detection:
Scs: The actuators have been detected with the adress A-PL (2 or 4 digits) ex: A=1 PL=2 or A=10 PL=12
Zigbee ; All actuators (Lighting or Automation) have been detected.
The Actuators Automation is unknow in system (Normal Currently)
Ex:
OpenWebNet GENERIC Device (WHERE=759452900#9)
OpenWebNet Generic Device

An OpenWebNet Generic Device.

Status: UNINITIALIZED - HANDLER_MISSING_ERROR

It’s a good job for a start

Thanks


(Massimo) #5

Thanks Arnaud!
Your feedback is particularly useful because you have a mixture of SCS and ZigBee, so I am particularly interested (this new binding was designed just for that!).

If I understand correctly your only error is that SCS monitoring (feedback) is not working , same as happened to @Faro above.

Would you be able to remove all things (not just from inbox, also from PaperUI Things menu) , set the log level to debug as explained above and start again with a new discovery of both SCS and Zigbee devices?
And then follow the instructions I sent to Faro (first activate the SCS device from OH and three from the physical device).

And send me the log, as private message if you prefer?
I will analyze the log and try to understand why monitoring is not working .
I have some suspect but I need your log to confirm.

Thanks
Massimo


(Enrico) #6

Thank you Massimo for this effort, I was really hoping for a binding like that!!!

I tried to use it with Myhomeserver1 but I receive this error:

It is probably related to the Myhomeserver1 requiring an alphanumeric password

Please let me know if you need more info, I would really like to help with the testing
Thanks,
Enrico


(Massimo) #7

Hello Enrico,
thanks for your feedback. Support for string passwords (Test1234) is not there yet, but if you provide me the logs at DEBUG level, it will help to understand the solution.
Here are the instructions:

  1. remove the current BUS/SCS Gateway thing
  2. set log level to DEBUG:
    • from Karaf console (more info here):
      • log:set DEBUG org.openhab.binding.openwebnet
      • log:set DEBUG org.openwebnet
  3. stop openhab
  4. start openhab
  5. start a new discovery from Inbox
  6. add manually a new BUS/SCS gateway

and then send me the log here, or even better as private message.

Bye,
Massi


(Arnaud) #8

Hello Enrico,

The MyHomeServer1 is not a gateway openwebnet.
It is only used with Legrand cloud and applications “MyHome_Up”

Regards


(Massimo) #9

@enrico.mcc can you do a very quick test?
Download from BTicino this client:
https://www.myopen-legrandgroup.com/developers/ then tab TOOLS then download and run OpenWebNet Client - Windows (exec file is OpenWebNet_Client.exe).
There you can put the IP address of your MyHomeServer1 and text password, select HMAC and the click on the green OpenEvent button.
If the near button Event Connected becomes red, then your client is connected to MyHomeServer1 and you can try to activate any of your physical devices and you should be able to receive events on the log window below the buttons.
Can you the test it and tell us what happens (may post an image)?
If you succeed in connecting and receiving events on the client, the MyHomeServer1 can be used as OpenWebNet gateway !
Thanks,
MASSI


(Enrico) #10

It works! :champagne:

But I have no idea on how can I make the binding work using HMAC authentication :roll_eyes:


(Massimo) #11

Excellent! :v: than you have a OpenWebNet gateway in your setup!
I am already working on implementing HMAC (text passwords) authentication in my new OH2 BTicino binding, exactly to support also these gateways.
Another 2 quick test to try:

  1. try switching on/off a light from the command.
    • In the “Frame” input box of the client put for example *1*0*WHERE## to switch OFF (1->to switch ON), where WHERE is the address of you light actuator (for example A=1, PL=1 becomes WHERE=11).
      Can you do this command test as well? Just to be sure that MyHomeServer1 does support both feedback and commands from OpenWebNet protocol.
  2. another test is to discover devices: just send the status query:
    • *#1*0## and you should receive a status response for every light actuator in your setup environment, with all WHERE addresses just before the final ## of each Open Message.
    • *#2*0## and you should receive a status response for every shutter actuator in your setup environment

Also if you can post snapshot images of the client in the 2 tests would be useful to understand (especially the response for the shutter status response).

Bye!
Massi


(Massimo) #12

Hi Arnaud, do you have an official page/doc where it is said that MyHomeServer1 does not support OpenWebNet? This would be strange as from the test by @enrico.mcc the server does actually respond to a login handshake (HMAC, text password) and sends events to a client.
Cheers,
Massi


(Enrico) #13

Here are the results, everything is working: :smiley:
Switch command

Light status:

Shutter status:


(Ran Broudo) #14

Hello Massimo,

This looks great.

I installed your binding but the discovery doesn’t detect my Zigbee 3578 dongle.

it seems the dongle is identified by the system and connected on /dev/ttyUSB0

Any idea what could be the problem?


(Massimo) #15

Hi @rbroudo.
One possibility is that the USB port is not accessible by openHAB. To check this, in the binding README I wrote:

  • as for the Serial binding, if you run OH2 on Linux to access the USB/serial port you might require that you add the openhab user to the dialout group to grant permission to read/write to the serial port:
sudo usermod -a -G dialout openhab

the user will need to logout from all login instances and log back in to see their new group added. If you add your user to this group and still cannot get permission, reboot Linux to ensure the new group permission is attached to the openhab user.

Please try this first.

If this also does not work, please set log level to DEBUG (find instructions previously in this thread), start a new dongle discovery and send me the logs here via private message.

Bye!
Massi


(Ran Broudo) #16

Hi @massi,

Thank you so much for your advice it really pointed me in the right direction.
It was indeed an access problem.
The ttyUSB0 device was created with permission to the user: root and group: root and not the group: dialout.

Once I changed the permissions (I still have to find out how to make this change permanent) the 3578 dongle was discovered and so were the light switches.

Are you going to add support the shutter switches (Up,Down,Stop) anytime soon?

Thanks again for your help and great work.

Ran


(Massimo) #17

Hi,

Happy that it worked also for you!
The serial port permissions depend on your installation. In my case I use Linux and installation from packages (apt install) and openHAB is executed by the openhab user. After setting this user to be member of the dialout group (see command above), the setting became permanent.

Yes, already working on that.
Stay tuned for a new version!

Massi


(Daniele Cappelletti) #18

Working like a charm with google home!! Thank you! How can i remain up to date to the new features?
Theres the possibility in the future to support even the termostat?

Thanks for you wonderful work!


(Massimo) #19

Thanks @jkendan !
Please can you give back some info about your setting? so that we know what works and what not.

  • are you using BUS or radio ZigBee devices, or both?
  • in case of BUS, which BTicino Gateway have you tested? (F453? F454? , …). With password or with IP range?
  • does monitoring/feedback work for you? That is: when you switch on/off a light from the physical device, does the status of the device change in openHAB/PaperUI ?

This info is helpful to get some stats about what is working and what not!

The final goal is to have LIGHTING, AUTOMATION and THERMO all supported, as in the BTicino v1 binding.

It would be very useful to get some logs from your installation to test all cases. If you are available to help, please send me a PM and I will tell you which tests/logs are useful.

Bye Thanks,
Massi


(Daniele Cappelletti) #20

I use a Bticino gateway F454, i’ll send more informetion via PM after doing this test. Can you send me the instruction via PM to give you the right logs? I’m new on the forum it seems i can’t send pms right now.

Thanks