Hisense TV Control

I can’t help you more unfortunately, looks like we’re not on the same hardware, maybe @sehaas can guide you ?

I hope this helps, as you mentioned your path is located in /usr/share/hassio/share/mosquitto/… I am guessing you are using Docker.
Maybe the post Hisense TV Control - #202 by Fabz helps as it discuss “where do I put the hisense.conf file or define the path to it?”

kinda. im Running Home Assistant on an Unraid Server via VM. But im getting on step closer.
All my config files and Certificates must be located in

/share/mosquitto/

instead of

/usr/share/hassio/share/mosquitto/

or

/usr/share/mosquitto/

which was really confusing

but now I’m getting a LOG in Mosquitto wich give me some Error

LOG FILE MOSQUITTO:

05:14:10] INFO: Starting mosquitto MQTT broker...
1651634050: Loading config file /share/mosquitto/acl.conf
1651634050: Loading config file /share/mosquitto/hisense.conf
1651634050: Warning: Bridge hisensetv using insecure mode.
1651634050: Warning: Mosquitto should not be run as root/administrator.
[05:14:10] INFO: Successfully send discovery information to Home Assistant.
[05:14:10] INFO: Successfully send service information to the Supervisor.
1651634050: mosquitto version 2.0.11 starting
1651634050: Config loaded from /etc/mosquitto/mosquitto.conf.
1651634050: Loading plugin: /usr/share/mosquitto/go-auth.so
1651634050:  ├── Username/password checking enabled.
1651634050:  ├── TLS-PSK checking enabled.
1651634050:  └── Extended authentication not enabled.
1651634050: Opening ipv4 listen socket on port 1883.
1651634050: Opening ipv6 listen socket on port 1883.
1651634050: Opening websockets listen socket on port 1884.
1651634050: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651634050: mosquitto version 2.0.11 running
1651634050: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)
1651634050: Error: Unable to load CA certificates, check bridge_cafile "hisense.crt".
1651634050: OpenSSL Error[0]: error:02001002:system library:fopen:No such file or directory
1651634050: OpenSSL Error[1]: error:2006D080:BIO routines:BIO_new_file:no such file
1651634050: OpenSSL Error[2]: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
1651634050: Bad socket read/write on client local.HomeAssistant: The client is not currently connected.
.
.
.
1651634055: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651634055: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)
1651634055: Error: Unable to load CA certificates, check bridge_cafile "hisense.crt".
1651634055: OpenSSL Error[0]: error:02001002:system library:fopen:No such file or directory
1651634055: OpenSSL Error[1]: error:2006D080:BIO routines:BIO_new_file:no such file
1651634055: OpenSSL Error[2]: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
1651634055: Bad socket read/write on client local.HomeAssistant: The client is not currently connected.

Ive got new log issue after moving my certificate an to /ssl/…instead of /share/ssl.

1651656079: Client local.HomeAssistant disconnected: Protocol error.
1651656089: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651656089: New connection from 172.30.32.2:54482 on port 1883.
1651656089: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)
1651656089: Client <unknown> closed its connection.
1651656092: Client local.HomeAssistant disconnected: Protocol error.
1651656113: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651656113: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)
1651656116: Client local.HomeAssistant disconnected: Protocol error.
1651656147: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651656147: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)

Why does it connect twice?
What does Client local.HomeAssistant disconnected mean?

This Mornin I’ve some additional Steps to get this running.

I’ve tried to dissable both cert files an see waht happens

#bridge_certfile /ssl/rcm_certchain_pem.cer
#bridge_keyfile /ssl/rcm_pem_privkey.pkcs8

1651806272: OpenSSL Error[0]: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
1651806272: Client local.HomeAssistant disconnected: Protocol error.
1651806303: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651806303: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)

Which doesn’t help a lot

then I enableed both dert files back again and disabled
#bridge_tls_version tlsv1.2

1651806624: Error: Unable to load client key file, check bridge_keyfile "/ssl/rcm_pem_privkey.pkcs8".
1651806624: OpenSSL Error[0]: error:0909006C:PEM routines:get_name:no start line
1651806624: OpenSSL Error[1]: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib
1651806624: Bad socket read/write on client local.HomeAssistant: The client is not currently connected.
1651806655: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651806655: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)

doesn’t help, errors still exist

Now, i deleted both of my cert files an reuploaded both cert files from GitHub - d3nd3/Hisense-mqtt-keyfiles: Some version of mqtt hisense require keys

[05:35:28] INFO: Starting NGINX for authentication handling...
[05:35:28] INFO: Starting mosquitto MQTT broker...
1651808128: Loading config file /share/mosquitto/acl.conf
1651808128: Loading config file /share/mosquitto/hisense.conf
1651808128: Warning: Bridge hisensetv using insecure mode.
1651808128: Warning: Mosquitto should not be run as root/administrator.
[05:35:29] INFO: Successfully send discovery information to Home Assistant.
[05:35:29] INFO: Successfully send service information to the Supervisor.

Now there are no Errors in the Log file, which is a good sign i think.

its still the same as long the TV is on, I also can see the published commands in MQTT Explorer.
As soon I turn off the TV it gives me the Errors that I’m talking erlier about

