milo526 / homebridge-tuya-web

Hoobs and Homebridge plugin for Tuya devices using Home Assistant Tuya Web Api
MIT License
217 stars 93 forks source link

Dimmer Brightness Value Error #466

Closed Marcus235 closed 1 year ago

Marcus235 commented 1 year ago

Describe the bug

I have connected two EcoDim Zigbee dimmers through a Zigbee router to Smart Life. Everything works fine, dimmers are exposed to Homekit and respond. However the Hoobs lof shows error messages for both dimmers. I have tried changing the configuration file by adding the dimmer, expose as dimmer and max value 100. The error messages disappears but now the dimmer is exposed to Homekit as a switch instead of dimmer. I've tried to leave expose field blank or expose as switch but then the error messages reappear. **Steps To Reproduce**

Plugin Version

1.1.2 **Homebridge Config**

{
    "accessories": [],
    "platforms": [
        {
            "platform": "TuyaWebPlatform",
            "name": "TuyaWebPlatform",
            "options": {
                "username": "l",
                "password": "!",
                "countryCode": "31",
                "platform": "smart_life"
            },
"defaults": [
                {
                    "id": "VW Bijkeuken",
                    "device_type": "climate",
                    "min_temper": "5.0",
                    "max_temper": "35.0",
                    "current_temperature_factor": "0.1",
                    "target_temperature_factor": "0.1"
                },
{
                    "id": "VW Badkamer",
                    "device_type": "climate",
                    "min_temper": "5.0",
                    "max_temper": "35.0",
                    "current_temperature_factor": "0.1",
                    "target_temperature_factor": "0.1"
                },
{
                    "id": "VW Douche",
                    "device_type": "climate",
                    "min_temper": "5.0",
                    "max_temper": "35.0",
                    "current_temperature_factor": "0.1",
                    "target_temperature_factor": "0.1"
                },
{
                    "id": "Dimmer",
                   "device_type": "dimmer",
                    "max_brightness": "100"
                },
                {
                    "id": "Dimmer Koen",
                    "device_type": "dimmer",
                    "max_brightness": "100"
                }
],
            "scenes": true,
            "scenesWhitelist": [
                "Eco Badkamer",
                "Program Badkamer",
                "Eco Douche",
                "Program Douche",
                "BuitenLamp",
                "Douche 18°",
                "Deken 30m OFF"
            ],
"hiddenAccessories": [
                "BuitenLamp"
            ]
        }
    ]
}

Device Config

Additional Context

Foto 16-08-2022 om 21 13

mpreissner commented 1 year ago

I'm having a similar issue, but with Feit Electric dimmer switches. Added them fine to the SmartLife app, was able to add them to Homebridge as a simple on/off switch without issue; but when enabling the dimmer option in the device settings, (using min 0, max 100) I get the following error, and dimming via Homekit doesn't work:

[30/08/2022, 08:24:25] [TuyaWebPlatform] [Deck lights] Characteristic.Brightness - Tried to set brightness but failed to parse data. 
 { online: true, state: false }

No issues dimming from the SmartLife app.

This is on Homebridge v1.5.0 with the latest Tuya Web Platform plugin.

milo526 commented 1 year ago

@Marcus235

  1. Set your dimmer to 100% brightness via the tuya app (or smart life, or a physical device, just not using homebridge/hoobs)

  2. Note the "provided tuya value" in the error logs. For @Marcus235 this will probably be 1000 for Dimmer Koen and 255 for Dimmer.

  3. Input the number you wrote down in step 2 as the max_brightness.

@mpreissner

This is a different issue, your device does not expose the required information (see the complete lack of any brightness information in the data that is logged). Your device cannot and will not be able to as a dimmer using the API that this plugin uses. Please try tuya's official plugin instead of this one.

mpreissner commented 1 year ago

@milo526 man that's disappointing. These are such great little dimmers - and really cheap at Costco!

Marcus235 commented 1 year ago

Hi,Thanks for your answer but that doesn’t solve the problem when you expose the device as dimmer which is what you have to do to fill out the max value, HomeKit sees the the device no longer as dimmer but a normal on/off switch..Kind regards,Met vriendelijke groet, Marcus BitterlingOp 30 aug. 2022 om 14:46 heeft Milo Cesar @.***> het volgende geschreven: @Marcus235

Set your dimmer to 100% brightness via the tuya app (or smart life, or a physical device, just not using homebridge/hoobs)

Note the "provided tuya value" in the error logs. For @Marcus235 this will probably be 1000 for Dimmer Koen and 255 for Dimmer.

Input the number you wrote down in step 2 as the max_brightness.

@mpreissner This is a different issue, your device does not expose the required information (see the complete lack of any brightness information in the data that is logged). Your device cannot and will not be able to as a dimmer using the API that this plugin uses. Please try tuya's official plugin instead of this one.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Marcus235 commented 1 year ago

Hi Milo

Once again. I have tried your solution and it does solve the error log but it exposes the dimmers as a switch to homekit instead of an dimmable device. I hope you have a solution for this as well. kind regards, Marcus

milo526 commented 1 year ago

@Marcus235 can you show me the config file that setting the max_brightness generated for you (be sure to remove any sensitive information)

Marcus235 commented 1 year ago

Hi Milo,

See hereunder. This is the config value generated when I change it for Dimmer Gijs and Dimmer Koen. As said before, the warning in the log ceases but now the dimmer is exposed as a switch instead of a dimmer in Homekit.

Thanks, Marcus

ConfigFile

{ "platform": "TuyaWebPlatform", "name": "TuyaWebPlatform", "options": { "username": “xxx”, "password": “xxx”, "countryCode": "31", "platform": "smart_life" }, "defaults": [ { "id": "VW Bijkeuken", "device_type": "climate", "min_temper": "5.0", "max_temper": "35.0", "current_temperature_factor": "0.1", "target_temperature_factor": "0.1" }, { "id": "VW Badkamer", "max_temper": "35.0", "current_temperature_factor": "0.1", "target_temperature_factor": "0.1" }, { "id": "Dimmer Gijs", "device_type": "dimmer", "max_brightness": "1096" }, { "id": "Dimmer Koen", "device_type": "dimmer", "max_brightness": "399" }

],
"scenes": true,
"scenesWhitelist": [
    "Eco Badkamer",
    "Program Badkamer",
    "Eco Douche",
    "Program Douche",
    "BuitenLamp",
    "Douche 18°",
    "Deken 30m OFF"
],

"hiddenAccessories": [ "BuitenLamp" ] }

Op 19 sep. 2022, om 21:32 heeft Milo Cesar @.***> het volgende geschreven:

@Marcus235 https://github.com/Marcus235 can you show me the config file that setting the max_brightness generated for you (be sure to remove any sensitive information)

— Reply to this email directly, view it on GitHub https://github.com/milo526/homebridge-tuya-web/issues/466#issuecomment-1251458525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOUSYYKNJMQUTIKT35VCXQDV7C5TLANCNFSM56XBKW3A. You are receiving this because you were mentioned.

xtian1234 commented 1 year ago

Which is the 'official' tuya plugin? I get the same max error but I cannot set max brightness in config file. Is this the official: Homebridge Tuya Platform homebridge-tuya-platform v1.5.0 (2021-11-03)

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Marcus235 commented 1 year ago

Issue still not resolved! Please do not close.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.