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

New Device: Zigbee Solar Rain Sensor #23532

Closed
cloudbr34k84 opened this issue Aug 6, 2024 · 8 comments
Closed

New Device: Zigbee Solar Rain Sensor #23532

cloudbr34k84 opened this issue Aug 6, 2024 · 8 comments
Labels
new device support New device support request

Comments

@cloudbr34k84
Copy link

Link

https://www.aliexpress.com/item/1005007269624052.html?spm=a2g0o.order_list.order_list_main.16.49731802i8AvVZ

Database entry

{"id":172,"type":"EndDevice","ieeeAddr":"0xa4c1386b5af8658b","nwkAddr":28526,"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":{"dateCode":""}},"ssIasZone":{"attributes":{"iasCieAddr":"0x00124b002a2ee669","zoneState":1}},"genPowerCfg":{"attributes":{"batteryPercentageRemaining":148}}},"binds":[{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x00124b002a2ee669","endpointID":1}],"configuredReportings":[{"cluster":1,"attrId":33,"minRepIntval":3600,"maxRepIntval":65000,"repChange":0,"manufacturerCode":null}],"meta":{}}},"appVersion":67,"stackVersion":1,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":543112114},"lastSeen":1722943531629}

Comments

When i pair the device its been picked up as

  • TS0207
  • _TZ3210_tgvtvdoc
  • Description: Water leak detector

I have tried to construct the converter, but its not sticking and im not sure if its because its already identified.

here is my 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 rbSrain01 = {
    fingerprint: [{modelID: 'RB-SRAIN01', manufacturerName: '_TZ3210_tgvtvdoc'}],
    model: 'RB-SRAIN01',
    vendor: 'Tuya',
    description: 'Solar Rain Sensor',
    fromZigbee: [fz.tuya_data_point],
    toZigbee: [],
    exposes: [
        e.binary('droplet_detection_state', ea.STATE, 'ON', 'OFF').withDescription('Droplet Detection State'),
        e.numeric('battery', ea.STATE).withUnit('%').withDescription('Battery level'),
        e.numeric('light_intensity', ea.STATE).withUnit('lx').withDescription('Light intensity'),
        e.numeric('average_light_intensity_20mins', ea.STATE).withUnit('lx').withDescription('20 mins average light intensity'),
        e.numeric('todays_max_light_intensity', ea.STATE).withUnit('lx').withDescription("Today's max light intensity"),
        e.binary('cleaning_reminder', ea.STATE, 'ON', 'OFF').withDescription('Cleaning reminder'),
        e.numeric('rain_sensor_voltage', ea.STATE).withUnit('V').withDescription('Rain sensor voltage'),
    ],
    meta: {
        tuyaDatapoints: [
            [1, 'droplet_detection_state', tuya.valueConverter.trueFalse],
            [4, 'battery', tuya.valueConverter.batteryPercentage],
            [101, 'light_intensity', tuya.valueConverter.raw],
            [102, 'average_light_intensity_20mins', tuya.valueConverter.raw],
            [103, 'todays_max_light_intensity', tuya.valueConverter.raw],
            [104, 'cleaning_reminder', tuya.valueConverter.trueFalse],
            [105, 'rain_sensor_voltage', tuya.valueConverter.raw],
        ],
    },
    extend: [],
};

module.exports = rbSrain01;

External definition

const {battery, iasZoneAlarm, commandsOnOff} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
    zigbeeModel: ['TS0207'],
    model: 'TS0207',
    vendor: '_TZ3210_tgvtvdoc',
    description: 'Automatically generated definition',
    extend: [battery(), iasZoneAlarm({"zoneType":"generic","zoneAttributes":["alarm_1","alarm_2","tamper","battery_low"]}), commandsOnOff()],
    meta: {},
};

module.exports = definition;
@kiselio
Copy link

kiselio commented Aug 9, 2024

Here's a fully working converter for this device, found here:

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;

@cloudbr34k84
Copy link
Author

Yeah I saw this yesterday as well

@Koenkk
Copy link
Owner

Koenkk commented Aug 12, 2024

Added!

Could you also submit a picture for the docs? This can be done by:

  1. Create a fork by clicking here
  2. Go to the public/images/devices directory, Add file -> Upload files
  3. Upload the files and press Commit changes
  4. Press Contribute -> Open pull request -> update title/description -> Create pull request

Make sure that:

  • The filename is RB-SRAIN01.png
  • The size is 512x512
  • The background is transparent (use e.g. Adobe remove background)

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Aug 12, 2024
@kiselio
Copy link

kiselio commented Aug 12, 2024

Added the image @Koenkk

https://github.com/Koenkk/zigbee2mqtt.io/compare/master...kiselio:zigbee2mqtt.io:master?expand=1

@BogdanNikolas
Copy link

Please, help me change the picture on this device in Z2M. I can't find clear instructions.

@budcalloway
Copy link

Hi !
In my case, I do not have any illuminance reported. Still at 0 mV under sunlight. Anyone having this problem too ?

{ "battery": 73, "battery_low": false, "illuminance": 0, "illuminance_average_20min": 0, "illuminance_maximum_today": 11, "linkquality": 149, "rain_intensity": 4, "tamper": false, "water_leak": false }

@rdorys
Copy link

rdorys commented Sep 2, 2024

It seems that water leak is missing since the last release,
#23678 (comment)

I created a PR to put in back in the converter.
Koenkk/zigbee-herdsman-converters#7931

@RubenKelevra
Copy link
Contributor

Please, help me change the picture on this device in Z2M. I can't find clear instructions.

Instructions are above your comment:

#23532 (comment)

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
Projects
None yet
Development

No branches or pull requests

7 participants