Code Monkey home page Code Monkey logo

Comments (18)

andyrowe247 avatar andyrowe247 commented on June 17, 2024 1

Ran update to 1.34.0 from HACS, and re-established new AirCon device in LG app. Zones are now visible and working.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 17, 2024 1

I'm convinced that the problem are clientid. This should be stored and reused on reboot. I will work on this on my next idle time...

from ha-smartthinq-sensors.

andyrowe247 avatar andyrowe247 commented on June 17, 2024 1

Upon first tests, it seems to be working as intended, and did require two reboots for the zones to become available as indicated.

I'll keep an eye on it and advise if things change.

Many thanks @ollo69.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 17, 2024

Problem seems the response from LG server, that is returning "This model is not registered". Are you sure that you are using same configuration used in LG app (account, language, etc...)

from ha-smartthinq-sensors.

srrsparky avatar srrsparky commented on June 17, 2024

I have more to add to this.

I still get the "Duct zone control failed" after restarting HA. If I disable the integration for a period (haven't worked out how long, but probably more than 30 minutes), and then re-enable it, everything works as expected.

This kinda makes me think the account is still "locked" by the integration, and doesn't unload itself properly. I started doing some debugging with the LG app, and think I saw two "de-authorise" requests when logging out of the app, whereas I think this integration is only doing one de-authorise. However, I would have to do some more testing.

The above could be completely made up, I have very little experience with HA & integrations. If there is anything I can do to help, let me know.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 17, 2024

Can you provide more details about this two "de-authorise" done by LG app?

from ha-smartthinq-sensors.

srrsparky avatar srrsparky commented on June 17, 2024

I've done some testing, and data capture. Let me know if this helps, or if you need more logs / info. These were captured using version 5.0.16130 of the LG Thinq app.

Once I exit the app, HA works as expected.

When there is another user (or HA) is accessing the device, /api/rti/rtiResult reports a stateCode of "P".
When the app gets control, /api/rti/rtiResult reports a stateCode of "S".
There is about 12 minutes between disabling the HA integration, before the App reports it can control the device.

Once logged in on the app, this is the regular /api/rti/rtiResult
Request:
{ "lgedmRoot": { "workList": [ { "workId": "n-a031afda-0523-6563-6b9d-f0cb779e11db", "deviceId": "a031afda-0523-6563-6b9d-f0cb779e11db" } ] } }
Response:
{ "lgedmRoot": { "returnCd": "0000", "returnMsg": "OK", "workList": { "deviceId": "a031afda-0523-6563-6b9d-f0cb779e11db", "deviceState": "E", "format": "B64", "returnCode": "0000", "returnData": "eyJPcGVyYXRpb24iOiIxIiwiT3BNb2RlIjoiMiIsIldpbmRTdHJlbmd0aCI6IjYiLCJUZW1wVW5pdCI6IjAiLCJUZW1wQ3VyIjoiMjciLCJUZW1wQ2ZnIjoiMjUiLCJHcm91cFR5cGUiOiI1IiwiQWlyQ2xlYW4iOiJOUyIsIkF1dG9EcnkiOiJOUyIsIlBvd2VyU2F2ZSI6Ik5TIiwiU2xlZXBUaW1lIjoiMCIsIk9uVGltZSI6Ik5TIiwiT2ZmVGltZSI6Ik5TIiwiUmFjQWRkRnVuYyI6Ik5TIiwiRXh0cmFPcCI6IjAiLCJEaWFnQ29kZSI6IjAwIiwiVGVtcExpbWl0TWF4IjoiMzAiLCJUZW1wTGltaXRNaW4iOiIxNiIsIlRpbWVCc09uIjoiMCIsIlRpbWVCc09mZiI6IjAiLCJEdWN0Wm9uZVR5cGUiOiI0IiwiWm9uZUNvbnRyb2wiOiIxMyIsIkRSRUQiOiIwIn0=", "stateCode": "S", "workId": "n-a031afda-0523-6563-6b9d-f0cb779e11db" } } }

When I change the duct zone the app sends a POST to /api/rt/rtiControl
Request:
{ "lgedmRoot": { "deviceId": "a031afda-0523-6563-6b9d-f0cb779e11db", "workId": "09cc2bef-b76e-4e9d-30bf-d22c31741d44", "cmd": "Control", "cmdOpt": "Set", "value": { "DuctZone": "1_1/2_0/3_1/4_1/5_0" }, "format": "B64" } }
Response:
{ "lgedmRoot": { "returnCd": "0000", "returnMsg": "OK", "deviceId": "a031afda-0523-6563-6b9d-f0cb779e11db", "stateCode": "S", "workId": "n-09cc2bef-b76e-4e9d-30bf-d22c31741d", "format": "B64", "deviceState": "E", "timestamp": 0 } }

When I "exit" from the device in the app it sends 2 POSTS to /api/rti/delControlPermission
First
Request:
{ "lgedmRoot": { "deviceId": "a031afda-0523-6563-6b9d-f0cb779e11db" } }
Response:
{ "lgedmRoot": { "returnCd": "0000", "returnMsg": "OK", "stateCode": "S", "workId": "n-65dd37ae-2651-4a57-89b2-83aab96ec8", "deviceState": "E", "timestamp": 0 } }
Second
Request:
{ "lgedmRoot": { "deviceId": "a031afda-0523-6563-6b9d-f0cb779e11db" } }
Response:
{ "lgedmRoot": { "returnCd": "0000", "returnMsg": "OK", "stateCode": "S", "workId": "n-36b03e42-b9b0-4f40-8591-cca1160723", "deviceState": "E", "timestamp": 0 } }

This is what happens when I logout.
image

POST /api/rti/rtiMon
Request:
{ "lgedmRoot": { "deviceId": "a031afda-0523-6563-6b9d-f0cb779e11db", "workId": "n-a031afda-0523-6563-6b9d-f0cb779e11db", "cmd": "Mon", "cmdOpt": "Stop" } }
Response:
{ "lgedmRoot": { "returnCd": "0000", "returnMsg": "OK", "stateCode": "S", "workId": "n-n-a031afda-0523-6563-6b9d-f0cb779e", "deviceState": "E", "timestamp": 0 } }

DELETE /v1/service/users/client
Response:
{ "resultCode": "0000", "result": "" }

DELETE /proxy/v1/service/users/push
Response:
{ "resultCode": "0000", "result": {}, "resultExtra": [ { "iotSS": { "resultCode": "0000", "duration": "83" } } ] }

DELETE /v1/service/users/push
Response:
{ "resultCode": "0000", "result": "" }

from ha-smartthinq-sensors.

andyrowe247 avatar andyrowe247 commented on June 17, 2024

Problem seems the response from LG server, that is returning "This model is not registered". Are you sure that you are using same configuration used in LG app (account, language, etc...)

I reinstalled the air con unit within the LG app a few times, using different air con remote types, and got the same issue each time.

Strangely, completing one of the installations resulted in the zones being available in HA for 1 minute before the zones vanished. I haven't been able to recreate the same result since.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 17, 2024

You cannot control zone (or any other feature) when LG app is open, this is a know limitation for APIv1 devices

from ha-smartthinq-sensors.

andyrowe247 avatar andyrowe247 commented on June 17, 2024

You cannot control zone (or any other feature) when LG app is open, this is a know limitation for APIv1 devices

That's want the problem.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 17, 2024

Suppose you mean 0.34.0, right? Are you saying that version over 0.34.0 is not working?

from ha-smartthinq-sensors.

andyrowe247 avatar andyrowe247 commented on June 17, 2024

Hi. Found some time to get back to this.
My bad. No idea where i got 1.34.0 from.

I have version 0.38.7 installed.

What i have found is that the zones cease to exist following a reboot of HA.

The only way to get the zones to be available again is to complete a removal of the LG device from the integration, restart of HA, and reinstall a new device in the integration.

Reloading the integration doesn't work.

This error originated from a custom integration.

//------
Logger: custom_components.smartthinq_sensors.wideq.devices.ac
Source: custom_components/smartthinq_sensors/wideq/devices/ac.py:957
integration: SmartThinQ LGE Sensors (documentation, issues)
First occurred: 8:45:50 AM (21 occurrences)
Last logged: 10:15:32 AM

Duct zone control failed
Traceback (most recent call last):
File "/config/custom_components/smartthinq_sensors/wideq/devices/ac.py", line 957, in poll
await self.update_duct_zones()
File "/config/custom_components/smartthinq_sensors/wideq/devices/ac.py", line 445, in update_duct_zones
states = await self._get_duct_zones()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smartthinq_sensors/wideq/devices/ac.py", line 502, in _get_duct_zones
zones = await self._get_config(DUCT_ZONE_V1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 620, in _get_config
data = await self._client.session.get_device_config(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1328, in get_device_config
res = await self.post(
^^^^^^^^^^^^^^^^
File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1057, in post
return await self._auth.gateway.core.lgedm2_post(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 387, in lgedm2_post
return self._manage_lge_result(out, is_api_v2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 414, in _manage_lge_result
raise exc.APIError(message, code)
custom_components.smartthinq_sensors.wideq.core_exceptions.APIError: 0011 - 등록되지 않은 모델입니다.

from ha-smartthinq-sensors.

andyrowe247 avatar andyrowe247 commented on June 17, 2024

You cannot control zone (or any other feature) when LG app is open, this is a know limitation for APIv1 devices

I have logged out of my LG app, and removed the app from my phone.

I'm not a coder so won't pretend that i know, but could it be that upon rebooting HA, LG still thinks that HA is logged in and won't allow access to the zones?

I am however able to still turn the air con on and off, and adjust the temperature however. It's just the zones that drop off.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 17, 2024

I have logged out of my LG app, and removed the app from my phone

Not so sure that this is a good idea. Don't know what you exactly do, but registration of device go through LG app. If device is not registered through application with your LG account, the device will not be visible inside integration. I always left LG app on my phone, just keeping it always close. Translation of the message with code 0011 is "This model is not registered", so there could be a relation.

could it be that upon rebooting HA, LG still thinks that HA is logged in and won't allow access to the zones?

This could also be an option. Maybe the problem is that with a reboot the permission are not properly released and because when the integration restart a new clientid is generated probably the server think that is still in use by the previous one. I will take a look at it.

from ha-smartthinq-sensors.

andyrowe247 avatar andyrowe247 commented on June 17, 2024

I have logged out of my LG app, and removed the app from my phone

Not so sure that this is a good idea. Don't know what you exactly do, but registration of device go through LG app. If device is not registered through application with your LG account, the device will not be visible inside integration. I always left LG app on my phone, just keeping it always close. Translation of the message with code 0011 is "This model is not registered", so there could be a relation.

could it be that upon rebooting HA, LG still thinks that HA is logged in and won't allow access to the zones?

This could also be an option. Maybe the problem is that with a reboot the permission are not properly released and because when the integration restart a new clientid is generated probably the server think that is still in use by the previous one. I will take a look at it.

Thanks for the quick reply.

Just for completeness, I've reinstalled and logged back onto the LG app. Keeping the app closed it produces the same result.

from ha-smartthinq-sensors.

andyrowe247 avatar andyrowe247 commented on June 17, 2024

@ollo69, I've done a bit for testing and found that reloading the LG integration, on top of restarting HA, the zones become unavailable.

I what I've also found is, if i disable the integration for a period of time, (12 minutes on first test), then re-enable thy integration, the zones become available again.

Which looks like a timeout related issue.

from ha-smartthinq-sensors.

github-actions avatar github-actions commented on June 17, 2024

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 17, 2024

Please try if last release fix this issue. Now client ID is stored with config entry and reused on startup. Consider that at least 2 reboot are required for have this change active.

from ha-smartthinq-sensors.

Related Issues (20)

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.