[BTicino/OpenWebNet] New openHAB2 binding ready for testing

Thank you. And how i can update It? Now i have installed a old version, but It give me comunication error with MH202

Hi, Just trying out a new idea.

I am trying to get Openhab to detect when a CEN from MH202 is fired. I don’t see it in the log. I assume that because its fired from MH202 it never gets sent on the BUS. Is this statement correct?

So, I configured virtual switches in the CEN actions using BUS addresses with no physical switch. I see these in the Log eg virtual switch 9.13

Switch VirtualSwitchAtClosed "Virtual switch: At closed" {channel="openwebnet:bus_on_off_switch:Screen10:913:switch"}

//Virtual switches
Thing bus_on_off_switch 913 "At closed" @ "Status" [ where="913" ]

Log when sending ON via BUS

2019-07-29 21:28:21.865 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*1*0913##

But my rule doesn’t trigger

rule 'Virtual switch: At closed'
when
    Item VirtualSwitchAtClosed received update
then
    logInfo("Blinds" , 'Blinds closed')
end

Anyone got any ideas why it doesn’t work or have I made a silly error that I don’t see
?

Thx M

I have to do tests

Let me see the log a little bit before and a little later

Now set log level to debug … and I now see no device associated… hmmmm. What can I do about that?

2019-07-29 22:04:31.689 [DEBUG] [et.handler.OpenWebNetLightingHandler] - $bri current level=4 ----> new level=5

2019-07-29 22:04:31.692 [DEBUG] [et.handler.OpenWebNetLightingHandler] - $bri change sent >=1500ms ago, updating state...

2019-07-29 22:04:31.698 [DEBUG] [et.handler.OpenWebNetLightingHandler] - $$$ END  ---updateLightBr latestBriWhat=5 latestBriBeforeOff=0 brightnessLevelRequested=false

==> /var/log/openhab2/events.log <==

2019-07-29 22:04:31.708 [vent.ItemStateChangedEvent] - WestBathroomSpots_Brightness changed from 40 to 50

==> /var/log/openhab2/openhab.log <==

2019-07-29 22:04:52.314 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *1*1*0913##

2019-07-29 22:04:52.317 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.0913

2019-07-29 22:04:52.319 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=1.0913 has NO DEVICE associated, ignoring it

==> /var/log/openhab2/events.log <==

2019-07-29 22:05:03.053 [vent.ItemStateChangedEvent] - BME280Sensor_Pressure changed from 1011.5265820389664 to 1011.5105633573975

2019-07-29 22:05:04.036 [vent.ItemStateChangedEvent] - BME280Sensor_Temperature changed from 26.6 to 27.0

2019-07-29 22:05:04.090 [ome.event.ItemCommandEvent] - Item 'BME280Sensor_PressureChange' received command -0.0160186815689

2019-07-29 22:05:04.099 [ome.event.ItemCommandEvent] - Item 'BME280Sensor_PreviousPressure' received command 1011.5105633573975

Its working now. I changed the item and thing address to 0913 instead of 913

2019-07-29 22:12:14.039 [DEBUG] [et.handler.OpenWebNetLightingHandler] - ==OWN:LightingHandler== updateLightState() for thing: openwebnet:bus_on_off_switch:Screen10:0913

==> /var/log/openhab2/events.log <==

2019-07-29 22:12:14.048 [hingStatusInfoChangedEvent] - 'openwebnet:bus_on_off_switch:Screen10:0913' changed from OFFLINE (COMMUNICATION_ERROR): Could not get channel state to ONLINE

2019-07-29 22:12:14.067 [vent.ItemStateChangedEvent] - VirtualSwitchAtClosed changed from NULL to ON

==> /var/log/openhab2/openhab.log <==

2019-07-29 22:12:15.847 [INFO ] [clipse.smarthome.model.script.Blinds] - Blinds closed

2019-07-29 22:12:34.674 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - ##gw-openwebnet-conn## sending MON keepalive ACK

2019-07-29 22:12:34.679 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - MON SENDING    ======>>>>>> *#*1##

Great

