Skip to content
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] Tuya rainsensor TS0207_TZ3210_tgvtvdoc #3249

Open
wbmk78 opened this issue Jul 12, 2024 · 73 comments · May be fixed by #3475
Open

[Device Support Request] Tuya rainsensor TS0207_TZ3210_tgvtvdoc #3249

wbmk78 opened this issue Jul 12, 2024 · 73 comments · May be fixed by #3475
Labels
Tuya Request/PR regarding a Tuya device

Comments

@wbmk78
Copy link

wbmk78 commented Jul 12, 2024

Problem description

I have a TS0207 battery powered outdoor rain and light intensity sensor:
https://a.aliexpress.com/_EjJGdz9

The sensors are reported as a motion and open/close sensor. It seems like the movement sensor is triggered when rain is detected, but it seems like it is rarely updated.

Solution description

Correctly mapped sensor output so a action can be created.

Screenshots/Video

Screenshots/Video

TS0207 and Tuya

Device signature

Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, 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=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0402",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0004",
        "0x0005",
        "0x0500",
        "0xef00"
      ],
      "output_clusters": [
        "0x0003",
        "0x0004",
        "0x0006",
        "0x000a",
        "0x0019",
        "0x1000"
      ]
    }
  },
  "manufacturer": "_TZ3210_tgvtvdoc",
  "model": "TS0207",
}

Diagnostic information

Diagnostic information
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.7.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "6.6.31-haos-raspi",
    "supervisor": "2024.06.2",
    "host_os": "Home Assistant OS 12.4",
    "docker_version": "26.1.4",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "nest_protect": {
      "documentation": "https://github.com/imicknl/ha-nest-protect",
      "version": "0.4.0b5",
      "requirements": []
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "hon": {
      "documentation": "https://github.com/gvigroux/hon",
      "version": "0.7.4",
      "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.39.1",
      "pyserial==3.5",
      "zha-quirks==0.0.117",
      "zigpy-deconz==0.23.2",
      "zigpy==0.64.1",
      "zigpy-xbee==0.20.1",
      "zigpy-zigate==0.12.1",
      "zigpy-znp==0.12.2",
      "universal-silabs-flasher==0.0.20",
      "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*"
      },
      {
        "type": "_xzg._tcp.local.",
        "name": "xzg*"
      },
      {
        "type": "_czc._tcp.local.",
        "name": "czc*"
      }
    ],
    "is_built_in": true
  },
  "setup_times": {
    "null": {
      "setup": 7.696299871895462e-05
    },
    "3402b9691794fee151a5736bcf588534": {
      "wait_import_platforms": -0.00024816500081215054,
      "wait_base_component": -0.0006417189979401883,
      "config_entry_setup": 12.806632286999957
    }
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 27934,
    "manufacturer": "_TZ3210_tgvtvdoc",
    "model": "TS0207",
    "name": "_TZ3210_tgvtvdoc TS0207",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "quirk_id": null,
    "manufacturer_code": 4417,
    "power_source": "Battery or Unknown",
    "lqi": 112,
    "rssi": -72,
    "last_seen": "2024-07-12T14:01:01",
    "available": true,
    "device_type": "EndDevice",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, 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=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": "0x0104",
          "device_type": "0x0402",
          "input_clusters": [
            "0x0000",
            "0x0001",
            "0x0004",
            "0x0005",
            "0x0500",
            "0xef00"
          ],
          "output_clusters": [
            "0x0003",
            "0x0004",
            "0x0006",
            "0x000a",
            "0x0019",
            "0x1000"
          ]
        }
      },
      "manufacturer": "_TZ3210_tgvtvdoc",
      "model": "TS0207"
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "binary_sensor.tz3210_tgvtvdoc_ts0207_beweging",
        "name": "_TZ3210_tgvtvdoc TS0207"
      },
      {
        "entity_id": "binary_sensor.tz3210_tgvtvdoc_ts0207_openen",
        "name": "_TZ3210_tgvtvdoc TS0207"
      },
      {
        "entity_id": "sensor.tz3210_tgvtvdoc_ts0207_batterij",
        "name": "_TZ3210_tgvtvdoc TS0207"
      },
      {
        "entity_id": "update.tz3210_tgvtvdoc_ts0207_firmware",
        "name": "_TZ3210_tgvtvdoc TS0207"
      }
    ],
    "neighbors": [],
    "routes": [],
    "endpoint_names": [
      {
        "name": "IAS_ZONE"
      }
    ],
    "user_given_name": "Regensensor",
    "device_reg_id": "e160386800c6e305dae008df8ea9e2e7",
    "area_id": "slaapkamer",
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "IAS_ZONE",
          "id": 1026
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "_TZ3210_tgvtvdoc"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "TS0207"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0001": {
            "endpoint_attribute": "power",
            "attributes": {
              "0x0021": {
                "attribute_name": "battery_percentage_remaining",
                "value": 196
              },
              "0x0020": {
                "attribute_name": "battery_voltage",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x0033": {
                "attribute_name": "battery_quantity"
              },
              "0x0031": {
                "attribute_name": "battery_size"
              }
            }
          },
          "0x0500": {
            "endpoint_attribute": "ias_zone",
            "attributes": {
              "0x0010": {
                "attribute_name": "cie_addr",
                "value": [
                  220,
                  64,
                  34,
                  254,
                  255,
                  39,
                  135,
                  4
                ]
              },
              "0x0000": {
                "attribute_name": "zone_state",
                "value": 1
              },
              "0x0002": {
                "attribute_name": "zone_status",
                "value": 1
              },
              "0x0001": {
                "attribute_name": "zone_type",
                "value": 13
              }
            },
            "unsupported_attributes": {}
          },
          "0xef00": {
            "endpoint_attribute": null,
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {
              "0x0000": {
                "attribute_name": "on_off",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x0000": {
                "attribute_name": "on_off"
              },
              "0x4003": {
                "attribute_name": "start_up_on_off"
              }
            }
          },
          "0x1000": {
            "endpoint_attribute": "lightlink",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {
              "0x0002": {
                "attribute_name": "current_file_version",
                "value": 67
              }
            },
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}

Logs

Logs
[Paste the logs here]

Custom quirk

Custom quirk
[Paste your custom quirk here]

Additional information

No response

@Chrisni2
Copy link

I would be interested in this too

@Andrik45719
Copy link

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    fingerprint: [
        {
            modelID: 'TS0207',
            manufacturerName: '_TZ3210_tgvtvdoc',
        },
    ],
    model: 'TS0207_rain_sensor',
    vendor: 'Tuya',
    description: 'TUYA TS0207 Rain Sensor RB-SRAN01',
    fromZigbee: [tuya.fz.datapoints, fz.battery],
    toZigbee: [],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
    exposes: [
        // Here you should put all functionality that your device exposes
        e.water_leak(), e.battery_low(), e.battery(),
        exposes.numeric('illuminance', ea.STATE).withDescription('Raw measured illuminance').withUnit('mV'),
        exposes.numeric('rainIntensity', ea.STATE).withDescription('Raw measured rain intensity').withUnit('mV')
    ],
    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
            [101, 'illuminance', tuya.valueConverter.raw],
            [105, 'rainIntensity', tuya.valueConverter.raw]
        ],
    },
};

module.exports = definition;

@Chrisni2
Copy link

Please excuse my ignorance but I'm very new to HA, but where does this code go?

@frankfrommelt
Copy link

This is the integration of the sensor for Zigbee2Mqtt.
For ZHA we will need a 'custom quirk'.
Sadly I have no idea how to create one.

@Chrisni2
Copy link

Chrisni2 commented Aug 1, 2024

Oops, told you I was a newbie.

@pbutterworth
Copy link

pbutterworth commented Aug 2, 2024

I tried asking ChatGPT to port the Z2M converter to a ZHA quirk. I added it as a custom quirk, fixed the errors, but it doesn't work (no surprises there).

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, PowerConfiguration
from zigpy.zcl.clusters.measurement import IlluminanceMeasurement

from zhaquirks import CustomCluster
from zhaquirks.tuya import TuyaPowerConfigurationCluster, TuyaManufClusterAttributes

class TuyaRainSensor(CustomDevice):
    """Custom device representing Tuya Rain Sensor."""

    signature = {
        MODELS_INFO: [("_TZ3210_tgvtvdoc", "TS0207")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SIMPLE_SENSOR,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    TuyaManufClusterAttributes.cluster_id,
                    IlluminanceMeasurement.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    Basic.cluster_id,
                ],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SIMPLE_SENSOR,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    TuyaPowerConfigurationCluster,
                    CustomIlluminanceCluster,
                    CustomRainIntensityCluster,
                ],
                OUTPUT_CLUSTERS: [
                    Basic.cluster_id,
                ],
            },
        },
    }

class CustomIlluminanceCluster(CustomCluster, IlluminanceMeasurement):
    """Custom cluster for illuminance measurement."""

    cluster_id = IlluminanceMeasurement.cluster_id

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.attributes.update({
            0x0400: ('illuminance', t.uint16_t),
        })

    def _update_attribute(self, attrid, value):
        if attrid == 0x0400:
            self.endpoint.device.illuminance = value
        super()._update_attribute(attrid, value)

class CustomRainIntensityCluster(CustomCluster):
    """Custom cluster for rain intensity."""

    cluster_id = 0x0401  # Example cluster ID, replace with appropriate one

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.attributes.update({
            0x0401: ('rainIntensity', t.uint16_t),
        })

    def _update_attribute(self, attrid, value):
        if attrid == 0x0401:
            self.endpoint.device.rainIntensity = value
        super()._update_attribute(attrid, value)

@hadeshimself
Copy link

hadeshimself commented Aug 7, 2024

There are more datapoints:
Koenkk/zigbee2mqtt#23532

