Hisense TV Control

Good Day

Please share your intergration. I have tried everything. I think the bridge and where I creat the subfolder might be my problem.

Could you possibly share a step by step guide? This will help much!

I have tried everything to get my certs working. Any step by step guide on obtaining this perhaps?

1 Like

Hi, please share you configuration :slight_smile:

  1. Download GitHub - d3nd3/Hisense-mqtt-keyfiles: Some version of mqtt hisense require keys
  2. copy to some folder in home assistant (my is /etc/mosquitto/certs/rcm_certchain_pem.cer and
    /etc/mosquitto/certs/rcm_pem_privkey.pkcs8
  3. Get TV certificates with - openssl s_client -host tv_ip_address -port 36669 -prexit -showcerts. Copy from BEGIN to END - 2 cetificates and save to hisence.crt ( my path /etc/mosquitto/certs/hisense.crt
  4. Put tv name after "both 0" in mosquitto.conf

My mosquitto.conf file

connection hisensemqtt
# hisense ip tv address
address tv_ip_address:36669
username hisenseservice
password multimqttservice
# IPhone MAC - auth on Remote Now hisense app
clientid mac_auth_remotenow_app
# openssl s_client -host tv_ip_adress -port 36669 -prexit -showcerts   ## open ssl cert from tv ##
bridge_cafile /etc/mosquitto/certs/hisense.crt
# https://github.com/d3nd3/Hisense-mqtt-keyfiles # hisense cer and pkcs8 certificates
bridge_certfile /etc/mosquitto/certs/rcm_certchain_pem.cer
bridge_keyfile  /etc/mosquitto/certs/rcm_pem_privkey.pkcs8
bridge_insecure true
bridge_tls_version tlsv1.2
try_private false
start_type automatic
# topic +/remoteapp/# both
# topic /remoteapp/# both 0 HISENSE_TV_NAME ""
topic /remoteapp/# both 0 hisense ""

Good Luck

I need help, have tried everything now.

I install the GitHub - sehaas/ha_hisense_tv: Hisense TV integration for Home Assistant intigration

  1. Download the keyfiles and add it into the ssl Folder
  2. Get TV certificates with - openssl s_client -host tv_ip_address -port 36669 -prexit -showcerts
-----BEGIN CERTIFICATE-----
MIIDtDCCApygAwIBAgIBAjANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJDTjER
MA8GA1UECAwIc2hhbmRvbmcxEDAOBgNVBAcMB3FpbmdkYW8xCzAJBgNVBAoMAmho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tqcC7SOTXWm1HQeJ+H6eMzuZVJjnQBhLEfSmbFaPe9irP
NKf7iB/rPm9rodw4KhvY/aKI+N4UIxGkuCiOLWjAZ+7BPWFHEvp71KxzAonkXbda
wz05w7AAuFlOF8h3wEZZdDErH7V9oAoIfpL2HuXsC8YnDUOD4i0BGEycgCKVQqXi
+8ZLbbOO2UPHA6rrQZbgcS6z/zLFP2jID+sCwxRakJubFSw1vPE4qoMmTqMSeHKL
piKSc2fAChDNZ61PTe+kvwu4Nmz3gIr6RlBv0uvnHYjc+9Azwq7RwSiaHh4hjfcZ
1CJQ7Zbr2+AaUp2D7XmhEJOVvJdN
-----END CERTIFICATE-----

  1. My Config file in /share/mosquitto
connection hisense
address 192.168.0.62:36669
username hisenseservice
password multimqttservice
clientid HomeAssistant
bridge_tls_version tlsv1.2
bridge_cafile /ssl/hisense.crt
bridge_certfile /ssl/rcm_certchain_pem.cer
bridge_keyfile /ssl/rcm_pem_privkey.pkcs8
bridge_insecure true
start_type automatic
try_private true
topic /remoteapp/# both 0 hisense ""
  1. MQTT Works
- username: mqtt_user
  password: *******
active: true
folder: mosquitto

But it doesn’t work, what am I doing wrong??

2 Likes

here you have to add auth mac address from Remote Now app

1 Like

I’ve had it before, but it doesn’t work either

Edit: I have now put the Mac from the Remote Now app into the config again and the problem was that all the letters in the MAC address were capitalized.

1 Like

Hey folks. I have a U78G and I’ve gone through all the setup steps.

I’ve installed this via HACS:
GitHub - sehaas/ha_hisense_tv: Hisense TV integration for Home Assistant

I’m not getting this prompt. What value am I supposed to enter? Regardless of what I enter, the prompt keeps reappearing

Mosquitto log doesn’t show anything:

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] mosquitto.sh: executing…
[22:10:12] INFO: SSL is not enabled
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing…
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[22:10:12] INFO: Starting NGINX for authentication handling…
[22:10:12] INFO: Starting mosquitto MQTT broker…
[services.d] done.
1672197012: Loading config file /share/mosquitto/hisense.conf
1672197012: Warning: Bridge hisens_tv_emqtt using insecure mode.
1672197012: Warning: Mosquitto should not be run as root/administrator.
[22:10:13] INFO: Successfully send discovery information to Home Assistant.
[22:10:13] INFO: Successfully send service information to the Supervisor.

Ahh nm - I figured out that was for the PIN that pops up on the TV. Thanks for all the help folks!

what am i doing wrong?
i provided all the infos


when i click on submit, all i get is a spinning wheel
image

this is the TV i recently got Hisense - 65" Class U6GR

1 Like

********* Got the Bridge Working - See Edit 3 below ************

I’ve just bought a Hisense TV (50A7HQTUK 50 due Saturday). I want to integrate it to HA running native on a NUC with Mosquito broker.
Been looking through this very long thread and, being an old fart, can’t pick out the current position or best wat to approach it.
Can some kind soul please provide a summary of where we are now and what I need to do. Just a few pointers and links would be good.
Edit 1: I’ve got the TV now and have successfully connected MQTT Explorer to it using the client cert and client key files downloaded from GitHub - d3nd3/Hisense-mqtt-keyfiles: Some version of mqtt hisense require keys and used as per the readme file there.
Edit 2. Got Wake on LAN working with the following in my configuration.ymal file…

wake_on_lan:

switch:
  - platform: wake_on_lan
    name: lounge tv on
    host: 192.168.x.y
    mac: de:ad:be:ef:ff:00

Followed this video - https://www.youtube.com/watch?v=n5zWj7QurLI
Added switch.lounge_tv_on to an Entities card.
Found that the TV had to be off for about 4 minutes before it would work (RemoteNow works without this wait time)! And it doesn’t work at all if the TV has been powered off and on (neither does RemoteNow).

Also created a ping platform binary sensor but found it doesn’t work. The telly doesn’t even respond to the ping command in a cmd terminal window!
Edit 3. Success!!! I should add that I have no idea of what I’m doing or trying to achieve. I could not find a mosquitto.conf file anywhere and am guessing mosquitto has moved on since the posts above or the configuration I’m running on does things differently.
I followed the steps here…

That didn’t work, but the mosquitto log file at least showed that the hisense.conf was being loaded, albeit with errors.
I have zero understanding of credentials and keys etc but could see the 2 files to download from the web and the 1 file with 2 things in it created by interrogating the TV (All of this is covered in posts above).
I noticed in another post above that all 3 files were referenced in someones hisense.conf file so tried that and it worked.
My mosquitto config looks like…

logins:
  - username: redacted
    password: redacted
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: true
  folder: mosquitto
anonymous: false
retain: true

I’m assuming the folder: mosqitto line refers to /share/mosquitto by default, which is where my hisense.conf file is stored which looks like…

connection hisensemqtt
address 192.168.x.y:36669
username hisenseservice
password multimqttservice
clientid DE:AD:BE:EF:99:99
bridge_cafile /ssl/hisense.crt
bridge_insecure true
bridge_tls_version tlsv1.2
try_private false
start_type automatic
topic +/remoteapp/# both
bridge_certfile /ssl/rcm_certchain_pem.cer
bridge_keyfile  /ssl/rcm_pem_privkey.pkcs8

After restarting mosquitto and checking the logs I could see the hisense stuff loading with no errors.
My next step was to add the 2 MQTT sensors as per the post instructions I was following, and they worked.
This was all done with the TV switched on.
That’s as far as I’ve got but now it’s working it’s down to me to start doing stuff with it. I tried sehaas thing, I think I got as far as trying to configure it but just got the non-stop spinning wheel. That was before I did the above so am not sure what I will achieve with it now and am too scared to give it another go in case I break it.

Hi All,
I found a way around the HACS plugin not connecting by handing the connection to the TVs MQTT broker from within Node-Red (as it allows an easy way to upload certificates via GUI and handles multiple brokers at once), nodered in this case is running from within HA on an old pi3.

MY TV is a 75U9HAU running Vidaa U6

some tricks:

The Tv seems to time out and disconnect if I don’t ping it for a while, so I have a “/remoteapp/tv/platform_service/3c:2a:d7:d5:30:64$vidaa_common/actions/gettvinfo” send every 10 seconds. (the MAC address in there is the one I used to authenticate the vidaa app on my phone initially, I copied it out of MQTT explorer when monitoring that communication).
It still disconnects occasionally, which I’m assuming is an issue with using wifi or perhaps the way i’m doing it is wrong, but i’m still working on that, perhaps I could just detect if the mqtt is disconnected then instead of turning on via mqtt, fire an ir on command via my video matrixes handy ir commands (i can send pronto codes to any source or display via a rest api) to wake it up instead.

I use the “/remoteapp/mobile/broadcast/ui_service/state” to find flags like “fake_sleep_0” and “fake_sleep_1” which are the tvs standby on/off modes when wake on lan/wlan is enabled and the tv is set to fast start up, it never fully turns off in this state unless it is doing the occasional reboot which it seems to do every few weeks on its own.

using the node-red-companion plugin via HACS I have a switch in my lovelace ui that not only sends the commands to the tv via virtual keypresses “/remoteapp/tv/remote_service/3c:2a:d7:d5:30:64$vidaa_common/actions/sendkey” with the payload of “KEY_POWER” for example but it also is constantly checking the tvs state so that the button in the ui accurately tracks the tvs state even if the remote is used, thus even though i don’t have separate power on and power off commands I can keep the state in sync.

It’s all a mess because I’m not good at homeassistant, nodered or MQTT but it’s working and has saved me a lot of trouble with IR control as well as the seemingly broken WOL/WOW on my tv that only works once in a blue moon. my controls required for the tv are very simple as everything else is handled from a HDMI matrix and a receiver, but if the Tv ever gets accidentally set to the wrong input, it now will be able to change back automatically when I select a source on my control panel.

Hi!
I’m having a lot of trouble getting my Hisense television to communicate with the homeassistant.

Could someone make a video of how to do this step by step?

Thanks

2 Likes

Hi Carlos,
Have you tested from within an app like MQTT Explorer?
I think the trick is having the certificate files (TLS), but not requiring certificate verification.

You also need to be able to connect via the VIDAA app or the RemoteNow app, to send commands you will need to use the mac address of that device (you can see mine copied into my commands above)

Some modern phones use randomised macs that cause issues with that so disable it, make the connection in the app, confirm it works, then copy that address down so you can re-enable random macs.

Hi! Thanks for your response!
Well… I use another app, the name is MQTTX. I get the certificate files (only 2) via terminal (SSH).
I cant make the connection! its very strange!
I cant understand how i put the tv connected with mqtt! :confused:
Ok, i understand, but if i used an “old” android phone and not open anymore the vidaa app, works forever?? Thanks a lot!

Have you disabled verification on those certificates? perhaps try MQTT Explorer, at least them I can give you screenshots of my setup.

The MQTT server in the TV only runs when the TV is awake, it seems to shut down after a while in standby. make sure it is on and you have an active connection on the phone app, then you should be able to view the communication in MQTT Explorer, copy some commands and test them from within your HA setup, in my case I used node-red running within HA to handle the sending of MQTT commands.

1 Like

I got MQTT Explorer connected to my new TV. See post 271 Edit 1 above. I’m trying now to send it a message but not finding any examples just yet!

if you send a command from the phone app, you can see the command and the valid MAC address in MQTT explorer, you can then copy those messages to try sending your own commands.

Thanks. I just needed that nudge. Got it responding to commands from MQTT Explorer now. :slight_smile:
My next step is to create the MQTT bridge. I’ve started from the top of this thread but can’t help thinking the guidance offered there is out of date. At the moment I’m trying to locate mosquitto.conf but cannot find it! I’m running on a NUC with Generic x86-64.

I didn’t try to get the Homeassistant side of things working, I’ve just manually done it within node-red and made switches within my HA dashboard to trigger those commands using the node-red-companion HACS module, since I only wanted on/off control.

It does look like it is possible to have the TV open a web page from an MQTT command though, that could be useful for cameras or a custom dashboard. now that I have it all working I will play with that.