milo526 / homebridge-tuya-web

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

[Accessory Request] Cover accessory #18

Open Fannangir opened 4 years ago

Fannangir commented 4 years ago

Hi, After moving from vitramirs fork to this one, I receive the following messages:

[TuyaWebPlatform] Could not init class for device type [cover]

My cover devices do not work

milo526 commented 4 years ago

Not an exact date but it should not be more than a few days after somebody makes a pull request or sponsors me so I can buy a Tuya cover accessory and create it myself 😄.

Where you able to test if the @next release works for you? So far as that it doesn't crash.

Fannangir commented 4 years ago

Understood. Thought it might help, or at least provide any clue. Good luck :).

milo526 commented 4 years ago

Just receive this data from somebody using the covers, if you yourself have some Tuya cover devices and want support please also drop your device config here!

{
   "header":{
      "code":"SUCCESS",
      "payloadVersion":1
   },
   "payload":{
      "devices":[
         {
            "data":{
               "online":True,
               "state":3,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaeu.com/smart/product_icon/cl.png",
            "id":"42787240807d3a010626",
            "name":"Curtain2"
         },
         {
            "data":{
               "online":True,
               "state":3,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaeu.com/smart/product_icon/cl.png",
            "id":"427872402462ab0a7685",
            "name":"Name0"
         },
         {
            "data":{
               "online":True,
               "state":3,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaeu.com/smart/product_icon/cl.png",
            "id":"42787240807d3a01048c",
            "name":"Name1"
         },
         {
            "data":{
               "online":True,
               "state":3,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaeu.com/smart/product_icon/cl.png",
            "id":"427872402462ab0aac7e",
            "name":"Name2"
         },
         {
            "data":{
               "online":True,
               "state":3,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaeu.com/smart/product_icon/cl.png",
            "id":"42787240a4cf12d3be9b",
            "name":"Name3"
         }
      ],
      "scenes":[

      ]
   }
}
Aekung commented 4 years ago

Hi,

I posted in another thread but I am posting it here once again for the device config. Hopefully it would help.

{
   "header":{
      "code":"SUCCESS",
      "payloadVersion":1
   },
   "payload":{
      "devices":[
         {
            "data":{
               "online":True,
               "state":3,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/product_icon/cl.png",
            "id":"52003233ecfabca9fdce",
            "name":"Window Cover for Front Door"
         },
         {
            "data":{
               "online":True,
               "state":3,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/product_icon/cl.png",
            "id":"10670875bcddc2b0e398",
            "name":"Window Cover for Garden"
         },
         {
            "data":{
               "online":True,
               "state":2,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/program_category_icon/cl.png",
            "id":"630777045002914b3123",
            "name":"Window Cover for Home Theater"
         }
      ],
      "scenes":[

      ]
   }

Let me know if I missed something or you want me to do something more.

milo526 commented 4 years ago

My house still does not have any Tuya cover devices, this makes it hard for me to develop for this accessory. Therefor the first part of this comment still applies 😉.

I hope you understand that the motivation to make something is severely reduced if the creator cannot enjoy the fruits of their labour. Not to say that I will never add support for this device but with the current setup it will take quite some time and I will require a lot of help from people who do have a cover accessory.

Pelagious commented 4 years ago

I have a cover device that I would be interested in testing for. I would really like to see cover support added. My config is below, (at the moment I'm overriding the default to make it behave as a switch, which is irritating because it is stateless switch and I can't make it stateful)


{
    "bridge": {
        "name": "Homebridge XXXX",
        "username": "xxxxxxx",
        "port": xxxxxx,
        "pin": "xxx-xx-xxx"
    },
    "accessories": [
        {
            "accessory": "SwitchBot",
            "name": "Basement Fan",
            "macAddress": "xxxxxxxxxx",
            "stateLess": false
        },
        {
            "name": "Dummy switch 1",
            "stateful": true,
            "reverse": false,
            "time": 1000,
            "accessory": "DummySwitch"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 8085,
            "auth": "form",
            "theme": "dark-mode",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config",
            "sudo": true,
            "log": {
                "method": "native",
                "path": "/var/lib/homebridge/homebridge.log"
            },
            "sessionTimeout": 28800
        },
        {
            "name": "TuyaWebPlatform",
            "options": {
                "username": "xxxxxxxxxx",
                "password": "xxxxxxxxxxx",
                "countryCode": "1",
                "platform": "tuya"
            },
            "defaults": [
                {
                    "id": "xxxxxxxxxxxxxx",
                    "device_type": "switch"
                }
            ],
            "scenes": true,
            "platform": "TuyaWebPlatform"
        }
    ]
}
milo526 commented 4 years ago

@Pelagious Hello and thank you for your interest in this plugin, could you please enable debugging in homebridge and upload the debug logs?

Pelagious commented 4 years ago

Sure, operating off of phone. Let me know if I need to repost this properly from a computer for better formatting

[8/14/2020, 11:43:49] [Config] Homebridge restart request received 
[8/14/2020, 11:43:50] [Config] No restart command defined, killing process... 
[8/14/2020, 11:43:50] [HB Supervisor] Stopping services... 
[8/14/2020, 11:43:50] Got SIGTERM, shutting down Homebridge... 
[8/14/2020, 11:43:55] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null 
[8/14/2020, 11:44:02] [HB Supervisor] OS: Linux 5.4.51-v7l+ arm 
[8/14/2020, 11:44:02] [HB Supervisor] Node.js v12.18.2 /usr/local/bin/node 
[8/14/2020, 11:44:02] [HB Supervisor] Homebridge Path: /usr/local/lib/node_modules/homebridge/bin/homebridge 
[8/14/2020, 11:44:02] [HB Supervisor] UI Path: /usr/local/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js 
[8/14/2020, 11:44:02] [HB Supervisor] Starting Homebridge with extra flags: -I -D 
[8/14/2020, 11:44:02] [HB Supervisor] Started Homebridge v1.1.2 with PID: xxxx 
[8/14/2020, 11:44:03] Loaded config.json with 2 accessories and 2 platforms. 
[8/14/2020, 11:44:03] --- 
[8/14/2020, 11:44:04] Loaded plugin: homebridge-config-ui-x@4.25.2 
[8/14/2020, 11:44:04] Registering platform 'homebridge-config-ui-x.config' 
[8/14/2020, 11:44:04] --- 
[8/14/2020, 11:44:04] Loaded plugin: homebridge-dummy@0.4.1 
[8/14/2020, 11:44:04] Registering accessory 'homebridge-dummy.DummySwitch' 
[8/14/2020, 11:44:04] --- 
[8/14/2020, 11:44:06] [Config] Homebridge Config UI X v4.25.2 is listening on :: port 8085 
[8/14/2020, 11:44:05] Loaded plugin: homebridge-ifttt@0.4.1 
[8/14/2020, 11:44:05] Registering platform 'homebridge-ifttt.IFTTT' 
[8/14/2020, 11:44:05] --- 
[8/14/2020, 11:44:05] Loaded plugin: homebridge-switchbot-plus@0.2.1 
[8/14/2020, 11:44:05] Plugin 'homebridge-switchbot-plus' tried to register with an incorrect plugin identifier: 'homebridge-switchbot'. Please report this to the developer! 
[8/14/2020, 11:44:05] Registering accessory 'homebridge-switchbot-plus.SwitchBot' 
[8/14/2020, 11:44:05] --- 
[8/14/2020, 11:44:05] Loaded plugin: @milo526/homebridge-tuya-web@0.4.3 
[8/14/2020, 11:44:05] Registering platform '@milo526/homebridge-tuya-web.TuyaWebPlatform' 
[8/14/2020, 11:44:05] --- 
[8/14/2020, 11:44:05] Loading 2 platforms... 
[8/14/2020, 11:44:05] [Config] Initializing config platform... 
[8/14/2020, 11:44:05] [Config] Running in Service Mode 
[8/14/2020, 11:44:05] [TuyaWebPlatform] Initializing TuyaWebPlatform platform... 
[8/14/2020, 11:44:05] [TuyaWebPlatform] Finished initializing platform: TuyaWebPlatform 
[8/14/2020, 11:44:05] Loading 2 accessories... 
[8/14/2020, 11:44:05] [Basement Fan] Initializing SwitchBot accessory... 
[8/14/2020, 11:44:05] [Dummy switch 1] Initializing DummySwitch accessory... 
[8/14/2020, 11:44:05] [Dummy switch 1] Setting switch to true 
[8/14/2020, 11:44:05] [TuyaWebPlatform] Loading accessory from cache: Open the kitchen blinds 
[8/14/2020, 11:44:05] [TuyaWebPlatform] Loading accessory from cache: Close the kitchen blinds 
[8/14/2020, 11:44:05] [TuyaWebPlatform] Loading accessory from cache: Kitchen blinds 
[8/14/2020, 11:44:05] [TuyaWebPlatform] Requesting new token Setup Payload: X-HM://0024IAFNVHE8E Enter this code with your HomeKit app on your iOS device to pair with Homebridge: ┌────────────┐ │ xxx-xx-xxx │ └────────────┘ 
[8/14/2020, 11:44:05] Homebridge is running on port 51202. 
[8/14/2020, 11:44:06] [TuyaWebPlatform] Sending HTTP GET request to /homeassistant/skill. 
[8/14/2020, 11:44:07] [TuyaWebPlatform] Device type for "Kitchen blinds " is overruled in config to: "scene" 
[8/14/2020, 11:44:07] [TuyaWebPlatform] [Kitchen blinds ] deviceConfig: { data: { support_stop: true, online: true, state: 1 }, name: 'Kitchen blinds ', icon: 'https://images.tuyaus.com/smart/program_category_icon/cl.png', id: '20406812807d3a04b6a0', dev_type: 'scene', ha_type: 'cover' } 
[8/14/2020, 11:44:07] [TuyaWebPlatform] Existing Accessory found [Name: Kitchen blinds ] [Tuya ID: xxxxxxxxxxxxxxxxxxx] [HomeBridge ID: 39d7a6d1-f4e3-4982-8422-6c13acfc1afb] 
[8/14/2020, 11:44:07] [TuyaWebPlatform] [Kitchen blinds ] Characteristic.MomentaryOn - Enabled 
[8/14/2020, 11:44:07] [TuyaWebPlatform] [Open the kitchen blinds ] deviceConfig: { data: {}, name: 'Open the kitchen blinds ', id: 'YZrLjxfJfGRP8a0w', dev_type: 'scene', ha_type: 'scene' } 
[8/14/2020, 11:44:07] [TuyaWebPlatform] Existing Accessory found [Name: Open the kitchen blinds ] [Tuya ID: YZrLjxfJfGRP8a0w] [HomeBridge ID: 208961e4-5dae-4728-a734-5a87014216f1] 
[8/14/2020, 11:44:07] [TuyaWebPlatform] [Open the kitchen blinds ] Characteristic.MomentaryOn - Enabled 
[8/14/2020, 11:44:07] [TuyaWebPlatform] [Close the kitchen blinds ] deviceConfig: { data: {}, name: 'Close the kitchen blinds ', id: 'smq7QNNUAva2mPE2', dev_type: 'scene', ha_type: 'scene' } 
[8/14/2020, 11:44:07] [TuyaWebPlatform] Existing Accessory found [Name: Close the kitchen blinds ] [Tuya ID: smq7QNNUAva2mPE2] [HomeBridge ID: cf40e473-e9a7-4eb4-b823-4dca19d41326] 
[8/14/2020, 11:44:07] [TuyaWebPlatform] [Close the kitchen blinds ] Characteristic.MomentaryOn - Enabled 
[8/14/2020, 11:44:15] 
Pelagious commented 4 years ago

Let me know if you need me to do config changes. I'm currently running the blinds as a switch-scene and imported the tuya scenes for opening and closing the blinds, since for whatever reason, when I override the blinds from a cover to a switch it is irritatingly stateless. Which really ruins a lot of automations

milo526 commented 3 years ago

I will probably have some time coming week to look at this. I need somebody with a cover accessory who can run some tests for me, if you feel like doing so please express that in this issue or even better in the #tuya-web channel on the homebridge discord.

Some of the questions I am struggling with assuming the following data for example:

{
  "online":true,
  "state":3,
  "support_stop":true
},

1) Will we be able to read the status of the covers? i.e. if they are open, opening, closed, closing, how far are they opened? etc. I strongly suspect the state parameter in this request has something to do with this. 2) Will we be able to set a status for the covers to only have them open a certain percentage.

To implement this I will at least need to know the current position of the covers (how far openend), their target position (this will need to be set), their "state" (opening, closing, stopped) and I will probably need to implement the hold position property to allow you'll to stop the covers half way through their motion (but what do we report as state then?)

So if you have a cover accessory, want support for it in this library, have some technical know-how (preferably able to run python scripts) and have some time available in the next week please reach out (preferably through discord, otherwise respond to this comment)! If you are not in the above mentioned group and still would like to see support for the window cover added, please consider donating to this library so I can buy a tuya powered window cover and test it locally!

costispavlou commented 3 years ago

vitramir/homebridge-tuya-web version which had that support was not having states or anything. It was working practically like an Up / Down / Stop-Pause Should the cover be open - status was Open Should the cover be closed - status was closed Should the cover be stopped at any point while open/close - status was 50% Open

As for question 2, I don't think that would be necessary for any one of us having these type of covers as each cover/shutter etc has a different speed for open / close. Therefore it would need some recalibration and all. However I don't see how this couldn't be done in the sense of: [if cover closed] and command [75% open] then open for 5 seconds, then stop/pause. (provided that the user would have the capability of entering these variables.

taaa22 commented 3 years ago

Please support cover device

{
   "header":{
      "code":"SUCCESS",
      "payloadVersion":1
   },
   "payload":{
      "devices":[
         {
            "data":{
               "online":true,
               "state":2,
               "support_stop":true
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaeu.com/smart/program_category_icon/cl.png",
            "id":"31381150cc50e3ff0586",
            "name":"Chain Controller"
         }
      ]
   }
}
Yayaa10 commented 3 years ago

Hello, I'm very interested to use tuya cover switch through homebridge. I have try to use the the this advanced configurations.

This is my configuration for Tuya devices:

    {
        "platform": "TuyaWebPlatform",
        "name": "TuyaWebPlatform",
        "options": {
            "username": "XXXXXXXXXXXXXXXXXXX",
            "password": "XXXXXXXXXXXXXXXXXXX",
            "countryCode": "33",
            "platform": "smart_life"
        },
        "defaults": [
            {
                "header": {
                    "code": "SUCCESS",
                    "payloadVersion": 1
                },
                "payload": {
                    "devices": [
                        {
                            "data": {
                                "online": true,
                                "state": 3,
                                "support_stop": true
                            },
                            "dev_type": "cover",
                            "ha_type": "cover",
                            "icon": "https://images.tuyaus.com/smart/product_icon/cl.png",
                            "id": "XXXXXXXXXXXXXXXXXXX",
                            "name": "Window Cover for Front Door"
                        },
                        {
                            "data": {
                                "online": true,
                                "state": true
                            },
                            "dev_type": "switch",
                            "ha_type": "switch",
                            "icon": "https://images.tuyaus.com/smart/program_category_icon/kg.png",
                            "id": "XXXXXXXXXXXXXXXXXXX",
                            "name": "Bedroom Light"
                        }
                    ]
                }
            }
        ],
        "scenes": []
    }

And the result of the log: [2020-10-24 22:17:14] [TuyaWebPlatform] Initializing TuyaWebPlatform platform... [2020-10-24 22:17:14] [TuyaWebPlatform] Finished initializing platform: TuyaWebPlatform [2020-10-24 22:17:14] [TuyaWebPlatform] Loading accessory from cache: Smart socket [2020-10-24 22:17:14] [TuyaWebPlatform] Requesting new token [2020-10-24 22:17:14] [TuyaWebPlatform] Sending HTTP GET request to /homeassistant/skill - Header: {"name":"Discovery","namespace":"discovery","payloadVersion":1}. [2020-10-24 22:17:14] [TuyaWebPlatform] Missing required id property on device type overwrite, received: { "header": { "code": "SUCCESS", "payloadVersion": 1 }, "payload": { "devices": [ { "data": { "online": true, "state": 3, "support_stop": true }, "dev_type": "cover", "ha_type": "cover", "icon": "https://images.tuyaus.com/smart/product_icon/cl.png", "id": "XXXXXXXXXXXXXXXXXXX", "name": "Window Cover for Front Door" }, { "data": { "online": true, "state": true }, "dev_type": "switch", "ha_type": "switch", "icon": "https://images.tuyaus.com/smart/program_category_icon/kg.png", "id": "XXXXXXXXXXXXXXXXXXX", "name": "Bedroom Light" } ] } } [2020-10-24 22:17:14] [TuyaWebPlatform] Could not init class for device type [cover] [2020-10-24 22:17:14] [TuyaWebPlatform] [Smart socket] deviceConfig: { data: { online: true, state: false }, name: 'Smart socket', icon: 'https://images.tuyaeu.com/smart/icon/152956414744qw5qx565_0.jpg', id: 'XXXXXXXXXXXXXXXXXXX', dev_type: 'switch', ha_type: 'switch' }

Can you help me to fix the config for cover device ?

tbbruno commented 3 years ago

I also would love cover support. I'm not very familiar with Python, but I'm available to help and for testing if needed. Here's the payload for my device:

{
   "header":{
      "code":"SUCCESS",
      "payloadVersion":1
   },
   "payload":{
      "devices":[
         {
            "data":{
               "online":True,
               "state":2,
               "support_stop":True
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/program_category_icon/cl.png",
            "id":"31381150cc50e3ff03d0",
            "name":"Bedroom blinds"
         },
         {
            "data":{

            },
            "dev_type":"scene",
            "ha_type":"scene",
            "id":"WNW3SnShz6hOK6qC",
            "name":"If Schedule:6:05 PM ""Weekday,\\\"Bedroom blinds\\\" ""Control:Open"
         }
      ],
      "scenes":[

      ]
   }
}

For the time being, if some else is interested, I got it to partially work by changing the device type in the home-bridge config file to switch. Then it shows as "on" when the curtain is opened and "off" when the curtain is closed. Far from ideal (specially with open curtain always showing as an "active" device in the home app), but does the job.

milo526 commented 3 years ago

@josephpoon0506 please follow this issue for updates on cover support.

josephpoon0506 commented 3 years ago

@josephpoon0506 please follow this issue for updates on cover support.

thanks @milo526

josephpoon0506 commented 3 years ago

Hi, this is the result from my device

Got devices

{
   "header":{
      "code":"SUCCESS",
      "payloadVersion":1
   },
   "payload":{
      "devices":[
         {
            "data":{
               "online":true
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/icon/ay1521165954459sVl6M/1592464776d5b3dbf1e85.png",
            "id":"855210025002915b8487",
            "name":"窗簾"
         },
         {
            "data":{
               "online":true
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/icon/ay1521165954459sVl6M/1592464776d5b3dbf1e85.png",
            "id":"855210025002915b6d67",
            "name":"細廳窗簾"
         },
         {
            "data":{
               "online":true
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/icon/ay1521165954459sVl6M/1592464776d5b3dbf1e85.png",
            "id":"855210025002915b6d70",
            "name":"大廳窗簾"
         },
         {
            "data":{
               "online":true
            },
            "dev_type":"cover",
            "ha_type":"cover",
            "icon":"https://images.tuyaus.com/smart/icon/ay1521165954459sVl6M/1592464776d5b3dbf1e85.png",
            "id":"855210025002915b6d8a",
            "name":"窗簾"
         }
      ],
      "scenes":[

      ]
   }
}
ksxi2 commented 3 years ago

Hi all, sorry bit of a novice on GitHub so please mind my errors.

I've just purchased the Zemismart TM25TQ Roller Blind Motor (WiFi).

I know that 'cover' devices are not supported but I would love to help where I can to get it supported.

Is there anything I can do?

Edit: Again, I apologise if this has already been said or whatever lol

taaa22 commented 3 years ago

Dear @milo526 thank you for your effort to keep this plugin one of the best plugins in the homebridge.

Any update on supporting cover accessory?

milo526 commented 3 years ago

Hey all;

pre-release version v0.5.4 might bring you a little Christmas gift 😉

Could you please check It out and report if it works for you?

ksxi2 commented 3 years ago

How does a n00b like me install this? I'm ready to test :)

taaa22 commented 3 years ago

Dear @milo526, Thank you for the Christmas gift 😉

I have 2 types of cover accessory, Unfortunately, both are not shown.

milo526 commented 3 years ago

How does a n00b like me install this? I'm ready to test :)

Please see the homebridge wiki on this topic

milo526 commented 3 years ago

Dear @milo526, Thank you for the Christmas gift 😉

I have 2 types of cover accessory, Unfortunately, both are not shown.

Thats too bad but I might need a little more information than this to help you 😛 Could you provide me with the log output after you rebooted the plugin.

taaa22 commented 3 years ago

[12/20/2020, 20:53:22] [TuyaWebPlatform] Could not init class for device type [cover]

taaa22 commented 3 years ago
 devices: [   {   'data': {   'online': True,
                                                  'state': 2,
                                                  'support_stop': True},
                                      'dev_type': 'cover',
                                      'ha_type': 'cover',
                                      'icon': 'https://images.tuyaeu.com/smart/program_category_icon/cl.png',
                                      'id': '31381150cc50e3ff0586',
                                      'name': 'Rolling Curtain'},
                                  {   'data': {   'online': True,
                                                  'state': 1,
                                                  'support_stop': True},
                                      'dev_type': 'cover',
                                      'ha_type': 'cover',
                                      'icon': 'https://images.tuyaeu.com/smart/icon/1524640833egsjpb7nrnnczo9gn5xez5mi_0.png',
                                      'id': '71000544d8bfc0131655',
                                      'name': 'Main Curtain'} ] 
ksxi2 commented 3 years ago

When using Device_Type: Dimmer with Brightness, it sort of works (it makes the motor move but I dont think I have full control)

When forcing the device_type = cover I get: [20/12/2020, 17:36:21] [TuyaWebPlatform] Tried overwriting device config for: "zemismart curtain motor" - device-type "cover" is not a valid device-type. [20/12/2020, 17:36:21] [TuyaWebPlatform] Could not init class for device type [cover]

costispavlou commented 3 years ago

Hey all;

pre-release version v0.5.4 might bring you a little Christmas gift 😉

Could you please check It out and report if it works for you?

is the pre-release up yet? where can I test it?

milo526 commented 3 years ago

Sorry for that; I might have slightly messed up my releases 😝 Will be fixed shortly!

costispavlou commented 3 years ago

awesome. let us know 👍

taaa22 commented 3 years ago

Cannot wait for the best Christmas gift 😄

Thanks a bunch.

sybrendotinga commented 3 years ago

Same here. Installed v0.5.4. Result:

Could not init class for device type [cover]
costispavlou commented 3 years ago

Same here. Installed v0.5.4. Result:

Could not init class for device type [cover]

how did you installed 0.5.4 ?

milo526 commented 3 years ago

Version 0.6.0 is rolling out as we speak.

Please test that version instead of v0.5.4 😄

taaa22 commented 3 years ago

It works like a charm 😍, for both types of my cover.

I noted that it doesn't support a percentage opening so it is either fully open or close.

milo526 commented 3 years ago

It works like a charm 😍, for both types of my cover.

I noted that it doesn't support a percentage opening so it is either fully open or close.

Great to hear!

Yeah currently it is only open or close.

Hopefully soon I will be able to add the "stop" option. that should enable you to stop it halfway through opening and/or closing.

Don't expect the ability to open a certain percentage to be available anytime soon, this is not supported by the API updating the plugin to support this will require a significant amount of time sadly.

taaa22 commented 3 years ago

Thank you again.

With more testing I found that when you close the cover it gives you the correct status as it is showing in the first image.image

But after sometimes when I open the app again I found it like the following image image

sybrendotinga commented 3 years ago

how did you installed 0.5.4 ?

If you ask this, you'd better not install an "alpha" release. This is pre-production stage. But, if you really "dare". Take a look at this:

Please see the homebridge wiki on this topic

sybrendotinga commented 3 years ago

Don't expect the ability to open a certain percentage to be available anytime soon, this is not supported by the API updating the plugin to support this will require a significant amount of time sadly.

I was already afraid you'd say that. Looked at the code myself, and saw no real "quick" approach in implementing it.

milo526 commented 3 years ago

Don't expect the ability to open a certain percentage to be available anytime soon, this is not supported by the API updating the plugin to support this will require a significant amount of time sadly.

I was already afraid you'd say that. Looked at the code myself, and saw no real "quick" approach in implementing it.

Yeah what I suspect to be the best way would be - allow users to define how many seconds it takes to open or close. And based on the percentage (or difference in percentage) perform the open (or close) action for a certain amount of time.

Which is freaking ugly

costispavlou commented 3 years ago

i'll wait until you roll the update out, since i'm using hoobs. also as regard the % open / close, yeah that'd be great. why would that be ugly? I mean, it's up to the user from there on.

bwp91 commented 3 years ago

Don't expect the ability to open a certain percentage to be available anytime soon, this is not supported by the API updating the plugin to support this will require a significant amount of time sadly.

I was already afraid you'd say that. Looked at the code myself, and saw no real "quick" approach in implementing it.

Yeah what I suspect to be the best way would be - allow users to define how many seconds it takes to open or close. And based on the percentage (or difference in percentage) perform the open (or close) action for a certain amount of time.

Which is freaking ugly

i have implemented this ugly method in my ewelink plugin. if you wanted some code 😅

milo526 commented 3 years ago

i'll wait until you roll the update out, since i'm using hoobs. also as regard the % open / close, yeah that'd be great. why would that be ugly? I mean, it's up to the user from there on.

Yeah it's up to the user from there on. This whole plugin is a giant mess 🙈.

And one way or another the questions always end up here 😛 and I am mostly the one to answer them and fix the issues.

The proposed solution is very wonky at best, I suspect that it will trigger a lot of errors, bugs, unhappy users.

I'd rather take the "Apple approach" of giving the users a little less flexibility but a better experience.

costispavlou commented 3 years ago

i get that, but you could add the implementation and let the user play with it a bit. i mean how bad can it be i.e. 0 (infinite) seconds up / 0 seconds down as default and can be edited in the plugins settings if needed.

lastly when are you planning to roll the update? today? tomorrow ? no rush, just asking.

josephpoon0506 commented 3 years ago

It works like a charm 😍, for both types of my cover. I noted that it doesn't support a percentage opening so it is either fully open or close.

Great to hear!

Yeah currently it is only open or close.

Hopefully soon I will be able to add the "stop" option. that should enable you to stop it halfway through opening and/or closing.

Don't expect the ability to open a certain percentage to be available anytime soon, this is not supported by the API updating the plugin to support this will require a significant amount of time sadly.

@milo526, Thank you for your effort, but my curtain still not work. it show the below error message. it still not able to get the currect position status. Or

[12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] - Unsetting debouncedDeviceStateRequestPromise [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] - Resolving resolveDeviceStateRequest from cache [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.CurrentPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.CurrentPosition - Updating value { online: true } [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.CurrentPosition - Unexpected state value provided: undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.TargetPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.TargetPosition - Unexpected state value provided: undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [細窗簾] - Unsetting debouncedDeviceStateRequestPromise [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [細窗簾] - Resolving resolveDeviceStateRequest from cache [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [細窗簾] Characteristic.CurrentPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [細窗簾] Characteristic.CurrentPosition - Updating value { online: true } [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [細窗簾] Characteristic.CurrentPosition - Unexpected state value provided: undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [細窗簾] Characteristic.TargetPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [細窗簾] Characteristic.TargetPosition - Unexpected state value provided: undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [大窗簾] - Unsetting debouncedDeviceStateRequestPromise [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [大窗簾] - Resolving resolveDeviceStateRequest from cache [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [大窗簾] Characteristic.TargetPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [大窗簾] Characteristic.TargetPosition - Unexpected state value provided: undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [大窗簾] Characteristic.CurrentPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [大窗簾] Characteristic.CurrentPosition - Updating value { online: true } [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [大窗簾] Characteristic.CurrentPosition - Unexpected state value provided: undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] - Unsetting debouncedDeviceStateRequestPromise [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] - Resolving resolveDeviceStateRequest from cache [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.TargetPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.TargetPosition - Unexpected state value provided: undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.CurrentPosition - [GET] undefined [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.CurrentPosition - Updating value { online: true } [12/21/2020, 7:55:39 AM] [TuyaWebPlatform] [窗簾] Characteristic.CurrentPosition - Unexpected state value provided: undefined

ksxi2 commented 3 years ago

Cover works on 0.6.3! Only have the option to open and close the cover. Would love to have the option to open the cover half way or something like that! Any possibility? The Tuya app has the option, I think the Home Assistant thing had the option, although idk if the API has it

costispavlou commented 3 years ago

@milo526 can you let me know when you're planning to update the plugin on hoobs? still shows the 0.4.8 as of today

milo526 commented 3 years ago

Cover works on 0.6.3! Only have the option to open and close the cover. Would love to have the option to open the cover half way or something like that! Any possibility? The Tuya app has the option, I think the Home Assistant thing had the option, although idk if the API has it

Please read the rest of this thread 😉 We already discussed that this is unlikely to happen soon.

@costispavlou there is no reason to ask this so often. Please remember that I am working on this alone, voluntarily, in my free time. But just so you know, it was just release, it will probably take a day to show up in hoobs.

ksxi2 commented 3 years ago

Please read the rest of this thread 😉 We already discussed that this is unlikely to happen soon.

My bad, thank you! I appreciate you working on this plugin!

costispavlou commented 3 years ago

@milo526 apologies if my comment sounded pushy. I was only wondering. I know and appreciate the effort you've put in this.