Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable7-7.1.005 ( November release) #1654

Merged
merged 49 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
055ca4c
move to certified device (https://github.com/zigbeefordomoticz/z4d-ce…
pipiche38 Oct 15, 2023
798b9cd
fix Heiman specific command handling
pipiche38 Oct 15, 2023
d4eae16
fix coding error
pipiche38 Oct 15, 2023
3d23a92
Fix group cpr412 (#1653)
pipiche38 Oct 15, 2023
94792a4
sort import
pipiche38 Oct 17, 2023
2ec6cef
Aotec zigbee button (#1658)
pipiche38 Oct 18, 2023
d9385fd
handle correctly Alarm1 and Alarm2 on IAS Cluster 0500
pipiche38 Oct 19, 2023
031d187
improve check_duplicate_sqn
pipiche38 Oct 25, 2023
7ef8761
add more log to error message
pipiche38 Oct 25, 2023
d6f9f86
prevent using the new tuyaTS0601 path, when the model do not provide …
pipiche38 Oct 25, 2023
35e1c96
address a codefactor multiple spaces before operator issue
pipiche38 Oct 25, 2023
2365062
Upgrade of zigpy radio libs to a more recent version (#1655)
pipiche38 Oct 26, 2023
ba1b776
Lighting color control / Fixing Lidl TS0505A behaviour (#1657)
pipiche38 Oct 29, 2023
39410db
upgrade to use zigpy packet_receive instead of handle_message (#1662)
pipiche38 Oct 29, 2023
33d3085
update
pipiche38 Oct 29, 2023
ce7ae5a
helpers to access nValue/sValue and SwitchType/SubType/Type
pipiche38 Oct 29, 2023
e50460f
Sonoff SNZB-02 gets connected as SONOFF Temp/Humi and is a Motion (#1…
pipiche38 Oct 31, 2023
7b4efd8
Move level for WW color was not correctly handled
pipiche38 Nov 1, 2023
4d8198b
use a try/except to protect the binascii.unhexlify()
pipiche38 Nov 1, 2023
54cd0ee
Add ep for tuyats0601 (#1663)
pipiche38 Nov 2, 2023
ae298dd
fix debug message
pipiche38 Nov 2, 2023
0ec30eb
better debug on packet_received
pipiche38 Nov 2, 2023
22043f8
Merge remote-tracking branch 'refs/remotes/origin/wip-stable7-1-005' …
pipiche38 Nov 2, 2023
2032411
Adding PowerFactor handling
pipiche38 Nov 3, 2023
3831fd9
due to zigpy-znp issue on pairing, revert back to solid znp version (…
pipiche38 Nov 4, 2023
9e45b4b
Fixing issue with PowerFactor wich overlap with Power
pipiche38 Nov 5, 2023
c325386
Adding Adeo/Nodon Fil Pilote switch mode
pipiche38 Nov 5, 2023
94665c6
make Fil Pilot using 0xfc00
pipiche38 Nov 8, 2023
9f74267
Update TS0601-Human-Presence.json
pipiche38 Nov 8, 2023
9bae0dc
Update TS0601-Human-Presence.json
pipiche38 Nov 8, 2023
8015a68
updates to get PC311 working
pipiche38 Nov 8, 2023
c4142ff
Move some Logs to Debug level
pipiche38 Nov 8, 2023
b94a0fe
Merge remote-tracking branch 'refs/remotes/origin/wip-stable7-1-005' …
pipiche38 Nov 8, 2023
51ac2e5
change the way to handle motion value for Tuya Human Presence Detection
pipiche38 Nov 8, 2023
94ba179
Move to Certified devices ( https://github.com/zigbeefordomoticz/z4d-…
pipiche38 Nov 8, 2023
34510f4
Update Nodon FP command
pipiche38 Nov 8, 2023
9381523
cosmetic
pipiche38 Nov 8, 2023
d7f5510
check that the device entry exist in Domoticz Devices, before reading it
pipiche38 Nov 11, 2023
95cc5bc
Manage Tuya Human Sensor and Lux
pipiche38 Nov 11, 2023
9d80a3b
Zigpy packet receive (#1665)
pipiche38 Nov 12, 2023
3bda66e
fixing when TWO_COMPLEMENT_TST do not exist
pipiche38 Nov 12, 2023
7dc5a51
fixing when TWO_COMPLEMENT_TST do not exist
pipiche38 Nov 12, 2023
f006331
update Release notes
pipiche38 Nov 12, 2023
0a87a02
Update plugin.py
pipiche38 Nov 13, 2023
f0da953
Update PluginConf.py
pipiche38 Nov 13, 2023
3d90081
Update plugin.py
pipiche38 Nov 13, 2023
dca78c7
instrument with GC
pipiche38 Nov 13, 2023
038af64
implement Tuya Data_Request wich must be sent by GW for some devices
pipiche38 Nov 14, 2023
991cd5e
disable gc code
pipiche38 Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 41 additions & 21 deletions Classes/GroupMgtv2/GrpDomoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from Classes.GroupMgtv2.GrpCommands import (set_hue_saturation,
set_kelvin_color, set_rgb_color)
from Classes.GroupMgtv2.GrpDatabase import update_due_to_nwk_id_change
from Modules.tools import Hex_Format
from Modules.tools import Hex_Format, is_hex
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,
Expand All @@ -19,6 +19,7 @@
zcl_group_onoff_on,
zcl_group_window_covering_off,
zcl_group_window_covering_on,
zcl_group_move_to_level_stop,
zcl_group_window_covering_stop)

WIDGET_STYLE = {
Expand Down Expand Up @@ -185,6 +186,7 @@ def best_group_widget(self, GroupId):
# }

GroupWidgetType = None
GroupWidgetStyle = None

self.logging("Debug", "best_group_widget Device - %s" % str(self.ListOfGroups[GroupId]["Devices"]))
for NwkId, devEp, iterIEEE in self.ListOfGroups[GroupId]["Devices"]:
Expand All @@ -194,7 +196,7 @@ def best_group_widget(self, GroupId):
if NwkId == "0000":
continue

self.logging("debug", "bestGroupWidget - Group: %s processing %s" % (GroupId, NwkId))
self.logging("Debug", "bestGroupWidget - Group: %s processing %s" % (GroupId, NwkId))
if NwkId not in self.ListOfDevices:
# We have some inconsistency !
continue
Expand All @@ -207,9 +209,13 @@ def best_group_widget(self, GroupId):
WidgetType = self.ListOfDevices[NwkId]["Ep"][devEp]["ClusterType"][DomoDeviceUnit]
self.logging("Debug", "------------ GroupWidget: %s WidgetType: %s" % (GroupWidgetType, WidgetType))

if WidgetType == "LvlControl" and "Blind" in self.ListOfDevices[NwkId]["Type"]:
GroupWidgetStyle = "BlindPercentInverted"

if WidgetType in ("VenetianInverted", "VanneInverted", "CurtainInverted"):
# Those widgets are commanded via cluster Level Control
GroupWidgetType = "LvlControl"
GroupWidgetStyle = "VenetianInverted"
continue

if GroupWidgetType is None and WidgetType in WIDGET_STYLE:
Expand Down Expand Up @@ -245,7 +251,6 @@ def best_group_widget(self, GroupId):
GroupWidgetType = WidgetType
continue


if WidgetType in ("Venetian", "WindowCovering", "BlindPercentInverted"):
GroupWidgetType = WidgetType

Expand Down Expand Up @@ -281,13 +286,13 @@ def best_group_widget(self, GroupId):
else:
self.ListOfGroups[GroupId]["Cluster"] = ""

self.logging(
"Debug",
"best_group_widget for GroupId: %s Found WidgetType: %s Widget: %s"
% (GroupId, GroupWidgetType, WIDGET_STYLE.get(GroupWidgetType, WIDGET_STYLE["ColorControlFull"])),
)
self.logging( "Debug", "best_group_widget for GroupId: %s Found WidgetType: %s Widget: %s" % (
GroupId, GroupWidgetType, WIDGET_STYLE.get(GroupWidgetType, WIDGET_STYLE["ColorControlFull"])), )

return WIDGET_STYLE.get(GroupWidgetType, WIDGET_STYLE["ColorControlFull"])
if GroupWidgetStyle is None:
GroupWidgetStyle = GroupWidgetType

return WIDGET_STYLE.get(GroupWidgetStyle, WIDGET_STYLE["ColorControlFull"])


def update_domoticz_group_device(self, GroupId):
Expand Down Expand Up @@ -317,7 +322,7 @@ def update_domoticz_group_device(self, GroupId):
if "Cluster" in self.ListOfGroups[GroupId]:
Cluster = self.ListOfGroups[GroupId]["Cluster"]

countOn = countOff = 0
countStop = countOn = countOff = 0
nValue = 0 if self.pluginconf.pluginConf["OnIfOneOn"] else 1
sValue = level = None
for NwkId, Ep, IEEE in self.ListOfGroups[GroupId]["Devices"]:
Expand Down Expand Up @@ -347,11 +352,13 @@ def update_domoticz_group_device(self, GroupId):
and Cluster in ("0006", "0008", "0300")
and "0006" in self.ListOfDevices[NwkId]["Ep"][Ep]
and "0000" in self.ListOfDevices[NwkId]["Ep"][Ep]["0006"]
and str(self.ListOfDevices[NwkId]["Ep"][Ep]["0006"]["0000"]).isdigit()
and is_hex( str(self.ListOfDevices[NwkId]["Ep"][Ep]["0006"]["0000"]) )
):
self.logging( "Debug", "update_domoticz_group_device - Cluster ON/OFF Group: %s NwkId: %s Ep: %s Value: %s" %(
GroupId, NwkId, Ep, self.ListOfDevices[NwkId]["Ep"][Ep]["0006"]["0000"]))
if int(self.ListOfDevices[NwkId]["Ep"][Ep]["0006"]["0000"]) != 0:
if str(self.ListOfDevices[NwkId]["Ep"][Ep]["0006"]["0000"]) == "f0":
countStop += 1
elif int(self.ListOfDevices[NwkId]["Ep"][Ep]["0006"]["0000"]) != 0:
countOn += 1
else:
countOff += 1
Expand Down Expand Up @@ -381,23 +388,31 @@ def update_domoticz_group_device(self, GroupId):
level = lvl_value if level is None else (level + lvl_value) // 2
nValue, sValue = ValuesForVenetian(level)

self.logging( "Debug", "update_domoticz_group_device - Processing: Group: %s %s/%s On: %s, Off: %s level: %s" % (
GroupId, NwkId, Ep, countOn, countOff, level), )
self.logging( "Debug", "update_domoticz_group_device - Processing: Group: %s %s/%s On: %s, Off: %s Stop: %s, level: %s" % (
GroupId, NwkId, Ep, countOn, countOff, countStop, level), )

if self.pluginconf.pluginConf["OnIfOneOn"]:
if countStop > 0:
nValue = 17
elif self.pluginconf.pluginConf["OnIfOneOn"]:
if countOn > 0:
nValue = 1
elif countOff > 0:
nValue = 0
self.logging( "Debug", "update_domoticz_group_device - Processing: Group: %s == > nValue: %s, level: %s" % (
GroupId, nValue, level), )


# At that stage
# nValue == 0 if Off
# nValue == 1 if Open/On
# nValue == 17 if Stop
# level is None, so we use nValue/sValue
# level is not None; so we have a LvlControl
if sValue is None and level:
if nValue == 17:
# Stop
sValue = "0"

elif sValue is None and level:
if self.Devices[unit].SwitchType not in (13, 14, 15, 16):
# Not a Shutter/Blind
analogValue = level
Expand Down Expand Up @@ -439,11 +454,8 @@ def update_domoticz_group_device(self, GroupId):
else:
sValue = "On"

self.logging(
"Debug",
"update_domoticz_group_device - Processing: Group: %s == > from %s:%s to %s:%s"
% (GroupId, self.Devices[unit].nValue, self.Devices[unit].sValue, nValue, sValue),
)
self.logging( "Debug", "update_domoticz_group_device - Processing: Group: %s == > from %s:%s to %s:%s" % (
GroupId, self.Devices[unit].nValue, self.Devices[unit].sValue, nValue, sValue), )
if nValue != self.Devices[unit].nValue or sValue != self.Devices[unit].sValue:
self.logging("Log", "UpdateGroup - (%15s) %s:%s" % (self.Devices[unit].Name, nValue, sValue))
self.Devices[unit].Update(nValue, sValue)
Expand Down Expand Up @@ -680,6 +692,14 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
sValue = "On"
self.Devices[unit].Update(nValue=int(nValue), sValue=str(sValue))

elif Command in ( "Stop",) and self.ListOfGroups[GrpId]["Cluster"] == "0102":
# Windowscovering Stop
zcl_group_window_covering_stop(self, GrpId, "01", EPout)

elif Command in ( "Stop",) and self.ListOfGroups[GrpId]["Cluster"] == "0008":
# SetLevel Off
zcl_group_move_to_level_stop(self, GrpId, EPout)

elif Command == "Set Level":
# Level: % value of move
# Converted to value , raw value from 0 to 255
Expand Down
1 change: 1 addition & 0 deletions Classes/PluginConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
"ThreadWriter": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"ThreadCommunication": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"ZLinky": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": False,"Advanced": True,},
"Garbage": {"type": "bool","default": 0,"current": None,"restart": 0,"hidden": True,"Advanced": True,},
},
},
# Others
Expand Down
8 changes: 6 additions & 2 deletions Classes/ZigpyTransport/AppBellows.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python3btt.
# coding: utf-8 -*-
#
# Author: deufo, badz & pipiche38
Expand All @@ -8,6 +8,7 @@

import bellows.config as bellows_conf
import bellows.types as t
import zigpy.types as zigpy_t
import bellows.zigbee.application
import zigpy.config as zigpy_conf
import zigpy.device
Expand Down Expand Up @@ -148,6 +149,9 @@ def handle_leave(self, nwk, ieee):
def get_zigpy_version(self):
return Classes.ZigpyTransport.AppGeneric.get_zigpy_version(self)

def packet_received(self, packet: zigpy_t.ZigbeePacket) -> None:
return Classes.ZigpyTransport.AppGeneric.packet_received(self,packet)

def handle_message(
self,
sender: zigpy.device.Device,
Expand All @@ -160,7 +164,7 @@ def handle_message(
dst_addressing=None,
)->None:
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
# 0x00: Normal mode
Expand Down
3 changes: 3 additions & 0 deletions Classes/ZigpyTransport/AppDeconz.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ def get_device_ieee(self, nwk):
def handle_leave(self, nwk, ieee):
Classes.ZigpyTransport.AppGeneric.handle_leave(self, nwk, ieee)

def packet_received(self, packet: t.ZigbeePacket) -> None:
return Classes.ZigpyTransport.AppGeneric.packet_received(self,packet)

def handle_message(
self,
sender: zigpy.device.Device,
Expand Down
Loading
Loading