zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

New Device: Zigbee Solar Rain Sensor

Open cloudbr34k84 opened this issue 2 years ago โ€ข 40 comments

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;

cloudbr34k84 avatar Aug 06 '24 11:08 cloudbr34k84

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;

kiselio avatar Aug 09 '24 10:08 kiselio

Yeah I saw this yesterday as well

cloudbr34k84 avatar Aug 09 '24 20:08 cloudbr34k84

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 avatar Aug 12 '24 10:08 Koenkk

Added the image @Koenkk

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

kiselio avatar Aug 12 '24 11:08 kiselio

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

BogdanNikolas avatar Aug 31 '24 19:08 BogdanNikolas

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 }

budcalloway avatar Sep 01 '24 18:09 budcalloway

It seems that water leak is missing since the last release, https://github.com/Koenkk/zigbee2mqtt/issues/23678#issuecomment-2324770434

I created a PR to put in back in the converter. https://github.com/Koenkk/zigbee-herdsman-converters/pull/7931

rdorys avatar Sep 02 '24 14:09 rdorys

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

Instructions are above your comment:

https://github.com/Koenkk/zigbee2mqtt/issues/23532#issuecomment-2283649487

RubenKelevra avatar Sep 02 '24 16:09 RubenKelevra

Is this device stable on your network? Mine seems to stop sending data for several hours at a time until I move it significantly closer to a router. Whatโ€™s odd is that I donโ€™t have to re-pair it. Once I bring it near the router (within just a few centimeters), the sensor starts working normally again, sending data every minute as expected. After that, I can put it back in its original position, and it continues to function properly for a while, but then the issue comes back.

Edit: It seems that it needs to reach directly the coordinator to be back again on the network (bringing it close to a router seemed to be close enought to send the info to the coordinator).

rdorys avatar Sep 13 '24 06:09 rdorys

Can you try covering the solar panel if that happens, before you move it, so we can rule out a low power situation?

RubenKelevra avatar Sep 13 '24 06:09 RubenKelevra

Ok I will try it next time, but it really happens randomly. Note that my battery is still 97%, so I don't know if the device will trigger any low power behaviour.

rdorys avatar Sep 13 '24 06:09 rdorys

Ok I will try it next time, but it really happens randomly. Note that my battery is still 97%, so I don't know if the device will trigger any low power behaviour.

Battery percentage reporting is non-optimal currently in Z2M, as most devices don't like usually considered pretty high voltage levels.

As this one got a rechargeable battery the conversion from voltage to percent might actually be completely wrong.

Would you mind graphing the battery voltage as well in HA to see if the battery just drops to a certain voltage when the device disappears?

Thanks!

RubenKelevra avatar Sep 13 '24 10:09 RubenKelevra

In fact the device is under heavy sunlight and never has been under 95% for days (was at 80% at unboxing).

rdorys avatar Sep 13 '24 11:09 rdorys

Ah okay. Doesn't sound like a power issue in that case. ๐Ÿค”

Have you confirmed that the signal strength is fine? Maybe it just falls off the network because it gets wet and thus the signal strength drops?

Btw: Does the device report a battery voltage?

RubenKelevra avatar Sep 13 '24 11:09 RubenKelevra

Thx for your time. The battery is reported but I needed to manually set the reporting in the dedicated tab. image

rdorys avatar Sep 13 '24 12:09 rdorys

Hi :)

I also get no battery informations

Monosnap Zigbee2MQTT โ€“ Home Assistant โ€“ Mozilla Fi

is there any solution?

If I try to add it like that i get an error: Monosnap Zigbee2MQTT โ€“ Home Assistant โ€“ Mozilla Fi2

c4m0-lab avatar Sep 23 '24 10:09 c4m0-lab

@c4m0-lab did you try to wake the sensor (clicking shortly the pairing button) just before sending the configuration?

rdorys avatar Sep 23 '24 10:09 rdorys

no but I will do it now :)

it worked - YEAH THANKS!!!

c4m0-lab avatar Sep 23 '24 10:09 c4m0-lab

did you try to wake the sensor (clicking shortly the pairing button) just before sending the configuration?

That helped me too, thank you so much!

knuti1960 avatar Sep 23 '24 12:09 knuti1960

Is this device stable on your network? Mine seems to stop sending data for several hours at a time until I move it significantly closer to a router. Whatโ€™s odd is that I donโ€™t have to re-pair it. Once I bring it near the router (within just a few centimeters), the sensor starts working normally again, sending data every minute as expected. After that, I can put it back in its original position, and it continues to function properly for a while, but then the issue comes back.

Edit: It seems that it needs to reach directly the coordinator to be back again on the network (bringing it close to a router seemed to be close enought to send the info to the coordinator).

Same issue, is there any solution to fix it, thk.

aston668334 avatar Sep 25 '24 08:09 aston668334