tixi / Domoticz-Tuya-SmartPlug-Plugin

Domoticz Python Plugin for Tuya Smart Plug
MIT License
23 stars 24 forks source link

Updated every 20 second the value of device #17

Open xavierlp opened 4 years ago

xavierlp commented 4 years ago

Hello I'm using an oxaone plug wich works perfectly with your plugin. Thanks again.

This device has 2 plugs. Every 20 second I receive new informations about Volt, Amp, WH. And I receive also an updated about the status of one plg (only one).

The log is huge with this update. Is it a way to avoid updated the value on/off ony if the status has changed ?

Here is some logs

Thanks a lot

2020-03-11 18:53:18.683 (Tuya) Pushing 'onMessageCallback' on to queue 2020-03-11 18:53:18.683 (Tuya) Processing 'onMessageCallback' message 2020-03-11 18:53:18.683 (Tuya) Calling message handler 'onMessage'. 2020-03-11 18:53:18.683 (Tuya) onMessage called: 192.168.1.8:6668 b'\x00\x00U\xaa\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x9d\x00\x00\x00\x00{"devId":"55142707bcddc295f96a","dps":{"1":false,"2":false,"9":0,"10":0,"18":0,"19":0,"20":2278,"21":1,"22":609,"23":27297,"24":15519,"25":1340}}\xc5\xed\xaa\x00\x00\xaaU' 2020-03-11 18:53:18.684 (Tuya - Gauche) Updating device from 0:'Off' to have values 0:'0.0'. 2020-03-11 18:53:18.688 (Tuya - Tuya SmartPlug (A)) Updating device from 0:'0.0' to have values 0:'0.0;0'. 2020-03-11 18:53:18.691 (Tuya - Tuya SmartPlug (kWh)) Updating device from 0:'0.0;74851.7' to have values 0:'227.8'. 2020-03-11 18:53:18.694 (Tuya - Tuya SmartPlug (V)) Updating device from 0:'227.8' to have values 0:'0.0'. 2020-03-11 18:53:18.696 (Tuya) Updated: 0.0 Ampere Key is:2 2020-03-11 18:53:18.696 (Tuya) Updated: 0.0 Watt Key is:13 2020-03-11 18:53:18.697 (Tuya) Updated: 227.8 Voltage Key is:14 2020-03-11 18:53:18.697 (Tuya - Gauche) Updating device from 0:'0.0' to have values 0:'Off'. 2020-03-11 18:53:18.702 (Tuya) Update Tuya - Gauche: 0 - 'Off' 2020-03-11 18:53:18.702 (Tuya - Tuya SmartPlug (A)) Updating device from 0:'0.0;0' to have values 0:'0.0'. 2020-03-11 18:53:18.704 (Tuya - Tuya SmartPlug (kWh)) Updating device from 0:'227.8;74851.7' to have values 0:'0.0;0'. 2020-03-11 18:53:18.707 (Tuya - Tuya SmartPlug (V)) Updating device from 0:'0.0' to have values 0:'227.8'. 2020-03-11 18:53:18.709 (Tuya - Tuya SmartPlug (W)) Updating device from 0:'0.0' to have values 0:'0.0'. 2020-03-11 18:53:18.712 (Tuya) Updated: 0.0 Ampere Key is:3 2020-03-11 18:53:18.712 (Tuya) Updated: 0.0 Watt Key is:14 2020-03-11 18:53:18.712 (Tuya) Updated: 227.8 Voltage Key is:15 2020-03-11 18:53:28.440 (Tuya) Pushing 'onHeartbeatCallback' on to queue 2020-03-11 18:53:28.478 (Tuya) Processing 'onHeartbeatCallback' message 2020-03-11 18:53:28.478 (Tuya) Calling message handler 'onHeartbeat'. 2020-03-11 18:53:38.443 (Tuya) Pushing 'onHeartbeatCallback' on to queue 2020-03-11 18:53:38.444 (Tuya) Processing 'onHeartbeatCallback' message 2020-03-11 18:53:38.444 (Tuya) Calling message handler 'onHeartbeat'. 2020-03-11 18:53:38.446 (Tuya) Pushing 'WriteDirective' on to queue 2020-03-11 18:53:38.446 (Tuya) Processing 'WriteDirective' message 2020-03-11 18:53:38.446 (Tuya) Sending 86 bytes of data 2020-03-11 18:53:38.446 (Tuya) 00 00 55 aa 00 00 00 00 00 00 00 0a 00 00 00 46 7b 22 64 65 ..U�...........F{"de 2020-03-11 18:53:38.446 (Tuya) 76 49 64 22 3a 22 35 35 31 34 32 37 30 37 62 63 64 64 63 32 vId":"55142707bcddc2 2020-03-11 18:53:38.447 (Tuya) 39 35 66 39 36 61 22 2c 22 67 77 49 64 22 3a 22 35 35 31 34 95f96a","gwId":"5514 2020-03-11 18:53:38.447 (Tuya) 32 37 30 37 62 63 64 64 63 32 39 35 66 39 36 61 22 7d 49 51 2707bcddc295f96a"}IQ 2020-03-11 18:53:38.447 (Tuya) d9 16 00 00 aa 55 .. .. .. .. .. .. .. .. .. .. .. .. .. .. �...�U 2020-03-11 18:53:38.524 (Tuya) Pushing 'ReadEvent' on to queue 2020-03-11 18:53:38.547 (Tuya) Processing 'ReadEvent' message 2020-03-11 18:53:38.547 (Tuya) Received 173 bytes of data 2020-03-11 18:53:38.547 (Tuya) 00 00 55 aa 00 00 00 00 00 00 00 0a 00 00 00 9d 00 00 00 00 ..U�...........�.... 2020-03-11 18:53:38.547 (Tuya) 7b 22 64 65 76 49 64 22 3a 22 35 35 31 34 32 37 30 37 62 63 {"devId":"55142707bc 2020-03-11 18:53:38.547 (Tuya) 64 64 63 32 39 35 66 39 36 61 22 2c 22 64 70 73 22 3a 7b 22 ddc295f96a","dps":{" 2020-03-11 18:53:38.547 (Tuya) 31 22 3a 66 61 6c 73 65 2c 22 32 22 3a 66 61 6c 73 65 2c 22 1":false,"2":false," 2020-03-11 18:53:38.547 (Tuya) 39 22 3a 30 2c 22 31 30 22 3a 30 2c 22 31 38 22 3a 30 2c 22 9":0,"10":0,"18":0," 2020-03-11 18:53:38.548 (Tuya) 31 39 22 3a 30 2c 22 32 30 22 3a 32 32 37 38 2c 22 32 31 22 19":0,"20":2278,"21" 2020-03-11 18:53:38.548 (Tuya) 3a 31 2c 22 32 32 22 3a 36 30 39 2c 22 32 33 22 3a 32 37 32 :1,"22":609,"23":272 2020-03-11 18:53:38.548 (Tuya) 39 37 2c 22 32 34 22 3a 31 35 35 31 39 2c 22 32 35 22 3a 31 97,"24":15519,"25":1 2020-03-11 18:53:38.548 (Tuya) 33 34 30 7d 7d c5 5f ed aa 00 00 aa 55 .. .. .. .. .. .. .. 340}}���..�U 2020-03-11 18:53:38.548 (Tuya) Pushing 'onMessageCallback' on to queue 2020-03-11 18:53:38.548 (Tuya) Processing 'onMessageCallback' message 2020-03-11 18:53:38.548 (Tuya) Calling message handler 'onMessage'. 2020-03-11 18:53:38.548 (Tuya) onMessage called: 192.168.1.8:6668 b'\x00\x00U\xaa\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x9d\x00\x00\x00\x00{"devId":"55142707bcddc295f96a","dps":{"1":false,"2":false,"9":0,"10":0,"18":0,"19":0,"20":2278,"21":1,"22":609,"23":27297,"24":15519,"25":1340}}\xc5_\xed\xaa\x00\x00\xaaU' 2020-03-11 18:53:38.549 (Tuya - Gauche) Updating device from 0:'Off' to have values 0:'0.0'. 2020-03-11 18:53:38.553 (Tuya - Tuya SmartPlug (A)) Updating device from 0:'0.0' to have values 0:'0.0;0'. 2020-03-11 18:53:38.555 (Tuya - Tuya SmartPlug (kWh)) Updating device from 0:'0.0;74851.7' to have values 0:'227.8'. 2020-03-11 18:53:38.558 (Tuya - Tuya SmartPlug (V)) Updating device from 0:'227.8' to have values 0:'0.0'. 2020-03-11 18:53:38.560 (Tuya) Updated: 0.0 Ampere Key is:2 2020-03-11 18:53:38.561 (Tuya) Updated: 0.0 Watt Key is:13 2020-03-11 18:53:38.561 (Tuya) Updated: 227.8 Voltage Key is:14 2020-03-11 18:53:38.561 (Tuya - Gauche) Updating device from 0:'0.0' to have values 0:'Off'. 2020-03-11 18:53:38.565 (Tuya) Update Tuya - Gauche: 0 - 'Off' 2020-03-11 18:53:38.565 (Tuya - Tuya SmartPlug (A)) Updating device from 0:'0.0;0' to have values 0:'0.0'. 2020-03-11 18:53:38.568 (Tuya - Tuya SmartPlug (kWh)) Updating device from 0:'227.8;74851.7' to have values 0:'0.0;0'. 2020-03-11 18:53:38.570 (Tuya - Tuya SmartPlug (V)) Updating device from 0:'0.0' to have values 0:'227.8'. 2020-03-11 18:53:38.572 (Tuya - Tuya SmartPlug (W)) Updating device from 0:'0.0' to have values 0:'0.0'. 2020-03-11 18:53:38.575 (Tuya) Updated: 0.0 Ampere Key is:3 2020-03-11 18:53:38.575 (Tuya) Updated: 0.0 Watt Key is:14 2020-03-11 18:53:38.575 (Tuya) Updated: 227.8 Voltage Key is:15 2020-03-11 18:53:48.448 (Tuya) Pushing 'onHeartbeatCallback' on to queue 2020-03-11 18:53:48.490 (Tuya) Processing 'onHeartbeatCallback' message