Has anyone began the work on the quirk file?

@hadeshimself
Copy link

hadeshimself commented Aug 9, 2024

Here's a quirk that works, but does not expose the secondary measurement values to HA yet. If anyone wants to tackle that it would be great. Pretty much all DP values are DC voltages measured in mV, except for the cleaning reminder.

edit: code removed to avoid confusion. please see new code bellow.

@TheJulianJES TheJulianJES added the Tuya Request/PR regarding a Tuya device label Aug 10, 2024
@pbutterworth
Copy link

Thanks for that @hadeshimself.
I've tested this out and can confirm that binary_sensor for moisture reports correctly, but only while the device is in pairing mode (green flashing light).
Once the device is out of pairing mode, we never hear from it again.
The device appears as red in the network visualisation:
image
Device diagnostics:
zha-538856afef528ecfa5f3aa6173859876-_TZ3210_tgvtvdoc TS0207-aa565ac66d71ea26618fcdc8a739c403 (4).json

@hadeshimself
Copy link

hadeshimself commented Aug 12, 2024

@pbutterworth, could you please try this one and let me know?

"""Quirk for TS0207 rain sensors."""

import zigpy.types as t
from typing import Any, Type
from zigpy.profiles import zha 
from zigpy.quirks import CustomDevice, CustomCluster
from zigpy.zcl.clusters.general import (
    Basic,
    Groups,
    Identify,
    OnOff,
    Ota,
    PowerConfiguration,
    Scenes,
    Time,
)
from zigpy.zcl.clusters.lightlink import LightLink
from zigpy.zcl.clusters.security import IasZone
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya.mcu import TuyaMCUCluster
from zhaquirks.tuya import (
    TuyaManufCluster,
    DPToAttributeMapping,
    EnchantedDevice,
    TuyaNoBindPowerConfigurationCluster,
)

ZONE_TYPE = 0x0001

class TuyaSolarRainSensorCluster(TuyaMCUCluster):
    """Tuya manufacturer cluster."""

    attributes = TuyaMCUCluster.attributes.copy()
    attributes.update(
        {
            0xEF65: ("light_intensity", t.uint32_t, True),
            0xEF66: ("average_light_intensity_20mins", t.uint32_t, True),
            0xEF67: ("todays_max_light_intensity", t.uint32_t, True),
            0xEF68: ("cleaning_reminder", t.Bool, True),
            0xEF69: ("rain_sensor_voltage", t.uint32_t, True),
        }
    )

    dp_to_attribute: dict[int, DPToAttributeMapping] = {
        101: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "light_intensity",
        ),
        102: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "average_light_intensity_20mins",
        ),
        103: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "todays_max_light_intensity",
        ),
        104: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "cleaning_reminder",
        ),
        105: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "rain_sensor_voltage",
        ),
    }

    data_point_handlers = {
        101: "_dp_2_attr_update",
        102: "_dp_2_attr_update",
        103: "_dp_2_attr_update",
        104: "_dp_2_attr_update",
        105: "_dp_2_attr_update",
    }


class TuyaIasZone(CustomCluster, IasZone):
    """IAS Zone for rain sensors."""

    _CONSTANT_ATTRIBUTES = {ZONE_TYPE: IasZone.ZoneType.Water_Sensor}


class TuyaSolarRainSensor(EnchantedDevice):
    """TS0207 Rain sensor quirk."""

    signature = {
        MODELS_INFO: [("_TZ3210_tgvtvdoc", "TS0207")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    IasZone.cluster_id,
                    TuyaMCUCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Groups.cluster_id,
                    OnOff.cluster_id,
                    Time.cluster_id,
                    Ota.cluster_id,
                    LightLink.cluster_id,
                ],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaNoBindPowerConfigurationCluster,
                    TuyaIasZone,
                    TuyaSolarRainSensorCluster,
                ],
                OUTPUT_CLUSTERS: [
                    Time.cluster_id,
                    Ota.cluster_id,
                ],
            },
        },
    }

@pbutterworth
Copy link

pbutterworth commented Aug 12, 2024

@hadeshimself same symptoms. Once the unit stops flashing, there are no further updates.
Triggering pairing mode again does not help. The device must be removed and re-added before getting any new updates.

@hadeshimself
Copy link

Just to make sure you replaced the file and reloaded everything before adding the device again. You should see a TuyaNoBindPowerConfigurationCluster entry in the device clusters.

Did you add this device previously to any other Zigbee hub? Tuya or zigbee2mqtt?

@pbutterworth
Copy link

pbutterworth commented Aug 12, 2024

@hadeshimself, ah yes, excuse me; my mistake. Failed to save the file (I think) 🤦‍♂️.
Take 2:

  • delete zha device
  • update quirk file (and save it!)
  • restart HA
  • re-add the rain sensor to zha.

Outcome: sensor does not update at all, even when the device is in pairing mode (green flashing light).

PS: this device has not been added to any other hub. Tuya: don't have one. Z2M: I'm only using ZHA.
PPS: Come to think of it, I have a tuya hub somewhere gathering dust. Shall I try pairing it to that hub, then bring it back to ZHA and see if there is a change of behaviour?

@frankfrommelt
Copy link

Hey @hadeshimself ,

first of all thank you for that quirk and I guess it is almost the solution (at least for me...).

For me it looks different after adding the quirk, removing the device, restarting HA an re-adding the device it is working quite well.
Battery and Rain sensors are exposed.
And I have the "TuyaSolarRainSensorCluster".

But I do not see all the other attributes.

The diagnostics shows them as "unsupported attributes".

image
image

"data": {
"ieee": "REDACTED",
"nwk": 6580,
"manufacturer": "_TZ3210_tgvtvdoc",
"model": "TS0207",
"name": "_TZ3210_tgvtvdoc TS0207",
"quirk_applied": true,
"quirk_class": "Tuya_rain.TuyaSolarRainSensor",
"quirk_id": null,
"manufacturer_code": 4417,
"power_source": "Battery or Unknown",
"lqi": 176,
"rssi": -56,
"last_seen": "2024-08-12T09:08:46",
"available": true,
"device_type": "EndDevice",
"signature": {
"node_descriptor": {
"logical_type": 2,
"complex_descriptor_available": 0,
"user_descriptor_available": 0,
"reserved": 0,
"aps_flags": 0,
"frequency_band": 8,
"mac_capability_flags": 128,
"manufacturer_code": 4417,
"maximum_buffer_size": 66,
"maximum_incoming_transfer_size": 66,
"server_mask": 10752,
"maximum_outgoing_transfer_size": 66,
"descriptor_capability_field": 0
},
"endpoints": {
"1": {
"profile_id": "0x0104",
"device_type": "0x0402",
"input_clusters": [
"0x0000",
"0x0001",
"0x0004",
"0x0005",
"0x0500",
"0xef00"
],
"output_clusters": [
"0x000a",
"0x0019"
]
}
},
"manufacturer": "_TZ3210_tgvtvdoc",
"model": "TS0207"
},
"active_coordinator": false,
"entities": [
{
"entity_id": "binary_sensor.tz3210_tgvtvdoc_ts0207_feuchtigkeit",
"name": "_TZ3210_tgvtvdoc TS0207"
},
{
"entity_id": "sensor.tz3210_tgvtvdoc_ts0207_batterie",
"name": "_TZ3210_tgvtvdoc TS0207"
},
{
"entity_id": "update.tz3210_tgvtvdoc_ts0207_firmware",
"name": "_TZ3210_tgvtvdoc TS0207"
},
{
"entity_id": "sensor.regensensor_batterie",
"name": "_TZ3210_tgvtvdoc TS0207"
},
{
"entity_id": "binary_sensor.regensensor_feuchtigkeit",
"name": "_TZ3210_tgvtvdoc TS0207"
},
{
"entity_id": "update.regensensor_firmware",
"name": "_TZ3210_tgvtvdoc TS0207"
}
],
"neighbors": [],
"routes": [],
"endpoint_names": [
{
"name": "IAS_ZONE"
}
],
"user_given_name": "Regensensor",
"device_reg_id": "8897db1af17f002c7d17cd98678279d9",
"area_id": "draussen",
"cluster_details": {
"1": {
"device_type": {
"name": "IAS_ZONE",
"id": 1026
},
"profile_id": 260,
"in_clusters": {
"0x0000": {
"endpoint_attribute": "basic",
"attributes": {
"0x0001": {
"attribute_name": "app_version",
"value": 67
},
"0x0004": {
"attribute_name": "manufacturer",
"value": "_TZ3210_tgvtvdoc"
},
"0x0005": {
"attribute_name": "model",
"value": "TS0207"
},
"0x0007": {
"attribute_name": "power_source",
"value": 3
},
"0xfffe": {
"attribute_name": "reporting_status",
"value": 0
},
"0x0000": {
"attribute_name": "zcl_version",
"value": 3
}
},
"unsupported_attributes": {}
},
"0x0001": {
"endpoint_attribute": "power",
"attributes": {
"0x0021": {
"attribute_name": "battery_percentage_remaining",
"value": 194
},
"0x0020": {
"attribute_name": "battery_voltage",
"value": 0
}
},
"unsupported_attributes": {
"0x0031": {
"attribute_name": "battery_size"
},
"0x0033": {
"attribute_name": "battery_quantity"
}
}
},
"0x0004": {
"endpoint_attribute": "groups",
"attributes": {},
"unsupported_attributes": {}
},
"0x0005": {
"endpoint_attribute": "scenes",
"attributes": {},
"unsupported_attributes": {}
},
"0x0500": {
"endpoint_attribute": "ias_zone",
"attributes": {
"0x0010": {
"attribute_name": "cie_addr",
"value": [
34,
103,
240,
254,
255,
129,
118,
40
]
},
"0x0000": {
"attribute_name": "zone_state",
"value": 1
},
"0x0002": {
"attribute_name": "zone_status",
"value": 0
},
"0x0001": {
"attribute_name": "zone_type",
"value": 42
}
},
"unsupported_attributes": {}
},
"0xef00": {
"endpoint_attribute": "tuya_manufacturer",
"attributes": {
"0xef66": {
"attribute_name": "average_light_intensity_20mins",
"value": 4291
},
"0xef68": {
"attribute_name": "cleaning_reminder",
"value": 0
},
"0xef65": {
"attribute_name": "light_intensity",
"value": 4444
},
"0xef69": {
"attribute_name": "rain_sensor_voltage",
"value": 5
},
"0xef67": {
"attribute_name": "todays_max_light_intensity",
"value": 4444
}
},
"unsupported_attributes": {}

}
},
"out_clusters": {
"0x000a": {
"endpoint_attribute": "time",
"attributes": {},
"unsupported_attributes": {}
},
"0x0019": {
"endpoint_attribute": "ota",
"attributes": {
"0x0002": {
"attribute_name": "current_file_version",
"value": 67
}
},
"unsupported_attributes": {}
}
}
}
}
}
}

