0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
206 stars 58 forks source link

Irrigation Valve switch shows ON in HomeKit when the valve is closed and shows OFF when the valve is opened #390

Open Mezuss opened 8 months ago

Mezuss commented 8 months ago

Prerequisite

Cache

Version

1.7.0-beta 51

Device Infomation JSON File

"appSchema": "tuyaSmart",
        "deviceOverrides": [
            {
                "id": "xxxxxxxxxxxxxxxxxxxxxxxxx",
                "unbridged": false,
                "schema": [
                    {
                        "code": "LeftManualSwitch",
                        "newCode": "switch",
                        "type": "Boolean"
                    },
                    {
                        "code": "RightManualSwitch",
                        "newCode": "switch_1",
                        "type": "Boolean"
                    }

Device Control Mode

DP Instruction

Logs

No response

Other Infomations

When I close the valve it shows opened on HomeKit and when I open it it shows closed. Is there a way to reverse the ON/OFF logic of the switch with the OPEN/CLOSE state of the valve? Thank you

MacForAll commented 8 months ago

Same for ggq, where I use this solution:

"onGet": "(value === true) ? false : true;",                                 "onSet": "(value === false) ? true : false;"

Mezuss commented 8 months ago

Same for ggq, where I use this solution:

"onGet": "(value === true) ? false : true;",                                 "onSet": "(value === false) ? true : false;"

Where did you add the lines? On JSON config ?