I created a test.
I created a scenario on MH202:

  • Activated with lighting of a light
  • Output with CEN command (Pressure start)

Log OH

2019-07-31 18:04:57.436 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*01*1001##
2019-07-31 18:04:57.438 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=15.1001
2019-07-31 18:04:57.439 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  BridgeHandler.discoverByActivation() 
2019-07-31 18:04:57.440 [INFO ] [ery.OpenWebNetDeviceDiscoveryService] - ==OWN:DeviceDiscovery== newDiscoveryResult() WHERE=1001, deviceType=SCENARIO_CONTROL
2019-07-31 18:05:01.346 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - ##gw-openwebnet-conn## sending MON keepalive ACK
2019-07-31 18:05:01.348 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - MON SENDING    ======>>>>>> *#*1##

In OH you receive the CEN command, everything works correctly.

2019-07-31 18:04:57.436 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *15*01*1001##

Do you connect to the MH202 web server?
I think the problem is on your Screen10 touchscreen

Hi,

Thanks for testing, It could be the Screen10. I previously used the MH202 as gateway but after some issues during early testing of the binding Massimo recommended I switched to using the S10 instead.

At the moment, as a work around, I toggle virtual switches to track blind modes in use. Its a bit messy keeping 7 switches in the right state but it works.

I will try again with S10 as gateway just in case I had something wrong.

Mark

I use MH202 as a gateway is no problem

I cant remember exactly what the issue was but I think it was some kind of performance issue. I have quite a lot of activity on the BUS and a complex, varied setup

Hello @massi,

I have same inverted UP/DOWN problem with my roller shutters. I’m sure everything is ok with my wires because it is working fine in Jeedom. My USB gateway is Bticino 3578.
Conversion always happens, would it be possible to make it optional ?
I don’t understand why you write that documentation is pretty clear, it states that UP=1 and this binding does an automatic conversion to send 2 instead of 1 for UP command.
Am I missing something ?

Here is openhab.log when I press DOWN button in PaperUI :

2019-08-01 12:46:27.915 [DEBUG] [ebnet.handler.OpenWebNetThingHandler] - ==OWN:ThingHandler== handleCommand() (command=DOWN - channel=openwebnet:zb_automation:7260281:7682457:shutter)
2019-08-01 12:46:27.917 [DEBUG] [penwebnet.message.OpenMessageFactory] - ###################################################################
2019-08-01 12:46:27.919 [DEBUG] [penwebnet.message.OpenMessageFactory] - ###################################################################
2019-08-01 12:46:27.920 [DEBUG] [penwebnet.message.OpenMessageFactory] - ##openwebnet## converting Automation DOWN <*2*2*768245701#9##> > UP
2019-08-01 12:46:27.922 [INFO ] [org.openwebnet.OpenGatewayZigBee    ] - SERIAL SENDING   >>>>>>>>>>>>>>>>>>>>>>>> *2*1*768245701#9##
2019-08-01 12:46:28.944 [INFO ] [org.openwebnet.OpenGatewayZigBee$a  ] - SERIAL RECEIVED  <<<<<<<<<<<<<<<<<<<<<<<< *#*1##
2019-08-01 12:46:28.945 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## onNewFrame *#*1##
2019-08-01 12:46:28.945 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## popped from session stack: {REQ=<*#2*768245701#9##>|RESP=[<*#*1##>]}
2019-08-01 12:46:28.946 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## stack size is now: 8
2019-08-01 12:46:32.695 [INFO ] [org.openwebnet.OpenGatewayZigBee$a  ] - SERIAL RECEIVED  <<<<<<<<<<<<<<<<<<<<<<<< *2*1*768245701#9##
2019-08-01 12:46:32.696 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## onNewFrame *2*1*768245701#9##
2019-08-01 12:46:32.697 [DEBUG] [penwebnet.message.OpenMessageFactory] - ###################################################################
2019-08-01 12:46:32.698 [DEBUG] [penwebnet.message.OpenMessageFactory] - ###################################################################
2019-08-01 12:46:32.699 [DEBUG] [penwebnet.message.OpenMessageFactory] - ##openwebnet## converting Automation UP <*2*1*768245701#9##> > DOWN
2019-08-01 12:46:32.701 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  ownId=2.7682457
2019-08-01 12:46:32.702 [DEBUG] [.handler.OpenWebNetAutomationHandler] - ==OWN:AutomationHandler== updateAutomationState() - msg=<*2*2*768245701#9##> what=DOWN
2019-08-01 12:46:32.703 [DEBUG] [.handler.OpenWebNetAutomationHandler] - ==OWN:AutomationHandler== # 768245701 # MOVING 2 - startedMovingAt=1564656392703 - 32.703
2019-08-01 12:46:32.704 [DEBUG] [.handler.OpenWebNetAutomationHandler] - ==OWN:AutomationHandler== # 768245701 # [[[ internalState=2 positionEst=-1 - calibrating=-1 shutterRun=-1 ]]]

