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

Wip stable7.1.009 #1708

Merged
merged 20 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
59091af
Update the message and do not mention it is an Error , but more it is…
pipiche38 Feb 2, 2024
ba4d7c5
possibility to configure decoupled relay per line (l1, l2), https://e…
pipiche38 Feb 3, 2024
faabed8
enable some Tuya radar parameters ( 7.1.009) (#1704)
pipiche38 Feb 4, 2024
331eb20
dedicate a module for OnOff settings (#1707)
pipiche38 Feb 4, 2024
25829d3
Adding Tuya Color gradiant delay
pipiche38 Feb 6, 2024
420a158
Maj domo force ep (needed for Lumi decoupled mode) (#1710)
pipiche38 Feb 6, 2024
c509a15
refactoring of paramDevice, and get the settings distributed
pipiche38 Feb 6, 2024
5d81479
update some settings
pipiche38 Feb 6, 2024
7c4fc0f
make sure that the payload size is correct before extracting data. Se…
pipiche38 Feb 10, 2024
7d42225
Use Neighbour tables to complete the Topology report and also retreiv…
pipiche38 Feb 10, 2024
f7eb17c
simplify code
pipiche38 Feb 10, 2024
1e5503c
remove old config files available on Certified Db
pipiche38 Feb 11, 2024
73c9ddb
remove old config files available on Certified Db
pipiche38 Feb 11, 2024
ef0bf62
Parameters to set the IAS sensitivity
pipiche38 Feb 15, 2024
7db66be
Make sure that the onoff_startup is an int and not str
pipiche38 Feb 17, 2024
58277ed
cosmetic, sort the SIMPLE_WIDGET dict
pipiche38 Feb 17, 2024
f2b18f0
Move enki setpower after onoff to onoff_settings
pipiche38 Feb 17, 2024
d0e48ab
resilience on handling the onoff_poweron settings
pipiche38 Feb 17, 2024
16cbdfa
introduce Tuya Magic Read Attribute
pipiche38 Feb 17, 2024
bf83c44
fix some lumi plug issues
pipiche38 Feb 22, 2024
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
224 changes: 111 additions & 113 deletions Classes/PluginConf.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Classes/WebServer/WebServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ def rest_raw_zigbee(self, verb, data, parameters):
'timestamp': time.time()
}

self.logging( "Log","Sending request to coordinator %s" % ( data))
self.logging( "Log","Sending request to coordinator %s for target %s" % ( data, target_address))
self.ControllerLink.sendData( "RAW-COMMAND", data, NwkId=int(target_address,16), sqn=int(sqn,16), ackIsDisabled=ack_Is_Disabled )

return _response
Expand Down
33 changes: 15 additions & 18 deletions Classes/WebServer/rest_Topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def rest_netTopologie(self, verb, data, parameters):

if not os.path.isfile(_filename):
_response["Data"] = json.dumps({}, sort_keys=True)
self.logging("Log", "Filename: %s not found !!" % _filename)
self.logging("Debug", "Filename: %s not found !!" % _filename)
return _response

# Read the file, as we have anyway to do it
Expand Down Expand Up @@ -402,21 +402,11 @@ def collect_routing_table(self, time_stamp=None):
_topo = []
self.logging( "Debug", "collect_routing_table - TimeStamp: %s" %time_stamp)
for father in self.ListOfDevices:
for child in extract_routes(self, father, time_stamp):
if child not in self.ListOfDevices:
continue
_relation = {
"Father": get_node_name( self, father),
"Child": get_node_name( self, child),
"_lnkqty": get_lqi_from_neighbours(self, father, child),
"DeviceType": find_device_type(self, child)
}
self.logging( "Log", "Relationship - %15.15s (%s) - %15.15s (%s) %3s %s" % (
_relation["Father"], father, _relation["Child"], child, _relation["_lnkqty"], _relation["DeviceType"]),)
_topo.append( _relation )

for child in collect_associated_devices( self, father, time_stamp):
self.logging( "Debug", f"check {father} child from routing table")
for child in set( extract_routes(self, father, time_stamp) + collect_associated_devices( self, father, time_stamp) + collect_neighbours_devices( self, father, time_stamp) ):
self.logging( "Debug", f"Found child {child}")
if child not in self.ListOfDevices:
self.logging( "Debug", f"Found child {child} but not found in ListOfDevices")
continue
_relation = {
"Father": get_node_name( self, father),
Expand All @@ -426,16 +416,23 @@ def collect_routing_table(self, time_stamp=None):
}
self.logging( "Debug", "Relationship - %15.15s (%s) - %15.15s (%s) %3s %s" % (
_relation["Father"], father, _relation["Child"], child, _relation["_lnkqty"], _relation["DeviceType"]),)
if _relation not in _topo:
_topo.append( _relation )
_topo.append( _relation )

return _topo


def collect_associated_devices( self, node, time_stamp=None):
last_associated_devices = get_device_table_entry(self, node, "AssociatedDevices", time_stamp)
self.logging( "Debug", "collect_associated_devices %s -> %s" %(node, str(last_associated_devices)))
return list(last_associated_devices)



def collect_neighbours_devices( self, node, time_stamp=None):
last_neighbours_devices = get_device_table_entry(self, node, "Neighbours", time_stamp)
self.logging( "Debug", "collect_neighbours_devices %s -> %s" %(node, str(last_neighbours_devices)))
keys_with_child_relation = [key for item in last_neighbours_devices for key, value in item.items() if value.get('_relationshp') == 'Child']
return list(keys_with_child_relation)


def extract_routes( self, node, time_stamp=None):
node_routes = []
Expand Down
92 changes: 0 additions & 92 deletions Conf/Certified/Danfoss/eT093WRG.json

This file was deleted.

45 changes: 0 additions & 45 deletions Conf/Local-Devices/AQSZB-110.json

This file was deleted.

38 changes: 0 additions & 38 deletions Conf/Local-Devices/TS0601-SmartAirHouseKeeper.json

This file was deleted.

55 changes: 0 additions & 55 deletions Conf/Local-Devices/lumi.curtain.acn002.json

This file was deleted.

23 changes: 15 additions & 8 deletions DevicesModules/custom_sonoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,30 @@
#
# SPDX-License-Identifier: GPL-3.0 license

from Modules.zigateConsts import ZIGATE_EP
from Modules.basicOutputs import write_attribute
from Modules.readAttributes import ReadAttributeRequest_0406_0022
from Modules.zigateConsts import ZIGATE_EP

SONOFF_MAUFACTURER_NAME = "SONOFF"
SONOFF_MANUFACTURER_ID = "1286"
SONOFF_CLUSTER_ID = "fc11"
SONOFF_MANUF_ID = "1286"
SONOFF_ILLUMINATION_ATTRIBUTE = "2001"


def is_sonoff_device(self, nwkid):
return self.ListOfDevices[nwkid]["Manufacturer"] == SONOFF_MANUFACTURER_ID or self.ListOfDevices[nwkid]["Manufacturer Name"] == SONOFF_MAUFACTURER_NAME


def sonoff_child_lock(self, nwkid, lock_mode):
self.log.logging("Sonoff", "Debug", "sonoff_child_lock - Nwkid: %s Mode: %s" % (nwkid, lock_mode))
write_attribute(self, nwkid, ZIGATE_EP, "01", SONOFF_CLUSTER_ID, SONOFF_MANUF_ID, "01", "0000", "10", "%02x" %lock_mode, ackIsDisabled=False)
write_attribute(self, nwkid, ZIGATE_EP, "01", SONOFF_CLUSTER_ID, SONOFF_MANUFACTURER_ID, "01", "0000", "10", "%02x" %lock_mode, ackIsDisabled=False)



def sonoff_open_window_detection(self, nwkid, detection):
self.log.logging("Sonoff", "Debug", "sonoff_child_lock - Nwkid: %s Mode: %s" %(nwkid, detection))
write_attribute(self, nwkid, ZIGATE_EP, "01", SONOFF_CLUSTER_ID, SONOFF_MANUF_ID, "01", "6000", "10", "%02x" %detection, ackIsDisabled=False)

write_attribute(self, nwkid, ZIGATE_EP, "01", SONOFF_CLUSTER_ID, SONOFF_MANUFACTURER_ID, "01", "6000", "10", "%02x" %detection, ackIsDisabled=False)

SONOFF_DEVICE_PARAMETERS = {
"SonOffTRVChildLock": sonoff_child_lock,
"SonOffTRVWindowDectection": sonoff_open_window_detection

"SonOffTRVWindowDectection": sonoff_open_window_detection,
}
32 changes: 0 additions & 32 deletions Modules/basicOutputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,38 +602,6 @@ def identifyEffect(self, nwkid, ep, effect="Blink"):
return zcl_identify_trigger_effect(self, nwkid, ep, "%02x" %effect_command[effect], "%02x" % 0)



def set_PIROccupiedToUnoccupiedDelay(self, key, delay, ListOfEp=None):

cluster_id = "0406"
attribute = "0010"
data_type = "21"
manuf_id = "0000"
manuf_spec = "00"
if ListOfEp is None:
ListOfEp = getListOfEpForCluster(self, key, cluster_id)
for EPout in ListOfEp:
data = "%04x" % delay
self.log.logging(
"BasicOutput", "Log", "set_PIROccupiedToUnoccupiedDelay for %s/%s - delay: %s" % (key, EPout, delay), key
)
if attribute in self.ListOfDevices[key]["Ep"][EPout][cluster_id]:
del self.ListOfDevices[key]["Ep"][EPout][cluster_id][attribute]
return write_attribute(
self,
key,
ZIGATE_EP,
EPout,
cluster_id,
manuf_id,
manuf_spec,
attribute,
data_type,
data,
ackIsDisabled=False,
)


def set_poweron_afteroffon(self, key, OnOffMode=0xFF):
# OSRAM/LEDVANCE
# 0xfc0f --> Command 0x01
Expand Down
15 changes: 15 additions & 0 deletions Modules/develco.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Implementation of Zigbee for Domoticz plugin.
#
# This file is part of Zigbee for Domoticz plugin. https://github.com/zigbeefordomoticz/Domoticz-Zigbee
# (C) 2015-2024
#
# Initial authors: zaraki673 & pipiche38
#
# SPDX-License-Identifier: GPL-3.0 license


def is_develco_device(self, nwkid):
return self.ListOfDevices[nwkid]["Manufacturer"] == "1015" or self.ListOfDevices[nwkid]["Manufacturer Name"] == "frient A/S"
Loading
Loading