Shell script to integrate Hisense TVs using the RemoteNOW app with Homebridge through the homebridge-cmd4 plug-in.
mosquitto
: sudo apt-get install mosquitto
wakeonlan
: sudo apt-get install wakeonlan
openssl
: sudo apt-get install openssl
openssl
(add your IP address in here): openssl s_client -host TV_IP_ADDRESS -port 36669 -showcerts
. It should spit out a bunch of information, you need to grab only the following area of code that looks like this:-----BEGIN CERTIFICATE-----
qmierjfpaoisdjmçfaisldjcçfskdjafcaçskdjcçfmasidcf (etc. etc. etc)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
7ferusycedaystraedyasredyatrdsecdtrseydtraESYDTRASCY (etc. etc. etc)
-----END CERTIFICATE-----
sudo nano hisense.crt
and paste the two certifications as found inside. This will have created the certificate file in your home file path (/home/pi/hisense.crt
).HisenseTV.sh
with the IP address of your TV, the MAC Address of your TV, the MAC Address of the paired device from earlier (the one you got from MQTT Explorer) and the file path of the certificate you just created.HisenseTV.sh
to a subdirectory of your .homebridge
directory; e.g. .homebridge/Cmd4Scripts/HisenseTV.sh
. Mine is located in /home/pi/HisenseTV.sh
as I find that easier. sudo nano HisenseTV.sh
and pasting the contents inside, then saving. Its pathway will be /home/pi/HisenseTV.sh
. NOTE: For HOOBS users this would create your shell scripts at the lcation: /home/hoobs/.hoobs/HisenseTV.sh
.sudo npm install -g --unsafe-perm homebridge-cmd4
. NOTE: you do not need to follow the extra installation steps on cmd4's page for this.config.json
file (easiest done through homebridge-confi-ui-x
web UI); use the config_sample.json
file. This file contains all potential input sources, personally I would only add the ones you use as there are 24. NOTE: do not change the values of "identifier"
for each input source or they will no longer work.The following Hisense TV Apps added as input sources do not seem to work:
Step 9
and before Step 10
; you can run the following two commands to see that you have the certs and your MAC Address correct. If the following commands do not work, then you have done something wrong with the certificatess or the MAC Addressfor the paired device and it is the not a problem the shell script or homebridge-cmd4
. wakeonlan XX:XX:XX:XX:XX:XX
(replace with the MAC Address of your TV) from your terminal.mosquitto_pub --cafile /home/pi/hisense.crt --insecure -h IP_ADDRESS -p 36669 -P multimqttservice -u hisenseservice -t "/remoteapp/tv/remote_service/XX:XX:XX:XX:XX:XX$normal/actions/sendkey" -m "KEY_POWER"
(replace with the certificate file path, the IP Address of your TV and the MAC Address of your paired device). I can't remember if these commands needs a sudo
in front or not.