LG Smart ThinQ

Running mosquitto will try to start the server on port 1883 - but yours is already running… I guess I found the problem… Can you please try this version now?

wget https://raw.githubusercontent.com/Flip76/thinq2-python/master/thinq_mqtt.py

If you use username/password, your subscripe-command should look like:

mosquitto_sub -h localhost -u username -P password -t thinq/#

1 Like

you nailed it all is good now thnk you

1 Like

I guess I owe you an explaination :slight_smile:

In all the quick and dirty coding, I forgot to handover the username/password from the variables (on top of the script) to the mqtt-connection. Therefore the script always tried to connect without username/password.

Sorry for that and thanks for all your patience!

1 Like

LOL r u serious mate?You r doing all the hard work i am just here to learn.Today i learned so much about linux and mosquitto from ur “mistake” :slight_smile: Many many thnx.

2 Likes

A bit off topic but in case your interested I flashed a few Tuya light switches with Tasmota using a cable, now OH talks MQTT directly to them

1 Like

I have some devices which I can‘t flash - so I did it that way:

But thanks for your input, really appreciated!

Regarding control I just found this in case it provides a clue to what’s needed

Is there a way of sniffing the iphone traffic to see what commands are being issued by the app?

Now the messages are retained many more settings have appeared too

I found that discussion too but it’s basicely about an aircon… I couldn’t get it to work with a washer/dryer… The reverse engineering would be part of the underlaying API and I hope the guys will find a solution…

I asked a question abs was directed towards further work since my last post which may help-

Controlling fans and other appliances can be done with the info above. Starting a washer is much more complicated, and since I don’t see any benefit in it, I never tried. I did grab the required json command here: ollo69/ha-smartthinq-sensors#47

I know this thread too but if you try to post the json-payload shown, nothing happens :frowning:
Also I can’t see anyone saying that this works - they are just saying “it’s more complicated” and they never tried it…

My hope is on this:

That all makes sense, hopefully something will appear soon.
My guess is the washer needs a large JSON containing many things before it will start as it seems to lose everything when it goes to sleep. Operating locally I have to deselect the cycle / extra rinse etc every time I use it, although remote start seems to stay on meaning it could work.
I’m happy to experiment with my machine if it helps and you can talk me through it. Experience with other things makes me wonder whether the incoming JSON could be modified slightly and then sent back.
Is it possible to control this thing through a web browser or curl?

although remote start seems to stay on meaning it could work.

That’s my understanding - also the app requires the remote start enabled and that makes the whole thing a kind of useless… If you leave your house without enabling the remote start first, the only thing you can do is to call your wife and ask her to start the washer - or you could work around with a bunch of those: https://www.switch-bot.com/products/switchbot-bot :smiley:

Is it possible to control this thing through a web browser or curl?

I tried with curl and posted the json payload but no success - the only response was:

{"resultCode":"0003","result":""}

But I’m not a professional developer - I would appreciate any hint which can get this to work…

The problem is the cycle time is unpredictable and seems to change as the wash cycle progresses. Fortunately I’m learning its ways and have just written a rule to predict what the end time needs to be set to so it finishes when I want. I’ll stick a bunch of logging in so I can refine things a bit.
Wonder if that SwitchBot can work with the capacitve touch switch on my drier :slight_smile:

@Flip I’ve changed to OH3 and broken thinq-mqtt along the way. I’ve changed the system file to point to /etc/openhab/scripts instead of /etc/openhab2/scripts but

poetry run python3 thinq_mqtt.py
gives

Poetry could not find a pyproject.toml file in /root or its parents

at .poetry/lib/poetry/_vendor/py3.7/poetry/core/factory.py:369 in locate
  365│
  366│         else:
  367│             raise RuntimeError(
  368│                 "Poetry could not find a pyproject.toml file in {} or its parents".format(
→ 369│                     cwd
  370│                 )
  371│             )
  372│

I’ve tried poetry --uninstall which doesn’t work. Reverting the the old disk brings it back to life so somewhere I have the working settings, and copying the old files over to the exact same directory - /etc/openhab2/scripts works,

Did you run

poetry install

within your new location?

Does Poetry Install need running from /etc/OpenHAB/scripts? Do I need to try and uninstall the old copy?

Poetry creates a .poetry directory from where you run “poetry install” - according to the error message

Poetry could not find a pyproject.toml file in /root or its parents
at .poetry/lib/poetry/_vendor/py3.7/poetry/core/factory.py:369 in locate

I would guess that .poetry-directory doesn’t exist in /root.

My system-file looks like:

[Unit]
Description=thinq-mqtt
After=mosquitto.service

[Service]
ExecStart=/bin/bash -c "PATH=/home/openhabian/.poetry/bin:$PATH exec poetry run python3 thinq_mqtt.py"
Restart=always
User=openhabian
Group=openhabian
WorkingDirectory=/etc/openhab2/scripts/thinq2-python

[Install]
WantedBy=multi-user.target

You could first try to adjust the system-file to the new path of your .poetry-directory

.poetry is in /home/pi on my system. Does poetry keep track of where the file is installed - /etc/openhab2/scripts/thinq2-python on your system by the looks of it

In my system-file I set the PATH to the .poetry/bin-directory and the WorkingDirectory points to the script-directory

1 Like

Based on this thread MY GOD - Anyone attempted an LG ThinQ integration? - Developers - Hubitat, @dcmeglio was able to attach to the MQTT servers provided by LQ and receive all the updates of the devices in the real time - see the code GitHub - dcmeglio/hubitat-thinq
Maybe this can help in creating OpenHab plugin.

1 Like