Python Plugin: LG Smart AC (SmartThinQ) Topic is solved
Moderator: leecollings
-
- Posts: 8
- Joined: Wednesday 24 July 2019 8:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Hello majki,
Due to a technical issue I had with one of my heat pumps module, one was replaced today. I used for the last 2 years the v1 api but once new module was added to my mobile phone application, it does not appear in my updated list of modules. So I made the assumption I may need v2 api for this new module.
I installed your plugin but I am facing an issue which apparently already happened to someone on this thread:
pi@Pie4B:~/domoticz/plugins/domoticz_lg_thinq_plugin $ python3 example.py -c FR -l fr-FR
2022-03-07 17:44:38 ERROR [wideq.example] No state file found (tried: '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq_state.json')
Traceback (most recent call last):
File "example.py", line 268, in example
with open(STATE_FILE) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'wideq_state.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "example.py", line 382, in <module>
main()
File "example.py", line 378, in main
ret = example(args.country, args.language, args.verbose, cmd=args.cmd, args=args.args)
File "example.py", line 273, in example
raise IOError
OSError
Obviously the file wideq_state.json does not exists yet so this error is sort of expected but when this last happened to someone you made a modification to your plugin.
Can you please assist me so I will be able to run example.py and check if my missing device appears with the V2 api ?
Many thanks in advance.
Regards.
Due to a technical issue I had with one of my heat pumps module, one was replaced today. I used for the last 2 years the v1 api but once new module was added to my mobile phone application, it does not appear in my updated list of modules. So I made the assumption I may need v2 api for this new module.
I installed your plugin but I am facing an issue which apparently already happened to someone on this thread:
pi@Pie4B:~/domoticz/plugins/domoticz_lg_thinq_plugin $ python3 example.py -c FR -l fr-FR
2022-03-07 17:44:38 ERROR [wideq.example] No state file found (tried: '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq_state.json')
Traceback (most recent call last):
File "example.py", line 268, in example
with open(STATE_FILE) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'wideq_state.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "example.py", line 382, in <module>
main()
File "example.py", line 378, in main
ret = example(args.country, args.language, args.verbose, cmd=args.cmd, args=args.args)
File "example.py", line 273, in example
raise IOError
OSError
Obviously the file wideq_state.json does not exists yet so this error is sort of expected but when this last happened to someone you made a modification to your plugin.
Can you please assist me so I will be able to run example.py and check if my missing device appears with the V2 api ?
Many thanks in advance.
Regards.
-
- Posts: 4
- Joined: Tuesday 22 February 2022 23:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: Warsaw
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Please try this:
https://github.com/majki09/domoticz_lg_ ... n/issues/7
Please note, that you must have LG account different than google
https://github.com/majki09/domoticz_lg_ ... n/issues/7
Please note, that you must have LG account different than google
-
- Posts: 8
- Joined: Wednesday 24 July 2019 8:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Thank you superprzemo. This is working now. As expected my new module is a v2. So I will have to use a hybrid config until there will be one plugin supporting both v1 and v2
-
- Posts: 17
- Joined: Friday 09 October 2020 8:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Location: Netherlands
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Since yesterday I receive errors like:
or
Maybe it's caused by LG outage, or caused by something else?
Issue seems gone for a while when I disable and enable the hardware (plugin) in Domoticz.
*edit* hm the last shown error keeps coming back, can't controle the AC anymore, when I want to switch it on:
Code: Select all
2022-03-30 22:02:23.240 Error: LG Thinq: 'onHeartbeat' failed 'APIError':'9995'.
2022-03-30 22:02:23.240 Error: LG Thinq: Exception traceback:
2022-03-30 22:02:23.240 Error: LG Thinq: ----> Line 418 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py', function onHeartbeat
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 269 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py', function onHeartbeat
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 296 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py', function example
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 159 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py', function _force_device
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 144 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py', function get_device
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 135 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py', function devices
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 526 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py', function get_devices
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 517 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py', function get
2022-03-30 22:02:23.241 Error: LG Thinq: ----> Line 284 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py', function thinq_request
Code: Select all
2022-03-31 21:13:24.252 Error: LG Thinq: ----> Line 282 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py', function thinq_request
2022-03-31 21:13:34.282 Error: LG Thinq: 'onHeartbeat' failed 'TypeError':'__init__() takes 1 positional argument but 2 were given'.
2022-03-31 21:13:34.282 Error: LG Thinq: Exception traceback:
2022-03-31 21:13:34.282 Error: LG Thinq: ----> Line 418 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py', function onHeartbeat
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 269 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py', function onHeartbeat
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 296 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py', function example
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 159 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py', function _force_device
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 144 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py', function get_device
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 135 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py', function devices
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 526 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py', function get_devices
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 517 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py', function get
2022-03-31 21:13:34.283 Error: LG Thinq: ----> Line 282 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py', function thinq_request
Issue seems gone for a while when I disable and enable the hardware (plugin) in Domoticz.
*edit* hm the last shown error keeps coming back, can't controle the AC anymore, when I want to switch it on:
Code: Select all
2022-03-31 21:40:06.738 Error: LG Thinq: 'onCommand' failed 'AttributeError':''NoneType' object has no attribute 'set_on''.
2022-03-31 21:40:06.738 Error: LG Thinq: Exception traceback:
2022-03-31 21:40:06.738 Error: LG Thinq: ----> Line 410 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py', function onCommand
2022-03-31 21:40:06.738 Error: LG Thinq: ----> Line 146 in '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py', function onCommand
-
- Posts: 21
- Joined: Monday 19 July 2021 14:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Krakow, PL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Hi gvrgvr!
First, make sure that you are using latest plugin version (git pull). Second, open LG ThinQ app on your smartphone and if there's new license to accept, please do it. Sometimes when we have API errors like this it's caused by changes in license and it have to be accepted with the app. No problem when you are using app only, new license dialog shows up with app start anyway. For this moment, our plugin is not aware of any license changes and throws errors, because it cannot connect to API.
Also, I've sometimes seen API errors when I was adding heat-pump feature (with other user's installation), but with my own configuration (AC only) there was no such an API errors. It appeared randomly, I don't know the real reason of this for now, but I hope it is just license thing in your case.
First, make sure that you are using latest plugin version (git pull). Second, open LG ThinQ app on your smartphone and if there's new license to accept, please do it. Sometimes when we have API errors like this it's caused by changes in license and it have to be accepted with the app. No problem when you are using app only, new license dialog shows up with app start anyway. For this moment, our plugin is not aware of any license changes and throws errors, because it cannot connect to API.
Also, I've sometimes seen API errors when I was adding heat-pump feature (with other user's installation), but with my own configuration (AC only) there was no such an API errors. It appeared randomly, I don't know the real reason of this for now, but I hope it is just license thing in your case.
-
- Posts: 17
- Joined: Friday 09 October 2020 8:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Location: Netherlands
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Hi Majki, yesterday I checked the LG app, there was no licence to accept, today I checked again, surprise, there's a new license to accept!majki wrote: ↑Friday 01 April 2022 6:50 Hi gvrgvr!
First, make sure that you are using latest plugin version (git pull). Second, open LG ThinQ app on your smartphone and if there's new license to accept, please do it. Sometimes when we have API errors like this it's caused by changes in license and it have to be accepted with the app. No problem when you are using app only, new license dialog shows up with app start anyway. For this moment, our plugin is not aware of any license changes and throws errors, because it cannot connect to API.
Also, I've sometimes seen API errors when I was adding heat-pump feature (with other user's installation), but with my own configuration (AC only) there was no such an API errors. It appeared randomly, I don't know the real reason of this for now, but I hope it is just license thing in your case.
That caused the errors, it's working again, thank you for the help!
-
- Posts: 21
- Joined: Monday 19 July 2021 14:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Krakow, PL
- Contact:
Heatpump now available!
Guys!
I have now pushed new version with heatpumps integration. Just pull last version from github and enjoy!
Many thanks for @superprzemo for supporting his wideq file (yes, integration was made remotely )
-
- 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: LG Smart AC (SmartThinQ)
Did try to install the original plugin on Ubuntu. It worked for some time. (Olek (Olinek2) and the fork of Herman (heggink) as well)
Now I get an error from Domoticz on restart
'PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform'
Any suggestions?
This plugin uses the wideq modified library. This plugin contains some modified functions from the domoticz-mirobot-plugin library. This plugin contains some modified functions from the domoticz_daikin_BRP069A42 library. LG AC Smarthing Unit control for Domoticz
Before installation plugin check the python3, python3-dev, pip3 is installed for Domoticz plugin system:
sudo apt-get install python3 python3-dev python3-pip. done
Make sure you have libffi and openssl headers installed, you can do this on Debian-based systems (like Rasperry Pi) with:
sudo apt-get install libffi-dev libssl-dev. done
Also do note that the setuptools version is too old for installing some requirements, so before trying to install this package you should update the setuptools with:
sudo pip3 install -U setuptools. done
Install all necessary libraries for LGACServer.py:
sudo pip3 install gevent msgpack-python greenlet. done
Install [LGAC_SmartT] by typing something like:
$ git clone https://github.com/olinek2/LGAC_SmartT done
$ cd LGAC_SmartT done
$ sudo pip3 install -e . done
Update region data inside wideq.py file. For US it looks like this:
GATEWAY_URL = 'https://kic.lgthinq.com:46030/api/common/gatewayUriList'
APP_KEY = 'wideq'
SECURITY_KEY = 'nuts_securitykey'
DATA_ROOT = 'lgedmRoot'
COUNTRY = 'US'
LANGUAGE = 'en-US'
SVC_CODE = 'SVC202'
CLIENT_ID = 'LGAO221A02'
OAUTH_SECRET_KEY = 'c053c2a6ddeb7ad97cb0eed0dcb31cf8'
OAUTH_CLIENT_KEY = 'LGAO221A02'
DATE_FORMAT = '%a, %d %b %Y %H:%M:%S +0000'
For Poland and probably rest of EU like that:
GATEWAY_URL = 'https://kic.lgthinq.com:46030/api/common/gatewayUriList'
APP_KEY = 'wideq'
SECURITY_KEY = 'nuts_securitykey'
DATA_ROOT = 'lgedmRoot'
COUNTRY = 'PL' done
LANGUAGE = 'en-EN'
SVC_CODE = 'SVC202'
CLIENT_ID = 'LGAO221A02'
OAUTH_SECRET_KEY = 'c053c2a6ddeb7ad97cb0eed0dcb31cf8'
OAUTH_CLIENT_KEY = 'LGAO221A02'
DATE_FORMAT = '%a, %d %b %Y %H:%M:%S +0000'
To do that just open it in nano and save (Ctrl+X. yes and enter): nano wideq.py
Authenticate with the SmartThing service to get a refresh token by running the WideQ example script.Run this in the wideq directory:
python3 example.py done
The script will ask you to open a browser, log in, and then paste the URL you're redirected to. It will then write a JSON file called wideq_state.json. done
Look inside this file for a key called "refresh_token" and copy the value.
We also need an AC Device Number. To obtain it run:
python3 example.py ls done
Device number looks like that: "????????-????-????-????-????????????": KLIMATYZATOR (AC Rxxx_xxx_xx)
After obtaining this two values just put them inside LGACServerNew.py file at default parser arguments.
parser.add_argument('--acDevNum', type=str, help='AC Device Number', default='copied dev num') done
parser.add_argument('--token', type=str, help='Refresh Token', default='copied token') done
Make it executable: sudo chmod +x LGACServerNew.py done
To check if the server is operating properly type: ./LGACServerNew.py. done
It will start operation. Open another terminal window, log in, navigate to 'LGAC_SmartT' folder cd LGAC_SmartT and run testServer.py file:
sudo python3 testServer.py.
You should observe communication between this two applications.
To run server automatically the service has to be made. Paths in line ExecStart=/usr/bin/python3 /home/pi/wideq/LGACServerNew.py is for python path (use: which python3) and second phrase is for location of LGACServerNew.py path. Make service file in systemd: sudo nano /lib/systemd/system/lgac_server.service. Paste this text with path modification: done
[Unit]
Description=LG AC Device Server
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/pi/LGAC_SmartT/LGACServerNew.py
Restart=on-abort
[Install]
WantedBy=multi-user.target
Press Ctrl+X, hit Y to save and enter.Then set privilidges: sudo chmod 644 /lib/systemd/system/lgac_server.service. Reload daemon and make service running, then check a status of service: done
sudo systemctl daemon-reload done
sudo systemctl enable lgac_server.service done
sudo systemctl start lgac_server done
sudo systemctl status lgac_server done
Status should look like this:
● lgac_server.service - LG AC Device Server
Loaded: loaded (/lib/systemd/system/lgac_server.service; enabled; vendor preset: enabled
Active: active (running) since Tue 2018-06-19 08:15:57 CEST; 2s ago
Main PID: 9288 (python3)
CPU: 1.958s
CGroup: /system.slice/lgac_server.service
└─9288 /usr/bin/python3 /home/pi/wideq/LGACServerNew.py
Jun 19 08:15:57 raspberrypi systemd[1]: Started LG AC Device Server.
Jun 19 08:15:59 raspberrypi python3[9288]: server: Starting server on 127.0.0.1 22233 Na herstart doet de test het nog steeds
Copy plugin to domoticz plugins folder and restart domoticz. Add hardware from list after restart and check if it is operating:
cp -Rf LG-SThinq-AC ~/domoticz/plugins/LG-SThinq-AC done
sudo service domoticz restart done
Now I get an error from Domoticz on restart
'PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform'
Any suggestions?
This plugin uses the wideq modified library. This plugin contains some modified functions from the domoticz-mirobot-plugin library. This plugin contains some modified functions from the domoticz_daikin_BRP069A42 library. LG AC Smarthing Unit control for Domoticz
Before installation plugin check the python3, python3-dev, pip3 is installed for Domoticz plugin system:
sudo apt-get install python3 python3-dev python3-pip. done
Make sure you have libffi and openssl headers installed, you can do this on Debian-based systems (like Rasperry Pi) with:
sudo apt-get install libffi-dev libssl-dev. done
Also do note that the setuptools version is too old for installing some requirements, so before trying to install this package you should update the setuptools with:
sudo pip3 install -U setuptools. done
Install all necessary libraries for LGACServer.py:
sudo pip3 install gevent msgpack-python greenlet. done
Install [LGAC_SmartT] by typing something like:
$ git clone https://github.com/olinek2/LGAC_SmartT done
$ cd LGAC_SmartT done
$ sudo pip3 install -e . done
Update region data inside wideq.py file. For US it looks like this:
GATEWAY_URL = 'https://kic.lgthinq.com:46030/api/common/gatewayUriList'
APP_KEY = 'wideq'
SECURITY_KEY = 'nuts_securitykey'
DATA_ROOT = 'lgedmRoot'
COUNTRY = 'US'
LANGUAGE = 'en-US'
SVC_CODE = 'SVC202'
CLIENT_ID = 'LGAO221A02'
OAUTH_SECRET_KEY = 'c053c2a6ddeb7ad97cb0eed0dcb31cf8'
OAUTH_CLIENT_KEY = 'LGAO221A02'
DATE_FORMAT = '%a, %d %b %Y %H:%M:%S +0000'
For Poland and probably rest of EU like that:
GATEWAY_URL = 'https://kic.lgthinq.com:46030/api/common/gatewayUriList'
APP_KEY = 'wideq'
SECURITY_KEY = 'nuts_securitykey'
DATA_ROOT = 'lgedmRoot'
COUNTRY = 'PL' done
LANGUAGE = 'en-EN'
SVC_CODE = 'SVC202'
CLIENT_ID = 'LGAO221A02'
OAUTH_SECRET_KEY = 'c053c2a6ddeb7ad97cb0eed0dcb31cf8'
OAUTH_CLIENT_KEY = 'LGAO221A02'
DATE_FORMAT = '%a, %d %b %Y %H:%M:%S +0000'
To do that just open it in nano and save (Ctrl+X. yes and enter): nano wideq.py
Authenticate with the SmartThing service to get a refresh token by running the WideQ example script.Run this in the wideq directory:
python3 example.py done
The script will ask you to open a browser, log in, and then paste the URL you're redirected to. It will then write a JSON file called wideq_state.json. done
Look inside this file for a key called "refresh_token" and copy the value.
We also need an AC Device Number. To obtain it run:
python3 example.py ls done
Device number looks like that: "????????-????-????-????-????????????": KLIMATYZATOR (AC Rxxx_xxx_xx)
After obtaining this two values just put them inside LGACServerNew.py file at default parser arguments.
parser.add_argument('--acDevNum', type=str, help='AC Device Number', default='copied dev num') done
parser.add_argument('--token', type=str, help='Refresh Token', default='copied token') done
Make it executable: sudo chmod +x LGACServerNew.py done
To check if the server is operating properly type: ./LGACServerNew.py. done
It will start operation. Open another terminal window, log in, navigate to 'LGAC_SmartT' folder cd LGAC_SmartT and run testServer.py file:
sudo python3 testServer.py.
You should observe communication between this two applications.
To run server automatically the service has to be made. Paths in line ExecStart=/usr/bin/python3 /home/pi/wideq/LGACServerNew.py is for python path (use: which python3) and second phrase is for location of LGACServerNew.py path. Make service file in systemd: sudo nano /lib/systemd/system/lgac_server.service. Paste this text with path modification: done
[Unit]
Description=LG AC Device Server
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/pi/LGAC_SmartT/LGACServerNew.py
Restart=on-abort
[Install]
WantedBy=multi-user.target
Press Ctrl+X, hit Y to save and enter.Then set privilidges: sudo chmod 644 /lib/systemd/system/lgac_server.service. Reload daemon and make service running, then check a status of service: done
sudo systemctl daemon-reload done
sudo systemctl enable lgac_server.service done
sudo systemctl start lgac_server done
sudo systemctl status lgac_server done
Status should look like this:
● lgac_server.service - LG AC Device Server
Loaded: loaded (/lib/systemd/system/lgac_server.service; enabled; vendor preset: enabled
Active: active (running) since Tue 2018-06-19 08:15:57 CEST; 2s ago
Main PID: 9288 (python3)
CPU: 1.958s
CGroup: /system.slice/lgac_server.service
└─9288 /usr/bin/python3 /home/pi/wideq/LGACServerNew.py
Jun 19 08:15:57 raspberrypi systemd[1]: Started LG AC Device Server.
Jun 19 08:15:59 raspberrypi python3[9288]: server: Starting server on 127.0.0.1 22233 Na herstart doet de test het nog steeds
Copy plugin to domoticz plugins folder and restart domoticz. Add hardware from list after restart and check if it is operating:
cp -Rf LG-SThinq-AC ~/domoticz/plugins/LG-SThinq-AC done
sudo service domoticz restart done
-
- 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: LG Smart AC (SmartThinQ)
Its related to 3.10 of python; some stupid string compare
I'll repair that and create a fork.
First have to find out how to do that.
I am a retired seasoned professional programmer; not in python but in many other languages.
With a little help from my internet friends I'll probably manage.
I'll repair that and create a fork.
First have to find out how to do that.
I am a retired seasoned professional programmer; not in python but in many other languages.
With a little help from my internet friends I'll probably manage.
-
- 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: LG Smart AC (SmartThinQ)
The Domoticz Beta solves the problem. Its still not working, but I'll learn Python first before further investigation
-
- Posts: 6
- Joined: Thursday 26 March 2020 9:01
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Hi All,
Got a question: after installing the plugin (from github majki09), executing the example.py, getting the wideq_state.json with api version 2. Restarting Domoticz, adding the new hardware; I got an error: wideq_state.json file missing or corrupted
logging:
2022-08-30 11:28:09.484 Error: Restarting: Airco beheer
2022-08-30 11:28:10.343 (Airco beheer) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2022-08-30 11:28:10.341 Status: (Airco beheer) Entering work loop.
2022-08-30 11:28:10.341 Status: (Airco beheer) Initialized version 1.2.3, author 'majki'
2022-08-30 11:28:25.756 (Airco beheer) 'HardwareID':'16'
2022-08-30 11:28:25.757 (Airco beheer) 'HomeFolder':'/usr/local/domoticz/var/plugins/domoticz_lg_thinq_plugin/'
2022-08-30 11:28:25.757 (Airco beheer) 'StartupFolder':'/usr/local/domoticz/'
2022-08-30 11:28:25.757 (Airco beheer) 'UserDataFolder':'/usr/local/domoticz/var/'
2022-08-30 11:28:25.757 (Airco beheer) 'Database':'/usr/local/domoticz/var/domoticz.db'
2022-08-30 11:28:25.757 (Airco beheer) 'Language':'nl'
2022-08-30 11:28:25.757 (Airco beheer) 'Version':'1.2.3'
2022-08-30 11:28:25.757 (Airco beheer) 'Author':'majki'
2022-08-30 11:28:25.757 (Airco beheer) 'Name':'Airco beheer'
2022-08-30 11:28:25.757 (Airco beheer) 'Port':'0'
2022-08-30 11:28:25.758 (Airco beheer) 'Key':'LG_ThinQ'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode1':'type_ac'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode2':'xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxx'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode3':'NL'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode4':'nl-NL'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode6':'Debug'
2022-08-30 11:28:25.758 (Airco beheer) 'DomoticzVersion':'2020.2 (build 12731)'
2022-08-30 11:28:25.758 (Airco beheer) 'DomoticzHash':'xxxx-modified'
2022-08-30 11:28:25.758 (Airco beheer) 'DomoticzBuildTime':'2020-12-06 10:22:02'
2022-08-30 11:28:25.758 (Airco beheer) Device count: 0
2022-08-30 11:28:25.756 Error: (Airco beheer) wideq_state.json status file missing or corrupted.
2022-08-30 11:28:25.756 Error: (Airco beheer) Getting LG device status failed.
2022-08-30 11:28:35.260 (Airco beheer) Pushing 'onHeartbeatCallback' on to queue
2022-08-30 11:28:35.272 (Airco beheer) Processing 'onHeartbeatCallback' message
2022-08-30 11:28:35.272 (Airco beheer) Calling message handler 'onHeartbeat'.
2022-08-30 11:28:45.261 (Airco beheer) Pushing 'onHeartbeatCallback' on to queue
2022-08-30 11:28:45.286 (Airco beheer) Processing 'onHeartbeatCallback' message
2022-08-30 11:28:45.286 (Airco beheer) Calling message handler 'onHeartbeat'.
What's wrong with my setup; why is the device count zero?
Got a question: after installing the plugin (from github majki09), executing the example.py, getting the wideq_state.json with api version 2. Restarting Domoticz, adding the new hardware; I got an error: wideq_state.json file missing or corrupted
logging:
2022-08-30 11:28:09.484 Error: Restarting: Airco beheer
2022-08-30 11:28:10.343 (Airco beheer) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2022-08-30 11:28:10.341 Status: (Airco beheer) Entering work loop.
2022-08-30 11:28:10.341 Status: (Airco beheer) Initialized version 1.2.3, author 'majki'
2022-08-30 11:28:25.756 (Airco beheer) 'HardwareID':'16'
2022-08-30 11:28:25.757 (Airco beheer) 'HomeFolder':'/usr/local/domoticz/var/plugins/domoticz_lg_thinq_plugin/'
2022-08-30 11:28:25.757 (Airco beheer) 'StartupFolder':'/usr/local/domoticz/'
2022-08-30 11:28:25.757 (Airco beheer) 'UserDataFolder':'/usr/local/domoticz/var/'
2022-08-30 11:28:25.757 (Airco beheer) 'Database':'/usr/local/domoticz/var/domoticz.db'
2022-08-30 11:28:25.757 (Airco beheer) 'Language':'nl'
2022-08-30 11:28:25.757 (Airco beheer) 'Version':'1.2.3'
2022-08-30 11:28:25.757 (Airco beheer) 'Author':'majki'
2022-08-30 11:28:25.757 (Airco beheer) 'Name':'Airco beheer'
2022-08-30 11:28:25.757 (Airco beheer) 'Port':'0'
2022-08-30 11:28:25.758 (Airco beheer) 'Key':'LG_ThinQ'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode1':'type_ac'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode2':'xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxx'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode3':'NL'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode4':'nl-NL'
2022-08-30 11:28:25.758 (Airco beheer) 'Mode6':'Debug'
2022-08-30 11:28:25.758 (Airco beheer) 'DomoticzVersion':'2020.2 (build 12731)'
2022-08-30 11:28:25.758 (Airco beheer) 'DomoticzHash':'xxxx-modified'
2022-08-30 11:28:25.758 (Airco beheer) 'DomoticzBuildTime':'2020-12-06 10:22:02'
2022-08-30 11:28:25.758 (Airco beheer) Device count: 0
2022-08-30 11:28:25.756 Error: (Airco beheer) wideq_state.json status file missing or corrupted.
2022-08-30 11:28:25.756 Error: (Airco beheer) Getting LG device status failed.
2022-08-30 11:28:35.260 (Airco beheer) Pushing 'onHeartbeatCallback' on to queue
2022-08-30 11:28:35.272 (Airco beheer) Processing 'onHeartbeatCallback' message
2022-08-30 11:28:35.272 (Airco beheer) Calling message handler 'onHeartbeat'.
2022-08-30 11:28:45.261 (Airco beheer) Pushing 'onHeartbeatCallback' on to queue
2022-08-30 11:28:45.286 (Airco beheer) Processing 'onHeartbeatCallback' message
2022-08-30 11:28:45.286 (Airco beheer) Calling message handler 'onHeartbeat'.
What's wrong with my setup; why is the device count zero?
- waltervl
- Posts: 5149
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
So you have a wideq_state.json file in your plugin folder?
Is it readable for the user running Domoticz? Perhaps you have to change the permissions.
Is it readable for the user running Domoticz? Perhaps you have to change the permissions.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 6
- Joined: Thursday 26 March 2020 9:01
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Hi,
yes, I have a wideq_state.json file. it has owner Domoticz.
Tried the api V1 version as well, no luck.
wideq_state.json:
{"model_info": {}, "gateway": {"auth_base": "https://nl.m.lgaccount.com", "api_root": "https://eic-service.lgthinq.com:46030/v1", "country": "NL", "language": "nl-NL"}, "auth": {"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "refresh_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "user_number": "NLxxxxxxxxxxxxxxx", "oauth_root": "https://gb.lgeapi.com/"}, "session": null, "country": "NL", "language": "nl-NL"}
output of example.py:
python3 example.py -c NL -l nl-NL
2022-09-01 09:21:47 INFO [wideq.example] Could not load wideq_state file from .//plugins//domoticz_lg_thinq_plugin//wideq_state.json
2022-09-01 09:21:47 INFO [wideq.example] Could not load wideq_state file from docker location: .//userdata//plugins//domoticz_lg_thinq_plugin//wideq_state.json
2022-09-01 09:21:47 ERROR [wideq.example] wideq_state file not found. Trying to load default STATE_FILE: wideq_state.json
2022-09-01 09:21:47 INFO [wideq.example] wideq_state will be loaded from: wideq_state.json
2022-09-01 09:21:47 INFO [wideq.example] State data loaded from /volume1/@appstore/domoticz/var/plugins/domoticz_lg_thinq_plugin/wideq_state.json'
2022-09-01 09:21:48 INFO [wideq.example] Session expired.
thinq2 devices: 1
b6c20a38-2d08-1ff3-8e00-f8b95aca6158: Air Conditioning/Air Care (AC RAC_056905_WW / thinq2)
2022-09-01 09:21:49 INFO [wideq.example] Wrote state file '/volume1/@appstore/domoticz/var/plugins/domoticz_lg_thinq_plugin/wideq_state.json'
yes, I have a wideq_state.json file. it has owner Domoticz.
Tried the api V1 version as well, no luck.
wideq_state.json:
{"model_info": {}, "gateway": {"auth_base": "https://nl.m.lgaccount.com", "api_root": "https://eic-service.lgthinq.com:46030/v1", "country": "NL", "language": "nl-NL"}, "auth": {"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "refresh_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "user_number": "NLxxxxxxxxxxxxxxx", "oauth_root": "https://gb.lgeapi.com/"}, "session": null, "country": "NL", "language": "nl-NL"}
output of example.py:
python3 example.py -c NL -l nl-NL
2022-09-01 09:21:47 INFO [wideq.example] Could not load wideq_state file from .//plugins//domoticz_lg_thinq_plugin//wideq_state.json
2022-09-01 09:21:47 INFO [wideq.example] Could not load wideq_state file from docker location: .//userdata//plugins//domoticz_lg_thinq_plugin//wideq_state.json
2022-09-01 09:21:47 ERROR [wideq.example] wideq_state file not found. Trying to load default STATE_FILE: wideq_state.json
2022-09-01 09:21:47 INFO [wideq.example] wideq_state will be loaded from: wideq_state.json
2022-09-01 09:21:47 INFO [wideq.example] State data loaded from /volume1/@appstore/domoticz/var/plugins/domoticz_lg_thinq_plugin/wideq_state.json'
2022-09-01 09:21:48 INFO [wideq.example] Session expired.
thinq2 devices: 1
b6c20a38-2d08-1ff3-8e00-f8b95aca6158: Air Conditioning/Air Care (AC RAC_056905_WW / thinq2)
2022-09-01 09:21:49 INFO [wideq.example] Wrote state file '/volume1/@appstore/domoticz/var/plugins/domoticz_lg_thinq_plugin/wideq_state.json'
-
- Posts: 6
- Joined: Thursday 26 March 2020 9:01
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
No one to help me out?
- waltervl
- Posts: 5149
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Alternative you can create an issue in the github repository of this plugin https://github.com/majki09/domoticz_lg_thinq_plugin
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 6
- Joined: Thursday 26 March 2020 9:01
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Done that.waltervl wrote: ↑Friday 02 September 2022 12:56Alternative you can create an issue in the github repository of this plugin https://github.com/majki09/domoticz_lg_thinq_plugin
I almost have the idea that my domoticz version is outdated on my synology DS216+ with DSM 6.2:
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)]
- waltervl
- Posts: 5149
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Indeed outdated. Try the dockerized Domoticz version, see wiki https://www.domoticz.com/wiki/Synologysmedest wrote: ↑Monday 05 September 2022 14:01Done that.waltervl wrote: ↑Friday 02 September 2022 12:56Alternative you can create an issue in the github repository of this plugin https://github.com/majki09/domoticz_lg_thinq_plugin
I almost have the idea that my domoticz version is outdated on my synology DS216+ with DSM 6.2:
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)]
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 21
- Joined: Monday 19 July 2021 14:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Krakow, PL
- Contact:
Re: Python Plugin: LG Smart AC (SmartThinQ)
Hi @smedest.
I think I've found the issue - you have "/var" folder for your plugins and this path is not covered by the plugin yet. I've posted a reply on your github issue:
https://github.com/majki09/domoticz_lg_ ... 1237701750
Also thanks for you @waltervl for trying to help - I have missed last post from this forum. And I really prefer people report issues on github, rather than domoticz forum, so
if you found any issue for this plugin, please report this on github
https://github.com/majki09/domoticz_lg_ ... new/choose
thanks
We can still discuss about plugin itself here on our best domoticz forum
I think I've found the issue - you have "/var" folder for your plugins and this path is not covered by the plugin yet. I've posted a reply on your github issue:
https://github.com/majki09/domoticz_lg_ ... 1237701750
Also thanks for you @waltervl for trying to help - I have missed last post from this forum. And I really prefer people report issues on github, rather than domoticz forum, so
if you found any issue for this plugin, please report this on github
https://github.com/majki09/domoticz_lg_ ... new/choose
thanks
We can still discuss about plugin itself here on our best domoticz forum
Re: Python Plugin: LG Smart AC (SmartThinQ)
The LG ThinQ plugin works perfectly with my LG Airconditioning unit. Happy that I can control it with Domoticz! Thanks; great work.
Re: Python Plugin: LG Smart AC (SmartThinQ)
Now I have issue's with this LG ThinQ plugin. When I enable and configure the Plugin, everything is working OK. But after a few days, when I check again, it says that the session is expired. At that point I need to delete the wideq_state.json and reinitiaze the plugin, After that, it is working again, but it looks like that there is a problem with my credentials. Any idea?
Edit-> I did some additional testing; but it seems like I am able to control the LG Airco for around 2 hours within Domoticz. After that I get an error message that I am not logged in anymore and I get all kind off errors. The only strange part is; I do not have to delete the wideq_state.json file, only a restart off Domoticz is sufficient to get it going for again 2 hours. I find this strange; because this would suggest that the Plugin by itself is working OK; could this be a bug within Domoticz? Any help is appreciated.
Who is online
Users browsing this forum: Google [Bot] and 1 guest