在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:MrAsterisco/homebridge-hisense-tv开源软件地址:https://github.com/MrAsterisco/homebridge-hisense-tv开源编程语言:Python 51.3%开源软件介绍:Homebridge-Hisense-TVThis is a plugin for Homebridge that allows you to control your RemoteNow-enabled Hisense TVs, using a custom version of the hisensetv tool. With this plugin, you can:
Requirements
CompatibilityIn theory, any RemoteNOW enabled TV should work with this plugin. However, some TVs have different behaviors, different SSL configurations and may not work completely or may require additional steps. This plugin has been developed and tested running Homebridge on Ubuntu Linux 20.04 and macOS Monterey with a Hisense 50AE7010F. If your configuration differs, the steps below may not be a 100% accurate: even if the general idea is the same (pair the TV, add it to Home, use it), your mileage may vary. If you find anything that is not correct, please open an issue (or even better: a PR changing this file) explaining what you're doing differently to make this plugin work with different TV models and/or on different operating systems. Known IncompatibilitiesSome TV models have been reported as incompatible or are known to cause problems.
InstallationSearch for the plugin in Homebridge:
You also need some additional dependencies, if you haven't installed them already. Follow the instructions below for your operating system and then proceed to "Setting up the TV". Linux (including Hoobs)# for Linux distros with APT
apt install python3-paho-mqtt python3-netifaces
# for any Linux distro, including Hoobs:
sudo su - homebridge
pip3 install netifaces
pip3 install paho-mqtt This step is required if you're using Hoobs. Please note that additional issues may arise when running on Hoobs, as I unfortunately don't have access to one and cannot test on it. I am happy to provide help and support in fixing those issues: just open an issue on this repo and we'll try to figure it out together. Error when installing NetifacesWhen you install pip3 install --upgrade setuptools
sudo apk add python3-dev # for apk
sudo apt-get install python3-dev # for apt macOS / Windowspip3 install netifaces
pip3 install paho-mqtt Setting up the TVFirst, you need to get the name of the network interface that your Homebridge machine will use to connect to the TV. To get the list of all the network interfaces on your machine, follow the instructions below for the operating system where you're running Homebridge. Once you have the network interface name, go to "Continue the Setup". Generic Linux
The name of a network interface usually looks similar to this: macOS
The name of a network interface usually looks similar to this: WindowsRun a Python shell on your system (you should be able to do so by running python or python3 without any parameters) and then typing:
The name of a network interface usually looks similar to this: To find the correct interface, use the following command in a python shell, repeating it using each network interface name until a matching IP address for the Homebridge host system is identified:
In order for the plugin to execute properly within Homebridge and retrieve the input names and TV status, you must also change the Local System Account associated with the Homebridge service using the following steps:
Continue the SetupFor this plugin to work correctly, you need to configure your TV to use a static DHCP (or configure a static reservation on your router). You also need to find your TV's MAC Address: this is usually displayed under Settings > Network Information, but it might vary based on your model. To connect to your TV, you need to pair the machine where you're running Homebridge with your TV. This is done in the command line, by manually running the bundled python3.8 hisensetv.py <TV_IP_ADDRESS> --authorize --ifname <NETWORK_INTERFACE_NAME> Your TV, if compatible, will display a PIN code: insert it in the command line and confirm. Your device is now paired with your TV and they can communicate when the TV is on. Repeat this step for all the TVs you want to use via HomeKit. If the command times-out after a while, make sure your TV is connected to the network and turned on. You can try to Configure the pluginYou can use the Homebridge UI to make changes to the plugin configuration. You must set the "Network interface name" to the name you found out previously and then configure your TVs (include the { } if configuring on Windows). Then, just add all the TVs you have authorized earlier:
Repeat the configuration for each TV you want to use, then restart Homebridge. SSL modeSince version 1.1.0, this plugin also supports connecting to Hisense TVs that require different SSL modes than the default one. For example, some models have an unrecognized certificate and some other models need a specific encryption to be used. To change how the plugin connects to your TV, use the If your TV needs a specific encryption key and certificate, you can find the most common ones here. Choose the appropriate one and download it onto the machine that executes Homebridge. When providing the certificate and its key, you'll need to store them outside of the plugin folder (i.e. outside of the Config example{
"platform": "HiSenseTV",
"ifname": "ens33",
"devices": [
{
"id": "A unique identifier (such as your TV S/N)",
"name": "A name to display in the Home app",
"ipaddress": "Your TV IP address",
"macaddress": "Your TV MAC Address",
"sslmode": "default (most common)|disabled (no SSL)|custom (use cert and key below)",
"sslcertificate": "/absolute/path/to/the/ssl/certificate.cer",
"sslprivatekey": "/absolute/path/to/the/ssl/privateKey.pkcs8"
}
]
} Add the TV to HomeOnce Homebridge is ready, look for a log line in the Homebridge log that looks like this one:
Take a note of the Setup Code and open your Home app on your iPhone, iPad or Mac. Make sure you are connected to the same network as Homebridge and that your TV is turned on, then follow these steps:
Done! As always, you can repeat the steps above if you have multiple TVs to add. Please note that each TV will have a different Setup Code logged in Homebridge. StatusThis plugin is under active development, but most of the features are ready to be used. There might edge cases that are not supported or not handled correctly, please see below. Known issues
ContributionsAll contributions to expand the library are welcome. Fork the repo, make the changes you want, and open a Pull Request. If you make changes to the codebase, I am not enforcing a coding style, but I may ask you to make changes based on how the rest of the library is made. CreditsThis plugin makes use of a modified version of the hisensetv Python script, originally written by Alex and distributed as open-source software here. The code structure and style is heavily inspired by the homebridge-smartglass plugin, written by UnknownSKL. SSL Support has been implemented with a lot of help from chinedu40 and ryanshand. LicenseThis plugin is distributed under the MIT license. See LICENSE for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论