@pbutterworth
Copy link

Quick update:
I dusted off an old Tuya gateway and added the rain sensor to that. Check for updates (none), version is V1.0.3.
I then removed it from the Tuya gateway, and added it back to ZHA, and observed no change.
Note: when adding the device to the Tuya gateway, once the device was added, the pairing mode terminated immediately (unlike ZHA where the pairing mode persists after the handshake is complete).
Also, it appears that the rain detection event in the device is an immediate push (tuya app responds immediately). Other attributes update periodically.

@hadeshimself
Copy link

@pbutterworth did you use the code you received by email or did you copy it from the GitHub page? Because I edited the post with some updated code a few minutes later.

@frankfrommelt yeah, I don’t know how to expose those other attributes. There’s no standard to represent that kind of data, except from some energy related stuff. You would get 4 sensors for Voltage. How to tell them apart? If I had to pick one I would use the rain sensor voltage as it may indicate the intensity of the rain (?).

@pbutterworth
Copy link

@frankfrommelt when you paired the device, did you notice whether the green light stopped flashing once the ZHA handshake was complete? Or, did the green light keep flashing for another couple of minutes?

@hadeshimself
Copy link

@pbutterworth, make sure you are using that last code I posted, which includes the enchanted device code (it will have a TuyaNoBindPowerConfigurationCluster cluster shown on the UI). When you trigger your rain sensor do you see a red LED blink on the back? Also, make sure you reload everything and even clear the pycache directory where you have your custom quirk files before adding the device again.

@frankfrommelt, you could try https://github.com/mdeweerd/zha-toolkit meanwhile to read the other values. Setup an action every minute or so to feed a sensor, something like:

action: zha_toolkit.attr_read
data:
  ieee: binary_sensor.rain_sensor_moisture
  cluster: 61184
  attribute: light_intensity
  state_id: sensor.rain_sensor_light_intensity
  allow_create: true
  use_cache: true

Replace "rain_sensor" accordingly.

@pbutterworth
Copy link

OK, another round of this. BTW @hadeshimself, feel free to step away from this; you've helped a lot already!

Re: red light on moisture detection: yes, once pairing mode has timed out, the red light flashes once when moisture is detected.

  • Confirmed latest quirk, including TuyaNoBindPowerConfigurationCluster.
  • Removed rain sensor from ZHA.
  • Blitzed the pycache
  • Restarted HA.
  • Added the rain sensor (note: at this point the green light is still flashing):
image
  • Moisture sensor updates state while the device is still in pairing mode (~30s latency):
image
  • Once pairing mode times out, not further comms from the device.
image image

Here's a log file that covers (sorry very noisy log file):

@hadeshimself
Copy link

@pbutterworth, also check if you have the latest coordinator firmware. At one point when debuging I couldn't pair it anymore and it only got back to normal after I updated the firmware. I'm using the Sonoff 3.0 dongle.

@pbutterworth
Copy link

@pbutterworth, also check if you have the latest coordinator firmware. At one point when debuging I couldn't pair it anymore and it only got back to normal after I updated the firmware. I'm using the Sonoff 3.0 dongle.

@hadeshimself nailed it! silabs firmware was 6.10, updated to 7.4, problem solved. 🤜🤛
Thanks for the quality assistance.

@frankfrommelt
Copy link

@frankfrommelt, you could try https://github.com/mdeweerd/zha-toolkit meanwhile to read the other values. Setup an action every minute or so to feed a sensor, something like:

action: zha_toolkit.attr_read
data:
  ieee: binary_sensor.rain_sensor_moisture
  cluster: 61184
  attribute: light_intensity
  state_id: sensor.rain_sensor_light_intensity
  allow_create: true
  use_cache: true

Replace "rain_sensor" accordingly.

That is a good workaround.

And this is how I create statistics from the States. As soon as I have a min/max value I will add some calculations to the state.

image

  • sensor:
    • name: sensor.regensensor_helligkeit_OK
      unique_id: sensor.regensensor_helligkeit_OK_13082024
      device_class: illuminance
      state: "{{ states('sensor.regensensor_helligkeit') }}"
      state_class: measurement
      unit_of_measurement: "lx"

@hadeshimself
Copy link

@frankfrommelt yes, please let me know the max value you can get. I topped at around 5500.

@frankfrommelt
Copy link

image

My max value was 4983 and now it is dropping rapidly as some heavy thunderstorms are approaching my area...

@frankfrommelt
Copy link

OK, I had a maximum of 5492.

In comparison to a real light sensor you can see that the values delivered by the rain sensor are not realistic.
I guess it is only calculating a value from the current the solar panel is producing.

image

@hadeshimself
Copy link

@frankfrommelt, my peak was 5880. But it's really not a good light measurement device. I've also compared it to a real light sensor and it's not even close to the same precision.

Screenshot 2024-08-15 at 08 32 59

@wbmk78
Copy link
Author

wbmk78 commented Aug 17, 2024

@hadeshimself thanx a lot!
The second quirk seems to work nicely for rain measurement!

@manuscho
Copy link

I struggle with the same problem for a water leak sensor (Model) which also uses the TS0207 chip.

Same behavior: Works great with generic Tuya hub, connects smoothly with ZHA (through SkyConnect; water leak is correctly showing the first minutes after initial setup), but then never updates again.

The water leak sensor is explicitly mentioned here as compatible with ZHA, which makes the whole thing a bit odd.

@pbutterworth
Copy link

I struggle with the same problem for a water leak sensor (Model) which also uses the TS0207 chip.

Same behavior: Works great with generic Tuya hub, connects smoothly with ZHA (through SkyConnect; water leak is correctly showing the first minutes after initial setup), but then never updates again.

The water leak sensor is explicitly mentioned here as compatible with ZHA, which makes the whole thing a bit odd.

Updating the zigbee radio firmware solved these symptoms for me.

@wsegatto
Copy link

And I'm back... It's in fact not working ! I loose the connection after few min or hour when lucky, than I struggled to pair it again... I think that a never have that famous green light flashing, expect when looking for pairing. So, I'm up for any tips, now I'm on z2m, I'm all listening!

Thanks by advance

Not sure what radio you are using, but I have HA Yellow and I couldn't make it pair with Zigbee2MQTT, so I rolled back my HA backup and bought a Sonoff ZBDongle-E. Now I have ZHA with the embedded radio and Sonoff as with MQTT. It was a very different behavior.

image

image

Couple of things I had to do:

  • Update the firmware of the dongle via Silicon Labs Flasher Add-on in HA:
    Information: https://www.zigbee2mqtt.io/devices/ZBDongle-E.html
    Firmware: https://github.com/darkxst/silabs-firmware-builder/raw/main/firmware_builds/zbdonglee/ncp-uart-hw-v7.4.1.0-zbdonglee-115200.gbl
    Maybe you can do it here as well: https://darkxst.github.io/silabs-firmware-builder/

  • After that for some reason I kept getting authentication errors and connection refused errors. It finally resolved and authenticated when I added the IP address of HA instead of localhost/127.0.0.1 or any other value. It worked straightaway with an user/pass maintained in the MQTT configuration tab, but I had troubles with user/pass from the Users in HA.

  • Reboot HA.

  • This did the trick. The battery took a while to appear, not sure why it was not there. Not all entities were there in the beginning, but it somehow "settled" after some hours. I have no clue what happened. All I did was to press the button at the back a couple of times (short press) to see what would happened and when I went to check the device multiple entities were there. Still little messy but much better than before with ZHA+Quirk.

image

@inigortega
Copy link

inigortega commented Oct 3, 2024

Hello. When will be quirk integrated in zha? Thanks!
Today I tried to configure Tuya Rain Sensor and it appears on ZHA, but doesnt work.
image

@aarongorka
Copy link

aarongorka commented Oct 26, 2024

I updated the above quirk so that it exposes the light_intensity attribute as a new cluster, which will show up in HA as a sensor:

image

Note the CALIBRATION_FACTOR variable which I'm not sure is necessary or correct but the values seem better with it.

"""Quirk for TS0207 rain sensors."""

import zigpy.types as t
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster
from zigpy.zcl.clusters.general import (
    Basic,
    Groups,
    Identify,
    OnOff,
    Ota,
    PowerConfiguration,
    Scenes,
    Time,
)
from zigpy.zcl.clusters.lightlink import LightLink
from zigpy.zcl.clusters.measurement import IlluminanceMeasurement
from zigpy.zcl.clusters.security import IasZone
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya.mcu import TuyaMCUCluster
from zhaquirks.tuya import (
    TuyaLocalCluster,
    DPToAttributeMapping,
    EnchantedDevice,
    TuyaNoBindPowerConfigurationCluster,
)
from zhaquirks import Bus
import logging

