Hisense TV Control

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:

Hey all,
I have currently have this working in HassOS, I am mostly through migrating to Docker container in bridge mode and trying to get this back to working again.

I have MQTT broker and HA talking to each other successfully. I currently have MQTT configured by the UI. I am stuck in getting HA/MQTT to talk to the TV.

Using MQTT explorer I can successfully connect to each HA and the TV on their own.

I am fairly certain its to do with where I am putting the hisense.conf and hisense.crt as I can’t actually work out where they are supposed to go. Currently, I have them in folders the same level as my HA /config folder replicating the way it is in HassOS being /share/mosquitto and /ssl. I am assuming either there are specific paths already where these should go or I need to define them somewhere, but I am not exactly sure where.

After arranging my thoughts while writing this I think the question to my problem is, where do I put the hisense.conf file or define the path to it? (As it will then point to the hisense.crt file)

Anyone got this to successfully work with HA in a Docker container, and MQTT in its own contianer?

This is my HA docker config:

homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - ./data/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    networks:
      - proxy
    ports:
      - 8123:8123
      - 1400:1400
      - 51827:51827
      - 5353:5353
      - 21063:21063
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
      - /dev/ttyUSB1:/dev/ttyUSB1
      - /dev/ttyACM0:/dev/ttyACM0
    expose:
      - 8123
      - 1400
    environment:
      - TZ=Australia/Sydney

This is my mosquitto docker config:

mqtt:
    container_name: mosquitto
    image: eclipse-mosquitto:latest
    ports:
      - 1883:1883
      - 9001:9001
    network_mode: host
            # - proxy
    restart: unless-stopped
    environment:
      - PUID=1000
    volumes:
      - ./data/mosquitto/config:/mosquitto/config
      - ./data/mosquitto/log:/mosquitto/log
      - ./data/mosquitto/data:/mosquitto/data

This is my mosquitto.conf:

persistence true
persistence_location /mosquitto/data/

user mosquitto

# Listen on all interfaces
listener 1883 192.168.10.60

#Allow connection without authentication
allow_anonymous true

socket_domain ipv4

log_dest file /mosquitto/log/mosquitto.log
log_dest stdout

password_file /mosquitto/config/pwfile

This is my hisense.conf:

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

You need to take that repository URL.

  • Go into HACS > Integrations.

  • 3 Dots top right.

  • Custom repositories.

  • Add the repository URL there.

NVM Worked it out.

But for those who may find this useful, I needed to define an “include_dir” parameter in mosquitto.conf to tell it where to look for the hisense.conf file.

Then updated the hisense.conf file to point to the hisense.crt file. I moved both files into paths under the /mosquitto/config directory.

New mosquitto.conf:

persistence true
persistence_location /mosquitto/data/

user mosquitto

# Listen on all interfaces
listener 1883 192.168.10.60

#Allow connection without authentication
allow_anonymous true

socket_domain ipv4

include_dir /mosquitto/config/devices/

log_dest file /mosquitto/log/mosquitto.log
log_dest stdout

password_file /mosquitto/config/pwfile

New hisense.conf:

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

I’m trying to get this setup working with my new Hisense TV but I’m stuck on the RemoteNow part, as this app just will not find my TV on my network. Is this a known issue? Is there any way to use a different device’s MAC address in the part where you are supposed to put in your phone’s MAC after connecting with RemoteNow?

Hello,

Need help !
I cannot connect my TV to HA.

I can access the TV MQTT with the data:

address 192.168.1.xx:36669
username hisenseservice
password multimqttservice

First problem:
Either my TV doesn’t have certificates, or I’m doing something wrong:

Integration always looks like this:

Sem Título (1)

Thanks

1 Like

I am a total noob and found this thread while looking for a way to turn my tv on and off with my pc. Is that possible?
Thanks

Hey all, I figured out how to get this working on a U6G Android TV.

Most of it is the same as ReDaLeR’s post, however the connection settings needed a slight modification, and several of the MQTT command payloads are now different.

Here is a link to my thread: Hisense U6G (and possibly other) Android TV Control

Hi all, I’m trying to get this working on a H78G, which is the Canadian version of H8G I believe. But I cannot for the life of me get RemoteNow to detect it, so I’m stuck at the first step. Is there an alternative to RemoteNow or some other method that can be used?

Thank you.

I’m having a strange issue. This was working fine however I’ve now lost the ability to control the TV. All the state information gets pulled through, if I change the volume with the remote etc it updates in home assistant however I can’t control anything/turn off the TV from hass. Anyone any ideas? I’ve tried readding the tv but the same result.

Didn’t notice your post when I made mine, but I somehow got it to work! Turning on content sharing didn’t help. Neither did messing with android TV Remote Service. I read somewhere people having problems after updating their TV so I tried a factory reset and now it works!

@sehaas
Is there any way to get the signal info with that integration ?
If not, would it be possible to add a binary sensor to the integration where it would return True or False regarding if the TV is displaying HDR or not ?
I’d like to know when the TV is displaying HDR in order to enable the tone mapping on my HyperHDR ambilight installation.

Many thanks.

@NeeeeB I haven’t found such information yet.
/remoteapp/mobile/broadcast/ui_service/state gives you something like this:

{
  "statetype": "livetv",
  "list_param": "sl5824ec82-db05-4acf-85d1-404b560ac198",
  "channel_num": "1",
  "eventid": "",
  "progname": "FIS Skispringen Weltcup Bischofshofen HS 142",
  "starttime": 1641740100,
  "endtime": 1641747600,
  "detail": "live aus Bischofshofen\n\nKommentar: Michael Roscher\nCo-Kommentar: Andreas Goldberger und Martin Koch\nModeration: Boris Kastner-Jirka",
  "channel_param": "8#ch1e71308f-8015-4217-bee3-92f9bbe4746e#sl5824ec82-db05-4acf-85d1-404b560ac198#4",
  "channel_name": "ORF1 HD",
  "sourceid": "TV",
}

But I don’t know any HDR channel nor do I have any HDR content to try with.

Thanks for your answer.
I’ve checked with MQTT Explorer while I was running HDR content on my LibreElec device, plugged in HDMI 1, looks like we don’t have that info available…
This is what state returns :

{
  "statetype": "sourceswitch",
  "sourceid": "HDMI1",
  "sourcename": "HDMI1",
  "is_signal": 0,
  "is_lock": 0,
  "hotel_mode": 0,
  "displayname": "HDMI1"
}

Found /remoteapp/mobile/broadcast/platform_service/data/picturesetting
Looks related and it gets trigged really often with different values.

{
	"action":	"notify_value_changed",
	"menu_id":	7,
	"menu_value_type":	"int",
	"menu_value":	0
}

If we have mapping for menu_id and menu_value we may get the desired information.

/edit: found the SES UHD Demo Channel, it broadcasts in UHD with HDR. With that I have HDR options under Settings -> Picture -> Picture Mode

Good News Everyone.
The picturesetting delivers plenty of values including flags for UHD, HDR, Brightness,…

My current implementation adds a single sensor with all key/value pairs as additional attributes. I’m not sure if this is the best way to handle this information. Maybe every key should be a separate sensor, but I don’t know how to handle a set of dynamic sensors yet.
Does someone know how to implement such a SensorEntity?

1 Like