1651656089: Client <unknown> closed its connection.
1651656092: Client local.HomeAssistant disconnected: Protocol error.
1651656113: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651656113: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)
1651656116: Client local.HomeAssistant disconnected: Protocol error.
1651656147: Connecting bridge (step 1) hisensetv (192.168.192.76:36669)
1651656147: Connecting bridge (step 2) hisensetv (192.168.192.76:36669)

So that the bridge is up and running with no Errors, How to get it to Home Assistant?
I’ve treid to install the integration “Hisense MQTT Bridge” from @sehaas, put in the MAC address of the TV, but nothing happens, the wheel ist spinning arround endless.

What to do now?

Hey @NeeeeB how long does it take until it starts working? To see the TV in HA.
I Have pretty much the same behaviour as your setup
TV: 55U8qf and HyperHDR so i need it to to get the HDR flag.

Hi @epictechlab,
That shouldn’t take more than a minute.

Did you have a look at all the closed issues from Sehaas github ?
Especially that one :

Might help you (browser problem)

Let me sumup how I made it work on my setup :
first I did put the .conf file in here

now this is what the .conf file looks like
image

You can see you need 3 files, that I put in ssl folder (but I think you can put them anywhere as long as the paths are correct in the .conf file)
hisense.crt is the one you have to generate yourself with the instructions from this repo :

the 2 other files can be found here :

and now this is how my MQTT broker is configured :

When all this is done, just install Sehaas integration from HACS, run it, fill the TV MAC address and you should be good to go.
Try with Chrome, not Firefox.

I wish this will help you solve your problem.

PS: the “folder” filled in the mosquitto configuration must be the folder where hisense.conf file is.

@NeeeeB I dId 100% exactly the same thing as u did and I only used Chrome no firefox etc. MAybe there s someting i dont understand on the mqtt side. if I Test my mqtt config by subscribing to # i can see one hisense Entry but they are not listet as an entity in my Mqtt integration. maybe there is something different. I’m not totaly undersztand this mqtt thing.

There is not much to understand on the MQTT side for this.
And the Sehaas integration won’t be listed under MQTT, it is a separate integration.
It should appear as this once properly configured :

@NeeeeB over the weekend I’ve tried to get it running.
I’ve installed the Hisense MQTT Bridge from @sehaas, the Pincode is showing on the TV but couldnt get the input filed on HA. I’ve tried different browsers (Chrome, Firefox, Safari, Edge) also tried different machines (mobile, Tablet, PC, Laptop).
But its all the same.

Which Information should I get you to help me with this issue.
Any additional Logs or output?

I can’t help you any further, unfortunately I’m no dev or expert of HA.
I think you should get in touch with @sehaas , he is the develoepr of this integration and might be able to help you…
@epictechlab if you see the pin code on TV, it is because HA is able to communicate with your TV, so I believe this is a bit of a progress actually.

1 Like

Thanks a lot for your help until now.

@sehaas how can I get this working? As mentioned above I get the pin code in the TV but never got a pin field on the integration.

1 Like

Could you solve it? Or @sehaas
I have the Same.
TV Shows the Code after I put IP / Mac etc …
But the Integration only Shows the loading circle and I can Not enter the Pin somewhere.

Hey how did you get past the Pin Problem?

ok I read through the closed issues on github
and tried to do the steps setting up the integration with another laptop and this suceeded …
so some kind of weird timing / browser / whatever issue.

1 Like

I just got my U6G setup and now trying to integrate to HA for some automations. I cannot get the RemoteNow app for android to find the TV. I have the IP port control enabled, the content sharing enabled, they are both on the same Wifi network… confirmed the TV is on 5GHz as is my phone…

Do I need this step? Feel like i’m stuck without it, but maybe not. Any ideas?

Figured it out… don’t need remoteNow and per someone else with the U6G only needed the .CRT file

I was able to use OpenSSL included with github on Windows to get the certs

I have try in a number of devices, with no luck. will explore further later.

Solved Pin and authentication now works
I had to use a newer device (laptop) running Chrome (my lab devices are all a bit old).
I had tried to many things and was focusing in the HASS instance using the clue of timing issues, but at the end it was my devices were to old (timing maybe).

Hey
When the TV was Off for a while the ON via the Integration is Not working anymore.

This only happens when the TV was Off for some time … Like It goes into a deeper sleep after some time.

Is this normal? Should a Standard WOL ne Part of the Integration to avoid this?

Thank you

EDIT:
For now I solved it via

configuration.yaml

wake_on_lan:

switch.yaml


  - platform: wake_on_lan
    name: Hisense TV Wohnzimmer LAN WOL
    mac: 5C-34-xx-xx-xx-xx

  - platform: template
    switches:
      hisense_tv_wohnzimmer_lan_switch_template:
        turn_on:
          service: switch.turn_on
          data:
            entity_id:  switch.hisense_tv_wohnzimmer_lan_wol  #triggers the WOL Switch
        turn_off:
          service: switch.turn_off
          data:
            entity_id:  switch.hisense_tv_wohnzimmer_lan   #triggers the MQTT Switch from sehaas integration
1 Like

Evening All,

Finally working through creating a Virtual Remote for Hisense TV, let me know your thoughts, only one piece of functionality is not working (How to launch TV Guide on the TV) so if anyone know how to fix it that would be awesome

If people are interested I will share the configuration, Built this using a combination of the key resources provided on this thread.

Cheers
Diviesh

2 Likes