Hisense TV Control

@sehaas Yes it does.

I’ve tried without changing filenames for the certs, so here is what my hisense.conf does look like now :

connection hisensetv
address 192.168.1.41:36669
username hisenseservice
password  multimqttservice
clientid HomeAssistant
bridge_tls_version tlsv1.2
bridge_cafile hisense.crt
bridge_certfile rcm_certchain_pem.cer
bridge_keyfile rcm_pem_privkey.pkcs8
bridge_insecure true
start_type automatic
try_private true
topic /remoteapp/# both 0 hisense ""

I’ve put all files in the mosquitto folder as you can see :

image

hisense.crt has been generated from the openssl command from TiagoFreire’s github.

and this is what the configuration looks like before spinning forever if I press on “submit” :

image

oh and mosquitto configuration is set to true also :
image

So I don’t know why it doesn’t work…

PS: my TV is a 55U7QF and i can see values from the broker with MQTT Explorer and both certificates.

Believe me or not, it has started working now…didn’t change anything, just tried again…
Sorry for the annoyance !
And thanks for the work !

EDIT: well, no, it doesn’t work.
the switch is reported as inactive although th TV is ON
Adding a card with that switch and trying to click on it has absolutely no effect on the TV.
And I do not understand how to use the other entity (media player)

EDIT2: it “kinda” works…
I have to run the app on my phone to see the card being enabled in HA.
Then I can quit the remote app.
But as soon as I switch off the TV from HA with the switch, when I switch it on with my physical remote, HA is not updated (the switch stays off), and I have to run the app again to update the switch state…
Any idea what I am doing wrong ?

I’m not sure if I’m doing anything wrong either, but if you see my earlier post, mine does not stay up to date. It only works sometimes.

Yep, it works as long as RemoteNow is opened on my phone.
As soon as I close the app, it looks like connection is lost…
Very strange, and no help from the integration author…

EDIT: after a bit of troubleshoot, it looks like the broker needs to be woken up by the app if the TV goes from OFF to ON. Then it works as intended, as long as the TV is not turned OFF.

@lindsayward I’ve found where was my problem, TV Fastboot was disabled, and when disabled the broker does not start with the TV when you switch it on…

@sehaas I’ve another problem now…WOL does not work. It is enabled on the TV and I’m on ethernet connection. I can switch off the TV, but can not switch it on.
Any idea ?

Are you running HA in a docker container? I only tested it in host-mode. Maybe that’s the reason.

@sehaas nope, running HassOS on Pi4


is this how its supposed to look?

No one has mentioned where this goes really, is this in the config.yaml file?

EDIT: update

so after messing around with hisensetv api for python, i am able to power on and off my projector using the api but i cant get it working in home assistant


any ideas?
i am running it in home assistant in a docker container

on my debian machine its under: /usr/share/hassio/share/mosquitto

thanks for the reply! considering the python api doesnt require ssl do you still think that could be the issue? i dont have a mosquitto folder under share

If i recall i had to create that folder wasnt there by default.

I also had to have this in the mosquitto add on config:

customize:
  active: true
  folder: mosquitto

Documentation:

Option: customize.active

If set to true additional configuration files will be read, see the next option.

Default value: false

Option: customize.folder

The folder to read the additional configuration files (*.conf) from.

I put the config into /usr/share/hassio/share/mosquitto/hisense.conf

connection hisensemqtt
address 192.168.2.120:36669
remote_username hisenseservice
remote_password multimqttservice
require_certificate false
cleansession true
remote_clientid HoMA-remote
local_clientid HoMA-local
try_private false
start_type automatic
topic # both
bridge_capath /ssl/
bridge_insecure true
bridge_tls_version tlsv1.2
log_type all
connection_messages true
log_timestamp_format %Y-%m-%dT%H:%M:%S
bridge_protocol_version mqttv31

The certificate is under /usr/share/hassio/ssl/hisense.crt and looks like this:

-----BEGIN CERTIFICATE-----
MIIDtDCCApygAwIBAgIBAjANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJDTjER
[...some more lines of symbols...]
CgfmqEp56iiTCceuQADm7/1T+lL1KtwiA0gvtybLzAFmsFB/aDmLvg==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIDoTCCAomgAwIBAgIJALkl/OZ9XUXDMA0GCSqGSIb3DQEBCwUAMGcxCzAJBgNV
[...some more lines of symbols...]
1CJQ7Zbr2+AaUp2D7XmhEJOVvJdN
-----END CERTIFICATE-----

Hello,
i own a Hisense H55U8B and i want to integrate it in HA, in this topic i find many ways which confuses me a little.
Is there a kind of a howto for starters to integrate the TV?

Hi Everyone, There’s some great work here, thank you! I’ve run into a little trouble in configuration and I was hoping to get some advice from the collective brains-trust.

I’ve been using the ha_hisense_tv library posted by @sehaas (installed as a custom repository via HACS) and following along with some of the instructions on Home_Assistant_Hisense_TV originally posted by @danzal, however I run into an issue obtaining the certfile from the TV, I get the following error:

CONNECTED(00000003)
write:errno=54
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 293 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---

The mosquitto log also shows the same error others have observed when they are missing a certificate:

1627184099: Connecting bridge hisense (192.168.88.161:36669)
1627184099: Socket error on client local.HomeAssistant, disconnecting.

I’m currently using the Hisense-mqtt-keyfiles originally listed by @neeeeb.

I’m not hugely familiar with handling certfiles like this so any suggestions would be greatly appreciated!

[edit]
I should add that remote control with the (iOS) RemoteNow app does work (except to turn the TV on, which appears to have been reported a few times on the app store. Attempting to connect using MQTT Explorer fails (validate certificate off and TLS encryption on) with a non-specific “Disconnected from server” error.

1 Like

Hi guys, I’ve read and re-read this whole thread dozens of times and tried every possible combination of config setting and using the correct certificates etc to no avail. I can however connect over MQTT explorer perfectly. I think half the issue is that we’re running different hisense models that need varying degrees of authentication. Can I get one of you fine people to check my screen shots and show me where I am getting this wrong.

This is my MQTT broker log:

My config which could be wrong:
Screen Shot 2021-08-19 at 5.03.07 pm

My MQTT connects totally fine with the below and using the RCM certificate and key provided by this thread.

Thanks, I am but moments away from buying a broadlink IR and or throwing my hisense out for an LG!

Hi!
Don’t know if this might help as it could be as you said it depends on the TV model, but just in case you want to double check this is my working config:

connection hisensemqtt
address 192.168.X.X:36669
username hisenseservice
password multimqttservice
clientid HomeAssistant
bridge_cafile /ssl/hisense.crt
bridge_insecure true
bridge_tls_version tlsv1.2
try_private false
start_type automatic
topic +/remoteapp/# both

I used the guide posted here.

It works pretty good (sometime you have to unplug the TV from the power because it hangs, but it doesn’t happen so often. Right now I’m only struggling to find a reliable way to create a binary sensor that tells me when it’s really on or off.

Hey
I see there are a couple ways to get Hisense TVs into HA.
Is there a advice which is the best?
To me the: https://github.com/sehaas/ha_hisense_tv lookedmost promising.
I just don’t find it as repo in HACS when I search for Hisense :grimacing: