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

tuya WKD-LS100 rain and sun sensor #23372

Closed
conta1988 opened this issue Jul 19, 2024 · 9 comments
Closed

tuya WKD-LS100 rain and sun sensor #23372

conta1988 opened this issue Jul 19, 2024 · 9 comments
Labels
new device support New device support request stale Stale issues

Comments

@conta1988
Copy link

Link

https://it.aliexpress.com/item/1005007269624052.html?spm=a2g0o.order_list.order_list_main.43.7b613696tX5dxn&gatewayAdapt=glo2ita

Database entry

{"id":19,"type":"EndDevice","ieeeAddr":"0xa4c138f98bbf43b4","nwkAddr":56375,"manufId":4742,"manufName":"zbeacon","powerSource":"Battery","modelId":"DS01","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,3,1,1280,32],"outClusterList":[25],"clusters":{"genPowerCfg":{"attributes":{"batteryVoltage":30,"batteryPercentageRemaining":200}},"genBasic":{"attributes":{"modelId":"DS01","manufacturerName":"zbeacon","powerSource":3,"zclVersion":3,"appVersion":113,"stackVersion":2,"hwVersion":0,"swBuildId":"0122052017"}},"ssIasZone":{"attributes":{"iasCieAddr":"0x0000000000000000","zoneState":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":113,"stackVersion":2,"hwVersion":0,"swBuildId":"0122052017","zclVersion":3,"interviewCompleted":false,"meta":{},"lastSeen":1721362616873} {"id":20,"type":"EndDevice","ieeeAddr":"0xa4c1383a82f0d0fa","nwkAddr":24874,"manufId":4742,"manufName":"zbeacon","powerSource":"Battery","modelId":"DS01","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,3,1,1280,32],"outClusterList":[25],"clusters":{"genPowerCfg":{"attributes":{"batteryPercentageRemaining":200,"batteryVoltage":30}},"genBasic":{"attributes":{"modelId":"DS01","manufacturerName":"zbeacon","powerSource":3,"zclVersion":3,"appVersion":113,"stackVersion":2,"hwVersion":0,"swBuildId":"0122052017"}},"ssIasZone":{"attributes":{"iasCieAddr":"0x00212effff08049d","zoneState":1}}},"binds":[{"cluster":32,"type":"endpoint","deviceIeeeAddress":"0x00212effff08049d","endpointID":1},{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x00212effff08049d","endpointID":1}],"configuredReportings":[{"cluster":1,"attrId":32,"minRepIntval":3600,"maxRepIntval":7200,"repChange":0,"manufacturerCode":null},{"cluster":1,"attrId":33,"minRepIntval":3600,"maxRepIntval":7200,"repChange":0,"manufacturerCode":null}],"meta":{}}},"appVersion":113,"stackVersion":2,"hwVersion":0,"swBuildId":"0122052017","zclVersion":3,"interviewCompleted":true,"meta":{"configured":-14895530},"lastSeen":1721362479267} {"id":21,"type":"EndDevice","ieeeAddr":"0xa4c138ed05ad0d64","nwkAddr":49127,"manufId":4417,"manufName":"_TZ3210_tgvtvdoc","powerSource":"Battery","modelId":"TS0207","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,4,5,1,1280,61184],"outClusterList":[3,4,6,4096,10,25],"clusters":{"genBasic":{"attributes":{"modelId":"TS0207","manufacturerName":"_TZ3210

Comments

i can't integrate the product, can you help me?

External definition

battery state
battery level
rain
sun (illumination)
@conta1988 conta1988 added the new device support New device support request label Jul 19, 2024
@u236
Copy link

u236 commented Jul 25, 2024

We've added support for this sensor in HOMEd ZigBee tonight, hope it will help. HOMEd ZigBee device library record:
https://github.com/u236/homed-service-zigbee/blob/4b1284c9f699fb5aef459bea7d20f61480248601/deploy/data/usr/share/homed-zigbee/tuya.json#L948-L965

Sensor sends battery state via default "Power Configuration" cluster (like any other battery-powered zigbee device).

Binary rain presence state sent via "IAS Zone" cluster (like occupancy/door and other "security" sensors), using firs bit (Alarm 1). Also it has "Battery Low" bit.

Illuminance intensity and rain intensity sent via "TUYA Data Points" cluster (0xEF00), and using not-standard command 0x06 (instead standard 0x02) for it. Datapoint 101 is illuminance intensity and datapoint 105 is rain intensity. Both has "millivolts" units.

@Andrik45719
Copy link

Andrik45719 commented Jul 25, 2024

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, fz.ias_water_leak_alarm_1],
    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;

@u236
Copy link

u236 commented Jul 25, 2024

    fromZigbee: [tuya.fz.datapoints, fz.battery],

Think you forgot item for "water leak" :)
And you not need "magic request", sensor works without it.

@conta1988
Copy link
Author

for now,
Thank you very much!

@Xander-V
Copy link

Xander-V commented Aug 18, 2024

Found this review about the sensor including an external converter:

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

const definition = {
    fingerprint: [
        {
            modelID: 'TS0207',
            manufacturerName: '_TZ3210_tgvtvdoc',
        },
    ],
    model: 'TS0207_rain_sensor',
    vendor: 'Tuya',
    description: 'Solar Rain Sensor RB-SRAIN01',
    fromZigbee: [tuya.fz.datapoints, fz.battery, fz.ias_water_leak_alarm_1],
    toZigbee: [],
    exposes: [
        e.water_leak('raining').withDescription('Droplet Detection (Raining)'), 
        e.numeric('illuminance', ea.STATE).withUnit('mV').withDescription('Illuminance level'),
        e.numeric('illuminance_average_20min', ea.STATE).withUnit('mV').withDescription('Illuminance average for the last 20 minutes'),
        e.numeric('illuminance_maximum_today', ea.STATE).withUnit('mV').withDescription('Illuminance maximum for the last 24 hours'),
        e.binary('cleaning_reminder', ea.STATE, 'ON', 'OFF').withDescription('Cleaning reminder'),
        e.numeric('rain_intensity', ea.STATE).withUnit('mV').withDescription('Rainfall intensity'),
        e.numeric('battery', ea.STATE).withUnit('%').withDescription('Battery level'),
        e.battery_low(),        
    ],
    meta: {
        tuyaDatapoints: [
            [4, 'battery', tuya.valueConverter.batteryPercentage],
            [101, 'illuminance', tuya.valueConverter.raw],
            [102, 'illuminance_average_20min', tuya.valueConverter.raw],
            [103, 'illuminance_maximum_today', tuya.valueConverter.raw],
            [104, 'cleaning_reminder', tuya.valueConverter.trueFalse],
            [105, 'rain_intensity', tuya.valueConverter.raw],
        ],
    },
    extend: [],
};

module.exports = definition;

Might help in adding it as a device. It seems however it needs some extra work to create f.i. options for heavy rain, light rain etc. since the values now are raw mV values if drops of rain are on the device.

The reviewer incorporated some templates in HA, but this could of course also be in Z2M directly.

template:
  - sensor:
      - name: "Rain Rate"
        state: >
          {% set intensity = states('sensor.tuya_rain_sensor_rb_srain01_rain_intensity') | int %}
          {% if intensity < 10 %}
            No Rain
          {% elif intensity <= 2000 %}
            Light Rain
          {% elif intensity <= 2600 %}
            Moderate Rain
          {% else %}
            Violent Rain
          {% endif %}      

@RubenKelevra
Copy link
Contributor

I think support was added in 1.40.0 and this is a duplicate to #23532.

@sajikur
Copy link

sajikur commented Sep 3, 2024

This device completely changed the exposed sensors in HA during the last update. It was previously recognized as "https://www.zigbee2mqtt.io/devices/TS0207_water_leak_detector.html#tuya-ts0207_water_leak_detector" and in addition to its solar sensors, it exposed the "water_leak". The "rain intensity" gives a value of 2896 if the sensor gets wet for testing which makes little sense for developing automations. Is it therefore possible to expose the old sensors again?
Could you fix?
thank you!!!

@fisch55
Copy link

fisch55 commented Sep 4, 2024

Same issue. Updating to the ne z2mqtt Version , my external converter with Waterleak doesn't work anymore.
In Status of Device ist shows following:

{ "battery_low": false, "cleaning_reminder": true, "illuminance": 2847, "illuminance_average_20min": 2324, "illuminance_maximum_today": 5889, "linkquality": 128, "rain_intensity": 57, "tamper": false, "water_leak": false, "battery": null, "elapsed": 127 }

Copy link
Contributor

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days

@github-actions github-actions bot added the stale Stale issues label Dec 20, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request stale Stale issues
Projects
None yet
Development

No branches or pull requests

7 participants