Skip to content

Commit

Permalink
Add Schneider Electric Thermostats
Browse files Browse the repository at this point in the history
  • Loading branch information
uvNikita committed Oct 29, 2024
1 parent bc2aa90 commit d255222
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions zhaquirks/schneiderelectric/thermostat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"""Schneider Electric thermostats quirks."""

from typing import Final

from zigpy.quirks import CustomCluster
from zigpy.quirks.v2 import QuirkBuilder
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zigpy.zcl.clusters.smartenergy import Metering

from zhaquirks.schneiderelectric import SE_MANUF_NAME


class SETemperatureSensorType(t.enum8):
"""Temperature sensor connected to thermostat."""

Sensor2kOhm = 0x01
Sensor10kOhm = 0x02
Sensor12kOhm = 0x03
Sensor15kOhm = 0x04
Sensor33kOhm = 0x05
Sensor47kOhm = 0x06
SensorAbsent = 0xFF


class SEMetering(CustomCluster, Metering):
""" Schneider Electric Metering cluster. """

class AttributeDefs(Metering.AttributeDefs):
""" Schneider Electric Metering cluster attributes. """

# This attribute specifies the demand of a switched load when it is energised
fixed_load_demand: Final = foundation.ZCLAttributeDef(
id=0x4510,
type=t.uint24_t,
access="rw",
is_manufacturer_specific=True,
)


class SETemperatureMeasurementExternal(CustomCluster, TemperatureMeasurement):
""" Schneider Electric Temperature Measurement cluster for external (floor) temperature input. """

class AttributeDefs(TemperatureMeasurement.AttributeDefs):
""" Schneider Electric Temperature Measurement cluster attributes. """

temperature_sensor_type: Final = foundation.ZCLAttributeDef(
id=0xE021,
type=SETemperatureSensorType,
access="rw",
is_manufacturer_specific=True,
)


(
QuirkBuilder(SE_MANUF_NAME, "EKO07259")
.also_applies_to(SE_MANUF_NAME, "WDE002497")
.also_applies_to(SE_MANUF_NAME, "WDE011680")
.replaces(SEMetering, endpoint_id=5)
.replaces(SETemperatureMeasurementExternal, endpoint_id=3)
.add_to_registry()
)

0 comments on commit d255222

Please sign in to comment.