Regards,
Cyril.

Hi Cyril
I do not remember well but the inversion for Automation on the USB gateway was introduced because some versions of the USB stick have inverted 1<->2 (probably a bug in the firmware).

Can you see in the logs which firmware version is your gateway?

I should probably add for zb_automation things an optional parameter to activate the inversion , and not just based on firmware version.

Hi Mark
The problem with your MH202 was at startup not being able to handle all the initial requests and resetting after too many requests, so kind of performance related.

I have no easy access to the official OpenWebNet docs but if I remember well it was clearly stated that S10 has limited support for CEN/CEN+ messages.

Bye

Hi Massimo,

Thanks that’s a useful reminder. I am getting old and my memory isn’t as good as it should be. Actually it never was :slight_smile:

I will do some testing to confirm that the Openhab startup is still an issue for the MH202 and play around with the CEN pressure and S10 to see if I can get it S10 gateway working with CEN.

My work around for now is to use an unused BUS address and send a command to it within a CEN’s action list. That way Openhab sees when a MH202 CEN was started by the MH202 itself and Openhab can then act on it.

It’s working quite well and I now see on my phone and in the log which CEN’s have been activated. My blinds run in various modes depending on house temperature, sun, wind, rain, sunset etc etc…so its useful for debugging and checking all is operating as planned. Its also great to now see when multiple modes are running at the same time using the Openhab stringBuilder() feature.

Ciao M

Hello @massi
I have a problem whit your binding, I have a Bticino myhomeserver1 and I add the JAR file in add-on folder and I edit the file add-on.cfg and I have the error in log file

2019-08-15 18:32:15.189 [ERROR] [org.openhab.binding.openwebnet      ] - FrameworkEvent ERROR - org.openhab.binding.openwebnet
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.openwebnet [204]
  Unresolved requirement: Import-Package: gnu.io
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1613) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) ~[?:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
2019-08-15 18:32:15.945 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Rome'.
2019-08-15 18:32:15.959 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '44.14881162634643,12.45671504947997'.
2019-08-15 18:32:15.962 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'it_IT'.
2019-08-15 18:32:16.160 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2019-08-15 18:32:16.263 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2019-08-15 18:32:21.432 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.33:8080
2019-08-15 18:32:21.435 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.33:8443
2019-08-15 18:32:21.477 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2019-08-15 18:32:23.597 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'lv_casa.sitemap'
2019-08-15 18:32:23.769 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2019-08-15 18:32:32.644 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.openwebnet-2.5.0-M2.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.openwebnet [204]
  Unresolved requirement: Import-Package: gnu.io
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

Can you help me?
Thanks
Luca

Hello @massi
now I have this error:

2019-08-15 21:20:36.108 [ERROR] [org.openwebnet.AbstractOpenGateway  ] - ERROR IN Java $MODULE$: connection cannot be established

==> /var/log/openhab2/events.log <==
2019-08-15 21:20:36.117 [hingStatusInfoChangedEvent] - ‘openwebnet:bus_gateway:MYHOMESERVER1_0003508c193b’ changed from OFFLINE (COMMUNICATION_ERROR) to UNKNOWN
2019-08-15 21:20:36.120 [vent.ConfigStatusInfoEvent] - ConfigStatusInfo [configStatusMessages=[]]
==> /var/log/openhab2/openhab.log <==
2019-08-15 21:20:56.114 [INFO ] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN== BridgeHandler status still UNKNOWN. Setting device=openwebnet:bus_gateway:MYHOMESERVER1_0003508c193b to OFFLINE
==> /var/log/openhab2/events.log <==
2019-08-15 21:20:56.121 [hingStatusInfoChangedEvent] - ‘openwebnet:bus_gateway:MYHOMESERVER1_0003508c193b’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR)

