GithubHelp home page GithubHelp logo

majki09 / domoticz_lg_thinq_plugin Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 7.0 131 KB

Domoticz plugin for LG ThinQ devices.

License: MIT License

Python 100.00%
python domoticz domoticz-plugin lg thinq lg-thinq lg-thinq-api airconditioning heatpump

domoticz_lg_thinq_plugin's Introduction

"Buy Me A Coffee"

Domoticz LG ThinQ (with WideQ) plugin.

🔥 NEW! Energy history script -> scroll down below

alt text

⚠️ New users of LG ThinQ: This library only works with v2 of the LG ThinQ API. You can check if your device is compatible when you execute the example.py. To use it, provide it with a country and language code via the -c and -l flags, respectively:

$ python3 example.py -c US -l en-US

LG accounts seem to be associated with specific countries, so be sure to use the one with which you originally created your account. For Polish, for example, you'd use -c PL -l en-US.

On first run, the script will ask you to log in with your LG account. Logging in with Google does not seem to work, but other methods (plain email & password, Facebook, and Amazon) do.

By default, the example just lists the devices associated with your account.

Installation

  1. Clone plugin to your domoticz

    cd /home/pi/domoticz/plugins
    git clone https://github.com/majki09/domoticz_lg_thinq_plugin.git
    cd ./domoticz_lg_thinq_plugin
    
  2. Login and get your token. Put your own country and language codes.

    $ python3 example.py -c US -l en-US
    

    Copy and go to given address with your browser. Log in, copy new address from your browser and paste it to console window.

⚠️ In case your device is not compatible, you will NOT get wideq_state.json and you will get following message:

   thinq1 devices: 1
   WARNING! Following devices are V1 LG API and will likely NOT work with this domoticz plugin!

   ab123456-c3c5-8181-9ec2-abcdef123456: LG thinq1 device (AC AWHP_5555_WW / thinq1)

   thinq2 devices: 0

   --------------------------------------------------------------------------------
   You don't have any thinq2 (LG API V2) device. This plugin will not work for you.
   wideq_state.json file will NOT be generated.
   --------------------------------------------------------------------------------

Proceed only if you have at least one thinq2 compatible device listed, which can look like this:

   thinq2 devices: 1
   ed123456-f3c5-1616-9ec2-abcdef123456: Klima (AC RAC_056905_WW / thinq2)

which ed123456-f3c5-1616-9ec2-abcdef123456 is Device ID (yours will be different). Note down your AC's Device ID to notepad. You will get your wideq_state.json file in plugin folder.

  1. Restart your domoticz.

    $ sudo systemctl restart domoticz.service
    
  2. Open Hardware tab and you should be now able to add new LG ThinQ device to your domoticz. Put your country and language codes and device ID. Click Add and new domoticz devices should be created. That's it!

Docker

Just install like any other plugin - manual: https://www.domoticz.com/wiki/Docker#Python_Plugins. The rest is pretty the same. To avoid loosing your wideq_state.json file (e.g. when recreating the container) just keep it under /userdata folder - that's it!

Development

The API has been reverse-engineered from LG's mobile app. This project is based on wideq project that has been developed by Adrian Sampson and modified for v2 by no2chem in his fork. I have made domoticz plugin then which uses most of their work for LG's server connection.

Notes

  • devices are updated with a heartbeat (every 60 seconds). If you change your AC's parameters with IR remote or mobile app, changes are not updated imidiately in your domoticz. Not applicable for domoticz control.

To-do

  • force status updates more often - for now statuses like internal temp. or set-point are updated only while turning on the device.

Energy history script

Now extra file came into our repository to put your LG device's energy history into domoticz! Ladies and Gentleman, let me introduce energy_history2domoticz.py 🎆

It can get your LG device's power consumption history, day-by-day and update it to your domoticz managed counter device. LG's servers limitation is 2 years (732 days) back. You need to put right dates, otherwise you will get an 9999 error.

Usage

  1. Create new Managed Counter in your Domoticz and notice it's IDX - this will be your energy device.
  2. Make it able to insert data into history log according to this manual.
  3. Run the script.

Arguments:

  • -d LG device ID,
  • -u domoticz URL,
  • -i Managed Counter's IDX,
  • -s start date
  • -e end date

Example:

