mvalla/openhab-addons

In ZigBee automation UP/DOWN commands are inverted

Closed this issue · 2 comments

I'm using Bticino 3578 USB gateway, firmware version is 1.2.3.
When i'm sending UP command, rollershutter goes DOWN, and vice versa. Rollershutter status is also incorrect.

Conversion ssems to happen in openwebnet-lib class OpenMessageFactory. Is it possible to make this inversion optional ?

Here are logged messages when I press DOWN 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 ]]]

Environment:
Synology DSM 6.2
OpenHab 2.4 in docker container

This related to bug #7 : if firmware is <= 1.2.3 automation messages have UP/DOWN inverted to correct a bug apparently affecting older firmware. The inversion was reported with USB stick firmware v1.1.0 for example.
I will change the oldFirmware version to be <= 1.2.0 so that USB stick with version 1.2.3 will not have UP/DOWN messages inverted.

fixed in own-2.5.0.M3