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.
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
mosquitto_pub.exe -h
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
mosquitto_pub.exe -h
mosquitto_pub.exe -h
mosquitto_sub.exe -h
mosquitto_pub.exe -h
mosquitto_pub.exe -h
mosquitto_pub.exe -h
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.
mosquitto_pub.exe -h
/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
/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
/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
publish: /remoteapp/tv/ui_service/HomeAssistant/actions/applist
subscribe: /remoteapp/mobile/HomeAssistant/ui_service/data/applist
**Known to work with:
Hisense 65P7 Hisense 75P7 Hisense VIDAA U 2.5