zha-device-handlers: [Device Support Request] Samotech SM323 showing wrong state in HA
Is your feature request related to a problem? Please describe. Samotech SM323 is recognised by ZHA but is not performing some basic functions correctly in Home Assistant.
When toggling the state of the light from Home Assistant, if the state is turned On the device turns On but the state reported in Home Assistant toggles itself back to Off. Home Assistant now considers the state of the device to be Off and so the device can’t be turned Off by the control in Home Assistant.
The same thing happens the other way around, if the state is turned Off the device turns Off but the state reported in Home Assistant toggles itself back to On. Home Assistant now considers the state of the device to be On and so the device can’t be turned On by the control in Home Assistant.
The physical device otherwise performs as normal, and the brightness control in Home Assistant also performs as normal.
Describe the solution you’d like Toggling the light control in Home Assistant results in the correct state persisting in Home Assistant.
Device signature
{
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4107, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0101",
"in_clusters": [
"0x0000",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0008",
"0x0b05",
"0x1000"
],
"out_clusters": [
"0x0019"
]
},
"242": {
"profile_id": 41440,
"device_type": "0x0061",
"in_clusters": [],
"out_clusters": [
"0x0021"
]
}
},
"manufacturer": "Samotech",
"model": "HK_DIM_A",
"class": "zigpy.device.Device"
}
Diagnostic information
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.2.0",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.7",
"docker": true,
"arch": "aarch64",
"timezone": "Europe/London",
"os_name": "Linux",
"os_version": "5.15.61-v8",
"supervisor": "2023.01.1",
"host_os": "Home Assistant OS 9.3",
"docker_version": "20.10.18",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"hacs": {
"version": "1.29.0",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"circadian_lighting": {
"version": "2.1.3",
"requirements": []
},
"watchman": {
"version": "0.5.1",
"requirements": [
"prettytable==3.0.0"
]
},
"scheduler": {
"version": "v0.0.0",
"requirements": []
},
"better_thermostat": {
"version": "1.0.1",
"requirements": []
},
"deebot": {
"version": "1.5.0",
"requirements": [
"deebot-client==1.6.0",
"numpy>=1.21.2"
]
},
"alarmo": {
"version": "v1.9.7",
"requirements": []
},
"smartthinq_sensors": {
"version": "0.26.1",
"requirements": [
"pycountry>=20.7.3",
"xmltodict>=0.12.0",
"cchardet>=2.1.7"
]
},
"kia_uvo": {
"version": "2.6.0",
"requirements": [
"hyundai_kia_connect_api==3.1.0"
]
},
"octopus_energy": {
"version": "5.4.0",
"requirements": []
},
"spotcast": {
"version": "v3.6.30",
"requirements": []
},
"presence_simulation": {
"version": "2.4",
"requirements": []
},
"govee": {
"version": "0.2.2",
"requirements": [
"govee-api-laggat==0.2.2",
"dacite==1.6.0"
]
}
},
"integration_manifest": {
"domain": "zha",
"name": "Zigbee Home Automation",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zha",
"requirements": [
"bellows==0.34.7",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.92",
"zigpy-deconz==0.19.2",
"zigpy==0.53.0",
"zigpy-xbee==0.16.2",
"zigpy-zigate==0.10.3",
"zigpy-znp==0.9.2"
],
"usb": [
{
"vid": "10C4",
"pid": "EA60",
"description": "*2652*",
"known_devices": [
"slae.sh cc2652rb stick"
]
},
{
"vid": "1A86",
"pid": "55D4",
"description": "*sonoff*plus*",
"known_devices": [
"sonoff zigbee dongle plus v2"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*sonoff*plus*",
"known_devices": [
"sonoff zigbee dongle plus"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*tubeszb*",
"known_devices": [
"TubesZB Coordinator"
]
},
{
"vid": "1A86",
"pid": "7523",
"description": "*tubeszb*",
"known_devices": [
"TubesZB Coordinator"
]
},
{
"vid": "1A86",
"pid": "7523",
"description": "*zigstar*",
"known_devices": [
"ZigStar Coordinators"
]
},
{
"vid": "1CF1",
"pid": "0030",
"description": "*conbee*",
"known_devices": [
"Conbee II"
]
},
{
"vid": "10C4",
"pid": "8A2A",
"description": "*zigbee*",
"known_devices": [
"Nortek HUSBZB-1"
]
},
{
"vid": "0403",
"pid": "6015",
"description": "*zigate*",
"known_devices": [
"ZiGate+"
]
},
{
"vid": "10C4",
"pid": "EA60",
"description": "*zigate*",
"known_devices": [
"ZiGate"
]
},
{
"vid": "10C4",
"pid": "8B34",
"description": "*bv 2010/10*",
"known_devices": [
"Bitron Video AV2010/10"
]
}
],
"codeowners": [
"@dmulcahey",
"@adminiuga",
"@puddly"
],
"zeroconf": [
{
"type": "_esphomelib._tcp.local.",
"name": "tube*"
},
{
"type": "_zigate-zigbee-gateway._tcp.local.",
"name": "*zigate*"
},
{
"type": "_zigstar_gw._tcp.local.",
"name": "*zigstar*"
},
{
"type": "_slzb-06._tcp.local.",
"name": "slzb-06*"
}
],
"dependencies": [
"file_upload"
],
"after_dependencies": [
"onboarding",
"usb",
"zeroconf"
],
"iot_class": "local_polling",
"loggers": [
"aiosqlite",
"bellows",
"crccheck",
"pure_pcapy3",
"zhaquirks",
"zigpy",
"zigpy_deconz",
"zigpy_xbee",
"zigpy_zigate",
"zigpy_znp"
],
"is_built_in": true
},
"data": {
"ieee": "**REDACTED**",
"nwk": 24633,
"manufacturer": "Samotech",
"model": "HK_DIM_A",
"name": "Samotech HK_DIM_A",
"quirk_applied": false,
"quirk_class": "zigpy.device.Device",
"manufacturer_code": 4107,
"power_source": "Mains",
"lqi": 144,
"rssi": -64,
"last_seen": "2023-02-27T20:34:42",
"available": true,
"device_type": "Router",
"signature": {
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4107, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0101",
"in_clusters": [
"0x0000",
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0008",
"0x0b05",
"0x1000"
],
"out_clusters": [
"0x0019"
]
},
"242": {
"profile_id": 41440,
"device_type": "0x0061",
"in_clusters": [],
"out_clusters": [
"0x0021"
]
}
}
},
"active_coordinator": false,
"entities": [
{
"entity_id": "button.kids_bedroom_ceiling_lights_dimmer_identify",
"name": "Samotech HK_DIM_A"
},
{
"entity_id": "light.kids_bedroom_ceiling_lights_dimmer_light",
"name": "Samotech HK_DIM_A"
},
{
"entity_id": "number.kids_bedroom_ceiling_lights_dimmer_on_level",
"name": "Samotech HK_DIM_A"
}
],
"neighbors": [
{
"device_type": "Coordinator",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x0000",
"permit_joining": "Unknown",
"depth": "0",
"lqi": "57"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x1698",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "78"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x1AD6",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "149"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x2D9E",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "95"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x30E7",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "175"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Parent",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x3B78",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "149"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x4F70",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "76"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x6197",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "127"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x6502",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "38"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x6AF1",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "122"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x72ED",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "103"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0x7CE7",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "118"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xB246",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "68"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xCAC3",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "117"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xDC12",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "119"
},
{
"device_type": "Router",
"rx_on_when_idle": "On",
"relationship": "Sibling",
"extended_pan_id": "**REDACTED**",
"ieee": "**REDACTED**",
"nwk": "0xDCFC",
"permit_joining": "Unknown",
"depth": "15",
"lqi": "106"
}
],
"routes": [
{
"dest_nwk": "0x0000",
"route_status": "Active",
"memory_constrained": true,
"many_to_one": true,
"route_record_required": false,
"next_hop": "0x1AD6"
},
{
"dest_nwk": "0xC135",
"route_status": "Active",
"memory_constrained": false,
"many_to_one": true,
"route_record_required": true,
"next_hop": "0x6AF1"
},
{
"dest_nwk": "0x52F7",
"route_status": "Active",
"memory_constrained": true,
"many_to_one": true,
"route_record_required": true,
"next_hop": "0xDCFC"
},
{
"dest_nwk": "0xD521",
"route_status": "Active",
"memory_constrained": true,
"many_to_one": true,
"route_record_required": true,
"next_hop": "0xDCFC"
},
{
"dest_nwk": "0x9A1A",
"route_status": "Active",
"memory_constrained": false,
"many_to_one": false,
"route_record_required": false,
"next_hop": "0xCAC3"
},
{
"dest_nwk": "0x30E7",
"route_status": "Active",
"memory_constrained": false,
"many_to_one": false,
"route_record_required": false,
"next_hop": "0x30E7"
},
{
"dest_nwk": "0x1698",
"route_status": "Active",
"memory_constrained": false,
"many_to_one": false,
"route_record_required": false,
"next_hop": "0x1698"
},
{
"dest_nwk": "0x2D9E",
"route_status": "Active",
"memory_constrained": false,
"many_to_one": false,
"route_record_required": false,
"next_hop": "0x2D9E"
},
{
"dest_nwk": "0xA321",
"route_status": "Discovery_Underway",
"memory_constrained": false,
"many_to_one": false,
"route_record_required": false,
"next_hop": "0x0000"
},
{
"dest_nwk": "0x72ED",
"route_status": "Active",
"memory_constrained": false,
"many_to_one": false,
"route_record_required": false,
"next_hop": "0x72ED"
}
],
"endpoint_names": [
{
"name": "DIMMABLE_LIGHT"
},
{
"name": "unknown 97 device_type of 0xa1e0 profile id"
}
],
"user_given_name": "Kids bedroom ceiling lights dimmer",
"device_reg_id": "e5b1ad3498aab981724bf7673a7509b0",
"area_id": "kids_bedroom",
"cluster_details": {
"1": {
"device_type": {
"name": "DIMMABLE_LIGHT",
"id": 257
},
"profile_id": 260,
"in_clusters": {
"0x0000": {
"endpoint_attribute": "basic",
"attributes": {
"0x0000": {
"attribute_name": "zcl_version",
"value": 8
},
"0x0001": {
"attribute_name": "app_version",
"value": 0
},
"0x0002": {
"attribute_name": "stack_version",
"value": 0
},
"0x0003": {
"attribute_name": "hw_version",
"value": 0
},
"0x0004": {
"attribute_name": "manufacturer",
"value": "Samotech"
},
"0x0005": {
"attribute_name": "model",
"value": "HK_DIM_A"
},
"0x0006": {
"attribute_name": "date_code",
"value": "20220531"
},
"0x0007": {
"attribute_name": "power_source",
"value": 178
},
"0x4000": {
"attribute_name": "sw_build_id",
"value": "1.00"
},
"0xfffd": {
"attribute_name": "cluster_revision",
"value": 3
}
},
"unsupported_attributes": {
"0x0009": {
"attribute_name": "generic_device_type"
},
"0x0013": {
"attribute_name": "alarm_mask"
},
"0x0008": {
"attribute_name": "generic_device_class"
},
"0x000a": {
"attribute_name": "product_code"
},
"0x000c": {
"attribute_name": "manufacturer_version_details"
},
"0x000b": {
"attribute_name": "product_url"
},
"0x000e": {
"attribute_name": "product_label"
},
"0x000d": {
"attribute_name": "serial_number"
},
"0x0010": {
"attribute_name": "location_desc"
},
"0x0011": {
"attribute_name": "physical_env"
},
"0x0012": {
"attribute_name": "device_enabled"
},
"0x0014": {
"attribute_name": "disable_local_config"
},
"0xfffe": {
"attribute_name": "attr_reporting_status"
}
}
},
"0x0003": {
"endpoint_attribute": "identify",
"attributes": {
"0x0000": {
"attribute_name": "identify_time",
"value": 0
},
"0xfffd": {
"attribute_name": "cluster_revision",
"value": 2
}
},
"unsupported_attributes": {
"0xfffe": {
"attribute_name": "attr_reporting_status"
}
}
},
"0x0004": {
"endpoint_attribute": "groups",
"attributes": {},
"unsupported_attributes": {}
},
"0x0005": {
"endpoint_attribute": "scenes",
"attributes": {},
"unsupported_attributes": {}
},
"0x0006": {
"endpoint_attribute": "on_off",
"attributes": {
"0x0000": {
"attribute_name": "on_off",
"value": 0
},
"0xfffd": {
"attribute_name": "cluster_revision",
"value": 2
}
},
"unsupported_attributes": {
"0x4000": {
"attribute_name": "global_scene_control"
},
"0x4001": {
"attribute_name": "on_time"
},
"0x4002": {
"attribute_name": "off_wait_time"
},
"0x4003": {
"attribute_name": "start_up_on_off"
},
"0xfffe": {
"attribute_name": "attr_reporting_status"
}
}
},
"0x0008": {
"endpoint_attribute": "level",
"attributes": {
"0x0000": {
"attribute_name": "current_level",
"value": 127
},
"0x0011": {
"attribute_name": "on_level",
"value": 187
}
},
"unsupported_attributes": {
"0x4000": {
"attribute_name": "start_up_current_level"
},
"0x0014": {
"attribute_name": "default_move_rate"
},
"0x0012": {
"attribute_name": "on_transition_time"
},
"0x0010": {
"attribute_name": "on_off_transition_time"
},
"0x0013": {
"attribute_name": "off_transition_time"
}
}
},
"0x0b05": {
"endpoint_attribute": "diagnostic",
"attributes": {},
"unsupported_attributes": {}
},
"0x1000": {
"endpoint_attribute": "lightlink",
"attributes": {},
"unsupported_attributes": {}
}
},
"out_clusters": {
"0x0019": {
"endpoint_attribute": "ota",
"attributes": {},
"unsupported_attributes": {}
}
}
},
"242": {
"device_type": {
"name": "unknown",
"id": 97
},
"profile_id": 41440,
"in_clusters": {},
"out_clusters": {
"0x0021": {
"endpoint_attribute": "green_power",
"attributes": {},
"unsupported_attributes": {}
}
}
}
}
}
}
Additional logs
Paste any additional debug logs here.
Don't remove the extra line breaks outside the ``` marks.
Additional context Add any other context or screenshots about the feature request here.
The device displays in Home Assistant as HK_DIM_A by Samotech. I also have installed in Home Assistant a HK_DIM_A by Candeo that is a physically identical device and that works perfectly.
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 29 (1 by maintainers)
@rahulpdev Just as @TheJulianJES said with the trigger just for ease of use, you need to add the took kit linked above first.
There will still be some flapping of the toggle as couldn’t get it to work with a delay less than the 7 seconds but least it will settle in the correct place once the automation fires.
(@TheJulianJES Deleted my previous comment to add this in the correct format to enable copying )
I’ve just had my reflashed by Samotech and they are spot on now. Very good customer service.
I originally had 2 problems.
Problem 1: dimmers worked fine from HA but if turned on physically from the switch, the ON state did not get recognised by HA unless you then turned the dimmer.
Problem 2: physically the dimmers worked fine but if operating from HA the states would toggle back. For example, light is on and you turn off on HA. Light switches off but state in HA toggles back on.
Both these issues are resolved with firmware 0x00000002
Here is some info showing what SW has what issues
Heads up! I just got my dimmers back from samotech after a firmware upgrade, and now they’re all working like a charm in ZHA. Hands down that’s the best customer service around!
Before firmware upgrade:
After firmware upgrade:
Strangely enough i have a HK-DIM-A Candeo device that is behaving in the exact same way as your Samotech device.
Through messing about i have found the “correct” codes to turn the device on and off and it reflect in HA those being
Clusters OnOff (Endpoint id: 1, Id: 0x0006, Type: in)
Commands of the selected cluster on (id: 0x0001) for on
and
Commands of the selected cluster off (id: 0x0000) for off.
These work perfectly in HA when issued manually however rewriting the code is a little beyond me.
I am therefore wondering if these switching are using different Zcl versions meaning some work and some don’t
Are you able to check the Zcl version of your working and non working versions?