domoticz_lg_thinq_plugin
domoticz_lg_thinq_plugin copied to clipboard
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
Hi Jan!
It's just great that you want to contribute and upgrade this plugin!
Since there is no API V2 documentation available all we need is to get all fields that API is delivering for the washer. You just need to generate wideq token file, debug the script and check what fields you will get from the API. With these we can modify the plugin to have washers support.
You can try by yourself or I can do it for you, but I will need your wideq token file (I don't have LG washer).
Was your washer detected by the plugin?
I'm pleased to help.
Hey,
I'm fine with building the washer interface (it won't be the first plugin I'm building). And yes, it was returned as a V2 device.
So my plan is to first explore the API for the washer a bit and then rework the example.py to get the generic part out to do the setup and separate the wrapper functionality for the AC in such a way that I can re-use it for the washer and perhaps later someone else can build the other types (it's not so convenient to do when you're not owning one).
Give me a couple of days and I'll come up with a proposal.
Hello,
We also have an LG washer and intresed in the washer interface :) @JanJaapKo did you have any luck to get it to work?
Thanks,
Michael
I haven't got any further than playing around a bit, since I've got another plugin I'm fixing first..... Will probably take me about a month or so to get some pilot version to work.......
So I haven't forgotten about it ;)
Hi all, we too are working with dryer & washer combination. I've found this repository by @fison67 that has a v1 and a v2 set of commands for multiple devices, supporting Korean and English languages.
Have a look in the Groovy files for a dryer here https://github.com/fison67/LG-Connector/blob/master/devicetypes/fison67/lg-dryer.src/lg-dryer.groovy and the washer here https://github.com/fison67/LG-Connector/blob/master/devicetypes/fison67/lg-washer-v2.src/lg-washer-v2.groovy There might be some caveats, as one could doubt whether the url extension on the washer on line 242 is actually the implementation, but who knows :)
@JanJaapKo any luck or news to get it to work? :)
Thanks
Hi ! I also got a v2 LG Washer/Dryer that is recognized by this plugin. Is there anything I can do to contribute (I do have some 30+ years experience in C/C++ and I have made some very minor contributions related to MySensors to the domoticz development a few years ago) ? I assume we "just" need to translate needed parts of the Java-code posted in the link(s) by Artens above into the existing python-plugin-code, right ?
Cheers !
Hi all,
I haven't had much time to spend on this one lately (busy with other plugins and other hobbies as well....) so haven't done anything, basically and do not really foresee to do so anytime soon...... What I saw from first investigation is that the design of the plugin needs to be reworked to accommodate the fact that it needs to handle multiple device types. Now it is simply handling one type (AC). If anyone else wants to have a go, be my guest ;). I'll be happy to help out.
@majki09 does your plugin currently supports heat exchange boilers like the WH27S ? I installed and tried it, but got some strange results.
@majki09 does your plugin currently supports heat exchange boilers like the WH27S ? I installed and tried it, but got some strange results.
Currently it does not. The thing is that every type of device has to be added separately with parsing it's unique wideq file and API fields. It's easy when I own a device (AC) or somebody will send me his wideq file (like we did with heat pump), otherwise it's hard to implement something new. Also, there is a way Artens mentioned, but I did not have time to try it out yet.
hello just downloaded your plugin (i have LG washer) example found device: thinq2 devices: 1 c67409de-e50c-1760-87e8-4cbad734366d: Pračka s předním plněním (WASHER F_V7_Y___W.B_2QEUK / thinq2)
i can send wideq_state.json or if you give me info where to dig i can try.... :)
found this file with washer&Drier for HA https://github.com/ollo69/ha-smartthinq-sensors/blob/0b320c64206dae4750b7b04efd04014d35b449fd/custom_components/smartthinq_sensors/wideq/devices/washerDryer.py
and here is my device.data output
https://objectcontent.lgthinq.com/3b6ebf42-2ccf-44d6-8f6d-52fab4a586be?hdnts=exp=1733961657~hmac=a04c452e1c9ae8e8e8538f0b7492da8588aab027f806ae43c1b18d1599ab3c04 {'appType': 'NUTS', 'modelCountryCode': 'WW', 'countryCode': 'CZ', 'modelName': 'F_V7_Y___W.B_2QEUK', 'deviceType': 201, 'deviceCode': 'LA02', 'alias': 'Pračka s předním plněním', 'deviceId': 'c67409de-e50c-1760-87e8-4cbad734366d', 'fwVer': '', 'imageFileName': 'home_appliances_img_wmdrum.png', 'imageUrl': 'https://objectcontent.lgthinq.com/3120cb69-4c7c-48d5-9d69-d6fad3480955?hdnts=exp=1701583246~hmac=90010937715d2b4622b8a37ecd4d44bb9f4882cae865dfadf2f61c48101d4799', 'smallImageUrl': 'https://objectcontent.lgthinq.com/04f965fe-de9b-42cc-884a-40a852782225?hdnts=exp=1701586845~hmac=558e8221d284081d83cf001b7adba4e3c033cc3bafe2237c8b5648056279bf53', 'ssid': 'WIFIC', 'softapId': '', 'softapPass': '', 'macAddress': '', 'networkType': '02', 'timezoneCode': 'Europe/Prague', 'timezoneCodeAlias': 'Europe/Prague', 'utcOffset': 1, 'utcOffsetDisplay': '+01:00', 'dstOffset': 2, 'dstOffsetDisplay': '+02:00', 'curOffset': 1, 'curOffsetDisplay': '+01:00', 'sdsGuide': '{"deviceCode":"LA02"}', 'newRegYn': 'N', 'remoteControlType': '', 'userNo': 'CZ2301073220622', 'tftYn': 'N', 'modelJsonVer': 1.4, 'modelJsonUri': 'https://objectcontent.lgthinq.com/3b6ebf42-2ccf-44d6-8f6d-52fab4a586be?hdnts=exp=1733961657~hmac=a04c452e1c9ae8e8e8538f0b7492da8588aab027f806ae43c1b18d1599ab3c04', 'appModuleVer': 203.16, 'appModuleUri': 'https://objectcontent.lgthinq.com/f24d6ee6-d315-48b5-ab0f-4edcf0c5bc48?hdnts=exp=1719705701~hmac=f14ce8a8407b387a62eac888306baa678e9ee0fa20062ef13e565dc1ce6ab006', 'appRestartYn': 'Y', 'appModuleSize': 3696622, 'langPackProductTypeVer': 108.5, 'langPackProductTypeUri': 'https://objectcontent.lgthinq.com/ff210aac-a5c1-4ff5-89db-e9709a5c0f4b?hdnts=exp=1734773290~hmac=0fea314a61717e218b8ea3d7f6316d1f105c12b89c929e954cb660cc257a594b', 'langPackModelVer': 1.9, 'langPackModelUri': 'https://objectcontent.lgthinq.com/9afc682e-70d8-46e8-96c7-931e6732ac53?hdnts=exp=1711673305~hmac=26eaf0899aa32165a64be8d7bbd0412e33273ced35557a5ddf26efff56bfe1ab', 'deviceState': 'E', 'snapshot': {'washerDryer': {'initialBit': 'INITIAL_BIT_OFF', 'standby': 'STANDBY_OFF', 'courseFL24inchBaseTitan': 'NOT_SELECTED', 'ezLinkDetergentState': 'EZLINKDT_NOT_EMPTY', 'initialTimeMinute': 0.0, 'preState': 'INITIAL', 'error': 'ERROR_NO', 'dryLevel': 'NOT_SELECTED', 'ezDetergentState': 'EZCSDT_NOT_EMPTY', 'creaseCare': 'CREASECARE_OFF', 'mlStep': 0.0, 'ezSoftenerAmount': 0.0, 'remainTimeHour': 0.0, 'smartCourseFL24inchBaseTitan': 'NOT_SELECTED', 'preWash': 'PREWASH_OFF', 'ezDispenseType': 'EZD_DETERGENT_SOFTENER', 'steam': 'STEAM_OFF', 'state': 'POWEROFF', 'ezCSSoftenerSetVal': 'EZCSSO_OFF', 'rinse': 'NO_RINSE', 'wrinkleCare': 'WRINKLECARE_OFF', 'loadItemWasher': 'LOADITEM_OFF', 'temp': 'NO_TEMP', 'doorLock': 'DOOR_LOCK_OFF', 'reserveTimeMinute': 0.0, 'ezCSDetergentSetVal': 'EZCSDT_OFF', 'AIDDLed': 'AIDDLed_OFF', 'TCLCount': 1.0, 'downloadedCourseFL24inchBaseTitan': 'RINSESPIN', 'ezSoftenerState': 'EZCSSO_NOT_EMPTY', 'medicRinse': 'MEDICRINSE_OFF', 'ezDispenseNotation': 'ezDisNotation_ml', 'ezDispenseSetting': 'EZD_SETTING_OFF', 'turboWash': 'TURBOWASH_OFF', 'ecoHybrid': 'ECOHYBRID_OFF', 'remainTimeMinute': 0.0, 'reserveTimeHour': 0.0, 'steamSoftener': 'STEAMSOFTENER_OFF', 'childLock': 'CHILDLOCK_OFF', 'remoteStart': 'REMOTE_START_OFF', 'spin': 'NOT_SELECTED', 'ezDetergentAmount': 0.0, 'soilWash': 'NO_SOILWASH', 'ezDispenseDrawerState': 'ezDisDrawer_CLOSE', 'rinseSpin': 'RINSE_SPIN_OFF', 'initialTimeHour': 0.0}, 'mid': 832282.0, 'online': True, 'static': {'deviceType': '201', 'countryCode': 'CZ'}, 'meta': {'allDeviceInfoUpdate': False, 'messageId': 'D47VmwZTRmmA9_s_MEQsBg'}, 'timestamp': 1673133186898.0}, 'online': True, 'platformType': 'thinq2', 'area': 125594, 'regDt': 20230108010054.0, 'blackboxYn': 'Y', 'modelProtocol': 'courseFL24inchBaseTitan', 'order': 0, 'drServiceYn': 'N', 'fwInfoList': [{'checksum': '0000F982', 'order': 2.0, 'partNumber': 'SAA42458609'}, {'checksum': '0000D879', 'order': 1.0, 'partNumber': 'SAA43483006'}], 'modemInfo': {'appVersion': 'clip_hna_v1.9.183', 'modelName': 'F_V7_Y___W.B_2QEUK', 'modemType': 'RTK_RTL8711am', 'oneshot': 'y', 'ruleEngine': 'y', 'size': 1572864.0}, 'guideTypeYn': 'Y', 'guideType': 'TYPE2', 'regDtUtc': '20230107230054', 'regIndex': 0, 'groupableYn': 'N', 'controllableYn': 'N', 'combinedProductYn': 'N', 'masterYn': 'Y', 'pccModelYn': 'N', 'sdsPid': {'sds4': '', 'sds3': '1017', 'sds2': '', 'sds1': ''}, 'autoOrderYn': 'N', 'initDevice': False, 'existsEntryPopup': 'N', 'tclcount': 0}
and here json model_info_url https://pastebin.com/rqpCLbdu
hello just downloaded your plugin (i have LG washer) example found device: thinq2 devices: 1 <REMOVED ID>: Pračka s předním plněním (WASHER F_V7_Y___W.B_2QEUK / thinq2)
Please edit your message to remove your ID as a safety measure.
@devrosx thanks for sharing your response.
The API documentation for LG can be found here.
I've found the washer and dryer commands and readouts. The structure is essentially available and some communication client elements are already available actually.
I will confirm that the already available washer and dryer files fit the current profiles.
Then the plugin needs to be updated accordingly. Maybe @JanJaapKo or @TokTias want to join the effort?
Hey @Artens I'll have a look the coming week into adding the washer.
@Artens , @majki09 the plugin currently takes the users selection for the device type. I think it would be much more powerfull to query the API for the device type, do you agree? We can throw an error for none supported types. As future extension, we can then also control multiple devices from 1 instance of the plugin.
@Artens , @majki09 the plugin currently takes the users selection for the device type. I think it would be much more powerfull to query the API for the device type, do you agree? We can throw an error for none supported types. As future extension, we can then also control multiple devices from 1 instance of the plugin.
Yes! This is good idea in my opinion. I like approaches like this. One instance, many device types. That should look really good. Technically it should be first checked in the API if we have any info about all devices/types available on user's account. Then the script would iterate through all of device types, adding appropriate domoticz instances. And if some device on account is not supported by our plugin it will throw a Warning into the logs. I think this would be the best approach. I could try to do this when I have some free time, I hope soon.
@JanJaapKo would you mind to create new issue for this (with enhancement label) as it is your idea? Thanks for this!
Well sure can do that. However, it would (perhaps) overlap with this ticket, since (as far as I can see now) the current implementation seems to be using a different version of the API. So that would require quite some refactoring firstly on the API and secondly on the plugin itself, as we'd need to move to the Domoticz extended framework (where 256 units can be connected per device).
But I'll focus on getting the washer to work first......
Two topics are relevant if I understand everything correctly:
- Currently, a token is copied to set the initial wideq_state.json values and assure correct sequence of token information available in the json file. The wideq_state.json should be kept centrally; I'm unsure whether multiple devices are possibly polled/set/unset with the same tokens? My guess would be yes, as current tokes are not disturbed (I've got two mobile devices and the plugin registered and they are not affected, mobile devices are able to readout without problem across washer and dryer). Would we need to register as developers if a change as suggested is applied? This will make it more cumbersome if others wish to apply the plugin.
- Should the polling for devices happen only once? (i.e. upon registering a device) Thinking about security, it would be beneficial to 'search for known devicetype' instead of polling for a full list. The possibility that someone has >1 washer is in my opinion manageable, ideally one can check custom name to confirm. Or wait until a user logs a defect.
Still working on this topic but progressing slowly. This plugin is quite complex to my opinion, could do with some simplification......
hi there! i'm also raising my hand to do some work with washers. is there any code related progress so far?