Add integration for Hisense devices using ConnectLife

Hello,
I’ve created ha addon to control my Hisense AC:

This is how I’ve got access token:

Hope it will be useful for you :slight_smile:

4 Likes

Sorry for the newb question, but how do you use this code? Does it get pasted into HA , or do we have to run it in a terminal? Thank you so much for all this amazing work!

1 Like

The easiest option is to install this as home assistant add-on but you need home assistant with supervisor and MQTT. I tried to put into README file guide how to do that. Let me know if something is not clear.

Another option is to run it as independent docker container.

Thanks for your advice! reinstalled MQTT broker and it seemed OK. However I cannot find my AC Hisense entities nor devices. What else do I have to fix?
Thanks again!

hi, thank you for the component you are developing, you’re great, but I’m encountering a problem. after a while that the container starts and everything works, I get this error and the container stops.

another question? but do I need to retrieve the api token from the swagger UI? if so where and how to insert it? A thousand thanks

this is a output when conteiner in stop:

In MqttClient.php line 1088:

[PhpMqtt\Client\Exceptions\DataTransferException (65)]
[65] Transferring data over socket failed: Sending data over the socket failed
led. Has it been closed?

Exception trace:
at /home/app/vendor/php-mqtt/client/src/MqttClient.php:1088
PhpMqtt\Client\MqttClient->writeToSocket() at /home/app/vendor/php-mqtt/client/src/MqttClient.php:1045
PhpMqtt\Client\MqttClient->writeToSocketWithAutoReconnect() at /home/app/vendor/php-mqtt/client/src/MqttClient.php:1018
PhpMqtt\Client\MqttClient->ping() at /home/app/vendor/php-mqtt/client/src/MqttClient.php:653
PhpMqtt\Client\MqttClient->loopOnce() at /home/app/app/Console/Commands/MqttLoop.php:44
App\Console\Commands\MqttLoop->handle() at /home/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
Illuminate\Container\BoundMethod::Illuminate\Container{closure}() at /home/app/vendor/laravel/framework/src/Illuminate/Container/Util.php:41
Illuminate\Container\Util::unwrapIfClosure() at /home/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
Illuminate\Container\BoundMethod::callBoundMethod() at /home/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35
Illuminate\Container\BoundMethod::call() at /home/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:662
Illuminate\Container\Container->call() at /home/app/vendor/laravel/framework/src/Illuminate/Console/Command.php:211
Illuminate\Console\Command->execute() at /home/app/vendor/symfony/console/Command/Command.php:326
Symfony\Component\Console\Command\Command->run() at /home/app/vendor/laravel/framework/src/Illuminate/Console/Command.php:180
Illuminate\Console\Command->run() at /home/app/vendor/symfony/console/Application.php:1096
Symfony\Component\Console\Application->doRunCommand() at /home/app/vendor/symfony/console/Application.php:324
Symfony\Component\Console\Application->doRun() at /home/app/vendor/symfony/console/Application.php:175
Symfony\Component\Console\Application->run() at /home/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:201
Illuminate\Foundation\Console\Kernel->handle() at /home/app/artisan:35

I suggest not to duplicate the discussion and report all problems with this add-on in the
issues section on Github.

I’ve been waiting for this like years now, and you’ve made it… It is working as intended and it was super easy to install, all my devices were found in an instance. I just wanted to say thank you and keep up the good work!

1 Like

Just as a follow up - thanks again. All credits for the code and the process go to @bilan

I will just try to describe the process for others let’s say “my level of knowledge” who want to run it in docker compose.

First create a directory for the project. Then either git pull or just download the zip file from github and extract it there.

Then run
#docker build . --build-arg='BUILD_FROM=alpine:3.19' -t ha-connectlife-addon

Then create the compose.yml

version: '3.8'

services:
  ha-connectlife-addon:
    image: ha-connectlife-addon
    environment:
      - CONNECTLIFE_LOGIN=connectlife-login-email
      - CONNECTLIFE_PASSWORD=your-password
      - LOG_LEVEL=info
      - MQTT_HOST=host
      - MQTT_USER=login
      - MQTT_PASSWORD=mqtt-pass
      - MQTT_PORT=1883
      - MQTT_SSL=false
    command: /bin/ash -c 'php artisan app:mqtt-loop'

Then just a docker compose up -d command and you are done. The AC unit will be added to the HA automatically in matter of seconds

Hello everyone! maybe someone who already managed to get devices popped up after installing the Add-On could give me a hint what to do now.

I installed the Add-On, typed in my connectlife credentials, AC is a split AC airconditioner, all devices are online in the connectlife app.
mqtt credentials were left blank as suggested.

However I cannot see my AC devices in HA.
Would be really nice to get some assistance.

thanks
djm193

Now the API is not available because Connectlife has turned it off.

I got info that someone (ip from Hungary) was abusing the integration and flooding the API with requests so they had to turn it off until proper public API will be available.

So guys please, when you are doing anything with unofficial APIs, please take care what are you are doing. They knew about this integration but they did not limit us until someone started to abuse it…

Same here

Dear Andrey,
API is under the development but because of the community interest for API, we left ‘’ unauthorized ‘’ gate open. Unfortunately integration was abused from HU and we had to close it down until we will make it as it should be to protect users and the system.
We appreciate your understanding and your input!
Kind regards
Neda Mijatović

Is anyone here from Hungary? :smiley:

Hi there, did they reported some expected period of this implementation?

I got answer that by the end of the year since now they will implement additional security layers to avoid further abuses

1 Like

Yeah but as can be seen above it is not connected to this attack from HU. Also question on their plan to implement it by 2025. Guess it’s easier to switch to an alternative wiii adapter.

I managed to integrate with API from Connectlife mobile app and the add-on works again.

3 Likes

Finally it was possible! After two years, I can integrate my machine with the rest of my home.

You made the integration working! Thank you Bilan!!! Congrats!!!
:clap: :clap: :clap: :clap: :clap:

Great!

Can this work also with other appliances or only AC?

Addon has API interface on port 8000 (default), you can try to control other appliances than AC.