This fixes #83 - I have the same LP1419IVSM Air Conditioner model, and it causes an error when turning on using wideq. I've updated the ACDevice class with two new @properties, which are the list of Operations the device supports, and the best-supported ON operation from that list. This makes the presumption that if the model reports ALL_ON as available, that it is appropriate to use (as the existing code did), but if ALL_ON is not supported by the particular model, it will fall back to using whichever ON Operation it reports as supporting. In the case of the LP1419, that will be RIGHT_ON. Additionally, as a backstop, this will raise an error if ALL_ON is not supported but there are still more than one supported ON operation - from reading issues I haven't been able to find any evidence that such a device exists, but if one should pop up it'll likely need handling in some creative way. These new values are now also reported in the ac-config subcommand of example.py. Finally, this updates the set_on method to use the resultant operation name. This now means that example.py set [id] on works for my air conditioner again, and just in time for the warmer weather!
WideQ
A library for interacting with the "LG SmartThinq" system, which can control heat pumps and such. I reverse-engineered the API from their mobile app.
To try out the API, there is a simple command-line tool included here, called 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 Korean, for example, you'd use -c KR -l ko-KR
.
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. You can also specify one of several other commands:
ls
: List devices (the default).mon <ID>
: Monitor a device continuously, printing out status information until you type control-C. Provide a device ID obtained from listing your devices.ac-mon <ID>
: Likemon
, but only for AC devices---prints out specific climate-related information in a more readable form.set-temp <ID> <TEMP>
: Set the target temperature for an AC device.turn <ID> <ONOFF>
: Turn an AC device on or off. Use "on" or "off" as the second argument.ac-config <ID>
: Print out some configuration information about an AC device.
Credits
This is by Adrian Sampson. The license is MIT. I also made a Home Assistant component that uses wideq.