dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 496 forks source link

Zigbee Solar Rain Sensor RB-SRAIN01 #7892

Open Idaho947 opened 3 weeks ago

Idaho947 commented 3 weeks ago

Is there already an existing issue for this?

Product name

Zigbee Solar Rain Sensor

Manufacturer

Tuya

Model identifier

RB-SRAIN01

Device type to add

Sensor

Node info

image

Endpoints and clusters

image

Basic

image

image

Further relevant clusters

Power Configuration

image

Scene

image

IAS Zone

image

Groups

image

More usefull information here : https://smarthomescene.com/reviews/tuya-zigbee-solar-rain-sensor-rb-srain01-review/

Smanar commented 3 weeks ago

Lol, seriously you are specialised in fucking exotic device .....

What to do with his one ....

[101, 'illuminance', tuya.valueConverter.raw] ok can use state/lightlevel

But for others

            [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],

?????

Idaho947 commented 3 weeks ago

yes, I love testing things! Most of the time I resell them but this one, a zigbee peripheral with solar power, I couldn't pass it up ^^.

I've put a link in topic 1 that explains how it works in English much better than I could. https://smarthomescene.com/reviews/tuya-zigbee-solar-rain-sensor-rb-srain01-review

it displays intensities that must then be converted in the home automation software into something that corresponds to reality.

Smanar commented 3 weeks ago

Ha yes and it's not linear, so no my job to make a good convertion, can just expose voltage. So I can use :

Edit: Arrrr, no, I can't I m forced to have a state/humity for a ZHAHumidity for exemple.

Shikaban commented 1 week ago

I have the same device, and while reading the information in raw format is possible, having it integrated into Deconz would be awesome. Is there any way I can contribute to help with this?

Smanar commented 1 week ago

But my problem is how to show the device in the API. I can't use state/voltage for a ZHAHumidity, the API is realy locked.

And not sure create 3 ZHAPower is a good thing, hard for you to reconise what is what ....

Perhaps using "ddfvalidate": false,

We have more liberty with that.

Perhaps something like

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3210_tgvtvdoc",
  "modelid": "TS0207",
  "vendor": "Tuya",
  "product": "Solar Rain Sensor",
  "sleeper": true,
  "status": "Gold",
  "ddfvalidate": false,
  "subdevices": [
    {
      "type": "$TYPE_HUMIDITY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0405"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "../tuya/tuya_swversion.js"},
          "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = (100 * Attr.val) + R.item('config/offset').val;" },
          "read": {"fn": "none"},
          "default": 0
        },
        {
          "name": "config/offset",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/voltage",
          "parse": {"fn": "tuya", "dpid": 105, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        }
      ]
    },
    {
      "type": "$TYPE_LIGHT_LEVEL_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0400"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "../tuya/tuya_swversion.js"},
          "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        },
        {
          "name": "config/offset",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/voltage",
          "parse": {"fn": "tuya", "dpid": 101, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        }
      ]
    }
  ]
}
Shikaban commented 3 days ago

Everything seams good, but I can't integrate the ddf file, it keeps failing

Idaho947 commented 1 day ago

Everything seams good, but I can't integrate the ddf file, it keeps failing

What do you mean ? It doesn't recongnize you sensor ?

Shikaban commented 1 day ago

No the sensor is inside the deconz ( I can only see him from the gui and not from phoscon ) But I've tried to load the ddf even restarting the raspberry or the service but nothing changed sensor is there but no information available.