You have to use the latest binding version and read the README…

Hi @massi,

I managed to get firmware version in openhab log file (I ran a node.js script using serialport module).

2019-08-26 15:51:14.339 [INFO ] [org.openwebnet.OpenGatewayZigBee$a  ] - SERIAL RECEIVED  <<<<<<<<<<<<<<<<<<<<<<<< *#13**16*1*2*3##*#*1##
2019-08-26 15:51:14.339 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## onNewFrame *#13**16*1*2*3##*#*1##
2019-08-26 15:51:14.340 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## stack size is now: 7
2019-08-26 15:51:14.341 [INFO ] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## GATEWAY FIRMWARE: 1.2.3 - isOldFirmware=true
2019-08-26 15:51:14.341 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## popped from session stack: {REQ=<*2*2*768243801#9##>|RESP=[<*#13**16*1*2*3##>, <*#*1##>]}
2019-08-26 15:51:14.343 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  GatewayManagement WHAT = null, ignoring
2019-08-26 15:51:14.343 [DEBUG] [org.openwebnet.OpenGatewayZigBee    ] - ##gw-openwebnet-ZB## stack size is now: 6

Firmware version is 1.2.3
Should I upgrade ? And how ?

Thanks for your help.

I have raspberries 3b+. The usb stick legrand 088328 is inserted. OpenHAB2 has been working normally for several hours. Controls all lights. Then loses connection.
After the tests, I found Linux in the logs (this happens if you do not even install the module for OWN for openHAB2).

Aug 29 10:03:44 openhab kernel: [184321.458737] usb 1-1.2: USB disconnect, device number 64
Aug 29 10:03:44 openhab kernel: [184321.752383] usb 1-1.2: new full-speed USB device number 65 using dwc_otg
Aug 29 10:03:45 openhab kernel: [184321.888678] usb 1-1.2: New USB device found, idVendor=1cb0, idProduct=0020, bcdDevice= 0.00
Aug 29 10:03:45 openhab kernel: [184321.888693] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 29 10:03:45 openhab kernel: [184321.888704] usb 1-1.2: Product: OpenWebNet ZigBee Gateway
Aug 29 10:03:45 openhab kernel: [184321.888713] usb 1-1.2: Manufacturer: Legrand
Aug 29 10:03:45 openhab kernel: [184321.888722] usb 1-1.2: SerialNumber: 2E7975000074040
Aug 29 10:03:45 openhab kernel: [184321.889841] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
Aug 29 10:49:17 openhab kernel: [187054.258723] usb 1-1.2: USB disconnect, device number 65
Aug 29 10:49:17 openhab kernel: [187054.605738] usb 1-1.2: new full-speed USB device number 66 using dwc_otg
Aug 29 10:49:17 openhab kernel: [187054.742065] usb 1-1.2: New USB device found, idVendor=1cb0, idProduct=0020, bcdDevice= 0.00
Aug 29 10:49:17 openhab kernel: [187054.742079] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 29 10:49:17 openhab kernel: [187054.742090] usb 1-1.2: Product: OpenWebNet ZigBee Gateway
Aug 29 10:49:17 openhab kernel: [187054.742099] usb 1-1.2: Manufacturer: Legrand
Aug 29 10:49:17 openhab kernel: [187054.742108] usb 1-1.2: SerialNumber: 2E7975000074040
Aug 29 10:49:17 openhab kernel: [187054.743238] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
Although if I connect a minicon, then everything works.

I tried to run the same box in another place where the stick does not see the lights and everything works without falling in the logs. The stick version is read normally.

Does anyone know how to fix this?