Skip to content

Commit

Permalink
RC 6.3.006 (#1339) (#1346)
Browse files Browse the repository at this point in the history
* fix resetSwitchSelectorPushButton for Button_3
* integrate new zigpy packet-api phase1 (#1324)
* aligning method signatures
* merging upstream with packet-api included
* update requirements level
* update the zigpy radio module version check
* enable source_routing for all coordinators
* merge upstream - fix ZDO deserialization
* improve log message on DeliveryError
* set a specific debug flag for DeliveryError on unicast messages
* zigpy 51.4
* Hot-fix to prevent plugin not starting in case of uninitialized Coordinator and wrong backup file (#1330)
* better error management and return None in the backup file is not in Json format, or un-readable
* WebUI translation update
* Integrating ST30 manufactured by Orvibo Temperature & Humidity Sensor
* Adapt plugin to the changes of ZLinky v11 (#1332)
* handle ZLinky firmware which now send SINSTS and SINSTS1 on different attributes depending on Tri-phased or Mono
* correct /zigpy-raw-command API
* User the new Domoticz command Open , Close for blinds ( Domoticz 2022.2 )
* Implement unbind_response_command #1302 (#1333)
* Addressing #1302 and implementing unbind_response_command
* Addressing #1302 and implementing unbind_response_command
* Merge latest zigpy development (#1331)
* merging the latest update from zigpy on Only enable APS ACKs for packets without implicit delivery notification
* correct the habndling of AckMode from WebUI with the ackIsDisabled parameter
* inverse expect_reply settings due to the zigpy PR zigpy/zigpy#1085
* Source Routing parameter is now avaliable for all Zigpy radio libs
* add logging message at startup
* register needed clusters when registering endpoints
* refactor endpoint registration in a more generic way
* accept up to a load of 8 request to process a callback, otherwise wait for the next one
* refactor how to handle setpoint for VACT Wiser
* set extended_timeout to True in order to get commands reaching End Devices
* set the ZNP CONF_PREFERED_ENDPOINT1 to False if there is at least one specific Ep to be registered
* add Cluster 0xe002
* TS130F-1dd.... seems to be used as a Blinds or as a Vanne
* use Curtain instead of Blind
* when preparing the RAW Command, provide context information on the target device, if it is a RX on Idle or not
* In case we send a request to a device which do not Rx on Idle, then make sure to set the extended_timeout to True
* in case where device do not exist just return rx on idle True
* remove the rule which was setting Wiser Ep requested when enableSchneiderWiser is on
* Move level with On/off when group command. (#1336)
* Pipiche38/group/move level onoff (#1338)
* prevent overwriting the value passed to MajDomoDevice
* upgrade zigpy-deconz version (#1340)
* makes source_routing disabled by default
* Merge upstream bellows 0.43.3 (#1343)
- Allow disabling the bellows UART thread
- Allow configuration options to be disabled
- make ACK dependents on packet.tx_options
* Wiser VACT improvement on Zigpy (#1335)
* give the possibility to delay the setpoint raw command, and waits for a call back to execute it, so we will no send a command which is going to fail because the end device do not listen
* update Setpoint if it is not matching what has been reported in a 12 minutes window
* Handle Open and Close command from Domoticz for Blinds
* fix way of implementing zclGroup commands.
* fix #1344
* enable Decode8502 for OTA Page request
* fixing TypeError: unsupported operand type(s) for //: 'str' and 'str'
* makes Group Level command with or without On/Off customizable based on GroupLevelWithOnOff parameter
* refactor GroupLevelWithOnOff
* fix issue when RxOnIdle is not set
* disable SourceRouting and disable ForceAPSAck
* add some WebUI translation
  • Loading branch information
pipiche38 authored Nov 15, 2022
1 parent 23031f0 commit 89cbc2a
Show file tree
Hide file tree
Showing 43 changed files with 728 additions and 423 deletions.
2 changes: 1 addition & 1 deletion .hidden/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"branch": "stable6", "version": "6.3.005"}
{"branch": "stable6", "version": "6.3.005"}
49 changes: 30 additions & 19 deletions Classes/GroupMgtv2/GrpDomoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
set_kelvin_color, set_rgb_color)
from Classes.GroupMgtv2.GrpDatabase import update_due_to_nwk_id_change
from Modules.tools import Hex_Format
from Zigbee.zclCommands import (zcl_group_level_move_to_level,
zcl_group_onoff_off_noeffect,
zcl_group_onoff_off_witheffect,
zcl_group_onoff_on,
zcl_group_window_covering_off,
zcl_group_window_covering_on,
zcl_group_window_covering_stop)
from Modules.zigateConsts import ADDRESS_MODE, LEGRAND_REMOTES, ZIGATE_EP


from Zigbee.zclCommands import (zcl_group_level_move_to_level,
zcl_group_move_to_level_with_onoff,
zcl_group_onoff_off_noeffect,
zcl_group_onoff_off_witheffect,
zcl_group_onoff_on,
zcl_group_window_covering_off,
zcl_group_window_covering_on,
zcl_group_window_covering_stop)

WIDGET_STYLE = {
"Plug": (244, 73, 0),
Expand Down Expand Up @@ -591,14 +590,14 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
and self.ListOfGroups[GrpId]["Cluster"] == "0102"
): # Venetian store
#zigate_cmd = "00FA"
if Command == "Off":
if Command in ( "Off", "Close", ):
zigate_param = "00"
nValue = 0
sValue = "Off"
update_device_list_attribute(self, GrpId, "0102", 0)
zcl_group_window_covering_on(self, GrpId, ZIGATE_EP, EPout)

if Command == "On":
if Command in ( "On", "Open",):
zigate_param = "01"
nValue = 1
sValue = "Off"
Expand All @@ -620,7 +619,7 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
return

# Old Fashon
if Command == "Off":
if Command in ( "Off", "Close", ):
if self.pluginconf.pluginConf["GrpfadingOff"]:
if self.pluginconf.pluginConf["GrpfadingOff"] == 1:
effect = "0002" # 50% dim down in 0.8 seconds then fade to off in 12 seconds
Expand Down Expand Up @@ -649,7 +648,7 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
update_device_list_attribute(self, GrpId, "0006", "00")
update_domoticz_group_device(self, GrpId)

elif Command == "On":
elif Command in ( "On", "Open", ):
#zigate_cmd = "0092"
#zigate_param = "01"
nValue = "1"
Expand All @@ -671,21 +670,31 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
# Level: % value of move
# Converted to value , raw value from 0 to 255
# sValue is just a string of Level
zigate_cmd = "0081"

if Level > 100:
Level = 100
elif Level < 0:
Level = 0
#OnOff = "01"
OnOff = "01"

# value = int(Level*255//100)
value = "%02X" % int(Level * 255 // 100)
#zigate_cmd = "0081"
#zigate_param = OnOff + value + "0010"
#nValue = 1
#sValue = str(Level)
#self.Devices[unit].Update(nValue=int(nValue), sValue=str(sValue))
update_device_list_attribute(self, GrpId, "0008", value)

zcl_group_level_move_to_level( self, GrpId, ZIGATE_EP, EPout, "01", value, "0010")
transitionMoveLevel = "%04x" % self.pluginconf.pluginConf["GrpmoveToLevel"]
GroupLevelWithOnOff = False
if ( "GroupLevelWithOnOff" in self.pluginconf.pluginConf and self.pluginconf.pluginConf["GroupLevelWithOnOff"] ):
GroupLevelWithOnOff = True

if GroupLevelWithOnOff:
zcl_group_move_to_level_with_onoff(self, GrpId, EPout, OnOff, value, transition=transitionMoveLevel, ackIsDisabled=True)
else:
zcl_group_level_move_to_level( self, GrpId, ZIGATE_EP, EPout, "01", value, transition=transitionMoveLevel)

#datas = "%02d" % ADDRESS_MODE["group"] + GrpId + ZIGATE_EP + EPout + zigate_param
#self.logging("Debug", "Command: %s %s" % (Command, datas))
Expand All @@ -706,7 +715,7 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
# First manage level
if Hue_List["m"] != 9998:
# In case of m ==3, we will do the Setlevel
#OnOff = "01" # 00 = off, 01 = on
OnOff = "01" # 00 = off, 01 = on
value = Hex_Format(2, round(1 + Level * 254 / 100)) # To prevent off state
#zigate_cmd = "0081"
#zigate_param = OnOff + value + transitionMoveLevel
Expand All @@ -716,7 +725,8 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
update_device_list_attribute(self, GrpId, "0008", value)
#self.ControllerLink.sendData(zigate_cmd, datas, ackIsDisabled=True)

zcl_group_level_move_to_level( self, GrpId, ZIGATE_EP, EPout, "01", value, "0000")
#zcl_group_level_move_to_level( self, GrpId, ZIGATE_EP, EPout, "01", value, "0000")
zcl_group_move_to_level_with_onoff(self, GrpId, EPout, OnOff, value, transition="0000")

if Hue_List["m"] == 1:
ww = int(Hue_List["ww"]) # Can be used as level for monochrome white
Expand Down Expand Up @@ -759,7 +769,8 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
# + transitionMoveLevel,
# ackIsDisabled=True,
#)
zcl_group_level_move_to_level( self, GrpId, ZIGATE_EP, EPout, "01", Hex_Format(2, value), transitionMoveLevel)
#zcl_group_level_move_to_level( self, GrpId, ZIGATE_EP, EPout, "01", Hex_Format(2, value), transitionMoveLevel)
zcl_group_move_to_level_with_onoff(self, GrpId, EPout, OnOff, Hex_Format(2, value), transition=transitionMoveLevel)

# Update Device
nValue = 1
Expand Down
4 changes: 2 additions & 2 deletions Classes/OTA.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def ota_image_page_request( self, MsgData ):
intMsgImageVersion = int(MsgData[22:30], 16)
intMsgImageType = int(MsgData[30:34], 16)
intMsgManufCode = int(MsgData[34:38], 16)
MsgMaxDataSize = MsgData[38:40]
PageSize = MsgData[40:44]
MsgMaxDataSize = int(MsgData[38:40],16)
PageSize = int(MsgData[40:44],16)
ResponseSpacing = MsgData[44:48]
FieldControl = MsgData[48:50]
intMsgFieldControl = int(FieldControl,16)
Expand Down
34 changes: 21 additions & 13 deletions Classes/PluginConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import time

import Domoticz
from Modules.tools import getConfigItem, is_domoticz_db_available, is_hex, setConfigItem
from Modules.tools import (getConfigItem, is_domoticz_db_available, is_hex,
setConfigItem)

SETTINGS = {
"Services": {
Expand Down Expand Up @@ -55,18 +56,19 @@
"Zigpy": {
"Order": 4,
"param": {
"Konke": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "deCONZ"},
"Livolo": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "deCONZ"},
"Orvibo": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "deCONZ"},
"Terncy": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "deCONZ"},
"Wiser": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "deCONZ"},
"Wiser2": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "deCONZ"},
"Konke": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, },
"Livolo": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True,},
"Orvibo": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True,},
"Terncy": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True,},
"Wiser": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, },
"Wiser2": {"type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True,},
"autoBackup": { "type": "bool", "default": 1, "current": None, "restart": 0, "hidden": False, "Advanced": False, },
"autoRestore": {"type": "bool", "default": 1, "current": None, "restart": 0, "hidden": False, "Advanced": True,},

"BackupFullDevices": { "type": "bool", "default": 0, "current": None, "restart": 0, "hidden": False, "Advanced": False,"ZigpyRadio": "znp" },
"ForceAPSAck": { "type": "bool", "default": 0, "current": None, "restart": 0, "hidden": False, "Advanced": True, },
"BellowsNoMoreEndDeviceChildren": { "type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "ezsp" },
"BellowsSourceRouting": { "type": "bool", "default": 1, "current": None, "restart": 1, "hidden": False, "Advanced": True, "ZigpyRadio": "ezsp" },
"zigpySourceRouting": { "type": "bool", "default": 0, "current": None, "restart": 1, "hidden": True, "Advanced": True, },
"forceZigpy_noasyncio": { "type": "bool", "default": 0, "current": None, "restart": 0, "hidden": True, "Advanced": True, },
}
},
Expand Down Expand Up @@ -139,14 +141,20 @@
"eraseZigatePDM": { "type": "bool", "default": 0, "current": None, "restart": 0, "hidden": True, "Advanced": True, "ZigpyRadio": "" },
"Certification": { "type": "list", "list": {"CE regulation": "CE", "FCC regulation": "FCC"}, "default": "CE", "current": None, "restart": True, "hidden": False, "Advanced": False, "ZigpyRadio": "" },
"CertificationCode": { "type": "int", "default": 1, "current": None, "restart": 1, "hidden": True, "Advanced": False, "ZigpyRadio": "" },
"channel": { "type": "list",
"list": { "default": 0, "11": 11, "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "17": 17, "18": 18, "19": 19, "20": 20, "21": 21, "22": 22, "23": 23, "24": 24, "25": 25, "26": 26, },
"channel": {
"type": "list",
"list": {
"default": 0,
"11": 11, "12": 12, "13": 13, "14": 14, "15": 15, "16": 16,
"17": 17, "18": 18, "19": 19, "20": 20, "21": 21, "22": 22,
"23": 23, "24": 24, "25": 25, "26": 26,
},
"default": "0",
"current": None,
"restart": 2,
"hidden": False,
"Advanced": False,
},
},
"TXpower_set": { "type": "list", "list": {"0dbM": 0, "-9 dbM": 1, "-20dbM": 2, "-32dbM": 3}, "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, },
"extendedPANID": { "type": "hex", "default": 0, "current": None, "restart": 3, "hidden": False, "Advanced": True, },
"forceClosingAllNodes": { "type": "bool", "default": 0, "current": None, "restart": 1, "hidden": False, "Advanced": True, },
Expand All @@ -161,6 +169,7 @@
"GrpmoveToColourTemp": { "type": "int", "default": 0, "current": None, "restart": 0, "hidden": False, "Advanced": False, },
"GrpmoveToColourRGB": { "type": "int", "default": 0, "current": None, "restart": 0, "hidden": False, "Advanced": False, },
"GrpmoveToLevel": { "type": "int", "default": 0, "current": None, "restart": 0, "hidden": False, "Advanced": False, },
"GroupLevelWithOnOff": { "type": "bool", "default": 1, "current": None, "restart": 0, "hidden": False, "Advanced": False, },
},
},
# Plugin Transport
Expand Down Expand Up @@ -230,6 +239,7 @@
"debugTransportTcpip": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"debugTransportSerial": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"debugTransportZigpy": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"debugTransportError": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"debugTransportZigpyZigate": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"debugTransportZigpyZNP": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"debugTransportZigpydeCONZ": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
Expand Down Expand Up @@ -578,8 +588,6 @@ def zigpy_setup(self):
"hidden": False,
"Advanced": True,
}
if self.pluginConf["enableSchneiderWiser"]:
self.pluginConf["Wiser"] =1

def setup_folder_parameters(self, homedir):
for theme in SETTINGS:
Expand Down
21 changes: 11 additions & 10 deletions Classes/WebServer/WebServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,22 +1182,28 @@ def rest_raw_zigbee(self, verb, data, parameters):
return _response

group_flag = data['GroupAddressFlag']
ack_Is_Disabled = not bool(data['AckMode'])
target_address = data['TargetAddr']
target_ep = data['TargetEp']
clusterid = data['ClusterId']
profileid = data['ProfileId']
payload = data['Payload']
source_ep = data['SourceEp']
sqn = data['Sqn']
ack_mode = data['AckMode']


self.logging(
"Debug",
"zigpy_raw_APS_request - %s ==> Profile: %s Cluster: %s TargetNwk: %0s TargetEp: %s SrcEp: %s payload: %s AckMode: %s"
% ( 'rest_raw_zigbee', data['ProfileId'], data['ClusterId'], data['TargetAddr'], data['TargetEp'], data['SourceEp'], data['Payload'], data['AckMode'] )
)

if group_flag:
addresse_mode = 0x01
elif ack_mode:
elif not ack_Is_Disabled:
addresse_mode = 0x07
else:
addresse_mode = 0x02


data = {
'AddressMode': addresse_mode,
Expand All @@ -1213,13 +1219,8 @@ def rest_raw_zigbee(self, verb, data, parameters):
}

self.logging( "Log","Sending request to coordinator %s" % ( data))
self.log.logging(
"outRawAPS",
"Debug",
"zigpy_raw_APS_request - %s ==> Profile: %04x Cluster: %04x TargetNwk: %04x TargetEp: %02x SrcEp: %02x payload: %s"
% ( 'rest_raw_zigbee', data['Profile'], data['Cluster'], data['TargetNwk'], data['TargetEp'], data['SrcEp'], data['payload'])
)
self.ControllerLink.sendData( "RAW-COMMAND", data, NwkId=int(target_address,16), sqn=int(sqn,16), ackIsDisabled=ack_mode )
self.ControllerLink.sendData( "RAW-COMMAND", data, NwkId=int(target_address,16), sqn=int(sqn,16), ackIsDisabled=ack_Is_Disabled )

return _response

def rest_dev_command(self, verb, data, parameters):
Expand Down
5 changes: 3 additions & 2 deletions Classes/WebServer/rest_Ota.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,15 @@ def get_device_informations(self, Nwkid):
swbuild_3 = self.ListOfDevices[Nwkid]["SWBUILD_3"]
if "SWBUILD_1" in self.ListOfDevices[Nwkid] and self.ListOfDevices[Nwkid]["SWBUILD_1"] != {}:
swbuild_1 = self.ListOfDevices[Nwkid]["SWBUILD_1"]
if "OTA" in self.ListOfDevices[Nwkid]:
if "OTA" in self.ListOfDevices[Nwkid] and self.ListOfDevices[Nwkid]["OTA"] not in ( '', {} ):
prev_ts = 0

for ts in self.ListOfDevices[Nwkid]["OTA"]:
if ts > prev_ts:
if int(ts) > int(prev_ts):
time_update = self.ListOfDevices[Nwkid]["OTA"][ts]["Time"]
LastImageVersion = self.ListOfDevices[Nwkid]["OTA"][ts]["Version"]
LastImageType = self.ListOfDevices[Nwkid]["OTA"][ts]["Type"]
prev_ts = int(ts)

return {
"Nwkid": Nwkid,
Expand Down
5 changes: 3 additions & 2 deletions Classes/ZigpyTransport/AppBellows.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ def handle_message(
src_ep: int,
dst_ep: int,
message: bytes,
dst_addressing: Addressing,
* ,
dst_addressing = None,
) -> None:
return Classes.ZigpyTransport.AppGeneric.handle_message(self,sender,profile,cluster,src_ep,dst_ep,message)
return Classes.ZigpyTransport.AppGeneric.handle_message(self,sender,profile,cluster,src_ep,dst_ep,message, dst_addressing =dst_addressing)

async def set_zigpy_tx_power(self, power):
# EmberConfigTxPowerMode - EZSP_CONFIG_TX_POWER_MODE in EzspConfigId
Expand Down
Loading

0 comments on commit 89cbc2a

Please sign in to comment.