GithubHelp home page GithubHelp logo

mqtt-hisensetv's Introduction

mqtt-hisensetv

Details on how to connect to Hisense Smart TV via the built in MQTT broker service.

Hisense Smart TV's (tested on 75P7 model) run a MQTT service on TCP port 36669 which is running mosquitto 1.4.2. This is primarily used to interact with the official hisense remote app.

NOTE that later versions of Hisense TV's are using a encrpyted MQTT connection on the same port. You need to ensure to set encryption=on and validate=off in your client (as they are using a self signed cert.)

##NOTE some newer versions of Hisense TV's have additional checks around authentication codes.

You can send the authentication code by sending the following: A user would need to publish

/remoteapp/tv/ui_service/HomeAssistant/actions/authenticationcode
{"authNum": XXXX}

where XXXX is the 4 digit number displayed on the screen. Once this pairing has been completed, the user than then send the other commands to change channel, power off etc.

To access this service connect via your MQTT client

with the following settings

Host: IP Address of your TV
Port: 36669
Username: hisenseservice
Password: multimqttservice


You can then subscribe to all topics with #.

Here is a sample of the TV state:

Publish:
/remoteapp/tv/ui_service/HomeAssistant/actions/gettvstate

Subscribe:
/remoteapp/mobile/broadcast/ui_service/state
JSON output:
{"statetype":"sourceswitch","sourceid":"4","sourcename":"HDMI 2","is_signal":1,"is_lock":0,"hotel_mode":0,"displayname":"HDMI 2"}

How to get TV sources lists:

Publish:
/remoteapp/tv/ui_service/HomeAssistant/actions/sourcelist

Subsribe:
/remoteapp/mobile/HomeAssistant/ui_service/data/sourcelist
JSON output:
[{"sourceid":"4","sourcename":"HDMI 2","displayname":"HDMI 2","is_signal":"1","is_lock":"0","hotel_mode":"0"},{"sourceid":"0","sourcename":"TV","displayname":"TV","is_signal":"1","is_lock":"0","hotel_mode":"0"},{"sourceid":"3","sourcename":"HDMI 1","displayname":"HDMI 1","is_signal":"0","is_lock":"0","hotel_mode":"0"},{"sourceid":"5","sourcename":"HDMI 3","displayname":"HDMI 3","is_signal":"0","is_lock":"0","hotel_mode":"0"},{"sourceid":"6","sourcename":"HDMI 4","displayname":"HDMI 4","is_signal":"0","is_lock":"0","hotel_mode":"0"},{"sourceid":"2","sourcename":"COMPONENT","displayname":"COMPONENT","is_signal":"0","is_lock":"0","hotel_mode":"0"},{"sourceid":"1","sourcename":"AV","displayname":"AV","is_signal":"0","is_lock":"0","hotel_mode":"0"}]

Launch Youtube app:

Publish:
/remoteapp/tv/ui_service/HomeAssistant/actions/launchapp
{
  "name" : "YouTube",
  "urlType" : 37,
  "storeType" : 0,
  "url" : "youtube"
}

Launch Netflix App:

/remoteapp/tv/ui_service/HomeAssistant/actions/launchapp
{
  "name" : "Netflix",
  "urlType" : 37,
  "storeType" : 0,
  "url" : "netflix"
}

Launch PrimeVideo app:

Publish:
/remoteapp/tv/ui_service/HomeAssistant/actions/launchapp
{
  "name" : "Amazon",
  "urlType" : 37,
  "storeType" : 0,
  "url" : "amazon"
}

Turning TV to standby:

Publish:
/remoteapp/tv/remote_service/HomeAssistant/actions/sendkey

KEY_POWER

Change Source:

/remoteapp/tv/ui_service/homeAssistant/actions/changesource

To TV:

{
  "sourceid" : "0",
  "sourcename" : "TV"
}

To HDMI 2:

{
  "sourceid" : "4",
  "sourcename" : "HDMI 2"
}

Thank you to @niczoom who provided additional commands using mosquitto_pub/sub executables!

Subscribe to all topics

mosquitto_sub -v -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t #

Get the tv state (Publish)

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -m 0 -t /remoteapp/tv/ui_service/AutoHTPC/actions/gettvstate.

It needs the -m message paramater filled otherwise you get an error "Error: Both topic and message must be supplied"

Subscribe to topic: mosquitto_sub.exe -h <TV_IP> -p 36669 -t /remoteapp/mobile/broadcast/ui_service/state -P multimqttservice -u hisenseservice

Change/Set the volume

Get current volume:

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/platform_service/AutoHTPC/actions/getvolume -m ""

Change/Set Volume (-m = volume level 0-100)

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/platform_service/AutoHTPC/actions/changevolume -m 50

Subscribe to topic:

mosquitto_sub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/mobile/broadcast/ui_service/volume

Change/View current source

Show current state:

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -m 0 -t /remoteapp/tv/ui_service/AutoHTPC/actions/gettvstate

Show all available sources:

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -m 0 -t /remoteapp/tv/ui_service/AutoHTPC/actions/sourcelist

Change source. The 'sourceid' is all thats required to change to a new source. For example to change to HDMI1:

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/ui_service/AutoHTPC/actions/changesource -m {"sourceid":"3"}

The '' are needed to escape the quotes when run from the command line.

You can use 'sourcename' as well but its not necessary. If you are then do not put a space in 'HDMI 1' eg: Use "sourcename":"HDMI1". I found using a space, which is what is shown when using 'sourcelist' above, gives an error.

TV Power

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/remote_service/AutoHTPC/actions/sendkey -m KEY_POWER

Other

Navigation:

/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_POWER
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_UP
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_DOWN
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_LEFT
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_RIGHT
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_RETURNS (Back)
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_MENU
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_EXIT
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_OK
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_HOME

Volume

/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_VOLUMEUP
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_VOLUMEDOWN
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_MUTE

Content interaction

/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_FORWARDS (fastforward)
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_BACK (rewind)
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_STOP
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_PLAY
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_PAUSE
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_0
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_1
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_2
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_3
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_4
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_5
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_6
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_7
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_8
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_9
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_SUBTITLE

Enumerate apps:

publish: /remoteapp/tv/ui_service/HomeAssistant/actions/applist

subscribe: /remoteapp/mobile/HomeAssistant/ui_service/data/applist

Please note that:

  • Power on is done via WOL to TV's MAC address (either wired or wireless)

**Known to work with:

Hisense 65P7 Hisense 75P7 Hisense VIDAA U 2.5

mqtt-hisensetv's People

Contributors

julianstremel avatar krazy998 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mqtt-hisensetv's Issues

Compatible TV List

Is there a list of compatible TV's anywhere or what to look for in the manual to see if this will be supported? I am looking to get a new TV and I have been looking for something to integrate with my smart home, preferably one that pushes status updates, namely power/wake status, to my device.

Hissende H55nec6500

Hello everyone,

I have a Problem with my TV NEC6500 I can't connect the TV with the MQTT.

Does someone know a solution for my Problem

not sure this is an issue with this but posted here as you guys are the best to know

having an issue with mqtt publish on my hisense vidaa. up until a week ago it was working fine however now i can only control volume both in home assistant and on the remote now app. i believe this is a tv issue rather than app issue as i can see the mqtt request send to the tv in mqtt explorer. volume, mute, home and exit work fine (sendkey) however anything like changesource or launchapp doesnt work basically things with a payload dont work. as i say this is sending from the remotenow app (publish verified in mqtt explorer) so something is broken on the tv end. any ideas?

Hisense H8 display connection

Hi, I spent a lot of time trying to figure out how to get this working on my H8 display, and I wanted to share with anyone else who might be trying to make it work. It looks like they've moved to an encrypted MQTT session (still on port 36669). I'm using MQTT Explorer for testing, and the options for encryption=on and validate=off (they're using a self-signed cert), with the same username and password as in the main doc, are working for me. (Sure wish I'd tried just playing with those switches before setting up an android emulator and wireshark...)

I'm still working on getting control functioning, but I can't tell if that's just inexperience or other changes to this display yet...

MQTT connection to 65E7HQ QLED

Hi,

I am trying to connect to a new Hisense 65E7HQ QLED with Vidaa 5.

Very simple setup with MQTT explorer for fast initial connection, exactly according to your description

image

image

But connection can't be established. Do you see any mistakes?

Regards
maxpd

Add retrieving app list

Enumerate apps:
publish:
/remoteapp/tv/ui_service/HomeAssistant/actions/applist
subscribe:
/remoteapp/mobile/HomeAssistant/ui_service/data/applist

Open specific video on youtube

Hi

thanks for the info. I manage to open youtube and netflix etc. but is there a way also to open a deep link of an app, for example not just open youtube main app, but open a specific video on youtube? thanks

Publish request for TV Status not working

We have a 5 TV Video wall setup at work. I am using MQTT to control all the tvs synchronously, all is working well but if the tvs get out of sync as in 2 TVs are on and 3 are off then using SEND_KEY to power off or WOL to power on then a toggle switch does not work. To elevate this I have been trying to get the TV State via MQTT to allow me to know the state and change the way the control operates.

Am i right in thinking i should get a response when i publish:
/remoteapp/tv/ui_service/[SOME_MAC_ADDRESS]/actions/gettvstate

The document states i should use: /remoteapp/tv/ui_service/HomeAssistant/actions/gettvstate

but i have replaced the "HomeAssistant" part with the authorized Mac address from my phone.

any assistance would be appreciated.

Keyboard input and sharing media

Hi!
I could realize connecting and controlling my Hisense Vidaa TV thanks to this repository and your work. I really appreciate this and must say thank you!
My tv doesn't work with simple connection with constant username and password, but I could find new method in issue. In my opinion may be you could move new instruction to readme and your main instruction will be really more helpful. By the way, it's only your choice and I'm really grateful for this repository.

