Skip to content

Commit

Permalink
Adding Adeo/Nodon Fil Pilote switch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Nov 5, 2023
1 parent 9e45b4b commit c325386
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 32 deletions.
25 changes: 25 additions & 0 deletions Modules/adeo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


from Modules.sendZigateCommand import raw_APS_request
from Modules.tools import get_and_inc_ZCL_SQN


def adeo_fip(self, NwkId, EpOut, fip_level):

ADEO_FIP_ONOFF_COMMAND = {
"Off": 0,
"Confort": 1,
"Eco": 2,
"Frost Protection": 3,
"Confort -1": 4,
"Confort -2": 5
}
self.log.logging( "Command", "Log", "adeo_fip : Fil Pilote mode: %s - %s" % (
fip_level, ADEO_FIP_ONOFF_COMMAND[fip_level]), NwkId, )

Cluster = "0006"
cluster_frame = 0b00010001
sqn = get_and_inc_ZCL_SQN(self, NwkId)
payload = "%02x" % cluster_frame + sqn + "%02x" % ADEO_FIP_ONOFF_COMMAND[fip_level]

raw_APS_request(self, NwkId, EpOut, Cluster, "0104", payload, zigpyzqn=sqn, zigate_ep="01", groupaddrmode=False, ackIsDisabled=False)
46 changes: 14 additions & 32 deletions Modules/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from Modules.actuators import (actuator_off, actuator_on, actuator_setcolor,
actuator_setlevel, actuator_stop, actuators)
from Modules.adeo import adeo_fip
from Modules.casaia import (casaia_ac201_fan_control, casaia_setpoint,
casaia_swing_OnOff, casaia_system_mode)
from Modules.cmdsDoorLock import cluster0101_lock_door, cluster0101_unlock_door
Expand Down Expand Up @@ -902,43 +903,24 @@ def mgtCommand(self, Devices, Unit, Command, Level, Color):

if ( Level in FIL_PILOT_MODE and "Model" in self.ListOfDevices[NWKID] ):
if self.ListOfDevices[NWKID]["Model"] == "EH-ZB-HACT":
self.log.logging(
"Command",
"Debug",
"mgtCommand : -----> HACT -> Fil Pilote mode: %s - %s" % (Level, FIL_PILOT_MODE[Level]),
NWKID,
)
self.log.logging( "Command", "Debug","mgtCommand : -----> HACT -> Fil Pilote mode: %s - %s" % (
Level, FIL_PILOT_MODE[Level]),NWKID, )
self.ListOfDevices[NWKID]["Schneider Wiser"]["HACT FIP Mode"] = FIL_PILOT_MODE[Level]
schneider_hact_fip_mode(self, NWKID, FIL_PILOT_MODE[Level])
UpdateDevice_v2(
self,
Devices,
Unit,
int(Level) // 10,
Level,
BatteryLevel,
SignalLevel,
ForceUpdate_=forceUpdateDev,
)
UpdateDevice_v2( self, Devices, Unit, int(Level) // 10, Level, BatteryLevel, SignalLevel, ForceUpdate_=forceUpdateDev, )

elif self.ListOfDevices[NWKID]["Model"] == "Cable outlet":
self.log.logging(
"Command",
"Debug",
"mgtCommand : -----> Fil Pilote mode: %s - %s" % (Level, FIL_PILOT_MODE[Level]),
NWKID,
)
self.log.logging( "Command", "Debug", "mgtCommand : -----> Fil Pilote mode: %s - %s" % (
Level, FIL_PILOT_MODE[Level]), NWKID, )
legrand_fc40(self, NWKID, FIL_PILOT_MODE[Level])
UpdateDevice_v2(
self,
Devices,
Unit,
int(Level) // 10,
Level,
BatteryLevel,
SignalLevel,
ForceUpdate_=forceUpdateDev,
)
UpdateDevice_v2( self, Devices, Unit, int(Level) // 10, Level, BatteryLevel, SignalLevel, ForceUpdate_=forceUpdateDev, )

elif self.ListOfDevices[NWKID]["Model"] == "SIN-4-FP-21_EQU":
self.log.logging( "Command", "Log", "mgtCommand : -----> Adeo/Nodon/Enky Fil Pilote mode: %s - %s" % (
Level, FIL_PILOT_MODE[Level]), NWKID, )

adeo_fip(self, NWKID, EPout, FIL_PILOT_MODE[ Level ])
UpdateDevice_v2( self, Devices, Unit, int(Level) // 10, Level, BatteryLevel, SignalLevel, ForceUpdate_=forceUpdateDev, )

# Let's force a refresh of Attribute in the next Heartbeat
request_read_device_status(self, NWKID)
Expand Down

0 comments on commit c325386

Please sign in to comment.