zigbeefordomoticz / z4d-certified-devices

GNU General Public License v3.0
4 stars 6 forks source link

[Model Certification] - MOES Star Ring Curtain Switch #71

Open adruet29 opened 3 months ago

adruet29 commented 3 months ago
  1. Please do provide device information such as Brand and Model name.

  2. Provide the URL where you have purchase the device

  3. Document as much what works, what doesn't work, what do you miss, what do you need: In the zigbee plugin I go to Tools \ command, I can select the object as a router but no command is present in the drop down list which displays "no items found".

  4. Got to the Tools Menu

  5. Select Plugin Raw Devices (json)

  6. Export

This will create an export.json file that you can save.

Thank you !

pipiche38 commented 3 months ago

can you please switch to a development branch

git pull
git checkout wip-stable7-7.1.13
sudo python3 -m pip install -r requirements.txt --upgrade

restart plugin

remove the existing pairing, in order to redo the Curtain switch pairing from scratch (make sure that no remaining widgets in Domoticz, and no device in the plugin)

Then redo the pairing

adruet29 commented 3 months ago

I did as requested: git pull git checkout wip-stable7-7.1.13 sudo python3 -m pip install -r requirements.txt --upgrade Then restarted the plugin, removed the device from the plugin (it was not created in domoticz).

But it does not work.

The device is still not optimized. In Domoticz I get the error: 2024-08-16 11:35:32.427 Error: Zigate: NXP_Extended_Error_Code - Extended Error Code: [80] No free NPDUs (resource error) - the number of NPDUs is set in the Number of NPDUs property of the PDU Manager section of the ZPS Configuration Editor 2024-08-16 11:35:52.066 Error: Zigate: processNotinDBDevices - Creat Domo Device Failed !!! for f815 status: 8043

The weird thing is that if I do a git show from my plugin directory I do see that I am on wip-stable7-7.1.13, but the plugin version from the UI is still at 7.1.012 [5298] even after a couple of restart commands. I might have done something wrong...

I have included the export.json file from after the repairing.

I have also included the _PluginZigbee_13.log, because we can see the latest commit included in the plugin, as well as the creation in domoticz issue (I had turned on in domoticz the accept new device to be sure before pairing): 2024-08-16 11:35:52,064 INFO :b'[3] NEW OBJECT: f815 Manufacturer Name: _TZE204_srmahpwl' 2024-08-16 11:35:52,066 ERROR : [MainThread 1640872] processNotinDBDevices - Creat Domo Device Failed !!! for f815 status: 8043

pipiche38 commented 3 months ago

Kindly redo sudo python3 -m pip install -r requirements.txt --upgrade so you move to 5.299

then you need to redo the pairing from scratch

adruet29 commented 3 months ago

OK, that did it, I moved to 7.1.012 [5299]. I deleted the object, restarted the pluging. The object is recognized in the plugin and created in domoticz. But it does not work for any command (open/close) from domoticz. In the zigbee plugin I go to Tools \ command, I can select the object as a router but no command is present in the drop down list which displays "no items found".

Don't know if it can help, but I have other MOES curtain modules that work fine (TS130F-_TZ3000_1dd0d5yi), but for that place I needed a switch too so this is why I got a MOES Star Ring Curtain Switch.

In domoticz the TS0601-Moes-Curtain does not display as the TS130F-_TZ3000_1dd0d5yi. It only has the Open/Close button, when the TS130F-_TZ3000_1dd0d5yi also has a progress bar like a dimmer switch, but maybe it's because it does not have this capability.

I have included the export.json and the _PluginZigbee_13.log from the plugin.

pipiche38 commented 3 months ago

This is not the same MOES curtain module. This one is a cheap OEM from Tuya, which does not follow Zigbee standard, but which is a Tuya manufacturer implementation.

Can you kindly enable debug Tuya0601 in the Tools->Debug

Then use the Domoticz Widget to action Open, Stop, Close, Percentage

Then drop the Plugin log here

pipiche38 commented 3 months ago

can you redo

git pull
sudo python3 -m pip install -r requirements.txt --upgrade

and redo the pairing from scratch. I have update the Domoticz widget to be similar as your TS130F one ...

adruet29 commented 3 months ago

Ok, I did all you asked. It's a bit better ! Now in domoticz the widget is the same as my MOES TS130F-_TZ3000. When I click on the button open or close in domoticz nothing happens. In domoticz log I do not get any error, it says: initiated a switch command (4694/VoletEtageSdb/Close) initiated a switch command (4694/VoletEtageSdb/Open) But nothing happens.

When I use the percentage bar from the domoticz widget it works if I do not pull it all the way to 0% or 100%. The other values do make the curtain move open or close. And in domoticz I get the log: initiated a switch command (4694/VoletEtageSdb/Set Level)

I have attached the export.json file as well as the _PluginZigbee_13.logwith the debug for the tuya001 activated.

pipiche38 commented 3 months ago

Several points:

And then provides the plugin logs

adruet29 commented 2 months ago

I have done the git pull and restarted the plugin. I have not removed / readded the device as you did not request me to do so. I have calibrated the module and set the parameter to 180. I have added the "Command" debug. In domoticz, when I click on the "open" or "close" action of the widget nothing happens, I see in domoticz logs that the command is sent but the curtain does not move. It's only when I move the percentage bar that it moves. But if I move the percentage bar to 0% or to 100% nothing happens either (only values from 1% to 99% make the curtain move).

I have attached the _PluginZigbee_13.log.

pipiche38 commented 2 months ago

From the Log, when doing a set Level 0 or 100, it is translated by Domoticz into Close and Open, so we have a consistent behaviour. Just need to find how to make the Open/Close working.

In the logs, I found a potential mismatch where I was expecting to use a Boolean type and it looks like it expects a bitmap data type.

Can yougit pull, restart and test the Open/Close ?

adruet29 commented 2 months ago

Almost there ! I have done the git pull, did the upgrade to be sure (sudo python3 -m pip install -r requirements.txt --upgrade), restarted the plugin (to be extra sure) and then tried the Open/Close from domoticz, it works but the close button on the widget sends an "open" command to the curtain and the open button on the widget sends a "close" command to the curtain (I don't think it's a wiring issue on my side, because the close switch lights up on the physical Moes switch when I click on the open button in domoticz). So it's just a matter of inverting the open / close command. I have included the _PluginZigbee_13.log.

pipiche38 commented 2 months ago

If you can do a git pull again the Open and Close have been inverted

adruet29 commented 2 months ago

1) I did the git pull. The open / close command are ok now.

Just a couple of things are strange. I will probably give you too many info, so don't hesitate to tell me where to focus:

2) If I hit the open button of the widget, now it opens fine. But the widget status still says it's closed, and the progress bar does not move. I tried to remove the device from domoticz and the plugin, redid the pairing, but it's still the same. Is it possible to fix the open/close status ?

3) The behavior of using the progress bar is not consistent, when I put it at 56%, it closes completely, other values act weird. I did change the calibration to 180 (it takes 18 seconds to fully open the curtain). But it does not change that strange behavior. I don't know if it's relevent, but no matter the calibration value, when I hit the open button, the physical button of on the MOES switch stays light for 1 minute and 9 seconds. It does the same when we use directly the physical button. So I thought that might mean that calibration does not work on the device (it works well on my MOES TS130F-_TZ3000). Anyway, maybe you should just remove the progression bar and note that it is not compatible with that device.

I have attached the _PluginZigbee_13.log.

pipiche38 commented 2 months ago

I push an update of the Device configuration so you need 5.302, as well as an update of the code.

So you need to do :

git pull
sudo python3 -m pip install -r requirements.txt --upgrade

For the calibration I'm afraid that you are right, I didn't understood how this one work. Do you have any documentation with the Module, which can then explain how calibration works.

It looks like we need to put the module in calibration, the I guess you have to do some Open/Close, and then you have to stop the calibration.

If that is the case, I would have to create a New Widget to put the module in Calibration or not.

Your inputs are more than welcome

pipiche38 commented 2 months ago

Last update, please update

git pull
sudo python3 -m pip install -r requirements.txt --upgrade

Then remove the existing Widget, and redo the pairing from scratch.

Kindly check how Open/Close and Stop behave

then You should have a Calibration Switch widget, If you put it to On, I guess you should do an Open, followed by a Close then you Switch Calibration Off

and finaly you can test the Level.

Let me know and provide me the logs

pipiche38 commented 2 months ago

@adruet29 alors ca donne quoi ?

adruet29 commented 2 months ago

Désolé je suis en déplacement jusqu'à ce soir, je ne pouvais donner de feedback plus tôt. J'essaie de faire ce soir si je ne rentre pas trop tard.

adruet29 commented 2 months ago

I didn't see the calibration at first, so I did twice the delete of the device and repairing. Anyway, it's still strange, but here is the behavior: I turned the calibration on, then I hit the open command (but it was already opened... my bad, I was tired), and then the close command. So after I figured this that might get calibration in a mess I turned off the switch, closed the curtain and started over. I turned on the calibration, hit open, waited for it to open thoroughly, then hit close, waited for it to close completely then turned off calibration. Well, the levels are still a mess. If I pull it up to 73 percent or so it kind of works, but if I hit 25 percent it closes completely, and if I set it back to 75 percent or so it fully opens.... well I don't get a grasp on the logic of the thing. The other strange behavior, which more important to my eyes is that when I hit open, the status of the widget does not progressively increase like my other MOES but it stays at 1%. Looks like a wrong value, maybe it was supposed to display an open value which would be fine to me, I don't really need that progress bar or percentage value for that particular device, but close / open would be great. I don't know if we'll be able to make it for that one, but if you want to dive deeper, I'll try to help as much as I can. Here are the logs: _PluginZigbee_13.log .

pipiche38 commented 2 months ago

what about the device documentation ? do they mentioned calibration ?

pipiche38 commented 2 months ago

I just pushed an update to use a different Data Type for Calibration. This could be good to test.

I had a look to the log, and I see a progress from 99% to 64% and then it stopped because the blind was fully Open, and then vice-versa it went from 64% to 99%. So we have a calibration issue.

Can you try with the latest update ( no need of re-pairing). However I have no clue what is the cailbration procedure. That is why the device documentation might give what is the overall procedure

pipiche38 commented 2 months ago

Alternative, can you send me the device, so I can clone what tuya is doing ? (or you purchase one send directly to me) From the web site, I found that there are 2 types of calibration ![Uploading Screenshot 2024-08-22 at 21.06.27.png…]()

adruet29 commented 2 months ago

Your screenshot link did not work (you probably clicked too quickly on comment before the upload was finished ;) ), it points to this issue but no image. I tried your update, but no luck. I have attached the logs _PluginZigbee_13.log . The device documentation is pretty light, nothing about calibration: https://cdn.shopify.com/s/files/1/0095/4079/6497/files/zigbee-star-ring-curtain-switch.pdf?v=1712623803

I have found another discussion where it seems that they hit the same issue with a workaround but no solution: https://community.home-assistant.io/t/zha-curtains-module-calibration/359996/43

Again, at this stage the device works well enough for me, don't need more features. But if you want I don't mind getting you one regarding all the time you spend for your wonderful work on this plugin.

pipiche38 commented 2 months ago

@adruet29 Can you try once more ?

git pull
sudo python3 -m pip install -r requirements.txt --upgrade

then restart the plugin. No need for re-pairing

Enable the Calibration, do Open/Close/Open, then Disable Calibration and try the PercentLevel

Here after is 2 calibration mode ( Accurate and Quick) that seems available from the SmartLife App

Screenshot 2024-08-24 at 08 56 54
adruet29 commented 2 months ago

After git pull / upgrade /restarting the plugin the calibration switch does not work anymore from Domoticz. I get these errors in domoticz: 2024-08-24 11:46:53.199 Status: User: admin (IP: 192.168.10.250) initiated a switch command (4694/VoletEtageSdbCalibration/On) 2024-08-24 11:46:53.228 Error: Zigate: Call to function 'onCommand' failed, exception details: 2024-08-24 11:46:53.229 Error: Zigate: Traceback (most recent call last): 2024-08-24 11:46:53.229 Error: Zigate: File "/opt/domoticz/plugins/Zigate/plugin.py", line 1568, in onCommand 2024-08-24 11:46:53.229 Error: Zigate: _plugin.onCommand( Unit, Command, Level, Color) 2024-08-24 11:46:53.229 Error: Zigate: File "/opt/domoticz/plugins/Zigate/plugin.py", line 806, in onCommand 2024-08-24 11:46:53.229 Error: Zigate: domoticz_command(self, Devices, DeviceID, Unit, self.IEEE2NWK[ DeviceID], Command, Level, Color) 2024-08-24 11:46:53.229 Error: Zigate: File "/opt/domoticz/plugins/Zigate/Modules/command.py", line 187, in domoticz_command 2024-08-24 11:46:53.229 Error: Zigate: handle_command_on(self, Devices, DeviceID, Unit, Level, Nwkid, EPout, DeviceType, BatteryLevel, SignalLevel, forceUpdateDev) 2024-08-24 11:46:53.229 Error: Zigate: File "/opt/domoticz/plugins/Zigate/Modules/command.py", line 525, in handle_command_on 2024-08-24 11:46:53.229 Error: Zigate: ts0601_curtain_calibration( self, Nwkid, EPout, 0x03, mode=1) 2024-08-24 11:46:53.229 Error: Zigate: TypeError: ts0601_curtain_calibration() got an unexpected keyword argument 'mode' I have attached the logs _PluginZigbee_13.log .