python3 energy_history2domoticz.py -c PL -l en-US -d ed123456-f3c5-1616-9ec2-abcdef123456 -u http://192.168.0.50:8080 -i 287 -s 2023-07-16 -e 2023-07-19
2023-07-20 13:18:13 INFO [wideq.example] Getting energy history data from range 2023-07-16 - 2023-07-19 from LG server...
2023-07-20 13:18:13 INFO [wideq.example] Energy history data from range 2023-07-16 - 2023-07-19 successfully fetched from LG server.
2023-07-20 13:18:18 INFO [wideq.example] 1/4 25%	Sending 2023-07-16 (45)	OK
2023-07-20 13:18:19 INFO [wideq.example] 2/4 50%	Sending 2023-07-17 (5)	OK
2023-07-20 13:18:20 INFO [wideq.example] 3/4 75%	Sending 2023-07-18 (6)	OK
2023-07-20 13:18:21 INFO [wideq.example] 4/4 100%	Sending 2023-07-19 (7)	OK

Credits

Many thanks for

The license is MIT.

"Buy Me A Coffee"

domoticz_lg_thinq_plugin's People

Contributors

avriessen avatar majki09 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

domoticz_lg_thinq_plugin's Issues

wideq_state.json file not existing and not created

Expected behaviour:
preconditions

  • GIT project cloned
  • User on machine has access and write rights in plugin folder
    run example.py
    -- country specification
    -- language specification

URL copy/paste request comes up to obtain API key

Experienced behaviour:
Error code on line 268 of example.py
wideq_state.json is not present, i/o error

Solution:

  • create a file wideq_state.json
    -- i.e. 'touch wideq_state.json'
  • edit file and add empty response brackets to make it a minimal JSON file
    -- i.e. vi wideq_state.json, add {}, save and close

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

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)]

Sleep timer on certain LG AC models