ZONE_TYPE = 0x0001

LOGGER = logging.getLogger(__name__)


class TuyaSolarRainSensorCluster(TuyaMCUCluster, CustomCluster):
    """Tuya manufacturer cluster."""

    attributes = TuyaMCUCluster.attributes.copy()
    attributes.update(
        {
            0xEF65: ("light_intensity", t.uint32_t, True),
            0xEF66: ("average_light_intensity_20mins", t.uint32_t, True),
            0xEF67: ("todays_max_light_intensity", t.uint32_t, True),
            0xEF68: ("cleaning_reminder", t.Bool, True),
            0xEF69: ("rain_sensor_voltage", t.uint32_t, True),
        }
    )

    dp_to_attribute: dict[int, DPToAttributeMapping] = {
        101: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "light_intensity",
        ),
        102: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "average_light_intensity_20mins",
        ),
        103: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "todays_max_light_intensity",
        ),
        104: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "cleaning_reminder",
        ),
        105: DPToAttributeMapping(
            TuyaMCUCluster.ep_attribute,
            "rain_sensor_voltage",
        ),
    }

    data_point_handlers = {
        101: "_dp_2_attr_update",
        102: "_dp_2_attr_update",
        103: "_dp_2_attr_update",
        104: "_dp_2_attr_update",
        105: "_dp_2_attr_update",
    }

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)
        LOGGER.debug(f"Updating attr {hex(attrid)}...")
        if attrid == 0xEF65 and value is not None and value >= 0:
            LOGGER.debug(
                f"Creating illuminance_reported event on illuminance_bus with attrid {hex(attrid)}..."
            )
            try:
                self.endpoint.device.illuminance_bus.listener_event(
                    "illuminance_reported", value
                )
            except:
                LOGGER.exception("Failed to create illuminance_reported event...")
                pass


class TuyaIlluminanceCluster(CustomCluster, IlluminanceMeasurement):
    """Tuya Illuminance cluster."""

    cluster_id = IlluminanceMeasurement.cluster_id
    MEASURED_VALUE_ATTR_ID = 0x0000
    MIN_MEASURED_VALUE_ATTR_ID = 0x0001
    MAX_MEASURED_VALUE_ATTR_ID = 0x0001

    # The value gets passed through `round(pow(10, ((value - 1) / 10000)))` by ZHA
    # https://github.com/zigpy/zha/blob/927e249134c87bd7805139c8fb61e048593ec155/zha/application/platforms/sensor/__init__.py#L782C9-L782C53
    CALIBRATION_FACTOR = 7  # dervied from a single comparison against a BH1750 sensor, likely not accurate at all

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        LOGGER.debug("Attaching TuyaIlluminanceCluster to listener...")
        try:
            self.endpoint.device.illuminance_bus.add_listener(self)
            LOGGER.debug("TuyaIlluminanceCluster attached to listener.")
        except:
            LOGGER.exception("Failed to add listener.")
            pass

    def illuminance_reported(self, value):
        """Illuminance reported."""

        calibrated_value = value * self.CALIBRATION_FACTOR
        LOGGER.debug(
            f"Received illuminance_reported event with value {value}, updating attribute with calibrated value {calibrated_value}..."
        )
        self._update_attribute(self.MEASURED_VALUE_ATTR_ID, calibrated_value)
        LOGGER.debug(f"measured_value attribute updated.")


class TuyaIasZone(CustomCluster, IasZone):
    """IAS Zone for rain sensors."""

    _CONSTANT_ATTRIBUTES = {ZONE_TYPE: IasZone.ZoneType.Water_Sensor}


class TuyaSolarRainSensor(EnchantedDevice):
    """TS0207 Rain sensor quirk."""

    def __init__(self, *args, **kwargs) -> None:
        """Init."""
        self.illuminance_bus = Bus()
        LOGGER.debug(f"Bus created.")
        super().__init__(*args, **kwargs)

    signature = {
        MODELS_INFO: [("_TZ3210_tgvtvdoc", "TS0207")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    IasZone.cluster_id,
                    TuyaMCUCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Groups.cluster_id,
                    OnOff.cluster_id,
                    Time.cluster_id,
                    Ota.cluster_id,
                    LightLink.cluster_id,
                ],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaNoBindPowerConfigurationCluster,
                    TuyaIasZone,
                    TuyaSolarRainSensorCluster,
                    TuyaIlluminanceCluster,
                ],
                OUTPUT_CLUSTERS: [
                    Time.cluster_id,
                    Ota.cluster_id,
                ],
            },
        },
    }

@inigortega
Copy link

And this quirk will be available in next zha uodates, or I need to install manually?
Best regards,

@Sanaki
Copy link

Sanaki commented Oct 27, 2024

It'll be available when someone submits a PR for it and it's accepted. Thus far no one has. That said, I like the newly posted quirk, though I have no idea how accurate its light sensor is. Still, that's the fault of the device, not the quirk.

@hadeshimself
Copy link

hadeshimself commented Oct 27, 2024 via email

@tasomaniac
Copy link

tasomaniac commented Oct 28, 2024

Just used the latest quirk from @aarongorka but unfortunately I did not have any other sensor visible.

It is only the below. Also after adding it, it did not update at all. It was stuck with the first value.

Solved by sonoff dongle-e firmware update.

image

@Sanaki
Copy link

Sanaki commented Oct 28, 2024

Did you reboot HA?

@tasomaniac
Copy link

Yes after changing the file, I rebooted the whole device.

@pb-asbuilt
Copy link

@tasomaniac, I had similar symptom with the first reading being stuck. The solution for me was to update the zigbee firmware. YMMV

@aarongorka
Copy link

Just used the latest quirk from @aarongorka but unfortunately I did not have any other sensor visible.

It is only the below. Also after adding it, it did not update at all. It was stuck with the first value.
image

Did you get this fixed? If not, could be interesting to see if you're getting any values from Manage Zigbee device > Clusters > TuyaSolarRainSensorCluster > light_intensity

@tasomaniac
Copy link

tasomaniac commented Oct 30, 2024

I got it fixed. Upgrading the zigbee firmware fixed it. After the upgrade, the light sensor value also came back. This may be because of a restart, I'm not sure. But it all works well now.

Btw, I do have a "calculated" virtual Illuminance sensor based on the weather forecast. So far the values match. I will report more after observing it more.

@NikoGrub
Copy link

@tasomaniac How did you upgrade the firmware of this sensor?

@tasomaniac
Copy link

@tasomaniac How did you upgrade the firmware of this sensor?

Sorry for the confusion. Update is necessary for the zigbee firmware. Not the sensor.

@NikoGrub
Copy link

@tasomaniac Thank you. I have the Conbee 3 from deconz with the newest firmware installed. Sadly the sensor does not work.
I can add it, but then it stuck.

aarongorka added a commit to aarongorka/zha-device-handlers that referenced this issue Oct 30, 2024
Adds a quirk that fixes this device by changing the "moving" and
"closed" sensors to the rain and illuminance sensors that the device
actually has.

Most of the credit for this code goes to @hadeshimself from
[this](zigpy#3249 (comment))
comment.
aarongorka added a commit to aarongorka/zha-device-handlers that referenced this issue Oct 30, 2024
Adds a quirk that fixes this device by changing the "moving" and
"closed" sensors to the rain and illuminance sensors that the device
actually has.

Most of the credit for this code goes to @hadeshimself from
[this](zigpy#3249 (comment))
comment.

Fixes zigpy#3249.
@aarongorka aarongorka linked a pull request Oct 30, 2024 that will close this issue
3 tasks
@inigortega
Copy link

It'll be available when someone submits a PR for it and it's accepted. Thus far no one has. That said, I like the newly posted quirk, though I have no idea how accurate its light sensor is. Still, that's the fault of the device, not the quirk.

Anyone knows when someone submits a PR for this? Can I do anything to get this quirk in zha? Thanks,

aarongorka added a commit to aarongorka/zha-device-handlers that referenced this issue Oct 30, 2024
Adds a quirk that fixes this device by changing the "moving" and
"closed" sensors to the rain and illuminance sensors that the device
actually has.

Most of the credit for this code goes to @hadeshimself from
[this](zigpy#3249 (comment))
comment.

Fixes zigpy#3249.
@aarongorka
Copy link

Anyone knows when someone submits a PR for this?

Now 🙂

@inigortega
Copy link

inigortega commented Oct 30, 2024

Anyone knows when someone submits a PR for this?

Now 🙂

Ah ok, I understand. You commited the new file to repository and now someone needs to accept.
Thanks a lot for your commit 😎

@tasomaniac
Copy link

Here is the chart for today. The illumination sensor is surprisingly similar to the calculated value from weather forecast.

Screenshot_20241030-213718.png

@hadeshimself
Copy link

hadeshimself commented Oct 30, 2024 via email

@tasomaniac
Copy link

Actually it is the contrary. The values were not so high but still accurate. I live in Berlin and it was super cloudy and rainy today

@inigortega
Copy link

Anyone knows when someone submits a PR for this?

Now 🙂

It seems that there is an error on pull request, no? Is easy to fix it? Thanks for your work.

@divirg
Copy link

divirg commented Nov 2, 2024

To whoever did this: thank you, I just copied and pasted the code, added quircks, and boom! (sorry to add noise to the thread, but I felt the need to thank)

@inigortega
Copy link

Yess, now it seems to work like a motion sensor, but pull request is not done, not?
Thanks again for your work!

@inigortega
Copy link

Any updates to pull request this quirk to zha base quirks? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

Successfully merging a pull request may close this issue.