Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Python and python framework

Moderator: leecollings

Itschi
Posts: 18
Joined: Saturday 16 May 2015 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Itschi »

Hi,

I'm trying to get two new waterleak sensors to work with Domoticz. I updated to Domoticz 2024.4 but still use Python 3.6 as I struggled to update to 3.8. However I think the errors I get in the log are not associated with the python version:

Code: Select all

2024-06-15 17:01:45.437 Error: (JSONtoPython) Parse Error on '{ "bf1ebe05f2f8f5fab3eptc":{ "key":"_PdVCb4]k|k_|HlH","category":"waterleak","mac":"d8:d6:68:e3:95:1d","ip":,"product_id":"bw94azhcnjeu1i0v","version":3.300000}}'
2024-06-15 17:01:45.437 Error: TinyTuya: Domoticz.Configuration read failed: 'NoneType' object is not subscriptable
2024-06-15 17:01:45.437 Error: (JSONtoPython) Parse Error on '{ "bf1ebe05f2f8f5fab3eptc":{ "key":"_PdVCb4]k|k_|HlH","category":"waterleak","mac":"d8:d6:68:e3:95:1d","ip":,"product_id":"bw94azhcnjeu1i0v","version":3.300000}}'

2024-06-15 17:09:46.086 TinyTuya: Device name=Wassereinbruch Keller id=bf1ebe05f2f8f5fab3eptc category=waterleak
2024-06-15 17:09:46.570 TinyTuya: Device name= Wassereinbruch Keller id= bf1ebe05f2f8f5fab3eptc FunctionProperties= []
2024-06-15 17:09:46.570 TinyTuya: Device name= Wassereinbruch Keller id= bf1ebe05f2f8f5fab3eptc StatusProperties= [{'code': 'watersensor_state', 'name': '水浸检测状态', 'type': 'Enum', 'values': '{"range":["alarm","normal"]}'}, {'code': 'battery_percentage', 'name': '电池电量百分比', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}]
2024-06-15 17:09:46.570 TinyTuya: Device name= Wassereinbruch Keller id= bf1ebe05f2f8f5fab3eptc result= [{'code': 'watersensor_state', 'value': 'normal'}, {'code': 'battery_percentage', 'value': 95}]
Trying to switch a normal light results in:

Code: Select all

2024-06-15 17:12:53.879 Error: TinyTuya: Call to function 'onCommand' failed, exception details:
2024-06-15 17:12:53.894 Error: TinyTuya: Traceback (most recent call last):
2024-06-15 17:12:53.894 Error: TinyTuya: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-TinyTUYA-Plugin-Master\plugin.py", line 759, in onCommand
2024-06-15 17:12:53.894 Error: TinyTuya: _plugin.onCommand(DeviceID, Unit, Command, Level, Color)
2024-06-15 17:12:53.894 Error: TinyTuya: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-TinyTUYA-Plugin-Master\plugin.py", line 156, in onCommand
2024-06-15 17:12:53.894 Error: TinyTuya: elif dev_type in ('dimmer'):
2024-06-15 17:12:53.894 Error: TinyTuya: TypeError: 'in <string>' requires string as left operand, not dict
I guess this is related to the python 3.6 version. Is there a simple fix for both?
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

Itschi wrote: Saturday 15 June 2024 17:14 Hi,

I'm trying to get two new waterleak sensors to work with Domoticz. I updated to Domoticz 2024.4 but still use Python 3.6 as I struggled to update to 3.8. However I think the errors I get in the log are not associated with the python version:

Code: Select all

2024-06-15 17:01:45.437 Error: (JSONtoPython) Parse Error on '{ "bf1ebe05f2f8f5fab3eptc":{ "key":"_PdVCb4]k|k_|HlH","category":"waterleak","mac":"d8:d6:68:e3:95:1d","ip":,"product_id":"bw94azhcnjeu1i0v","version":3.300000}}'
2024-06-15 17:01:45.437 Error: TinyTuya: Domoticz.Configuration read failed: 'NoneType' object is not subscriptable
2024-06-15 17:01:45.437 Error: (JSONtoPython) Parse Error on '{ "bf1ebe05f2f8f5fab3eptc":{ "key":"_PdVCb4]k|k_|HlH","category":"waterleak","mac":"d8:d6:68:e3:95:1d","ip":,"product_id":"bw94azhcnjeu1i0v","version":3.300000}}'

2024-06-15 17:09:46.086 TinyTuya: Device name=Wassereinbruch Keller id=bf1ebe05f2f8f5fab3eptc category=waterleak
2024-06-15 17:09:46.570 TinyTuya: Device name= Wassereinbruch Keller id= bf1ebe05f2f8f5fab3eptc FunctionProperties= []
2024-06-15 17:09:46.570 TinyTuya: Device name= Wassereinbruch Keller id= bf1ebe05f2f8f5fab3eptc StatusProperties= [{'code': 'watersensor_state', 'name': '水浸检测状态', 'type': 'Enum', 'values': '{"range":["alarm","normal"]}'}, {'code': 'battery_percentage', 'name': '电池电量百分比', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}]
2024-06-15 17:09:46.570 TinyTuya: Device name= Wassereinbruch Keller id= bf1ebe05f2f8f5fab3eptc result= [{'code': 'watersensor_state', 'value': 'normal'}, {'code': 'battery_percentage', 'value': 95}]
There is an error in the code for the water leak sensor. Fixed in update 1.8.8
Itschi wrote: Saturday 15 June 2024 17:14 Trying to switch a normal light results in:

Code: Select all

2024-06-15 17:12:53.879 Error: TinyTuya: Call to function 'onCommand' failed, exception details:
2024-06-15 17:12:53.894 Error: TinyTuya: Traceback (most recent call last):
2024-06-15 17:12:53.894 Error: TinyTuya: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-TinyTUYA-Plugin-Master\plugin.py", line 759, in onCommand
2024-06-15 17:12:53.894 Error: TinyTuya: _plugin.onCommand(DeviceID, Unit, Command, Level, Color)
2024-06-15 17:12:53.894 Error: TinyTuya: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-TinyTUYA-Plugin-Master\plugin.py", line 156, in onCommand
2024-06-15 17:12:53.894 Error: TinyTuya: elif dev_type in ('dimmer'):
2024-06-15 17:12:53.894 Error: TinyTuya: TypeError: 'in <string>' requires string as left operand, not dict
The light is detected as dimmer, which could be an error in the detection method. Can you run the 'debug_discovery.py' and send the created JSON file to [email protected]?
Itschi wrote: Saturday 15 June 2024 17:14 I guess this is related to the python 3.6 version. Is there a simple fix for both?
No, I don't think so.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
Ramnol
Posts: 8
Joined: Sunday 18 June 2017 9:52
Target OS: Linux
Domoticz version: 2024.4
Location: Landgraaf, Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Ramnol »

Hi,

Since this morning I'm getting this error every 10 seconds:

2024-06-21 12:57:36.697 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866
2024-06-21 12:58:26.060 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866
2024-06-21 12:58:36.054 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866
2024-06-21 12:58:46.096 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866

I upgraded the plugin from 1.8.6 to 1.8.8 but the error is still there.

What could be wrong, the plugin.py wasn't changed.

Thanks in advance,

Guus.
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

Ramnol wrote: Friday 21 June 2024 13:07 Hi,

Since this morning I'm getting this error every 10 seconds:

2024-06-21 12:57:36.697 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866
2024-06-21 12:58:26.060 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866
2024-06-21 12:58:36.054 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866
2024-06-21 12:58:46.096 Error: Tuya IOT (21-9-2024): handleThread: string indices must be integers line 866

I upgraded the plugin from 1.8.6 to 1.8.8 but the error is still there.

What could be wrong, the plugin.py wasn't changed.

Thanks in advance,

Guus.
Looks like your subscription cloud plan has expired!
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
nebojisa
Posts: 3
Joined: Sunday 28 July 2024 15:25
Target OS: Windows
Domoticz version: 2024.6
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by nebojisa »

Hello,
I installed plugin and temperature sensors show 0 degree, all but one. The one that shows, shows only when I start Domoticz and stays the same all day. In log I see that values have been pulled from Tuya Cloud, just not displayed. I tried "Empty cache and hard reload" in Chrome, not working.
Version: 2024.6
Compile Date: 2024-07-08 09:26:15
dzVents Version: 3.1.8
Python Version: 3.11.0 (main, Oct 24 2022, 18:13:38) [MSC v.1933 32 bit (Intel)]

Code: Select all