pipiche38 commented 2 months ago

@adruet29 My mistake, sorry.

Can you update and try again

adruet29 commented 2 months ago

Ok, so now after update I was able to turn calibration On. Sent open/close/open commands, and switched off calibration. After that I tried the percentage to 49% (it sort of closed it at 80%). Then tried many other commands but neither he percentage nor the open / close commands work anymore. Maybe the easiest way is to get back to previous behavior when open / close would work, which is enough for me. And I can buy a device for you so you can try to figure it out. Here are the logs _PluginZigbee_13.log .

pipiche38 commented 2 months ago

From the logs, I found a communication issue, which has nothing to do with the plugin changes. The plugin changes was not affecting Open/Close, and the Calibration was still based on the old Data Point.

Can you do the following

(1) update

git pull
sudo python3 -m pip install -r requirements.txt --upgrade

(2) restart the plugin, you must be on 5.304

(3) remove the 2 widgets (Calibration and Curtain), check that the device is not in the Plugin devices anymore, or remove it

(4) restart the plugin once more

(5) redo the pairing

adruet29 commented 2 months ago

You were right, just before updating I tried to close the curtain and it worked. So it was just a communication issue.

I did the entire testing protocol you asked, but could not go ahead with calibration, the widget does not turn on when I click on it. I do have this log in domoticz: Status: User: admin (IP: 192.168.10.250) initiated a switch command (4694/VoletEtageSdbCalibration/On) But the calibration widget does not turn on. Don't think it will be useful for that particular issue, but here are the plugin logs _PluginZigbee_13.log.

pipiche38 commented 2 months ago

I think we are becoming closer,

Can you do a git pull

restart the plugin, and redo the test

adruet29 commented 2 months ago

It looks much better. The calibration switch works. Opening the curtain at 50% gives a good results, other values like 70% or more open it completely, and 20% tends to close it completely. Maybe I am not doing the calibration correctly: I clicked open, waited for it to completely open and hear the curtain motor stop, then hit the close right away waiting to hear the motor stop, and hit right away open and wait to hear the motor stop and hit the calibration off button. The strange thing is the domoticz widget. When I hit open, it stays stuck at 1% in its status and never says "opened" (the progress bar does not move at all either) but the curtain does open completely: Moes_Opened But when I hit close, the status does say "closed" which is better (the progress bar does not move either): Moes_closed When I do a percentage opening, I drag it to lets say 51%, it says 51% and then the status changes back to 1% and the progress bar goes back to 1% (and the curtain does open to about 50%). When I do a percentage opening to 100% and the curtain is already opened, the widget goes into closed state for a second, then goes back to its 1% status and the progress bar goes back to 1% as well. Here are the logs _PluginZigbee_13.log.

pipiche38 commented 2 months ago

git pull

then restart the plugin and play with %

pipiche38 commented 2 months ago

For the calibration, you might want to try the following

adruet29 commented 2 months ago

ok, here are some news. I started my tests before your second message. The behavior was still a bit weird, when hitting 50% it would close the curtain completely, Hitting 75% would open it completely, could not figure it out. After seeing your message I tried your calibration method, but it's still weird, cannot get much consistancy with de different percentages. 46% will close it completely, 62% will open it sometimes at about 5%, then 86% will open it completely, driving me nuts :) The domoticz widget still behaves strangely, hitting open will set its status to 1%, when close does set the status to closed. Slidding the percentage bar usually always resets the bar to 1% (though it is opening / closing), I managed only a couple of time to get it to stay at the right percentage: Moes_95percent I have attached the logs _PluginZigbee_13.log .

pipiche38 commented 2 months ago

What I wonder is if the Percentage level provided by the device shouldn't be inverted ? Like 90% reported should be set to 10% on the widget .

And when commanding 90% from the Widget we should request 10%

pipiche38 commented 2 months ago

@adruet29 Found some interesting things in the log.

You Set Level at 97% ( 0x61), and we see the level moving from 82% (I guess previous stage) to 97%. (1) it confirms that nothing is inverted.

I need more logs, and I would appreciate if you could enable debug 'Widget'. You might enable it just before doing the tests, and disabling it just after the test, as this will generate quiet some logs.

I suspect an issue in an other place of the plugin and those logs would be good. Thanks in advance

2024-08-24 18:05:06,213 INFO :b'onCommand - unit: 51, command: Set Level, level: 97, color: ' 2024-08-24 18:05:06,213 INFO :b'mgtCommand (0f17) a4c1381c74697f18 51 Name: VoletEtageSdb Command: Set Level Level: 97 Color: ' 2024-08-24 18:05:06,213 INFO :b'handle_command_setlevel : Set Level for Device: 0f17 EPout: 01 Unit: 51 DeviceType: Curtain Level: 97' 2024-08-24 18:05:06,214 INFO :b'handle_command_setlevel : Tuya TS0601: 0f17 Level: 97' 2024-08-24 18:05:06,214 INFO :b'ts0601_actuator - requesting CurtainLevel 97' 2024-08-24 18:05:06,214 INFO :b'ts0601_actuator - requesting CurtainLevel 2 97' 2024-08-24 18:05:06,214 INFO :b'ts0601_curtain_level_cmd - 0f17 Switch Action: dp:2 value: 97' 2024-08-24 18:05:06,214 INFO :b'ts0601_tuya_cmd - 0f17 01 0202 00000061' 2024-08-24 18:05:06,214 INFO :b'ts0601_tuya_cmd - 0f17 01 sqn: 23 action: 0202 data: 00000061' 2024-08-24 18:05:06,215 INFO :b'tuya_cmd - 0f17/01 cmd: 00 action: 0202 data: 00000061' 2024-08-24 18:05:06,215 INFO :b'tuya_cmd - 0f17/01 cmd: 00 payload: 112300003c0202000400000061' 2024-08-24 18:05:06,220 INFO :b'UpdateDevice - ( VoletEtageSdb) 2:97' 2024-08-24 18:05:06,371 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000052' 2024-08-24 18:05:06,371 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000052' 2024-08-24 18:05:06,371 INFO :b' - value: 82' 2024-08-24 18:05:06,372 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:06,372 INFO :b' - after evaluate_expression_with_data() value: 82' 2024-08-24 18:05:06,372 INFO :b"sensor_type - 0f17 01 82 2 2 00000052 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:06,372 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:06,372 INFO :b' - after sensor_type() value: 82 divisor: 1 rounding: 0' 2024-08-24 18:05:06,372 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 82' 2024-08-24 18:05:06,522 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000053' 2024-08-24 18:05:06,522 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000053' 2024-08-24 18:05:06,522 INFO :b' - value: 83' 2024-08-24 18:05:06,522 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:06,522 INFO :b' - after evaluate_expression_with_data() value: 83' 2024-08-24 18:05:06,522 INFO :b"sensor_type - 0f17 01 83 2 2 00000053 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:06,523 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:06,523 INFO :b' - after sensor_type() value: 83 divisor: 1 rounding: 0' 2024-08-24 18:05:06,523 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 83' 2024-08-24 18:05:07,174 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000054' 2024-08-24 18:05:07,175 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000054' 2024-08-24 18:05:07,175 INFO :b' - value: 84' 2024-08-24 18:05:07,175 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:07,175 INFO :b' - after evaluate_expression_with_data() value: 84' 2024-08-24 18:05:07,175 INFO :b"sensor_type - 0f17 01 84 2 2 00000054 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:07,175 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:07,175 INFO :b' - after sensor_type() value: 84 divisor: 1 rounding: 0' 2024-08-24 18:05:07,176 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 84' 2024-08-24 18:05:07,777 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000055' 2024-08-24 18:05:07,777 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000055' 2024-08-24 18:05:07,777 INFO :b' - value: 85' 2024-08-24 18:05:07,777 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:07,777 INFO :b' - after evaluate_expression_with_data() value: 85' 2024-08-24 18:05:07,777 INFO :b"sensor_type - 0f17 01 85 2 2 00000055 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:07,778 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:07,778 INFO :b' - after sensor_type() value: 85 divisor: 1 rounding: 0' 2024-08-24 18:05:07,778 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 85' 2024-08-24 18:05:08,279 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000056' 2024-08-24 18:05:08,279 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000056' 2024-08-24 18:05:08,279 INFO :b' - value: 86' 2024-08-24 18:05:08,279 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:08,280 INFO :b' - after evaluate_expression_with_data() value: 86' 2024-08-24 18:05:08,280 INFO :b"sensor_type - 0f17 01 86 2 2 00000056 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:08,280 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:08,280 INFO :b' - after sensor_type() value: 86 divisor: 1 rounding: 0' 2024-08-24 18:05:08,280 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 86' 2024-08-24 18:05:08,881 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000057' 2024-08-24 18:05:08,881 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000057' 2024-08-24 18:05:08,882 INFO :b' - value: 87' 2024-08-24 18:05:08,882 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:08,882 INFO :b' - after evaluate_expression_with_data() value: 87' 2024-08-24 18:05:08,882 INFO :b"sensor_type - 0f17 01 87 2 2 00000057 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:08,882 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:08,882 INFO :b' - after sensor_type() value: 87 divisor: 1 rounding: 0' 2024-08-24 18:05:08,882 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 87' 2024-08-24 18:05:09,483 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000058' 2024-08-24 18:05:09,484 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000058' 2024-08-24 18:05:09,484 INFO :b' - value: 88' 2024-08-24 18:05:09,484 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:09,484 INFO :b' - after evaluate_expression_with_data() value: 88' 2024-08-24 18:05:09,484 INFO :b"sensor_type - 0f17 01 88 2 2 00000058 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:09,484 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:09,485 INFO :b' - after sensor_type() value: 88 divisor: 1 rounding: 0' 2024-08-24 18:05:09,485 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 88' 2024-08-24 18:05:10,537 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000059' 2024-08-24 18:05:10,538 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000059' 2024-08-24 18:05:10,538 INFO :b' - value: 89' 2024-08-24 18:05:10,538 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:10,538 INFO :b' - after evaluate_expression_with_data() value: 89' 2024-08-24 18:05:10,538 INFO :b"sensor_type - 0f17 01 89 2 2 00000059 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:10,538 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:10,538 INFO :b' - after sensor_type() value: 89 divisor: 1 rounding: 0' 2024-08-24 18:05:10,539 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 89' 2024-08-24 18:05:10,738 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 0000005a' 2024-08-24 18:05:10,738 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 0000005a' 2024-08-24 18:05:10,739 INFO :b' - value: 90' 2024-08-24 18:05:10,739 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:10,739 INFO :b' - after evaluate_expression_with_data() value: 90' 2024-08-24 18:05:10,739 INFO :b"sensor_type - 0f17 01 90 2 2 0000005a {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:10,739 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:10,739 INFO :b' - after sensor_type() value: 90 divisor: 1 rounding: 0' 2024-08-24 18:05:10,739 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 90' 2024-08-24 18:05:11,241 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 0000005b' 2024-08-24 18:05:11,241 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 0000005b' 2024-08-24 18:05:11,241 INFO :b' - value: 91' 2024-08-24 18:05:11,241 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:11,241 INFO :b' - after evaluate_expression_with_data() value: 91' 2024-08-24 18:05:11,241 INFO :b"sensor_type - 0f17 01 91 2 2 0000005b {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:11,241 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:11,242 INFO :b' - after sensor_type() value: 91 divisor: 1 rounding: 0' 2024-08-24 18:05:11,242 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 91' 2024-08-24 18:05:11,842 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 0000005c' 2024-08-24 18:05:11,843 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 0000005c' 2024-08-24 18:05:11,843 INFO :b' - value: 92' 2024-08-24 18:05:11,843 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:11,843 INFO :b' - after evaluate_expression_with_data() value: 92' 2024-08-24 18:05:11,843 INFO :b"sensor_type - 0f17 01 92 2 2 0000005c {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:11,843 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:11,844 INFO :b' - after sensor_type() value: 92 divisor: 1 rounding: 0' 2024-08-24 18:05:11,844 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 92' 2024-08-24 18:05:12,445 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 0000005d' 2024-08-24 18:05:12,445 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 0000005d' 2024-08-24 18:05:12,445 INFO :b' - value: 93' 2024-08-24 18:05:12,446 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:12,446 INFO :b' - after evaluate_expression_with_data() value: 93' 2024-08-24 18:05:12,446 INFO :b"sensor_type - 0f17 01 93 2 2 0000005d {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:12,446 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:12,446 INFO :b' - after sensor_type() value: 93 divisor: 1 rounding: 0' 2024-08-24 18:05:12,446 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 93' 2024-08-24 18:05:13,098 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 0000005e' 2024-08-24 18:05:13,098 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 0000005e' 2024-08-24 18:05:13,098 INFO :b' - value: 94' 2024-08-24 18:05:13,098 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:13,098 INFO :b' - after evaluate_expression_with_data() value: 94' 2024-08-24 18:05:13,099 INFO :b"sensor_type - 0f17 01 94 2 2 0000005e {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:13,099 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:13,099 INFO :b' - after sensor_type() value: 94 divisor: 1 rounding: 0' 2024-08-24 18:05:13,099 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 94' 2024-08-24 18:05:13,700 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 0000005f' 2024-08-24 18:05:13,700 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 0000005f' 2024-08-24 18:05:13,700 INFO :b' - value: 95' 2024-08-24 18:05:13,701 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:13,701 INFO :b' - after evaluate_expression_with_data() value: 95' 2024-08-24 18:05:13,701 INFO :b"sensor_type - 0f17 01 95 2 2 0000005f {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:13,701 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:13,701 INFO :b' - after sensor_type() value: 95 divisor: 1 rounding: 0' 2024-08-24 18:05:13,701 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 95' 2024-08-24 18:05:14,412 INFO :b'tuya_response - Model: TS0601-Moes-Curtain Nwkid: 0f17/01 dp: 02 dt: 02 data: 00000060' 2024-08-24 18:05:14,412 INFO :b'ts0601_response - 0f17 TS0601-Moes-Curtain 2 2 00000060' 2024-08-24 18:05:14,412 INFO :b' - value: 96' 2024-08-24 18:05:14,412 INFO :b" - dps_mapping[ 02 ]: {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'} (<class 'dict'>)" 2024-08-24 18:05:14,412 INFO :b' - after evaluate_expression_with_data() value: 96' 2024-08-24 18:05:14,413 INFO :b"sensor_type - 0f17 01 96 2 2 00000060 {'sensor_type': 'curtain_level', 'EvalExp': 'int(value)', 'action_type': 'CurtainLevel'}" 2024-08-24 18:05:14,413 INFO :b' - Ep to be used for domo update 01' 2024-08-24 18:05:14,413 INFO :b' - after sensor_type() value: 96 divisor: 1 rounding: 0' 2024-08-24 18:05:14,413 INFO :b'ts0601_curtain_level - Nwkid: 0f17/01 Level: 96'

pipiche38 commented 2 months ago

@adruet29 if you can do a git pull that would be good too

adruet29 commented 2 months ago

I did a git pull, but not sure that it updated anything: remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0 (from 0) Dépaquetage des objets: 100% (3/3), 554 octets | 110.00 Kio/s, fait. Depuis https://github.com/zigbeefordomoticz/Domoticz-Zigbee bfff4fe1..49f06b1b upgrade-zigpy-libraries-7-1-13-stable7 -> origin/upgrade-zigpy-libraries-7-1-13-stable7 Déjà à jour.

adruet29 commented 2 months ago

So I did a little test protocol after the git pull and restart of the plugin (maybe I should have done the upgrade :s ), but don't know if that's relevant regarding my previous comment. I started by putting calibration mode, and sent the commands through curl to open it at 99%, then close it at 1% and then open it at 99% and turned off calibration. Anyway, after calibration, the curtain was fully opened, and the widget state was "1%" (not "opened" state like I mentioned before). So here is what I set as levels approximately from the widget and my observations: 62% -> the curtain moves down by maybe 2%, but barely visible, still pretty wide opened -> I did not write down the widget status (poor tester protocol, sorry about that) 49% half close -> widget goes into closed status, progress bar at 0% 21% -> widget goes into close status, progress bar at 0% 65% -> but i can of waited too long on the widget which made a kind of glitch (displayed quickly 1% went back to 65%) -> it triggered a full open of the curtain 71% -> remains fully opened-> widget move to 1% status 16% fully closed the curtain -> widget in closed status, progress bar at 0% 48% -> curtain fully opens -> widget in 1% status

You will find the logs attached with the widget debug activated: _PluginZigbee_13.log

pipiche38 commented 2 months ago

my bad, I didn't push the update. I expect to have fixed the 1% status issue

adruet29 commented 2 months ago

no problem. Here are the logs. _PluginZigbee_13.zip

I did not go through calibration process, just did a close / open , then percentage and another percentage, then close.

The widget does display the open status now, that is good !

The progress bar is still buggy, will do more tests tomorrow evening.

adruet29 commented 2 months ago

One thing I noticed in domoticz widget logs is that on my other Moes curtain modules, when I hit close I can see the progress bar moving down as the curtain shuts, same thing when I open it but the other way arround, and in the logs I see that there is a set level x% sent every couple seconds: Moes_progressive_bar On this MOES Star Ring we've been working on the widget does not behave this way (maybe because of the module capabilities which may be different): Moes_non_progressive_bar

Let me know if you need me to do more testing.

pipiche38 commented 2 months ago

The device is providing the data, but I'm strugling to find why it is not behaving correctly. Can you do one more test and add WidgetUpdate Widget debug parameters

pipiche38 commented 2 months ago

can you get a try with the latest update ( git pull and restart )

adruet29 commented 2 months ago

Ok, so I did the update, deleted the log files because it was 120MB big, restarted the plugin, and added the Widget and WidgetUpdate debug logs. I first closed it fully and opened it fully. Everything behaved correctly except the progress bar which is not moving progressively. Then I set it from fully opened to 51% -> it closed completely, but the progress bar stayed at 51% I then set it to 70% it opened a bit (about 15% opened), I then put it at 83% and it opened to about 50%. I set it to 92% and it was fully opened. I then set it to 61% and it closed completely. I don't know if that's enough to help you make any sense of it, but here are the logs: _PluginZigbee_13.log

pipiche38 commented 2 months ago

are you sure that you have done the git pull and it works without error ? And you have restarted the plugin ? The log provided do not show changes that have been pushed

adruet29 commented 2 months ago

I wasn't sure, but checking my history I think I did: 489 cd /opt/domoticz/plugins/Zigate/ 490 git pull 491 python3 -m pip install -r requirements.txt --upgrade --break-system-packages 492 ls -l 493 cd Logs/ 494 ls -l 495 rm PluginZigbee_13.log Then I restarted the plugin through the UI. But maybe I uploaded the wrong log files... that's probably what happened.

I just did a git pull again, and it detects those changes: epuis https://github.com/zigbeefordomoticz/Domoticz-Zigbee d23554c5..615fb6a3 wip-stable7-7.1.13 -> origin/wip-stable7-7.1.13 3dd9a430..50438a6e upgrade-zigpy-libraries-7-1-13-stable7 -> origin/upgrade-zigpy-libraries-7-1-13-stable7 Mise à jour d23554c5..615fb6a3 Fast-forward Modules/domoMaj.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

It's todays modification correcting a syntax issue for the Level control of the widget, looks good ;) https://github.com/zigbeefordomoticz/Domoticz-Zigbee/commit/615fb6a3bcb994021a11ddedc458a2b22b5c304d

Anyway, I have updated the plugin, restarted it, added the debug log for widget and widget update, then I restarted the plugin again to be sure.

So now the progress bar of the plugin does work correctly, the percentage moves as the curtain goes up or down. Now the curtain is fully opened when it reaches 30% (but progress bar continues until 100%). When closing, the progress bar goes down to 0% (the curtain is actually closed) then the widget says its opened until the physical switch closing button's light turns out (I can actually hear a click in the physical switch) then I guess the widget does receive the information it is closed and it's status turns into closed mode. If I move the progress bar between 0% and 30% I get a consistent result. So now I think it's now a calibration issue, I tried to do it a couple more times to correct it but without success. I tried like you said: turn calibration on, then open / close / open, then turn calibration off. But nothing changed. I tried to turn calibration on, then hit stop, then close, then hit stop, then open, then turn calibration off, but not any better. Here are the logs, hope it helps: _PluginZigbee_13.log

pipiche38 commented 2 months ago

One potential issue, is that the device is sending % step by step, which could be slower than the physical curtain, and so we could have a delay between the real position and the position reported in the widget. I'll have a look to the logs

pipiche38 commented 2 months ago

I do confirm that when you switch Calibration it does send a command to the device, as we get a response confirming the command.

There is one remaining DataPoint 0x0e which is a 1 bytes (0 to 255) number that we do not change. In the documentation they were refering to Accurate Calibration ( Boolean) and Quick Calibration ( number of second) (picture here: https://github.com/zigbeefordomoticz/z4d-certified-devices/issues/71#issuecomment-2308157135 )

In the present case this second data point is either 0 or 2. 0 When Calibration is On and 2 when Calibration is Off

pipiche38 commented 2 months ago

I don't think I can do more on this one. If you have the possibility to send me one, I can check with the Tuya apps what it does and reproduce with the plugin.

I had spend some time on the net and even wonder if this is not the application itself which managed the % time. But in that case, I don't know what would be the purpose of those 2 data points.

I'm trying to reach the MOES support, but not sure this will go somewhere.

adruet29 commented 2 months ago

Yeah, you've already corrected many things, thank you very much. So far on my side it's working good enough for me as I don't need the percentage on that curtain. But I am more than willing to send you a model of the switch so that you can correct it completely for the community and maybe for your own use.