LG Smart ThinQ

@Constantinos_Contis can you please check if PKG_CONFIG_PATH-variable is set:

echo $PKG_CONFIG_PATH

If it’s set please unset it and try again:

unset PKG_CONFIG_PATH

@kevin

yes, several instances of it on different ports. Retained shows up elsewhere as expected

You mean it appears on a different instance of Mosquitto?
Within the script, you can modify the ip and the port of your Mosquitto…

installed libssl-dev and libffi-dev that was missing from my openhabian and all is ok now.I loged in with example.py and found my devices.Now i

poetry run python3 thinq_mqtt.py

using my “localhost” as broker ,my mqtt broker is running at the same pi,i cant see thinq topic at mqtt explorer.Do i need to change something else to your script except mqtt-user and mqtt-pass ?

with your script running i can monitor both my washer and dryer events.

Did you start MQTT Explorer before you ran thinq_mqtt.py?

And what was the output after you ran thinq_mqtt.py?

I put ThinQ on the default port 1883. The server I have on 1886 has IRMQTTServer on it that uses retained messages and I could see the retained flag on there. With ThinQ messages there was no retained flag

yes i always start mqtt explorer before…

i get that:

@kevin Can you please check if line 80 of the script looks like:

mqtt_client.publish(mqtt_topic + “/user/” + “user_id”,thinq.auth.profile.user_id, 0, True)

@Constantinos_Contis The output looks good - no error in publishing the topic… Hm… Can you please post a screenshot of your advanced MQTT explorer connection?

I have 2 scripts. thinq_mqtt.py and thinq_mqtt.py.1. The script ending in py.1 does have that line. I’m guessing I need to be running that one which I’ll change tomorrow. Guess Linux was being helpful and not overwriting…

you mean this?

I just changed the scripts over and all the thinq messages are retained.
Incidentally I wasted an hour of my life speaking to LG tech support today, and eventually I got the idea they may publish an APi one day, but they don’t know when or if

@kevin Yes, only the new version of the script retains the messages. Over the weekend I will adjust the script to retain/clean only the relevant values.

I hope the guys from wideq can reverse engineer the API in order to be able to send commands… I mean the app can do it so it should be possible… Waiting for a LG sounds like a waste of time :slight_smile:

@Constantinos_Contis The config looks ok… Hm… This is really strange… Can you redownload my script and check with the latest version?

removed thinq_mqtt.py and redownload it,

nano thinq_mqtt_py

edit mqtt-user and mqtt-pass with my broker’s user and pass,left mqtt_host=“localhost” and

poetry run python3 thinq_mqtt.py

all good but no “thinq” topic at my mqtt explorer …should i try something else than “localhost”?

@Constantinos_Contis Unfortunately I can’t see the ip-address from your mqtt-settings-screenshot… localhost should be fine as long as your mosqitto is running on the same server… You can try to set the same IP in the script which you see in mqtt explorer

i have tried to set my ip (192.168.1xxx) with the same results,no error just no thinq topic published.I run my openhabian /eclipse Mosquitto broker at the same pi so i also think that “localhost” should be fine…i dont know what is wrong.I normally get all my other topics at mqtt-explorer ,tasmota,octoprint,wled and others…

I quickly added some more error handling to the script… Can you please download the latest version and try it again?

For easier handling, I just forked the original project and added my modified script… So you can replace the thinq2-python with the fork:

cd /etc/openhab2/scripts
mv thinq2-python thinq2-python.old
git clone https://github.com/Flip76/thinq2-python.git
cd thinq2-python
cp …/thinq2-python.old/state.json .

And now start:

poetry run python3 thinq_mqtt.py

tried the new version …no errors again

but no thinq topic at mqtt-explorer.
i am a noobie so i think maybe i dont use mqtt-explorer right?i can login to my broker and see all my other topics…i know i miss something small but i cant put my finger on it…

Ok, let’s try it another way:

Can you open a new terminal and subscribe to your mosquitto with:

mosquitto_sub -h localhost -t thinq/#

After that, start the tuya_mqtt.py script and see if there is any output?