2024-07-28 17:04:54.506  TinyTUYA (Cloud): Device name=Temp kupatilo id=bf6857dc83968b0d4fgswb category=sensor
2024-07-28 17:04:55.226  TinyTUYA (Cloud): Device name= Temp kupatilo id= bf6857dc83968b0d4fgswb FunctionProperties= []
2024-07-28 17:04:55.227  TinyTUYA (Cloud): Device name= Temp kupatilo id= bf6857dc83968b0d4fgswb StatusProperties= [{'code': 'temp_current', 'name': '温度', 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'humidity_value', 'name': '湿度数值', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":1000,"scale":1,"step":1}'}, {'code': 'battery_percentage', 'name': '电池电量', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}]
2024-07-28 17:04:55.227  TinyTUYA (Cloud): Device name= Temp kupatilo id= bf6857dc83968b0d4fgswb result= [{'code': 'temp_current', 'value': 237}, {'code': 'humidity_value', 'value': 686}, {'code': 'battery_percentage', 'value': 100}]
2024-07-28 17:04:55.228  TinyTUYA (Cloud): Create Sensor device
2024-07-28 17:04:55.232  Error: TinyTUYA (Cloud): Device read failed: bf6857dc83968b0d4fgswb
2024-07-28 17:04:55.232  TinyTUYA (Cloud): handleThread: 'float' object cannot be interpreted as an integer line 2424

Code: Select all

2024-07-28 17:04:57.360  TinyTUYA (Cloud): Device name=Temp dnevna id=bf389cc55c58b7846axjub category=sensor
2024-07-28 17:04:58.077  TinyTUYA (Cloud): Device name= Temp dnevna id= bf389cc55c58b7846axjub FunctionProperties= [{'code': 'temp_unit_convert', 'desc': '{"range":["c","f"]}', 'name': '温标', 'type': 'Enum', 'values': '{"range":["c","f"]}'}, {'code': 'maxtemp_set', 'desc': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}', 'name': '温度上限设置', 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'minitemp_set', 'desc': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}', 'name': '温度下限设置', 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'maxhum_set', 'desc': '{"unit":"%","min":0,"max":1000,"scale":1,"step":1}', 'name': '湿度上限设置', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":1000,"scale":1,"step":1}'}, {'code': 'minihum_set', 'desc': '{"unit":"%","min":0,"max":1000,"scale":1,"step":1}', 'name': '湿度下限设置', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":1000,"scale":1,"step":1}'}, {'code': 'temp_periodic_report', 'desc': '{"unit":"min","min":5,"max":60,"scale":0,"step":5}', 'name': '温湿度上报时间', 'type': 'Integer', 'values': '{"unit":"min","min":5,"max":60,"scale":0,"step":5}'}]
2024-07-28 17:04:58.078  TinyTUYA (Cloud): Device name= Temp dnevna id= bf389cc55c58b7846axjub StatusProperties= [{'code': 'temp_current', 'name': '温度', 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'humidity_value', 'name': '湿度', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}, {'code': 'battery_percentage', 'name': '电池电量', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":100,"scale":0,"step":1}'}, {'code': 'temp_unit_convert', 'name': '温标', 'type': 'Enum', 'values': '{"range":["c","f"]}'}, {'code': 'maxtemp_set', 'name': '温度上限设置', 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'minitemp_set', 'name': '温度下限设置', 'type': 'Integer', 'values': '{"unit":"℃","min":-200,"max":600,"scale":1,"step":1}'}, {'code': 'maxhum_set', 'name': '湿度上限设置', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":1000,"scale":1,"step":1}'}, {'code': 'minihum_set', 'name': '湿度下限设置', 'type': 'Integer', 'values': '{"unit":"%","min":0,"max":1000,"scale":1,"step":1}'}, {'code': 'temp_alarm', 'name': '温度报警', 'type': 'Enum', 'values': '{"range":["loweralarm","upperalarm","cancel"]}'}, {'code': 'hum_alarm', 'name': '湿度报警', 'type': 'Enum', 'values': '{"range":["loweralarm","upperalarm","cancel"]}'}, {'code': 'temp_periodic_report', 'name': '温湿度上报时间', 'type': 'Integer', 'values': '{"unit":"min","min":5,"max":60,"scale":0,"step":5}'}]
2024-07-28 17:04:58.079  TinyTUYA (Cloud): Device name= Temp dnevna id= bf389cc55c58b7846axjub result= [{'code': 'temp_current', 'value': 212}, {'code': 'humidity_value', 'value': 59}, {'code': 'battery_percentage', 'value': 100}, {'code': 'temp_unit_convert', 'value': 'c'}, {'code': 'maxtemp_set', 'value': 360}, {'code': 'minitemp_set', 'value': 110}, {'code': 'maxhum_set', 'value': 70}, {'code': 'minihum_set', 'value': 20}, {'code': 'temp_alarm', 'value': 'cancel'}, {'code': 'hum_alarm', 'value': 'cancel'}, {'code': 'temp_periodic_report', 'value': 60}]
2024-07-28 17:04:58.080  TinyTUYA (Cloud): Create Sensor device
2024-07-28 17:04:58.084  Error: TinyTUYA (Cloud): Device read failed: bf389cc55c58b7846axjub
2024-07-28 17:04:58.084  TinyTUYA (Cloud): handleThread: 'float' object cannot be interpreted as an integer line 2424
Temp kupatilo shows 0 degree, same as other 5 temp sensors, but in log it's 237
Temp dnevna shows 24,3 C (first reading when Domoticz started) but in log it's 212

Code: Select all

    "name": "Temp kupatilo",
    "id": "bf6857dc83968b0d4fgswb",
    "key": "Deleted",
    "mac": "a4:c1:38:02:14:8e:ca:7c",
    "uuid": "a4c13802148eca7c",
    "sn": "10011550701908",
    "category": "wsdcg",
    "product_name": "Temperature Humidity Sensor",
    "product_id": "xr3htd96",
    "biz_type": 18,
    "model": "",
    "sub": true,
    "icon": "https://images.tuyaeu.com/smart/icon/ay1562830083757AoBrF/cfb6e086fbcecef9711b728b85024b04.png",
    "node_id": "a4c13802148eca7c"
    
    "name": "Temp dnevna",
    "id": "bf389cc55c58b7846axjub",
    "key": "Deleted",
    "mac": "a4:c1:38:15:fc:4f:f5:9b",
    "uuid": "a4c13815fc4ff59b",
    "sn": "10009530100005",
    "category": "wsdcg",
    "product_name": "Zigbee Temperature Humidity Sensor",
    "product_id": "whkgqxse",
    "biz_type": 18,
    "model": "JMTRH02",
    "sub": true,
    "icon": "https://images.tuyaeu.com/smart/icon/ay1562803410690AUgvL/55a250a14dd0efa57ab858a74747408f.jpg",
    "node_id": "a4c13815fc4ff59b"
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

Looks like a conversion issue on the temp_current value, can you run the debug_discovery.py in the tools directory and send the create dump,json file to [email protected], then i can check why the conversion fails.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
gert1956
Posts: 14
Joined: Monday 18 April 2022 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL, Susteren
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by gert1956 »

A couple of weeks ago I bought a QLIMA D 812 Smart dehumidifier and installed it in the basement. Connected it to the Tuya Smart app. It works fine. This week I connected it to Domoticz with this Cloud plugin and studied this topic.
It also works fine. I did write a small python script that turns on the device when the humidity is to high and turn it off when it is ok again. I defined 2 user variables for the limits. Humidity is read by Alecto RFlink devices.
When I inspect the json file created by the debug_discovery.py script I can see that the "water reservoir full" indicator is also available. Is it possible to make it available in Domoticz as well?
@Xenomes, you did a lot of work on this. Thanks for this. I can email the json file when needed.
nebojisa
Posts: 3
Joined: Sunday 28 July 2024 15:25
Target OS: Windows
Domoticz version: 2024.6
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by nebojisa »

Xenomes wrote: Monday 29 July 2024 9:37 Looks like a conversion issue on the temp_current value, can you run the debug_discovery.py in the tools directory and send the create dump,json file to [email protected], then i can check why the conversion fails.
Thank you for taking interest. It is not conversion, values are showing 0 on 5 sensors and one sensor is stuck at fixed value. Anyway, I installed Python Version: 3.8.1 instead of 3.11.0 and now it's working. Thank you
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

nebojisa wrote: Tuesday 30 July 2024 20:30 Thank you for taking interest. It is not conversion, values are showing 0 on 5 sensors and one sensor is stuck at fixed value. Anyway, I installed Python Version: 3.8.1 instead of 3.11.0 and now it's working. Thank you
Thanks for reporting, will test 3.11.0 on the code of the plugin. I currently testing on 3.9.2, the version in the docker environment.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

gert1956 wrote: Tuesday 30 July 2024 17:38 When I inspect the json file created by the debug_discovery.py script I can see that the "water reservoir full" indicator is also available. Is it possible to make it available in Domoticz as well?
Yes, that is possible.
gert1956 wrote: Tuesday 30 July 2024 17:38 @Xenomes, you did a lot of work on this. Thanks for this. I can email the json file when needed.
Better is to open an issue on GitHub or fork the project, make modifications, and create a pull request.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
gert1956
Posts: 14
Joined: Monday 18 April 2022 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL, Susteren
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by gert1956 »

I will do both. Create an issue and try to fork the project. Do not expect miracles. Lot of programming experience from the past. But very new on github and Python.
gert1956
Posts: 14
Joined: Monday 18 April 2022 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL, Susteren
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by gert1956 »

Thanks to Xenomes I could read all my QLIMA data.
Unfortunattely it stopped working
2024-08-11 09:59:29.216 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887
2024-08-11 10:00:39.216 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887
2024-08-11 10:01:49.284 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887
2024-08-11 10:02:59.248 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887

2024-08-11 10:07:16.136 Status: myTuya: Exiting work loop.
2024-08-11 10:07:16.175 Status: myTuya: Stopping threads.
2024-08-11 10:07:16.175 Status: myTuya: Stopped.
2024-08-11 10:15:08.918 Status: myTuya: Entering work loop.
2024-08-11 10:15:08.918 Status: myTuya: Started.
2024-08-11 10:15:09.366 Status: myTuya: Initialized version 1.9.4, author 'Xenomes'
2024-08-11 10:15:27.731 Error: myTuya: handleThread: string indices must be integers line 875
2024-08-11 10:16:17.059 Error: myTuya: handleThread: string indices must be integers line 875
2024-08-11 10:16:27.074 Error: myTuya: handleThread: string indices must be integers line 875
2024-08-11 10:16:37.088 Error: myTuya: handleThread: string indices must be integers line 875
I can login to the IOT developer platform.
Any suggestions?
In the mean time I bought some Action LSC powerplugs with energy monitoring. They integrated fine in the plugin.
I will search for solutions that are cloud independent.
Any suggestions are welcome.
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

gert1956 wrote: Sunday 11 August 2024 10:28 Thanks to Xenomes I could read all my QLIMA data.
Unfortunattely it stopped working
2024-08-11 09:59:29.216 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887
2024-08-11 10:00:39.216 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887
2024-08-11 10:01:49.284 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887
2024-08-11 10:02:59.248 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887

2024-08-11 10:07:16.136 Status: myTuya: Exiting work loop.
2024-08-11 10:07:16.175 Status: myTuya: Stopping threads.
2024-08-11 10:07:16.175 Status: myTuya: Stopped.
2024-08-11 10:15:08.918 Status: myTuya: Entering work loop.
2024-08-11 10:15:08.918 Status: myTuya: Started.
2024-08-11 10:15:09.366 Status: myTuya: Initialized version 1.9.4, author 'Xenomes'
2024-08-11 10:15:27.731 Error: myTuya: handleThread: string indices must be integers line 875
2024-08-11 10:16:17.059 Error: myTuya: handleThread: string indices must be integers line 875
2024-08-11 10:16:27.074 Error: myTuya: handleThread: string indices must be integers line 875
2024-08-11 10:16:37.088 Error: myTuya: handleThread: string indices must be integers line 875
I can login to the IOT developer platform.
Any suggestions?
In the mean time I bought some Action LSC powerplugs with energy monitoring. They integrated fine in the plugin.
I will search for solutions that are cloud independent.
Any suggestions are welcome.
2024-08-11 10:00:39.216 Error: myTuya: handleThread: Credentials are incorrect or tuya subscription has expired! line 887
see: https://github.com/Xenomes/Domoticz-Tin ... on-expired
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
gert1956
Posts: 14
Joined: Monday 18 April 2022 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL, Susteren
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by gert1956 »

Thanks Xenomes for the tip. I tried this yesterday before posting the issue. Will retry carefully later today and record the steps taken
gert1956
Posts: 14
Joined: Monday 18 April 2022 10:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: NL, Susteren
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by gert1956 »

Tried to extend the trial period again, but without result.
I'll create an issue with the proper attachments
Ramnol
Posts: 8
Joined: Sunday 18 June 2017 9:52
Target OS: Linux
Domoticz version: 2024.4
Location: Landgraaf, Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Ramnol »

I would like to make the following points:
I use a Tuya Switch with Energy Monitoring to measure the power of a number of solar panels. The results of the measurements are registered in Domoticz.

In itself, this approach works well with the exception of updating the output of Tuya. This output is not adjusted per (approximately) fixed unit of time, but can remain the same for up to an hour. The output (Watt) of the panels is certainly not the same during an hour.

When I look at the energy monitoring via the smartphone with the Tuya app, it turns out that the updating of the measurements takes place with very short intervals (sometimes per second).

Another observation is that, when information is read out with the smartphone, the updating of the current information via Domoticz with the TinyTUYA-Plugin takes place approximately per minute (i.e. when the update of the Tuya devices takes place).

Question: Is it possible to modify the plugin so that the update takes place based on the current monitoring? This also makes the measurement of the calculated energy in kWh much more accurate.

Kind regards Guus.
User avatar
Xenomes
Posts: 379
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Xenomes »

Ramnol wrote: Thursday 19 September 2024 11:11 Question: Is it possible to modify the plugin so that the update takes place based on the current monitoring? This also makes the measurement of the calculated energy in kWh much more accurate.
Hi, Tinytuya pulls data from the cloud, so increasing the polling calls will exceed the limit very quickly. I've heard that new accounts have a 30,000 call limit per month, but I haven't been able to find this information on the website. Since 60×24×31 equals 44,640 read calls (if polling once per minute), I should reduce the interval to once every 2 minutes to stay within the limit. I’m developing a local version, but it's far from ready due to time constraints 😅. See: https://github.com/Xenomes/Domoticz-Tin ... cal-Plugin
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
ensingg
Posts: 65
Joined: Saturday 22 April 2017 17:35
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by ensingg »

Hi
I have rhe Smart life app in my Android.
But its not clear howc to connect the plugin.
How to create s cloud Account.

Best regards
Gert
edwin1234
Posts: 249
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by edwin1234 »

I have tried this plugin also but got errors in the log,
Can someone help me?

This is in the log:
2024-11-26 18:15:12.908 Tinytuya hardware started.
2024-11-26 18:15:12.908 Status: Tinytuya: (Tinytuya) Started.
2024-11-26 18:15:12.908 Status: Tinytuya: (Tinytuya) Entering work loop.
2024-11-26 18:15:13.683 Error: Tinytuya: (tinytuya) start up failed, Domoticz module not found in interpreter.
2024-11-26 18:15:22.098 Error: Tinytuya: (Tinytuya) 'onHeartbeat' failed 'AttributeError':'module 'fakeDomoticz' has no attribute 'Debug''.
2024-11-26 18:15:22.098 Error: Tinytuya: (Tinytuya) ----> Line 846 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:15:22.098 Error: Tinytuya: (Tinytuya) ----> Line 800 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:15:32.056 Error: Tinytuya: (Tinytuya) 'onHeartbeat' failed 'AttributeError':'module 'fakeDomoticz' has no attribute 'Debug''.
2024-11-26 18:15:32.056 Error: Tinytuya: (Tinytuya) ----> Line 846 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:15:32.056 Error: Tinytuya: (Tinytuya) ----> Line 800 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:15:42.075 Error: Tinytuya: (Tinytuya) 'onHeartbeat' failed 'AttributeError':'module 'fakeDomoticz' has no attribute 'Debug''.
2024-11-26 18:15:42.075 Error: Tinytuya: (Tinytuya) ----> Line 846 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:15:42.075 Error: Tinytuya: (Tinytuya) ----> Line 800 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:15:52.094 Error: Tinytuya: (Tinytuya) 'onHeartbeat' failed 'AttributeError':'module 'fakeDomoticz' has no attribute 'Debug''.
2024-11-26 18:15:52.094 Error: Tinytuya: (Tinytuya) ----> Line 846 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:15:52.094 Error: Tinytuya: (Tinytuya) ----> Line 800 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:16:02.071 Error: Tinytuya: (Tinytuya) 'onHeartbeat' failed 'AttributeError':'module 'fakeDomoticz' has no attribute 'Debug''.
2024-11-26 18:16:02.071 Error: Tinytuya: (Tinytuya) ----> Line 846 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
2024-11-26 18:16:02.071 Error: Tinytuya: (Tinytuya) ----> Line 800 in '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py', function onHeartbeat
Akerboom
Posts: 36
Joined: Thursday 15 March 2018 19:40
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Post by Akerboom »

Please help.

I deleted a TUYA device in Domoticz and got an error:

Code: Select all

Error: TinyTUYA: handleThread: Device not found in Domoticz! Has the device been removed, or is the "Accept New Hardware" option not enabled? line 2324
Tried to delete the plugin in Domoticz Hardware and reinstall with a diffent name. Now all my TUYA devices are gone and I only get the above error.

How to reset and re-add all my devices to Domoticz?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest