zha-device-handlers icon indicating copy to clipboard operation
zha-device-handlers copied to clipboard

[Device Support Request] TS000F Mumubiz Smart Switch with Temperature and Humidity Sensors

Open cleverdevil opened this issue 1 year ago • 8 comments

Problem description

I recently acquired this device: https://www.amazon.com/dp/B0D63CR311

It is a smart on/off switch coupled with a temperature and humidity sensor. It can be added to ZHA, but only functions as an on/off switch, and does not report temperature or humidity. I believe that this device will require a custom quirk.

Solution description

A custom quirk to support this device would be necessary.

Screenshots/Video

No response

Device signature

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.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, 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": "0x0104",
      "device_type": "0x0100",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0xe000",
        "0xe001",
        "0xef00"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZ3218_7fiyo3kv",
  "model": "TS000F",
  "class": "zigpy.device.Device"
}

Diagnostic information

Diagnostic information
{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2024.5.4",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.12.2",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/Los_Angeles",
    "os_name": "Linux",
    "os_version": "4.4.302+",
    "run_as_root": true
  },
  "custom_components": {
    "zha_toolkit": {
      "documentation": "https://github.com/mdeweerd/zha-toolkit",
      "version": "v1.1.10",
      "requirements": [
        "pytz"
      ]
    },
    "pyscript": {
      "documentation": "https://github.com/custom-components/pyscript",
      "version": "1.5.0",
      "requirements": [
        "croniter==1.3.8",
        "watchdog==2.3.1"
      ]
    },
    "meross_lan": {
      "documentation": "https://github.com/krahabb/meross_lan",
      "version": "5.2.2",
      "requirements": []
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "remote_homeassistant": {
      "documentation": "https://github.com/custom-components/remote_homeassistant",
      "version": "3.11",
      "requirements": []
    },
    "localtuya": {
      "documentation": "https://github.com/rospogrigio/localtuya/",
      "version": "5.2.1",
      "requirements": []
    },
    "zidoo": {
      "documentation": "https://www.github.com/wizmo2/zidoo-player",
      "version": "2.0.1",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "after_dependencies": [
      "onboarding",
      "usb"
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga",
      "@puddly",
      "@TheJulianJES"
    ],
    "config_flow": true,
    "dependencies": [
      "file_upload"
    ],
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp",
      "universal_silabs_flasher"
    ],
    "requirements": [
      "bellows==0.38.4",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.115",
      "zigpy-deconz==0.23.1",
      "zigpy==0.64.0",
      "zigpy-xbee==0.20.1",
      "zigpy-zigate==0.12.0",
      "zigpy-znp==0.12.1",
      "universal-silabs-flasher==0.0.18",
      "pyserial-asyncio-fast==0.11"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*slzb-07*",
        "known_devices": [
          "smlight slzb-07"
        ]
      },
      {
        "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": "0403",
        "pid": "6015",
        "description": "*conbee*",
        "known_devices": [
          "Conbee III"
        ]
      },
      {
        "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"
        ]
      }
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      },
      {
        "type": "_zigstar_gw._tcp.local.",
        "name": "*zigstar*"
      },
      {
        "type": "_uzg-01._tcp.local.",
        "name": "uzg-01*"
      },
      {
        "type": "_slzb-06._tcp.local.",
        "name": "slzb-06*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 8047,
    "manufacturer": "_TZ3218_7fiyo3kv",
    "model": "TS000F",
    "name": "_TZ3218_7fiyo3kv TS000F",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "quirk_id": null,
    "manufacturer_code": 4417,
    "power_source": "Mains",
    "lqi": 32,
    "rssi": null,
    "last_seen": "2024-07-12T14:33:17",
    "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.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, 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": "0x0104",
          "device_type": "0x0100",
          "input_clusters": [
            "0x0000",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0xe000",
            "0xe001",
            "0xef00"
          ],
          "output_clusters": [
            "0x000a",
            "0x0019"
          ]
        },
        "242": {
          "profile_id": "0xa1e0",
          "device_type": "0x0061",
          "input_clusters": [],
          "output_clusters": [
            "0x0021"
          ]
        }
      },
      "manufacturer": "_TZ3218_7fiyo3kv",
      "model": "TS000F"
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "button.temp_and_humidity_switch_identify",
        "name": "_TZ3218_7fiyo3kv TS000F"
      },
      {
        "entity_id": "light.temp_and_humidity_switch_light",
        "name": "_TZ3218_7fiyo3kv TS000F"
      },
      {
        "entity_id": "sensor.tz3218_7fiyo3kv_ts000f_rssi",
        "name": "_TZ3218_7fiyo3kv TS000F"
      },
      {
        "entity_id": "sensor.tz3218_7fiyo3kv_ts000f_lqi",
        "name": "_TZ3218_7fiyo3kv TS000F"
      },
      {
        "entity_id": "update.temp_and_humidity_switch_firmware",
        "name": "_TZ3218_7fiyo3kv TS000F"
      }
    ],
    "neighbors": [],
    "routes": [],
    "endpoint_names": [
      {
        "name": "ON_OFF_LIGHT"
      },
      {
        "name": "PROXY_BASIC"
      }
    ],
    "user_given_name": "Temp and Humidity Switch",
    "device_reg_id": "f3a60c55c60f1ec569b032cbee26423f",
    "area_id": null,
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "ON_OFF_LIGHT",
          "id": 256
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0001": {
                "attribute_name": "app_version",
                "value": 80
              },
              "0xfffd": {
                "attribute_name": "cluster_revision",
                "value": 2
              },
              "0x0006": {
                "attribute_name": "date_code",
                "value": ""
              },
              "0x0003": {
                "attribute_name": "hw_version",
                "value": 1
              },
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "_TZ3218_7fiyo3kv"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "TS000F"
              },
              "0x0007": {
                "attribute_name": "power_source",
                "value": 1
              },
              "0xfffe": {
                "attribute_name": "reporting_status",
                "value": 0
              },
              "0x0002": {
                "attribute_name": "stack_version",
                "value": 1
              },
              "0x0000": {
                "attribute_name": "zcl_version",
                "value": 3
              }
            },
            "unsupported_attributes": {
              "0x000d": {
                "attribute_name": "serial_number"
              },
              "0x0011": {
                "attribute_name": "physical_env"
              },
              "0x000e": {
                "attribute_name": "product_label"
              },
              "0x0009": {
                "attribute_name": "generic_device_type"
              },
              "0x0008": {
                "attribute_name": "generic_device_class"
              },
              "0x000a": {
                "attribute_name": "product_code"
              },
              "0x0013": {
                "attribute_name": "alarm_mask"
              },
              "0x000b": {
                "attribute_name": "product_url"
              },
              "0x0012": {
                "attribute_name": "device_enabled"
              }
            }
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {
              "0xfffd": {
                "attribute_name": "cluster_revision",
                "value": 1
              },
              "0x0000": {
                "attribute_name": "identify_time",
                "value": 0
              }
            },
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {
              "0xfffd": {
                "attribute_name": "cluster_revision",
                "value": 2
              },
              "0x0000": {
                "attribute_name": "name_support",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0xfffe": {
                "attribute_name": "reporting_status"
              }
            }
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {
              "0xfffd": {
                "attribute_name": "cluster_revision",
                "value": 2
              },
              "0x0000": {
                "attribute_name": "count",
                "value": 0
              },
              "0x0002": {
                "attribute_name": "current_group",
                "value": 0
              },
              "0x0001": {
                "attribute_name": "current_scene",
                "value": 0
              },
              "0x0004": {
                "attribute_name": "name_support",
                "value": 0
              },
              "0x0003": {
                "attribute_name": "scene_valid",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0xfffe": {
                "attribute_name": "reporting_status"
              }
            }
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {
              "0xfffd": {
                "attribute_name": "cluster_revision",
                "value": 2
              },
              "0x4002": {
                "attribute_name": "off_wait_time",
                "value": 0
              },
              "0x0000": {
                "attribute_name": "on_off",
                "value": 0
              },
              "0x4001": {
                "attribute_name": "on_time",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x4000": {
                "attribute_name": "global_scene_control"
              },
              "0xfffe": {
                "attribute_name": "reporting_status"
              },
              "0x4003": {
                "attribute_name": "start_up_on_off"
              }
            }
          },
          "0xe001": {
            "endpoint_attribute": null,
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0xe000": {
            "endpoint_attribute": null,
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0xef00": {
            "endpoint_attribute": null,
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {
              "0xfffd": {
                "attribute_name": "cluster_revision",
                "value": 1
              }
            },
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {
              "0xfffd": {
                "attribute_name": "cluster_revision",
                "value": 3
              },
              "0x0002": {
                "attribute_name": "current_file_version",
                "value": 80
              },
              "0x0003": {
                "attribute_name": "current_zigbee_stack_version",
                "value": 2
              },
              "0x0004": {
                "attribute_name": "downloaded_file_version",
                "value": 4294967295
              },
              "0x0005": {
                "attribute_name": "downloaded_zigbee_stack_version",
                "value": 65535
              },
              "0x0001": {
                "attribute_name": "file_offset",
                "value": 4294967295
              },
              "0x0008": {
                "attribute_name": "image_type_id",
                "value": 65535
              },
              "0x0006": {
                "attribute_name": "image_upgrade_status",
                "value": 0
              },
              "0x0007": {
                "attribute_name": "manufacturer_id",
                "value": 4417
              },
              "0x0009": {
                "attribute_name": "minimum_block_req_delay",
                "value": 0
              },
              "0x0000": {
                "attribute_name": "upgrade_server_id",
                "value": [
                  255,
                  255,
                  255,
                  255,
                  255,
                  255,
                  255,
                  255
                ]
              }
            },
            "unsupported_attributes": {}
          }
        }
      },
      "242": {
        "device_type": {
          "name": "PROXY_BASIC",
          "id": 97
        },
        "profile_id": 41440,
        "in_clusters": {},
        "out_clusters": {
          "0x0021": {
            "endpoint_attribute": "green_power",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}

Logs

No response

Custom quirk

No response

Additional information

No response

cleverdevil avatar Jul 12 '24 21:07 cleverdevil

Snap ... same issue.... have you found a work around yet? BTW, how do you power your device? I'm only using it as a 'main' (rather than battery) Zigbee temp sensor.... but only the 5v input seems to power it up.... I had hoped that 240v (regardless of whether I used it as a switch) would provide power.

brianacox avatar Jul 16 '24 13:07 brianacox

Nope, no luck yet. I got the switch for free as part of Amazon Vine, so not in a big rush to get it to work. I am sure it will be supported eventually! Currently powering it with this switching power adapter. Simply cut off the connector, strip the wires, and connect them directly to the switch.

cleverdevil avatar Jul 17 '24 22:07 cleverdevil

Mine started smoking with the USB cable in ..... seemed to be fine via the 240v input.... hey ho... waiting on a replacement at the moment....

brianacox avatar Jul 22 '24 14:07 brianacox

Custom quirk was created by user klibro here TS000F_TZ3218_7fiyo3kv.py

Ezzob avatar Oct 08 '24 19:10 Ezzob

Custom quirk was created by user klibro here TS000F_TZ3218_7fiyo3kv.py

Works perfectly... thank you!

brianacox avatar Oct 09 '24 13:10 brianacox

I have tried installing with the custom quirk, but the temp sensor still does not work - the diagnostics state it is unsupported. It is definately measuring it (the 2380 value is 23.8 deg, and increases as temp increases), but it doesn't display anywhere:

"0x0402": { "endpoint_attribute": "temperature", "attributes": { "0xfffd": { "attribute": "ZCLAttributeDef(id=0xFFFD, name='cluster_revision', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)", "value": null }, "0x0002": { "attribute": "ZCLAttributeDef(id=0x0002, name='max_measured_value', type=<class 'zigpy.types.basic.int16s'>, zcl_type=<DataTypeId.int16: 41>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)", "value": null }, "0x0000": { "attribute": "ZCLAttributeDef(id=0x0000, name='measured_value', type=<class 'zigpy.types.basic.int16s'>, zcl_type=<DataTypeId.int16: 41>, access=<ZCLAttributeAccess.Read|Report: 9>, mandatory=True, is_manufacturer_specific=False)", "value": 2180 }, "0x0001": { "attribute": "ZCLAttributeDef(id=0x0001, name='min_measured_value', type=<class 'zigpy.types.basic.int16s'>, zcl_type=<DataTypeId.int16: 41>, access=<ZCLAttributeAccess.Read: 1>, mandatory=True, is_manufacturer_specific=False)", "value": null }, "0xfffe": { "attribute": "ZCLAttributeDef(id=0xFFFE, name='reporting_status', type=<enum 'AttributeReportingStatus'>, zcl_type=<DataTypeId.enum8: 48>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)", "value": null }, "0x0003": { "attribute": "ZCLAttributeDef(id=0x0003, name='tolerance', type=<class 'zigpy.types.basic.uint16_t'>, zcl_type=<DataTypeId.uint16: 33>, access=<ZCLAttributeAccess.Read: 1>, mandatory=False, is_manufacturer_specific=False)", "value": null } }, "unsupported_attributes": [ 0, "measured_value" ] } },

tk200 avatar Oct 11 '24 19:10 tk200

I downloaded the custom quirk, moved it to the correct directory and then simply did a reconfigure; that was sufficient, it seems, to reload the quirk. It worked first time. I wonder if you have a slightly different device?

brianacox avatar Oct 11 '24 19:10 brianacox

I think you may be right, in that it is a slightly different device…

tk200 avatar Oct 11 '24 20:10 tk200

For what it's worth, I have a TYZGTH1CH-B1RF. I had the same issue where the latest quirk still wasn't showing the temp sensor but I could see it in the device settings TuyaTemperatureMeasurement > measured_value

I'm not an expert in quirks so this is probably not elegant and may have other issues ... but works for me For some reason this device was a bit different so the TuyaTemperatureMeasurement ID should be 402 instead of 102. After making this change and restarting HA I now see the temp sensor as an entity (I didn't need to delete/re-add the device to HA, but YMMV)

I made a small tweak to the posted TS000F_TZ3218_7fiyo3kv.py quirk and adjusted the code within class TemperatureHumidityManufCluster to reflect what is shown below:

class TemperatureHumidityManufCluster(TuyaMCUCluster):
    """Tuya Manufacturer Cluster with Temperature and Humidity data points."""

    dp_to_attribute: dict[int, DPToAttributeMapping] = {
        102: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "measured_value",
            converter=lambda x: x * 10,  # decidegree to centidegree
        ),
        402: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "measured_value",
            converter=lambda x: x * 10,  # decidegree to centidegree
        ),
    }

    data_point_handlers = {
        402: "_dp_2_attr_update",
        102: "_dp_2_attr_update",
    }

dvp-coms avatar May 16 '25 15:05 dvp-coms

Thank you, Thank you, Thank you! I've been fooling around for a couple of days with this, and after I saw this I checked the signature and saw mine used 402 as well. I changed it rather than added it, and it popped right up. We must have been banging at the same time since you just posted this yesterday. Fantastic timing.

gormami avatar May 17 '25 16:05 gormami

@dvp-coms You should definitely put up a PR to kilbro's repo, it is already linked all over the place. I've come across a dozen or more threads asking about this thing and there is an "It didn't work for me" in every one. I think there must be 2 models or firmware versions, or something, and your fix would help a lot of people.

gormami avatar May 17 '25 16:05 gormami

Good call, just submitted the PR

dvp-coms avatar May 17 '25 18:05 dvp-coms

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.

github-actions[bot] avatar Nov 14 '25 02:11 github-actions[bot]