For reference, I have an LG LP1419IVSM.AC1AHDC (https://www.lg.com/ca_en/heating-and-cooling/portable-air-conditioner/lp1419ivsm/). I wanted to set/read the current sleep timer (a feature that slowly increases the temperature on the AC-side while you sleep).

Some debugging logs
{
    "airState.windStrength": 2,
    "fwUpgradeInfo": {
        "upgSched": {
            "upgUtc": "0",
            "cmd": "none"
        }
    },
    "airState.notification": 0,
    "static": {
        "deviceType": "401",
        "countryCode": "CA"
    },
    "airState.tempState.current": 26,
    "airState.diagCode": 0,
    "mid": 176302357,
    "airState.energy.onCurrent": 72,
    "airState.reservation.sleepTime": 0,
    "airState.quality.sensorMon": 0,
    "airState.tempState.target": 20,
    "airState.miscFuncState.autoDryRemainTime": 0,
    "airState.operation": 1,
    "airState.reservation.targetTimeToStart": 0,
    "meta": {
        "allDeviceInfoUpdate": false,
        "messageId": ""
    },
    "online": true,
    "airState.opMode": 2,
    "airState.reservation.targetTimeToStop": 0,
    "airState.filterMngStates.maxTime": 250,
    "airState.filterMngStates.useTime": 0,
    "airState.wDir.vStep": 100,
    "timestamp": 1708251304654
}

The key in question would be: "airState.reservation.sleepTime": 0, which can be both set and read with the same property. It currently does not exist in the ACDevice class.

Additional devices

Hi @majki09 ,

I've got an LG washer I'dd like to add using your plugin as basis. I could refactor the whole thing so this plugin supports more than just the AC's, but that would require some work on your end to keep the AC u pand running (I may break some things....)

So do you feel like doing this? If not, I'll just fork

Restart Plugin

Hi I am using this plugin with two LG Airconditioning units using Domoticz 2023.1. The setup of this plugin is pretty straight forward and works OK. The problem that I have is that it works OK for around 2 hours. After this period of time, the plugin stops responding. The solution is then to restart the Domoticz service or I can disable and re-enable the plugin in the Hardware tab of Domoticz.

Funny thing is; I have two LG airco's (multisplit) and therefore I have 2 hardware devices listed in Domoticz using this plugin. When it stops working; both airco's cannot be controlled with Domoticz anymore, but the funny part is that disabling and re-enabling one LG hardware unit in Domoticz will make that one work again. But the strange part is that the Airco is still not working, also by disabling and re-enabling the plugin will it responds back. Is this a bug with the Domoticz plugin?

A snippit of what I see in the Domoticz logging:

Error: LG: Call to function 'onCommand' failed, exception details:
Error: LG: Traceback (most recent call last):
Error: LG: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 575, in onCommand
Error: LG: _plugin.onCommand(Unit, Command, Level, Hue)
Error: LG: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 201, in onCommand
Error: LG: self.lg_device.set_on(True)
Error: LG: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/ac.py", line 327, in set_on
Error: LG: self._set_control("airState.operation", op_value, command="Operation")
Error: LG: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 470, in _set_control
Error: LG: self.client.session.device_control(
Error: LG: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 601, in device_control
Error: LG: res = self.post(controlPath, data)
Error: LG: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 492, in post
Error: LG: return thinq_request(
Error: LG: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 281, in thinq_request
Error: LG: raise API_ERRORS
Error: LG: wideq.core.NotLoggedInError: 0102

Basically it says not logged in I guess; but the plugin uses that Wideq file for authentication. I don't know exactly how this works, but I would not suggest that restarting a service of Domoticz (or the hardware) should fix the issue. So I think there something else causing the failture after some time.

Set Target Temperature

Hi,

Great plugin, thanks! I was wondering, is it possible to make a function which can set the target temperature from the Domoticz device? So, for example, it can be used in LUA scripting?

Thanks
Frank

How to use with domoticz docker image

Hi!

The apt packages are not all available inside the official domoticz docker image.
Following the installation steps will work for the running container, but whenever it gets recreated, it'll be all gone.
So how could I use this with the docker image? I'm afraid that I'll have to create my own image based on the official image, or are there other ways?

lg-wh27s

Hi, got an lg-wh27s heatpumpboiler

it seems not to be recognised ; will this be supported in future ?

thinq2 devices: 1
ValueError: 406 is not a valid DeviceType

Reinstallation Failed

Hi,

Everything was running perfectly since the last couple of days, but I needed to restart Domoticz today. Unfortunately the plugin stopped working after the restart. I have tried to reinstall it, so to start fresh, but I am not able to initialize the plugin. When executing the Example.py, I get the following error:

Traceback (most recent call last):
  File "example.py", line 423, in <module>
    main()
  File "example.py", line 419, in main
    ret = example(args.country, args.language, args.verbose, cmd=args.cmd, args=args.args)
  File "example.py", line 335, in example
    resp = example_command(client, cmd, args)
  File "example.py", line 283, in example_command
    return func(client, *args)
  File "example.py", line 59, in ls
    thinq1_devices = [dev for dev in client.devices if dev.platform_type == "thinq1"]
  File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 135, in devices
    self._devices = self.session.get_devices()
  File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 525, in get_devices
    return get_list(self.get("service/application/dashboard"), "item")
  File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 510, in get
    return thinq_request(
  File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 281, in thinq_request
    raise API_ERRORS[code](code)
wideq.core.AgreementError: 0110

Any idea hat could cause this?

Restart Plugin - issue presented again but no more usable

Hi Majki09,
same issue #15
no other changes or update in the infrastructure/devices on my side.
today I saw logs error continuosly and I had to disable both devices on DZ.

please have a look my error logs below:

2023-07-04 10:48:43.511 Error: AC Room1: Call to function 'onHeartbeat' failed, exception details:
2023-07-04 10:48:43.513 Error: AC Room1: Traceback (most recent call last):
2023-07-04 10:48:43.514 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 341, in onHeartbeat
2023-07-04 10:48:43.514 Error: AC Room1: self.lg_device_status = self.lg_device.get_status()
2023-07-04 10:48:43.515 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/ac.py", line 372, in get_status
2023-07-04 10:48:43.515 Error: AC Room1: res = self._get_deviceinfo_from_snapshot()
2023-07-04 10:48:43.516 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 460, in _get_deviceinfo_from_snapshot
2023-07-04 10:48:43.516 Error: AC Room1: devices = self.client.session.get_devices()
2023-07-04 10:48:43.517 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 525, in get_devices
2023-07-04 10:48:43.518 Error: AC Room1: return get_list(self.get("service/application/dashboard"), "item")
2023-07-04 10:48:43.518 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 516, in get
2023-07-04 10:48:43.519 Error: AC Room1: language=self.auth.gateway.language,
2023-07-04 10:48:43.519 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 281, in thinq_request
2023-07-04 10:48:43.520 Error: AC Room1: raise API_ERRORS[code](code)
2023-07-04 10:48:43.520 Error: AC Room1: wideq.core.NotLoggedInError: 0102
2023-07-04 10:48:43.521 Error: AC Room1:
2023-07-04 10:48:43.521 Error: AC Room1: During handling of the above exception, another exception occurred:
2023-07-04 10:48:43.522 Error: AC Room1:
2023-07-04 10:48:43.523 Error: AC Room1: Traceback (most recent call last):
2023-07-04 10:48:43.523 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 578, in onHeartbeat
2023-07-04 10:48:43.524 Error: AC Room1: _plugin.onHeartbeat()
2023-07-04 10:48:43.524 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 378, in onHeartbeat
2023-07-04 10:48:43.525 Error: AC Room1: self.lg_device = self.wideq_object.operate_device(device_id=self.DEVICE_ID)
2023-07-04 10:48:43.525 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 745, in operate_device
2023-07-04 10:48:43.526 Error: AC Room1: lg_device = wideq.ACDevice(client, self._force_device(client, device_id))
2023-07-04 10:48:43.526 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 726, in _force_device
2023-07-04 10:48:43.527 Error: AC Room1: device = client.get_device(device_id)
2023-07-04 10:48:43.528 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 144, in get_device
2023-07-04 10:48:43.528 Error: AC Room1: for device in self.devices:
2023-07-04 10:48:43.528 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 135, in devices
2023-07-04 10:48:43.528 Error: AC Room1: self._devices = self.session.get_devices()
2023-07-04 10:48:43.528 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 525, in get_devices
2023-07-04 10:48:43.528 Error: AC Room1: return get_list(self.get("service/application/dashboard"), "item")
2023-07-04 10:48:43.528 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 516, in get
2023-07-04 10:48:43.528 Error: AC Room1: language=self.auth.gateway.language,
2023-07-04 10:48:43.528 Error: AC Room1: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 281, in thinq_request
2023-07-04 10:48:43.528 Error: AC Room1: raise API_ERRORS[code](code)
2023-07-04 10:48:43.528 Error: AC Room1: wideq.core.AgreementError: 0110


2023-07-04 10:49:45.275 Error: AC Room2: Call to function 'onHeartbeat' failed, exception details:
2023-07-04 10:49:45.279 Error: AC Room2: Traceback (most recent call last):
2023-07-04 10:49:45.279 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 341, in onHeartbeat
2023-07-04 10:49:45.279 Error: AC Room2: self.lg_device_status = self.lg_device.get_status()
2023-07-04 10:49:45.279 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/ac.py", line 372, in get_status
2023-07-04 10:49:45.280 Error: AC Room2: res = self._get_deviceinfo_from_snapshot()
2023-07-04 10:49:45.280 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 460, in _get_deviceinfo_from_snapshot
2023-07-04 10:49:45.280 Error: AC Room2: devices = self.client.session.get_devices()
2023-07-04 10:49:45.280 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 525, in get_devices
2023-07-04 10:49:45.280 Error: AC Room2: return get_list(self.get("service/application/dashboard"), "item")
2023-07-04 10:49:45.280 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 516, in get
2023-07-04 10:49:45.280 Error: AC Room2: language=self.auth.gateway.language,
2023-07-04 10:49:45.280 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 281, in thinq_request
2023-07-04 10:49:45.280 Error: AC Room2: raise API_ERRORS[code](code)
2023-07-04 10:49:45.280 Error: AC Room2: wideq.core.NotLoggedInError: 0102
2023-07-04 10:49:45.281 Error: AC Room2:
2023-07-04 10:49:45.281 Error: AC Room2: During handling of the above exception, another exception occurred:
2023-07-04 10:49:45.281 Error: AC Room2:
2023-07-04 10:49:45.281 Error: AC Room2: Traceback (most recent call last):
2023-07-04 10:49:45.281 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 578, in onHeartbeat
2023-07-04 10:49:45.281 Error: AC Room2: _plugin.onHeartbeat()
2023-07-04 10:49:45.281 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 378, in onHeartbeat
2023-07-04 10:49:45.281 Error: AC Room2: self.lg_device = self.wideq_object.operate_device(device_id=self.DEVICE_ID)
2023-07-04 10:49:45.281 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 745, in operate_device
2023-07-04 10:49:45.281 Error: AC Room2: lg_device = wideq.ACDevice(client, self._force_device(client, device_id))
2023-07-04 10:49:45.281 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 726, in _force_device
2023-07-04 10:49:45.282 Error: AC Room2: device = client.get_device(device_id)
2023-07-04 10:49:45.282 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 144, in get_device
2023-07-04 10:49:45.282 Error: AC Room2: for device in self.devices:
2023-07-04 10:49:45.282 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 135, in devices
2023-07-04 10:49:45.282 Error: AC Room2: self._devices = self.session.get_devices()
2023-07-04 10:49:45.282 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 525, in get_devices
2023-07-04 10:49:45.282 Error: AC Room2: return get_list(self.get("service/application/dashboard"), "item")
2023-07-04 10:49:45.282 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 516, in get
2023-07-04 10:49:45.282 Error: AC Room2: language=self.auth.gateway.language,
2023-07-04 10:49:45.282 Error: AC Room2: File "/home/<username>/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 281, in thinq_request
2023-07-04 10:49:45.282 Error: AC Room2: raise API_ERRORS[code](code)
2023-07-04 10:49:45.282 Error: AC Room2: wideq.core.AgreementError: 0110 

I've already disabled and re-enabled them but no luck.
please are you able to something ?

currently is unusable

Regards

Room temp sensor not updating

Hi,

It seems that on my device the current room temp. is not updating.
After using the lg thinq app, the temp. is updated once.
How can it be forced to update it in the api?
Same for the filter indicators

Errors log before and after last update

Hello Majki09,
I got again errors on LG Ac devices, different errors before and after the last plugin update:

before the upgrade

2023-09-11 01:49:48.362 Error: AC Room1: Call to function 'onHeartbeat' failed, exception details:
2023-09-11 01:49:48.363 Error: AC Room1: Traceback (most recent call last):
2023-09-11 01:49:48.363 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 578, in onHeartbeat
2023-09-11 01:49:48.363 Error: AC Room1: _plugin.onHeartbeat()
2023-09-11 01:49:48.363 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 341, in onHeartbeat
2023-09-11 01:49:48.363 Error: AC Room1: self.lg_device_status = self.lg_device.get_status()
2023-09-11 01:49:48.363 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/ac.py", line 372, in get_status
2023-09-11 01:49:48.363 Error: AC Room1: res = self._get_deviceinfo_from_snapshot()
2023-09-11 01:49:48.363 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 460, in _get_deviceinfo_from_snapshot
2023-09-11 01:49:48.363 Error: AC Room1: devices = self.client.session.get_devices()
2023-09-11 01:49:48.363 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 525, in get_devices
2023-09-11 01:49:48.363 Error: AC Room1: return get_list(self.get("service/application/dashboard"), "item")
2023-09-11 01:49:48.363 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 516, in get
2023-09-11 01:49:48.363 Error: AC Room1: language=self.auth.gateway.language,
2023-09-11 01:49:48.363 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 283, in thinq_request
2023-09-11 01:49:48.363 Error: AC Room1: raise APIError(code)
2023-09-11 01:49:48.364 Error: AC Room1: wideq.core.APIError: 9995

After plugin update:

2023-09-20 14:00:09.232 Error: AC Room1: Call to function 'onHeartbeat' failed, exception details:
2023-09-20 14:00:09.237 Error: AC Room1: Traceback (most recent call last):
2023-09-20 14:00:09.238 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 578, in onHeartbeat
2023-09-20 14:00:09.238 Error: AC Room1: _plugin.onHeartbeat()
2023-09-20 14:00:09.238 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py", line 341, in onHeartbeat
2023-09-20 14:00:09.238 Error: AC Room1: self.lg_device_status = self.lg_device.get_status()
2023-09-20 14:00:09.238 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/ac.py", line 372, in get_status
2023-09-20 14:00:09.238 Error: AC Room1: res = self._get_deviceinfo_from_snapshot()
2023-09-20 14:00:09.238 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 460, in _get_deviceinfo_from_snapshot
2023-09-20 14:00:09.238 Error: AC Room1: devices = self.client.session.get_devices()
2023-09-20 14:00:09.238 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 526, in get_devices
2023-09-20 14:00:09.238 Error: AC Room1: return get_list(self.get("service/application/dashboard"), "item")
2023-09-20 14:00:09.238 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 517, in get
2023-09-20 14:00:09.238 Error: AC Room1: language=self.auth.gateway.language,
2023-09-20 14:00:09.238 Error: AC Room1: File "/home/user/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/core.py", line 284, in thinq_request
2023-09-20 14:00:09.238 Error: AC Room1: raise APIError(code)
2023-09-20 14:00:09.238 Error: AC Room1: wideq.core.APIError: 9999

devices works anyway, but I have huge spam of logs in the error page

could you fix it ?

Regards

KeyError onHeartbeat - no control or updates of LG AC

Hi.
I have installed plugin, run example.py with my settings (PL and en-EN), I entered my redirected URL and got my Device ID:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx: NAME_OF_AC_IN_LG_BACKEND (AC RAC_xxxxxx_WW / thinq1)
I have copied wideq_state.json to domoticz home dir.
I added my hardware in domoticz.
It created devices, but it didn't get proper status.

In domoticz logs I got this:

2021-10-18 18:39:47.373 [7fd3d7fff700] Error: LG AC: (LG AC) 'onHeartbeat' failed 'KeyError'.
2021-10-18 18:39:47.374 [7fd3d7fff700] Error: LG AC: (LG AC) ----> Line 414 in '/home/server/Domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py'
2021-10-18 18:39:47.374 [7fd3d7fff700] Error: LG AC: (LG AC) ----> Line 263 in '/home/server/Domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py'
2021-10-18 18:39:47.374 [7fd3d7fff700] Error: LG AC: (LG AC) ----> Line 367 in '/home/server/Domoticz/plugins/domoticz_lg_thinq_plugin/wideq/ac.py'
2021-10-18 18:39:47.374 [7fd3d7fff700] Error: LG AC: (LG AC) ----> Line 466 in '/home/server/Domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py'

is my AC not complatible with v2 API or it might be something else?

upgrade plugin also for v1 devices?

Majki,

Thanks for the plugin. I have a new single split with API v1. Since olinek2 doesn't seem to maintain it anymore API v1, are you thinking of updating the plugin to be able to work with v1 devices?

Kind regards

LG ThinQ: (LG ThinQ) 'onStart' failed 'EOFError':'EOF when reading a line'.

The V2 plugin worked perfect. however after a reinstall of domoticz it suddenly give me error below.

The script is working and detecting the AC.

2021-08-31 09:02:24.837 Error: LG ThinQ: (LG ThinQ) 'onStart' failed 'EOFError':'EOF when reading a line'.
2021-08-31 09:02:24.837 Error: LG ThinQ: (LG ThinQ) Exception traceback:
2021-08-31 09:02:24.837 Error: LG ThinQ: (LG ThinQ) ----> Line 383 in '/home/stingone/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py'
2021-08-31 09:02:24.837 Error: LG ThinQ: (LG ThinQ) ----> Line 115 in '/home/stingone/domoticz/plugins/domoticz_lg_thinq_plugin/plugin.py'
2021-08-31 09:02:24.837 Error: LG ThinQ: (LG ThinQ) ----> Line 254 in '/home/stingone/domoticz/plugins/domoticz_lg_thinq_plugin/example.py'
2021-08-31 09:02:24.837 Error: LG ThinQ: (LG ThinQ) ----> Line 27 in '/home/stingone/domoticz/plugins/domoticz_lg_thinq_plugin/example.py'

Connect from belgium with google

Hi,

When trying to setup the plugin i cannot get the first step to get the authentication from thinq.

As i registered my thinq account in belgium with google i do enter:

$ python3 example.py -c BE -l be-FR

When doing that the page doesn't show the google sign in... that i can re-enable by removing the show_thirdparty_login from the query or update it to contain GGL

When trying to sign in with google, i am following trough confirming my mail and password and when redirected to lg... googles complains about an unauthorized URL :-(

Cédric

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.