Hi Manjh, what is the version of the plug-in you are using?
Python Plugin: TUYA
Moderator: leecollings
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Ah, found it in the setup. Tuyaha, version 0.0.6. Downloaded yesterday.
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
OK, then you are using the other plug-in. Can you try https://github.com/Xenomes/Domoticz-TUYA-Plugin there are more lights selections.
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
AH, so I am using the wrong plugin... Should I remove Tuyaha first?Xenomes wrote: ↑Thursday 18 March 2021 21:33 OK, then you are using the other plug-in. Can you try https://github.com/Xenomes/Domoticz-TUYA-Plugin there are more lights selections.
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
the other plug-in has Tuyaha as a git pull, my one has a pip3 install
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
OK, that was easy.
With your plugin, I can now see a color-circle, but a second one with only warm/cold white. So I can now change the color and dimmer level.
One thing: the device still comes up as RGB. Is that how it was meant to be?
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
Can you run the debug_discovery.py from the tools directory?
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
I get:
Code: Select all
Traceback (most recent call last):
File "debug_discovery.py", ;ine 2, in <module>
import requests
ImportError: No module named requests
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
Did you install requests?manjh wrote: ↑Thursday 18 March 2021 21:59 I get:Code: Select all
Traceback (most recent call last): File "debug_discovery.py", ;ine 2, in <module> import requests ImportError: No module named requests
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Yes, I followed the instructions to the letter!Xenomes wrote: ↑Thursday 18 March 2021 22:00Did you install requests?manjh wrote: ↑Thursday 18 March 2021 21:59 I get:Code: Select all
Traceback (most recent call last): File "debug_discovery.py", ;ine 2, in <module> import requests ImportError: No module named requests
Hans
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
I re-ran the pip3 command, and get two lines saying "already satisfied".
I should note: the devices work just fine. But it seems funny to get a full color selector for a device that is white-only...
I should note: the devices work just fine. But it seems funny to get a full color selector for a device that is white-only...
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
Then you run python ./debug_discovery.py try python3 ./debug_discovery.py
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Ah, that's different.
Code: Select all
Getting credentials
Got credentials
{ 'errorMsg': 'Get accesstoken failed. Invalid parms.',
'responseStatus': 'error'}
Traceback (most recent call last):
File "./debug_discovery.py", line 35, in <module>
payload = {"accessToken": auth_response["access_token"]}
KeyError: 'access_token'
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
That is better, edit the file and fill in the information between CHANGE THISmanjh wrote: ↑Thursday 18 March 2021 22:09 Ah, that's different.Code: Select all
Getting credentials Got credentials { 'errorMsg': 'Get accesstoken failed. Invalid parms.', 'responseStatus': 'error'} Traceback (most recent call last): File "./debug_discovery.py", line 35, in <module> payload = {"accessToken": auth_response["access_token"]} KeyError: 'access_token'
Last edited by Xenomes on Thursday 18 March 2021 22:14, edited 1 time in total.
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
FYI: in the Domoticz log I can see this:
LSC 1 and 2 are the two lamps that I have.
Code: Select all
2021-03-18 22:11:49.254 (Tuya devices) DEV name=LSC 2 state=True id=6276453110521cc9ecd9 online=True
2021-03-18 22:11:49.254 (Tuya devices) DEV name=LSC 1 state=True id=53425342f4cfa209631c online=True
Hans
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Sorry, I must have missed this in the plugin instructions.Xenomes wrote: ↑Thursday 18 March 2021 22:12That is better, edit the file and fill in the information between CHANGE THISmanjh wrote: ↑Thursday 18 March 2021 22:09 Ah, that's different.Code: Select all
Getting credentials Got credentials { 'errorMsg': 'Get accesstoken failed. Invalid parms.', 'responseStatus': 'error'} Traceback (most recent call last): File "./debug_discovery.py", line 35, in <module> payload = {"accessToken": auth_response["access_token"]} KeyError: 'access_token'
Which file should I edit?
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
debug_discovery.py
the tool gives a json string so i can see the what device outputs, then i can update the plugin so a device without rgb has no colour wheel.
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
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
OK, got it.
Code: Select all
Getting credentials
Got credentials
{ 'access_token': 'EUheu1616000992439YNMrdQKReKU4r4S',
'expires_in': 864000,
'refresh_token': 'EUheu1616000992439YNMrdAFLvKdAtuy',
'token_type': 'bearer'}
Getting devices
Got devices
{ 'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': { 'devices': [ { 'data': { 'brightness': '130',
'color_mode': 'white',
'color_temp': 1000,
'online': True,
'state': 'true'},
'dev_type': 'light',
'ha_type': 'light',
'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/15919273389f9d925c99f.png',
'id': '6276453110521cc9ecd9',
'name': 'LSC 2'},
{ 'data': { 'brightness': '10',
'color_mode': 'white',
'color_temp': 1000,
'online': True,
'state': 'true'},
'dev_type': 'light',
'ha_type': 'light',
'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/15919273389f9d925c99f.png',
'id': '53425342f4cfa209631c',
'name': 'LSC 1'}],
'scenes': []}}
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
If you give the device output that is enough, you can mask any info you want.
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
Who is online
Users browsing this forum: Bing [Bot] and 1 guest