So I want to implement keyboard input and media sharing. It's possible because they could do it in official iOS app. But I'm not really good at Wireshark and sniffing and don't get how I can decrypt traffic.

Maybe you have found something about that or you can give me instruction about sniffing

Thank you one more time

Minor change to topic format

I have a Hisense 55R7.

On my TV, most of the information is correct (it has the certificate issue, but that was solvable).

But, the topics are slightly different:

Currently, your doco has PowerOff as:
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey

What I found was that this didnt work, but instead, the "AutoHTPC" section was replaced with "AA:BB:CC:DD:EE:FF$normal", where AA:BB:CC:DD:EE:FF is some kind of MAC address (Possibly phone MAC address, but its not one that is linked to my wifi, so not really sure). It seems to be a device ID of some kind.

I dont know if there is a registration step or something required to setup the AutoHTPC/HomeAssistant device ID or something, but I will keep investigating and update this ticket if I find a solution.

Retrieving currently selected source

Thanks so much for documenting this! Has anyone figured out how to get the currently selected source? I know you can get the source list, but I was hoping to also get the selected source. Thanks!

A bit more info on using mosquitto from the command line

Thanks for all this information. I ended up here as I was looking for discrete commands (IR) to turn my 75P7 on & off. Unlike my Samsung 65" UHD TV which has discrete IR codes for on & off this tv doesn't seem to. I've found a few resources which state discreet codes but they must of been for older models.

I've spent a bit of time now using mosquito MQTT from the command line and would like mention some findings I made, perhaps to update your readme file.

  1. Anywhere you have 'HomeAssistant', I've found this can be replaced with any word of your choosing, perhaps something to represent your use case.

  2. Subscribe to all topics

mosquitto_sub -v -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t #

  1. Get the tv state (Publish)

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -m 0 -t /remoteapp/tv/ui_service/AutoHTPC/actions/gettvstate.

It needs the -m message paramater filled otherwise you get an error "Error: Both topic and message must be supplied"

Subscribe to topic:
mosquitto_sub.exe -h <TV_IP> -p 36669 -t /remoteapp/mobile/broadcast/ui_service/state -P multimqttservice -u hisenseservice

  1. Change/Set the volume

Get current volume:
mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/platform_service/AutoHTPC/actions/getvolume -m ""

Change/Set Volume (-m = volume level 0-100)
mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/platform_service/AutoHTPC/actions/changevolume -m 50

Subscribe to topic:
mosquitto_sub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/mobile/broadcast/ui_service/volume

  1. Change/View current source

Show current state:
mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -m 0 -t /remoteapp/tv/ui_service/AutoHTPC/actions/gettvstate

Show all available sources:
mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -m 0 -t /remoteapp/tv/ui_service/AutoHTPC/actions/sourcelist

Change source. The 'sourceid' is all thats required to change to a new source. For example to change to HDMI1:
mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/ui_service/AutoHTPC/actions/changesource -m {"sourceid":"3"}

The '' are needed to escape the quotes when run from the command line.

You can use 'sourcename' as well but its not necessary.
If you are then do not put a space in 'HDMI 1' eg: Use "sourcename":"HDMI1". I found using a space, which is what is shown when using 'sourcelist' above, gives an error.

  1. TV Power

mosquitto_pub.exe -h <TV_IP> -p 36669 -P multimqttservice -u hisenseservice -t /remoteapp/tv/remote_service/AutoHTPC/actions/sendkey -m KEY_POWER

  1. Other

Navigation:
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_UP
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_RIGHT
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_LEFT
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_DOWN
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_MENU
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_RETURNS (Back)
/remoteapp/tv/remote_service/AutoHTPC/actions/sendkey KEY_EXIT

Authentication code

Hi,
Thanks for your useful guide, I've been using it to connect to my Hisense TV.
When I first connected to the TV and tried to get the TV state my TV came up on the screen with a 4 digit conformation code that I had to submit before I could send any further commands. I couldn't find how to publish this code from your code but have worked it out by piecing together several other bits of code I found online.

A user would need to publish
/remoteapp/tv/ui_service/HomeAssistant/actions/authenticationcode
{"authNum": XXXX}
where XXXX is the 4 digit number displayed on the screen. Once this pairing has been completed, the user than then send the other commands to change channel, power off etc.

I thought you might want to update your readme file to include this, as I thought it might be useful to some other users too.

Thanks for your work, it's been really helpful.

Cheers,

Sean

Identifier rejected on 55U7KQ

I bought a 55U7KQ that came out this year. It looks like Hisense did some changes to MQTT again, I am getting “Connection refused: Identifier rejected” over MQTT Explorer as well as within the mqtt logs on my raspberry although I am using my phone’s MAC address as the client ID.
Also on this newer model I can not use the Remotenow app, only the VIDAA app. Any help would be highy appreciated.

Bildschirmfoto 2023-10-17 um 16 47 42

Prime Video URL

Hi thanks for that,

i got everything working in HA.
can you tell me how you found out the url for Netflix? My hisense model has a prime video button as well, i want to add that...

BR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.