treban / pimatic-raspbee

This plugin provides a raspbee interface for pimatic.
GNU General Public License v2.0
5 stars 5 forks source link

Support for ZHAHumidity / ZHATemperature sensors #4

Closed treban closed 6 years ago

treban commented 6 years ago

Implement sensor devices see

mwittig commented 6 years ago

This sensor appears as three sensors on the network. Ideally, it would be nice to have this as a single logical device in pimatic, i.e., a MultiSensor similar to what pimatic-mysensors provides with MySensorsMulti. Additionally, it would be nice to allow for the discovery to automatically detect the multi sensor. That is the tricky bit. Apparently, the grouping could be achieved by using the "etag" property or a prefix of "uniqueid" as suggested in #57.

Temperatue (Original Xiaomi):

{
    "config": {
        "on": true,
        "reachable": true
    },
    "ep": 1,
    "etag": "baceb383ac8e25019e439fea82ed501e",
    "manufacturername": "LUMI",
    "modelid": "lumi.sensor_ht",
    "name": "Temperature",
    "state": {
        "lastupdated": "2017-08-05T11:03:18",
        "temperature": 2411
    },
    "swversion": "3000-0001",
    "type": "ZHATemperature",
    "uniqueid": "00:15:8d:00:##:##:##:##-01-0402"
}

Humidity (Original Xiaomi, part of the temperature sensor, so it has the same prefix in uniqueid as the temperature sensor):

{
    "config": {
        "on": true,
        "reachable": true
    },
    "ep": 1,
    "etag": "baceb383ac8e25019e439fea82ed501e",
    "manufacturername": "LUMI",
    "modelid": "lumi.sensor_ht",
    "name": "Humidity",
    "state": {
        "humidity": 5624,
        "lastupdated": "2017-08-05T11:03:18"
    },
    "swversion": "3000-0001",
    "type": "ZHAHumidity",
    "uniqueid": "00:15:8d:00:##:##:##:##-01-0405"
}
sweebee commented 6 years ago

I've added devices for every value right now in #9.

We can later add a multi sensor and check the modelid and can check with that which values it supports.

like the lumi.sensor_ht supports only temperature and humidity, but the lumi.weather supports temperature, humidity and pressure.

with the uniqueid or etag we could combine them.

if the model.id is not known, it will fallback on the base sensor devices.

sweebee commented 6 years ago

YESS got it working, te latest commits in my pull request.

Multisensor for temperature, humidity and pressure Motion sensor also shows lux if supported

treban commented 6 years ago

implemented