Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run the script with two devices, I get this result: #22

Closed
PvdGulik opened this issue Nov 2, 2024 · 5 comments
Closed

Trying to run the script with two devices, I get this result: #22

PvdGulik opened this issue Nov 2, 2024 · 5 comments

Comments

@PvdGulik
Copy link

PvdGulik commented Nov 2, 2024

I posted this earlier on 2024-06-01

Trying to run the script with two devices, I get this result:

pi@Domoticz:~/domoticz/plugins/domoticz_lg_thinq_plugin $ python3 example.py -c NL -l nl-NL
2024-06-01 12:20:11 ERROR [wideq.example] wideq_state file not found. Trying to load default STATE_FILE: wideq_state.json
2024-06-01 12:20:11 INFO [wideq.example] wideq_state will be loaded from: wideq_state.json
2024-06-01 12:20:11 INFO [wideq.example] State data loaded from /home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq_state.json'

thinq2 devices: 2
Traceback (most recent call last):
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 423, in <module>
    main()
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 419, in main
    ret = example(args.country, args.language, args.verbose, cmd=args.cmd, args=args.args)
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 335, in example
    resp = example_command(client, cmd, args)
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 283, in example_command
    return func(client, *args)
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 71, in ls
    print("{0.id}: {0.name} ({0.type.name} {0.model_id} / {0.platform_type})".format(device))
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 317, in type
    return DeviceType(self.data["deviceType"])
  File "/usr/lib/python3.9/enum.py", line 360, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.9/enum.py", line 677, in __new__
    raise ve_exc
ValueError: 406 is not a valid DeviceType

What to do?

Originally posted by @PvdGulik in #19 (comment)

@PvdGulik
Copy link
Author

PvdGulik commented Nov 2, 2024

Still this problem:

I tried to reinstall the plug-in, but still same issue:

pi@Domoticz:~/domoticz/plugins $ git clone https://github.com/majki09/domoticz_lg_thinq_plugin.git
Cloning into 'domoticz_lg_thinq_plugin'...
remote: Enumerating objects: 196, done.
remote: Counting objects: 100% (87/87), done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 196 (delta 68), reused 68 (delta 56), pack-reused 109 (from 1)
Receiving objects: 100% (196/196), 149.15 KiB | 730.00 KiB/s, done.
Resolving deltas: 100% (112/112), done.
pi@Domoticz:~/domoticz/plugins $ cd ./domoticz_lg_thinq_plugin
pi@Domoticz:~/domoticz/plugins/domoticz_lg_thinq_plugin $ python3 example.py -c NL -l nl-NL
2024-11-02 18:33:34 ERROR [wideq.example] wideq_state file not found. Trying to load default STATE_FILE: wideq_state.json
2024-11-02 18:33:34 INFO [wideq.example] wideq_state will be loaded from: wideq_state.json
2024-11-02 18:33:34 ERROR [wideq.example] No state file found (tried: '/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq_state.json')
Log in here:
https://nl.m.lgaccount.com/spx/login/signIn?country=NL&language=nl-NL&svc_list=SVC2**&client_id=LGAO2*****&division=ha&redirect_uri=https%3A%2F%2Fkr.m.lgaccount.com%2Flogin%2FiabClose&state=96aff2f6994011efa4aab827ebe*******&show_thirdparty_login=AMZ%2*****
Then paste the URL where the browser is redirected:
https://kr.m.lgaccount.com/login/iabClose?state=96aff2f6994011efa4aab827ebe2****&code=mE5xu1Kscg877bOWlzL2qTJkE*****&user_number=NL19081********&oauth2_backend_url=https%3A%2F%2Fgb.lgeapi.com%2F

thinq2 devices: 2
75b21***-0b3b-1424-886b-b8165f******: Lucht-water H/P (AC AWHP_019101_WW / thinq2)
Traceback (most recent call last):
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 427, in <module>
    main()
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 423, in main
    ret = example(args.country, args.language, args.verbose, cmd=args.cmd, args=args.args)
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 339, in example
    resp = example_command(client, cmd, args)
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 287, in example_command
    return func(client, *args)
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/example.py", line 75, in ls
    print("{0.id}: {0.name} ({0.type.name} {0.model_id} / {0.platform_type})".format(device))
  File "/home/pi/domoticz/plugins/domoticz_lg_thinq_plugin/wideq/client.py", line 317, in type
    return DeviceType(self.data["deviceType"])
  File "/usr/lib/python3.9/enum.py", line 360, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.9/enum.py", line 677, in __new__
    raise ve_exc
