majki09 / domoticz_lg_thinq_plugin

Domoticz plugin for LG ThinQ devices.
MIT License
21 stars 7 forks source link

My LG airco doesn't work with wideq api V1 or V2 #10

Closed smedest closed 2 years ago

smedest commented 2 years ago

Hi, I tried to us the V1 api, didn't work, Thought to try the V2 api. got the right info in my wideq_state file. But when starting the plugin in Domoticz on my synology Nas (not docker, but the last version from Jadahl) it comes with the error: (LG Airco) wideq_state.json status file missing or corrupted.

Did some more investigating: when running the example.py in ssh it doesn't give me an error. when running in monitoring mode, it gives me the results from my airco, Changing settings with the remote, I see it instantly in the monitoring.

What goes wrong? How can I find why domoticz doesn't work with the plugin? I checked the ownership of the whole plugin folder, it's set at user domoticz, group 1000, same as domoticz itself uses. I set the right to 777, so all can access the files, not secure, but for the time being....

I'm not very familiar with python scripting, but can read the files. I allso asked the question on the domoticz forum: https://www.domoticz.com/forum/viewtopic.php?p=292265#p292265

Domoticz info: Version: 2020.2 (build 12731) Build Hash: 7933f659d-modified Compile Date: 2020-12-06 10:22:02 dzVents Version: 3.0.18 Python Version: 3.8.6 (default, Jan 4 2021, 16:11:49) [GCC 4.9.3 20150311 (prerelease)]

majki09 commented 2 years ago

Hi @smedest! Thanks for this issue. I looked into your logs you posted in the domoticz forum (please include it here on github in the future). I think I found presumed issue - there is "var" folder for plugins in your domoticz instance. By default plugin is looking for wideq_state.json file in these paths:

And you have: /var/plugins/domoticz_lg_thinq_plugin/wideq_state.json'

Let's workaround this and move wideq_state.json file:

  1. Create temporary folder mkdir /volume1/@appstore/domoticz/plugins/domoticz_lg_thinq_plugin
  2. Move you wideq_state.json file mv /volume1/@appstore/domoticz/var/plugins/domoticz_lg_thinq_plugin/wideq_state.json /volume1/@appstore/domoticz/plugins/domoticz_lg_thinq_plugin/wideq_state.json
  3. Restart domoticz service (or even whole device if you don't mind).
  4. Check if plugin works.

Let us know once you've finished. If it works, you can leave as it is till this case will be covered in next plugin release.

smedest commented 2 years ago

Still have the same problem within Domoticz. logging: 2022-09-06 16:52:57.428 Status: (LG Airco) Started. 2022-09-06 16:52:58.699 (LG Airco) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL 2022-09-06 16:52:58.697 Status: (LG Airco) Initialized version 1.2.3, author 'majki' 2022-09-06 16:52:58.705 Status: (LG Airco) Entering work loop. 2022-09-06 16:53:14.459 (LG Airco) 'HardwareID':'16' 2022-09-06 16:53:14.459 (LG Airco) 'HomeFolder':'/usr/local/domoticz/var/plugins/domoticz_lg_thinq_plugin/' 2022-09-06 16:53:14.459 (LG Airco) 'StartupFolder':'/usr/local/domoticz/' 2022-09-06 16:53:14.459 (LG Airco) 'UserDataFolder':'/usr/local/domoticz/var/' 2022-09-06 16:53:14.459 (LG Airco) 'Database':'/usr/local/domoticz/var/domoticz.db' 2022-09-06 16:53:14.459 (LG Airco) 'Language':'nl' 2022-09-06 16:53:14.459 (LG Airco) 'Version':'1.2.3' 2022-09-06 16:53:14.459 (LG Airco) 'Author':'majki' 2022-09-06 16:53:14.459 (LG Airco) 'Name':'LG Airco' 2022-09-06 16:53:14.459 (LG Airco) 'Port':'0' 2022-09-06 16:53:14.459 (LG Airco) 'Key':'LG_ThinQ' 2022-09-06 16:53:14.459 (LG Airco) 'Mode1':'type_ac' 2022-09-06 16:53:14.459 (LG Airco) 'Mode2':'b6c20a38-2d08-1ff3-8e00-f8b95aca6158' 2022-09-06 16:53:14.459 (LG Airco) 'Mode3':'NL' 2022-09-06 16:53:14.460 (LG Airco) 'Mode4':'nl-NL' 2022-09-06 16:53:14.460 (LG Airco) 'Mode6':'Debug' 2022-09-06 16:53:14.460 (LG Airco) 'DomoticzVersion':'2020.2 (build 12731)' 2022-09-06 16:53:14.460 (LG Airco) 'DomoticzHash':'7933f659d-modified' 2022-09-06 16:53:14.460 (LG Airco) 'DomoticzBuildTime':'2020-12-06 10:22:02' 2022-09-06 16:53:14.460 (LG Airco) Device count: 0 2022-09-06 16:53:14.458 Error: (LG Airco) wideq_state.json status file missing or corrupted. 2022-09-06 16:53:14.459 Error: (LG Airco) Getting LG device status failed. 2022-09-06 16:53:23.962 (LG Airco) Pushing 'onHeartbeatCallback' on to queue 2022-09-06 16:53:23.994 (LG Airco) Processing 'onHeartbeatCallback' message 2022-09-06 16:53:24.000 (LG Airco) Calling message handler 'onHeartbeat'.

while running the example with info / mon is working, but also error on wideq_state.json: root@Diskstation216:/volume1/@appstore/domoticz/var/plugins/domoticz_lg_thinq_plugin# python3 example.py -c NL -l nl-NL mon xxxx 2022-09-06 17:00:24 INFO [wideq.example] Could not load wideq_state file from .//plugins//domoticz_lg_thinq_plugin//wideq_state.json 2022-09-06 17:00:24 INFO [wideq.example] Could not load wideq_state file from docker location: .//userdata//plugins//domoticz_lg_thinq_plugin//wideq_state.json 2022-09-06 17:00:24 ERROR [wideq.example] wideq_state file not found. Trying to load default STATE_FILE: wideq_state.json 2022-09-06 17:00:24 INFO [wideq.example] wideq_state will be loaded from: wideq_state.json 2022-09-06 17:00:24 INFO [wideq.example] State data loaded from /volume1/@appstore/domoticz/var/plugins/domoticz_lg_thinq_plugin/wideq_state.json' state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH state on; COOL; cur 78°F; cfg 76°F; fan speed HIGH ^Z [1]+ Stopped python3 example.py -c NL -l nl-NL mon xxxxxxx

majki09 commented 2 years ago

You should be now warned that your domoticz installation is deprecated and no longer supported.

I don't have no experience with Synology NAS so far, so it's hard for me to help. However, I have modified the code for this case, try it, but expect no further support for deprecated or outdated installations.