Closed Xenomes closed 1 year ago
@CV8R
Can you test this modification of the script? I have no way to test it so it is really experiential. https://github.com/Xenomes/Domoticz-TUYA-Plugin/tree/Climate_Test
Hi @Xenomes
The plugin fails to run.
2020-12-03 08:51:36.577 Error: (tuya) failed to load 'plugin.py', Python Path used was '/home/domoticz/domoticz/plugins/Domoticz-TUYA-Plugin-Climate_Test/:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.8/dist-packages'. 2020-12-03 08:51:36.577 Error: (TUYA) Module Import failed, exception: 'SyntaxError' 2020-12-03 08:51:36.577 Error: (TUYA) Import detail: File: /home/domoticz/domoticz/plugins/Domoticz-TUYA-Plugin-Climate_Test/plugin.py, Line: 112, offset: 9 2020-12-03 08:51:36.577 Error: (TUYA) Error Line ' dev = None
There was something wrong, uploaded a new version.
Hi @Xenomes,
I am so happy with your plugin for Domoticz. Yesterday I installed it and it works!
I use it for a heater in my bathroom of the brand "Flinq"with type number FQ8176 or FQ8177. It is a Dutch company but the heater is manufactured in China (where else?) and works with the TuyaSmart App.
This equipment has the following adjustable values:
1) Power On and Off Which now works with your plugin.
2) Temperature Setpoint and Actual Value
3) Switch for 1KW or 2KW or also called high power and low power
4) Lock On and Off
I would also be very interested to have temperature actual and setting on Domoticz. I would also be interested in the swith for 1/2 KW as well as Lock on and off. That is however less important for me.
Many, many thanks for your plugin. Cees
@Cees2439867 Can you post the result of debug_discovery.py script in the tools directory? maybe there is something in the reported json string.
Dear Xenomes,
The equipment was switched off when I ran the tool.
I have noticed there is a whole bunch of equipment starting to come on the marked that all uses Tuya App. Especially I am looking for movement sensors and temperature/moisture gages. To be able to use those in Domoticz would be awesome.
Many thanks for your support!
Cees
Dear Xenomes, just added two mains switches. Great, enabled "Allow new devices for 5 minutes" and YES! They show up in under the devices tab, awesome! Thanks a lot, Cees
Good to hear the switches a working!
Hi @CV8R
I created a new version of the latest version plug-in and tried to add climate support, are you still able to test it?
Sure I will test it. I need to understand in detail how to install and how to remove. I will get back to you tomorrow with more questions about how to cooperate with you. ā£ Met vriendelijke groet,
Cees Bakker
TypeApp voor Android downloaden ā
Op 13 mei 2021 22:16, om 22:16, Xenomes @.***> schreef:
Hi @CV8R
I created a new version of the latest version plug-in and tried to add climate support, are you still able to test it?
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Xenomes/Domoticz-TUYA-Plugin/issues/3#issuecomment-840807253
Hi @Cees2439867,
I create a new branch Climate_Test, in your case there will be three devices discovered on/off, current temperature and set temperature. Is it possible that you test this version of the plug in? You need to delete your current climate device and update the plug-in and restart Domoticz. Check if the current temperature matches the device (can take a minute to update) also if you can set the temperature from Domoticz and visa versa. If there are error please post the log entries here (Log to all details).
Can you pull the other branch git with this command git pull origin Climate_Test
and back with git pull origin master
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $ sudo git pull origin Climate_Test remote: Enumerating objects: 78, done. remote: Counting objects: 100% (78/78), done. remote: Compressing objects: 100% (69/69), done. remote: Total 78 (delta 31), reused 21 (delta 9), pack-reused 0 Unpacking objects: 100% (78/78), done. From https://github.com/Xenomes/Domoticz-TUYA-Plugin
I see no new devices after 5 minutes. The logfile shows no errors.
Part of the "Status" part of the logfile:
Hope this helps. I have left the system running on your new software as it seems okay.
There is a selection in the configuration Celsius/Fahrenheit. I never set it. So I chose Celsius and updated the Hardware.
The heater switches on and of fine. I wait what I can do. Sorry for the strange letter-types I do not know how to deal with that.
pi@domoticz:~ $ cd /home/pi/domoticz/plugins/Domoticz-TUYA-Plugin pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $ sudo git pull origin master From https://github.com/Xenomes/Domoticz-TUYA-Plugin
I have restarted domoticz. This does not restart. I wll reboot.
Crash is not good... downgrade worked after the reboot? The celcius/fahrenheit i think it is not necessary. Tomorrow i will try to review the code. the rollback command was git checkout origin/HEAD
Hi @Cees2439867,
I found the issue forgot to increase the unit number with the extra devices... Is it possible that you can try again... Hope it don't case a crash again. š
Very nice you found rhe issue. I try tomorrow, otherwise it may take up to the next weekend. I will come back with the results.
ā£ Met vriendelijke groet,
Cees Bakker
TypeApp voor Android downloaden ā
Op 16 mei 2021 21:15, om 21:15, Xenomes @.***> schreef:
Hi @Cees2439867,
I found the issue forgot to increase the unit number with the extra devices... Is it possible that you can try again... Hope it don't case a crash again. š
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Xenomes/Domoticz-TUYA-Plugin/issues/3#issuecomment-841863529
No problem! I will see your result!
BTW. I delete your telephone number from the post.
Oeps, did nor think about that, thanks!
ā£
Op 16 mei 2021 21:24, om 21:24, Xenomes @.***> schreef:
No problem! I will see your result!
BTW. I delete your telephone number from the post.
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Xenomes/Domoticz-TUYA-Plugin/issues/3#issuecomment-841864820
Just been looking to try the new solution. Have you noticed that trying to go back to the previous version of the plugin I see the following on my terminal:
pi@domoticz:~ $ cd /home/pi/domoticz/plugins/Domoticz-TUYA-Plugin
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $ sudo git pull origin master
From https://github.com/Xenomes/Domoticz-TUYA-Plugin
branch master -> FETCH_HEAD
ba7d6dc..965b6d0 master -> origin/master
Already up to date.
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $
It looks like the original version is not reinstalled. Is this okay anyway?
Sorry that command was wrong. please try 'git checkout origin/HEAD'
Unfortunately that gives new messages:
pi@domoticz:~ $ cd /home/pi/domoticz/plugins/Domoticz-TUYA-Plugin
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $ sudo git checkout origin/HEAD
Note: checking out 'origin/HEAD'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 965b6d0 Changed the detected scene's switch type to push button.
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $
I do not understand this...... I have left the system in the state it is.
When you nano the plugin.py can you see that it is version 1.0.9?
I see the following lines:
<plugin key="tuya" name="TUYA" author="Wagner Oliveira contributed Xenomes" version="1.0.9" wikilink="" externallink="https://github.com/Xenomes/Domoticz-TUYA-Plugin.git">
<h2>TUYA Plugin v.1.0.9</h2><br/>
v.1.0.9 is the live version. What went wrong with the test version?
Don't know, have to comeback later........
Op 17 mei 2021 13:17, om 13:17, Xenomes @.***> schreef:
v.1.0.9 is the live version. What went wrong with the test version?
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Xenomes/Domoticz-TUYA-Plugin/issues/3#issuecomment-842240160
I have installed the test version, see below
pi@domoticz:~ $ cd /home/pi/domoticz/plugins/Domoticz-TUYA-Plugin
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $ sudo git pull origin Climate_Test
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), done.
From https://github.com/Xenomes/Domoticz-TUYA-Plugin
* branch Climate_Test -> FETCH_HEAD
ec560c2..03cb033 Climate_Test -> origin/Climate_Test
Updating 965b6d0..03cb033
Fast-forward
README.md | 19 ++++++++++---------
plugin.py | 21 +++++++++++++++++++--
2 files changed, 29 insertions(+), 11 deletions(-)
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $ sudo systemctl restart domoticz.service
pi@domoticz:~/domoticz/plugins/Domoticz-TUYA-Plugin $
The plugin.py shows:
<h2>TUYA Plugin v.1.0.10 alpha</h2><br/>
After installing the new file, in Domoticz, I enabled new equipment for 5 minutes. The log file shows:
2021-05-21 11:33:08.310 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 4 state=False id=bf0d089744373f65f6fdh8 online=True
2021-05-21 11:33:08.310 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 6 state=False id=bf87b0e2b750788d240gj5 online=True
2021-05-21 11:33:08.311 Tuya Apparaten: (Tuya Apparaten) DEV name=Badkamer_545F37 state=False id=76001160483fda545f37 online=True
2021-05-21 11:33:08.311 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 2 state=False id=bf7468802bbe3d2e29aheb online=True
2021-05-21 11:33:08.311 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 3 state=False id=bfc57ce83e976922111ljy online=True
2021-05-21 11:33:08.311 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 5 state=False id=bf4c4b88c0b24c9bbbujfq online=True
2021-05-21 11:33:08.311 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 1 state=False id=bf8f2435897c06be2eaci7 online=True
There is no new devices in Domotics. I will leave the test file installed, or should I remove it?
Ok that looks good. I think you need to delete the climate device and activate the 5 min detection. Then there must be three devices in devices where you can activate them.
Aaah, now I understand. So I deleted the heater device and indeed three devices show up, great! I see the following:
The picture is more than 10 minutes after the devices are added. I see the temperatures of the heater as zero. I have tried setting the 'setpoint' temperature to 20 degrees (from 24). It keeps on showing zero degrees and the heater temperature setpoint does not change. Hope this helps.
Ok, I need to check the device update from tuyaha. I will keep you posted, maybe tonight or tomorrow.
Can you provide me with the part of you log filtered by "Tuya Apparaten"?
Here is the list:
2021-05-23 10:01:17.953 Hoofdmeter: Usage (Momenteel Verbruik L1)
2021-05-23 10:01:18.202 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 4 state=False id=bf0d089744373f65f6fdh8 online=True
2021-05-23 10:01:18.202 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 6 state=False id=bf87b0e2b750788d240gj5 online=True
2021-05-23 10:01:18.202 Tuya Apparaten: (Tuya Apparaten) DEV name=Badkamer_545F37 state=True id=76001160483fda545f37 online=True
2021-05-23 10:01:18.202 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 2 state=False id=bf7468802bbe3d2e29aheb online=True
2021-05-23 10:01:18.202 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 3 state=False id=bfc57ce83e976922111ljy online=True
2021-05-23 10:01:18.202 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 5 state=False id=bf4c4b88c0b24c9bbbujfq online=True
2021-05-23 10:01:18.202 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 1 state=False id=bf8f2435897c06be2eaci7 online=True
Thanks, i need a little bit more information. Can you set the debug in the plugin on "Python Only" and save it by update/aanpassen let it run of a couple of minutes and try to set a temperature hen post the log again.
2021-05-23 10:14:57.942 Hoofdmeter: Usage (Momenteel Verbruik L0) Is this what you need?
2021-05-23 10:14:57.946 Hoofdmeter: Usage (Momenteel Verbruik L1)
2021-05-23 10:14:57.223 Error: Tuya Apparaten: (Tuya Apparaten) Command for DeviceID=76001160483fda545f37 but device is not available.
2021-05-23 10:14:58.636 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 4 state=False id=bf0d089744373f65f6fdh8 online=True
2021-05-23 10:14:58.640 Tuya Apparaten: (Tuya Apparaten) Update 0:'Off' (Tuya Plug 4: Lamp Televisie) TimedOut=False
2021-05-23 10:14:58.640 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 6 state=False id=bf87b0e2b750788d240gj5 online=True
2021-05-23 10:14:58.645 Tuya Apparaten: (Tuya Apparaten) Update 0:'Off' (Tuya Plug 6: Lamp naast Bank) TimedOut=False
2021-05-23 10:14:58.645 Tuya Apparaten: (Tuya Apparaten) DEV name=Badkamer_545F37 state=True id=76001160483fda545f37 online=True
2021-05-23 10:14:58.650 Tuya Apparaten: (Tuya Apparaten) Update 1:'On' (Kachel Badkamer) TimedOut=False
2021-05-23 10:14:58.650 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 2 state=False id=bf7468802bbe3d2e29aheb online=True
2021-05-23 10:14:58.654 Tuya Apparaten: (Tuya Apparaten) Update 0:'Off' (Tuya - Plug 2: Lamp bij Raam) TimedOut=False
2021-05-23 10:14:58.654 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 3 state=False id=bfc57ce83e976922111ljy online=True
2021-05-23 10:14:58.658 Tuya Apparaten: (Tuya Apparaten) Update 0:'Off' (Tuya Plug 3: Lamp naast Kachel) TimedOut=False
2021-05-23 10:14:58.658 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 5 state=False id=bf4c4b88c0b24c9bbbujfq online=True
2021-05-23 10:14:58.662 Tuya Apparaten: (Tuya Apparaten) Update 0:'Off' (Tuya Plug 5: Lamp op Kist) TimedOut=False
2021-05-23 10:14:58.662 Tuya Apparaten: (Tuya Apparaten) DEV name=Wifi Plug 1 state=False id=bf8f2435897c06be2eaci7 online=True
2021-05-23 10:14:58.666 Tuya Apparaten: (Tuya Apparaten) Update 0:'Off' (Tuya - Plug 1: Staande Lamp) TimedOut=False
2021-05-23 10:14:58.926 Hoofdmeter: P1 Smart Meter (Verbruik)
Hi. I'm interested on climate heater support too. I was trying to start with your Climate branch but I cannot find it. What can I do to help?
Hi, is the update to support "climate" available please, as I need to read a thermometer temperature in Domoticz from a "Smartlife" device.
Thanks
Hi @Xenomes , Is this functionality ever implemented in the production (master) branche? The Climate_Test branch is no longer available however my Tuya heater is not fully recognized (only on/off) after several efforts. Currently on 1.0.13. Output of debug script:
Getting devices Got devices { u'header': { u'code': u'SUCCESS', u'payloadVersion': 1}, u'payload': { u'devices': [ { u'data': { u'current_temperature': 21, u'max_temper': 37, u'min_temper': 0, u'online': True, u'state': u'false', u'temperature': 22}, u'dev_type': u'climate', u'ha_type': u'climate', u'icon': u'https://images.tuyaeu.com/smart/program_category_icon/qn.png', u'id': u'74354272c45bbef4adf4', u'name': u'Bureau Vide'}], u'scenes': []}}
Thanks for answering.
Hi @Xenomes
https://www.domoticz.com/forum/viewtopic.php?p=119582#p119582
Thank you for working on this plugin.
I have recently acquired an Inkbird ITC-308-WIFI temperature controller. It reports temperature and allows the switching of heating and cooling based on a set point. I am using it for a Marine Fish Tank.
Below is a dump from your debug_discovery. The TUYA app allows me to set the units switchpoints and various settings but also reports the temp.
Getting devices Got devices { 'header': {'code': 'SUCCESS', 'payloadVersion': 1}, 'payload': { 'devices': [ { 'data': { 'current_temperature': 232, 'max_temper': 2120, 'min_temper': -400, 'online': True, 'state': 'false', 'temperature': 240}, 'dev_type': 'climate', 'ha_type': 'climate', 'icon': 'https://images.tuyaeu.com/smart/icon/15 ... 2c7z_0.png', 'id': '428061235002916fca85', 'name': 'Marine Tank Thermostat'}], 'scenes': []}}
From what I can tell based on the setup of the unit the returned values are as per below. Temps are <value/10> so 232 is 23.2C.
'current_temperature': 232 = Current Temp 'max_temper': 2120, = Max Temp for Alarm 'min_temper': -400, = Min Temp for Alarm 'online': True, = Is the unit online 'state': 'false', = No idea, does not appear to change even if the unit goes into heating or cooling mode. 'temperature': 240 = Set point for the temp
Is it possible that you could look at integrating this device to report at minimum the reported temp and allow setting the set point? There are many things it does via the TUYA app like flag alarms over the max and min alarm set points but I am not sure how I can sniff this data.
Cheers CV8R.