ValueError: 406 is not a valid DeviceType
pi@Domoticz:~/domoticz/plugins/domoticz_lg_thinq_plugin $ sudo systemctl restart domoticz.service

And in the logging:

2024-11-02 18:35:52.359 Status: LG ThinQ WP: Entering work loop.
2024-11-02 18:35:52.359 Status: LG ThinQ WP: Started.
2024-11-02 18:35:53.382 Status: LG ThinQ WP: Initialized version 2.2.2, author 'majki'
2024-11-02 18:35:53.388 Error: LG ThinQ WP: wideq_state file not found!
2024-11-02 18:46:42.042 LG ThinQ WP: Pushing 'onHeartbeatCallback' on to queue
2024-11-02 18:46:42.093 LG ThinQ WP: Processing 'onHeartbeatCallback' message
2024-11-02 18:46:42.093 LG ThinQ WP: Acquiring GIL for 'onHeartbeatCallback'
2024-11-02 18:46:42.093 LG ThinQ WP: Calling message handler 'onHeartbeat' on 'module' type object.
2024-11-02 18:46:42.093 LG ThinQ WP: Acquiring GIL for 'onHeartbeatCallback'
2024-11-02 18:46:52.014 LG ThinQ WP: Pushing 'onHeartbeatCallback' on to queue
2024-11-02 18:46:52.064 LG ThinQ WP: Processing 'onHeartbeatCallback' message
2024-11-02 18:46:52.064 LG ThinQ WP: Acquiring GIL for 'onHeartbeatCallback'
2024-11-02 18:46:52.064 LG ThinQ WP: Calling message handler 'onHeartbeat' on 'module' type object.
2024-11-02 18:46:52.064 LG ThinQ WP: Acquiring GIL for 'onHeartbeatCallback'

What to do, please help!

@PvdGulik
Copy link
Author

still same issue.....

2024-11-13 09:20:41.064 Status: LG ThinQ WP: Entering work loop. 2024-11-13 09:20:41.064 LG ThinQ WP: Worker thread started. 2024-11-13 09:20:41.064 Status: LG ThinQ WP: Started. 2024-11-13 09:20:42.070 Status: LG ThinQ WP: Initialized version 2.2.2, author 'majki' 2024-11-13 09:20:42.076 LG ThinQ WP: Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL 2024-11-13 09:20:42.076 Error: LG ThinQ WP: wideq_state file not found! 2024-11-13 09:20:42.076 LG ThinQ WP: Acquiring GIL for 'onStartCallback' 2024-11-13 09:20:51.041 LG ThinQ WP: Pushing 'onHeartbeatCallback' on to queue 2024-11-13 09:20:51.091 LG ThinQ WP: Processing 'onHeartbeatCallback' message 2024-11-13 09:20:51.091 LG ThinQ WP: Acquiring GIL for 'onHeartbeatCallback' 2024-11-13 09:20:51.091 LG ThinQ WP: Calling message handler 'onHeartbeat' on 'module' type object. 2024-11-13 09:20:51.091 LG ThinQ WP: Acquiring GIL for 'onHeartbeatCallback' 2024-11-13 09:21:01.012 LG ThinQ WP: Pushing 'onHeartbeatCallback' on to queue 2024-11-13 09:21:01.063 LG ThinQ WP: Processing 'onHeartbeatCallback' message 2024-11-13 09:21:01.063 LG ThinQ WP: Acquiring GIL for 'onHeartbeatCallback' 2024-11-13 09:21:01.063 LG ThinQ WP: Calling message handler 'onHeartbeat' on 'module' type object.

@PvdGulik
Copy link
Author

Solved by restoring old plugin install in new install domotic instance

@PvdGulik
Copy link
Author

Se previous comment

@majki09
Copy link
Owner

majki09 commented Nov 13, 2024

Hi @PvdGulik
This plugin was not tested with more than one LG device (I had only one). You can try to create separate accounts for all devices and add these accounts do your domoticz, like Luckymr2201 did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants