-
Notifications
You must be signed in to change notification settings - Fork 664
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
[Device Support Request] Immax Neo Smart Keypad "_TZE200_n9clpsht" #1852
Comments
There is a custom component for Zigbee2MQTT that is working for this device, could someone help out converting this to a ZHA quirk? const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
fingerprint: [
{
// The model ID from: Device with modelID 'TS0601' is not supported
// You may need to add \u0000 at the end of the name in some cases
modelID: 'TS0601',
// The manufacturer name from: Device with modelID 'TS0601' is not supported.
manufacturerName: '_TZE200_n9clpsht'
},
],
model: '07505L', // Vendor model number, look on the device for a model number
vendor: 'Immax', // Vendor of the device (only used for documentation and startup logging)
description: 'Immax Neo Smart Keypad', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
fromZigbee: [
fz.ignore_basic_report,
{
cluster: "manuSpecificTuya",
type: [
"commandSetDataResponse",
"commandGetData",
"commandActiveStatusReport",
"commandDataResponse"
],
convert: (model, msg, publish, options, meta) => {
const dp = msg.data.dpValues[0].dp;
const armModeImmax = {
26: 'disarm',
27: 'arm_away',
28: 'arm_home',
29: 'sos',
};
return {action: armModeImmax[dp]};
// return {data: msg.data};
},
},
],
exposes: [e.action(['disarm', 'arm_home', 'arm_away', 'sos'])],
toZigbee: [],
};
module.exports = definition; |
I've requested support for this in DeCONZ as well, and have purchased a Tuya Zigbee Gateway to map out all the DP ID's. |
Wow amazing work, I was going to buy a tuya hub just to be able to get those values, that is amazing, thanks for your hard work. |
If I'm missing any values, please tell, and I'll try and get them :) EDIT: I'll try migrating my setup from DeCONZ to ZHA and see if I can get a quirk working |
That would be amazing, as now I have had to add Zigbee2MQTT just to use this keypad, it would be amazing if I could use it with ZHA, I have been trying with Quirks, but I don't know how to process the messages received from the device in ZHA, I can see them in the debug log but can't process them as in Z2M. |
I'm running on ZHA instead of deCONZ now, so I'll at least give it a try when I get the time :) |
Lets see if we can get something to work with ZHA, and get a working quirk so we can start using this keypad 😊 |
I got some time to work on the quirk this weekend, but am far from finished. from typing import Dict
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.security import IasAce
from zigpy.zcl.clusters.general import PowerConfiguration
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
SKIP_CONFIGURATION,
)
from zhaquirks.tuya import TuyaLocalCluster, TUYA_CLUSTER_ID
from zhaquirks.tuya.mcu import (
DPToAttributeMapping,
TuyaDPType,
TuyaMCUCluster,
)
TUYA_DP_ID_BATTERY_LEVEL_PERCENTAGE = 3 # Percentage
TUYA_DP_ID_SOS_ALARM = 23
TUYA_DP_ID_ANTI_REMOVE_ALARM = 24
TUYA_DP_ID_BATTERY_LEVEL_ENUM = 25 # "Low", "Middle", "High"
TUYA_DP_ID_DISARMED = 26
TUYA_DP_ID_ARMED = 27
TUYA_DP_ID_ARMED_HOME = 28
TUYA_DP_ID_SOS = 29
TUYA_DP_ID_ARM_DELAY_TIME = 103 # Seconds
TUYA_DP_ID_KEYPAD_BEEPS = 104 # Boolean
TUYA_DP_ID_QUICK_SOS = 105 # Boolean
TUYA_DP_ID_QUICK_DISARM = 106 # Boolean
TUYA_DP_ID_QUICK_ARM = 107 # Boolean
TUYA_DP_ID_ADMIN_CODE = 108
TUYA_DP_ID_USER_CODE = 109
TUYA_DP_ID_RESET = 110
TUYA_DP_ID_ARM_DELAY_BEEPS = 111 # Boolean
TUYA_DP_ID_UNKNOWN = 112
class TuyaPowerConfigurationCluster3AAA(PowerConfiguration, TuyaLocalCluster):
"""PowerConfiguration cluster for devices with 3 AAA."""
BATTERY_SIZE = 0x0031
BATTERY_QUANTITY = 0x0033
BATTERY_RATED_VOLTAGE = 0x0034
_CONSTANT_ATTRIBUTES = {
BATTERY_SIZE: PowerConfiguration.BatterySize.AAA,
BATTERY_QUANTITY: 3,
BATTERY_RATED_VOLTAGE: 15,
}
class WirelessZigbeeKeypadManufCluster(TuyaMCUCluster):
"""Tuya manufacturer cluster."""
attributes = TuyaMCUCluster.attributes.copy()
attributes.update(
{
TUYA_CLUSTER_ID + TUYA_DP_ID_ARM_DELAY_TIME: ("arm_delay_time", t.uint32_t),
TUYA_CLUSTER_ID + TUYA_DP_ID_KEYPAD_BEEPS: ("keypad_beeps", t.Bool),
TUYA_CLUSTER_ID + TUYA_DP_ID_QUICK_SOS: ("quick_sos", t.Bool),
TUYA_CLUSTER_ID + TUYA_DP_ID_QUICK_DISARM: ("quick_disarm", t.Bool),
TUYA_CLUSTER_ID + TUYA_DP_ID_QUICK_ARM: ("quick_arm", t.Bool),
TUYA_CLUSTER_ID + TUYA_DP_ID_ARM_DELAY_BEEPS: ("arm_delay_beeps", t.Bool),
TUYA_CLUSTER_ID + TUYA_DP_ID_RESET: ("reset", t.Bool),
} # type: ignore
)
dp_to_attribute: Dict[int, DPToAttributeMapping] = {
TUYA_DP_ID_BATTERY_LEVEL_PERCENTAGE: DPToAttributeMapping(
TuyaPowerConfigurationCluster3AAA.ep_attribute,
"battery_percentage_remaining",
TuyaDPType.VALUE,
converter=lambda x: x * 2,
),
TUYA_DP_ID_ARM_DELAY_TIME: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"arm_delay_time",
TuyaDPType.VALUE,
),
TUYA_DP_ID_KEYPAD_BEEPS: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"keypad_beeps",
TuyaDPType.BOOL,
),
TUYA_DP_ID_QUICK_SOS: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"quick_sos",
TuyaDPType.BOOL,
),
TUYA_DP_ID_QUICK_DISARM: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"quick_disarm",
TuyaDPType.BOOL,
),
TUYA_DP_ID_QUICK_ARM: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"quick_arm",
TuyaDPType.BOOL,
),
TUYA_DP_ID_USER_CODE: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"user_code",
TuyaDPType.VALUE,
),
TUYA_DP_ID_ARM_DELAY_BEEPS: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"arm_delay_beeps",
TuyaDPType.BOOL,
),
TUYA_DP_ID_RESET: DPToAttributeMapping(
TuyaMCUCluster.ep_attribute,
"reset",
TuyaDPType.BOOL,
),
}
data_point_handlers = {
TUYA_DP_ID_BATTERY_LEVEL_PERCENTAGE: "_dp_2_attr_update",
TUYA_DP_ID_SOS_ALARM: "_dp_2_attr_update",
TUYA_DP_ID_ANTI_REMOVE_ALARM: "_dp_2_attr_update",
TUYA_DP_ID_BATTERY_LEVEL_ENUM: "_dp_2_attr_update",
TUYA_DP_ID_DISARMED: "_dp_2_attr_update",
TUYA_DP_ID_ARMED: "_dp_2_attr_update",
TUYA_DP_ID_ARMED_HOME: "_dp_2_attr_update",
TUYA_DP_ID_SOS: "_dp_2_attr_update",
TUYA_DP_ID_ARM_DELAY_TIME: "_dp_2_attr_update",
TUYA_DP_ID_KEYPAD_BEEPS: "_dp_2_attr_update",
TUYA_DP_ID_QUICK_SOS: "_dp_2_attr_update",
TUYA_DP_ID_QUICK_DISARM: "_dp_2_attr_update",
TUYA_DP_ID_QUICK_ARM: "_dp_2_attr_update",
TUYA_DP_ID_ADMIN_CODE: "_dp_2_attr_update",
TUYA_DP_ID_USER_CODE: "_dp_2_attr_update",
TUYA_DP_ID_RESET: "_dp_2_attr_update",
TUYA_DP_ID_ARM_DELAY_BEEPS: "_dp_2_attr_update",
TUYA_DP_ID_UNKNOWN: "_dp_2_attr_update",
}
class WirelessZigbeeKeypad(CustomDevice):
"""MS-K1AZ Wireless Zigbee Keypad."""
signature = {
MODELS_INFO: [("_TZE200_n9clpsht", "TS0601")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
WirelessZigbeeKeypadManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [
Ota.cluster_id,
Time.cluster_id,
],
}
},
}
replacement = {
SKIP_CONFIGURATION: True,
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.IAS_ANCILLARY_CONTROL,
INPUT_CLUSTERS: [
WirelessZigbeeKeypadManufCluster,
TuyaPowerConfigurationCluster3AAA,
],
OUTPUT_CLUSTERS: [
Ota.cluster_id,
Time.cluster_id,
],
}
},
} |
Have these conversations in PR’s just mark them draft until you’re ready |
@MrAdam Amazing work 👌🏻 I will give it a try. |
I've moved from zigbee2mqtt to ZHA and I own this keypad. |
I stopped working on this and moved to zigbee2mqtt, as I had to make changes in both home assistant repository, and this repository, but weren't able to get any feedback on which direction to go with the code. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions. |
Immax Neo Keypad Zigbee 3.0 / MaxSmart MS-K1AZ, is discovered fine by ZHA, but unfortunately no entities show up.
It seems a Quirk is needed...
Describe the solution you'd like
Entities for armed/disarmed/armed-home, battery, SOS and others if possible to show up in HA
Device signature
Diagnostic information
Additional context
The text was updated successfully, but these errors were encountered: