0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
217 stars 66 forks source link

Help with Schema for Cover (Door) #194

Open livefeed opened 1 year ago

livefeed commented 1 year ago

Can someone please help with getting a Door Opener working, I read the Support info and Changed to DP but I have no clue what I need to put in for schema.

Screenshot 2023-01-03 at 1 18 02 PM
0x5e commented 1 year ago

You need to find the boolean schema which represents for "target door state", and "rename" it to "switch_1". the log is incomplete and I didn't see any boolean schema

livefeed commented 1 year ago

Thank you for the reply, I am no coder!

I have this in my config;

    "deviceOverrides": [
        {
            "id": "eb08fcc9017ade?????eco",
            "schema": [
                {
                    "oldCode": "doorstate",
                    "code": "switch_1",
                    "type": "Boolean"
                },
                {
                    "oldCode": "open",
                    "code": "switch_2",
                    "type": "Boolean"
                },
                {
                    "oldCode": "closedoor",
                    "code": "switch_3",
                    "type": "Boolean"
                }
Movieaholic commented 1 year ago

I Brought a Air Quality Monitor that is asking for the required Schema [ 'switch' ]. I'm not a Programmer either but i was going to try and work it out my self I'm glad i saw this i was thinking i had to hide all the sensors that aren't compatible with homekit but I'm still not sure what boolean schema it requires as none of the sensors are either one state or another they are all ranges from one point to another
Screenshot_20230105_025601

0x5e commented 1 year ago

What's your product code of Air Quality Monitor? @Movieaholic

@livefeed No need to writing code, just writing a config file, but you need to confirm which DP code can control your door open&close, this can be figured out with tuya web device debugging tool.

Movieaholic commented 1 year ago

Is this it from inside the device list saved at /var/lib/homebridge/persist/TuyaDeviceList.az.json

"product_id": "e5sihrsiszirhljp", "product_name": "multi-function-timer-air monitor",

0x5e commented 1 year ago

My typo, I mean product category code, which is category @Movieaholic

Movieaholic commented 1 year ago

In the Tuya iot platform debug menu it says is kj

0x5e commented 1 year ago

In the Tuya iot platform debug menu it says is kj

kj is Air Purifier. change it to code pm25 should work.

Movieaholic commented 1 year ago

Ended up getting Most of the sensors i could out of it thanks for your help again these pages also helped https://developer.tuya.com/en/docs/iot/s?id=K9gf48r2l6s0y https://us.iot.tuya.com/cloud/explorer?id=p16291988737709ejxxf&groupId=group-controll&interfaceId=1372847888740126700 Just had one question, the pm2.5 sensor supports CO2 detection and so does home kit and the values are almost the same apart from the values min 400 max 5000 vs min 0 max 1000 also scale 0 vs 1 is this able to be mapped correctly? { "code": "eco2", "name": "eCO2", "type": "Integer", "values": "{\"unit\":\"ppm\",\"min\":400,\"max\":5000,\"scale\":0,\"step\":1}" }, For My device and co2_value | CO2 detection value | Integer | {“unit”:“ppm”,“min”:0,“max”:1000,“scale”:1,“step”:1} for the standard status set

livefeed commented 1 year ago

@0x5e Within the tuya web device debugging tool I get function not supported as seen here.

Screenshot 2023-01-09 at 3 11 41 PM
livefeed commented 1 year ago

I just can't get my head around this, @0x5e could I please ask you to login to my machine to help me?