Coder Social home page Coder Social logo

homebridge-hisense-tv's Introduction

Homebridge-Hisense

Homebridge-Hisense-TV

Build and Lint

This 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:

  • See the status of the TV (on/off, current input).
  • Turn on and off.
  • List inputs (using the display name set on the TV) and switch between them.
  • Control the TV volume.
  • Remote control using the native iOS remote.

Requirements

  • NodeJS 10 or later.
  • Homebridge 1.3.0 or later.
  • Python 3.8 with paho-mqtt version 1.6.1 and netifaces.
  • A Hisense TV that supports the RemoteNow app (App Store or Play Store).
  • Starting with version 2.0.0, macOS is also supported as host.

Compatibility

TVs

In 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.

Starting with VIDAA U6 (2022) and continuing with VIDAA U7 (2023), native AirPlay and HomeKit support is built-in. For these TVs, this plugin is not required.

Known Incompatibilities

Some TV models have been reported as incompatible or are known to cause problems.

Homebridge Hosts

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.

Installation

Search for the plugin in Homebridge:

homebridge-hisense-tv-remotenow

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==1.6.1"

Hoobs

Generally, the commands shown above should work on Hoobs too, however, please note that additional issues may arise when running on this machine, 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.

The following issue contains additional steps that might be required in your setup with Hoobs.

Error when installing Netifaces

When you install netifaces, depending on your configuration, you may run into an error saying fatal error: Python.h: No such file or directory. The following commands should fix the issue by updating the setup tools to the latest version:

pip3 install --upgrade setuptools
sudo apk add python3-dev  # for apk
sudo apt-get install python3-dev  # for apt

macOS / Windows

pip3 install netifaces
pip3 install paho-mqtt

Setting up the TV

First, 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

ip a

The name of a network interface usually looks similar to this: ens33.

macOS

networksetup -listallhardwareports

The name of a network interface usually looks similar to this: en0.

Windows

Run a Python shell on your system (you should be able to do so by running python or python3 without any parameters) and then typing:

import netifaces
netifaces.interfaces()

The name of a network interface usually looks similar to this: {00000000-0000-0000-0000-000000000000}.

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:

netifaces.ifaddresses('{interface-name-here}')

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:

Press the Windows Key + R
services.msc
Find the Homebridge Service and double-click
Switch to the "Log On" tab
Change "Local System Account" to "This Account" and enter your user name (usually .\username)
-OR- 
click "Browse..." and search for your username
Enter your login password in the Password fields
Press "Apply" and "OK" and restart the service if prompted

Continue the Setup

For 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 hisensetv.py script. To do this, find the node_modules folder in your system (on Linux, it is located in /usr/local/lib/node_modules and on Windows, /users/(username)/AppData/Roaming/npm/node_modules) and move to homebridge-hisense-tv/bin, then run:

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 telnet <TV_IP_ADDRESS> 36669 to make sure your Homebridge instance can reach your TV. If telnet works but this command doesn't, try to run a different command, such as --get state (just replace authorize with this in the command above): if this command succeeds, it means your TV and your machine are already paired.

Configure the plugin

You 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:

  • as ID, you can input your TV's S/N or your own identifier, as long as it's unique in your Home. You can also leave the default value, if you have just one TV. Whatever you input, will be displayed as the accessory "Serial Number" in Home.
  • as name, input the display name that the Home app will suggest when adding this TV to your Home.
  • as IP address, input the IP that you have assigned to your TV.
  • as MAC Address, input the MAC Address of your TV (if your TV is connected both via WiFi and Ethernet, make sure to configure the interface that your TV is using).

Repeat the configuration for each TV you want to use, then restart Homebridge.

SSL mode

Since 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 sslmode config key. See below in the config example for more info.

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 node_modules directory). If you store them in the directory, they will be deleted when a new version of the plugin is installed. It is not important where you store them, as long as they are readable by the homebridge user.

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 Home

Once Homebridge is ready, look for a log line in the Homebridge log that looks like this one:

Please add [HiSense <SOME NUMBERS>] manually in Home app. Setup Code: XXX-XX-XXX.

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:

  • Tap the "+" button in the Home app and choose "Add Accessory".
  • Tap "I Don't Have a Code or Cannot Scan".
  • Your device should automatically detect the TV and show it. If it doesn't, make sure your network is up. You can also try and go ahead anyway by tapping "My Accessory Isn't Shown Here".
  • Input the "Setup Code" you found in the Homebridge logs.

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.

Status

This 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

  • The input list might not be fetched correctly if the TV is turned off while adding the accessory or after restarting Homebridge. To fix this, force close your Home app and open it again.
  • Switching input to "TV" might not work properly. Home will not display any error, but the next TV state refresh will bring the input back to the previous one (which is also the one displayed on the TV).
  • Making changes to the TV state (turning on/off, changing input) while the Home app is opened will not trigger a live update. This is theoretically supported by the plugin, but it seems to not work properly.. Just switching to another app and then going back to Home will trigger a refresh.
  • Some newer TV models are always reported as turned on: this happens because they still respond to requests, even if they're "off". As I don't have a such a model to test, I am unfortunately unable to provide a fix: if you have some experience with Python, TypeScript and have some free time, take a look at this issue.

Contributions

All 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.

Credits

This 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.

License

This plugin is distributed under the MIT license. See LICENSE for details.

homebridge-hisense-tv's People

Contributors

adamjthompson avatar jimmy0017 avatar mrasterisco avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

homebridge-hisense-tv's Issues

ModuleNotFoundError: No module named 'paho'

Hello,

I run homebridge on a Debian Linux and it's working fine, but I have a problem with this Hisense plugin.

I did install successfully by "npm -g install homebridge-hisense-tv-remotenow".
Until now, I did not configure anything in homebridge config, cause that very first command for pairing is already failing.
I did only run this:

root@Server:/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin# python3.9 hisensetv.py 192.168.1.40 --authorize --ifname ens3 Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 3, in <module> from hisensetv import __main__ File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 12, in <module> import paho.mqtt.client as mqtt ModuleNotFoundError: No module named 'paho'

What is the problem?
The TV pairs correctly with the iPhone app and the Linux machine can also connect by telnet to port 36669.
Can you please help me to fix?

Installing

Describe Your Problem:

I have homebridge installed on Pi, but I do not understand how to install any of the dependencies. Do I install Python for windows on my computer?

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

  • Plugin Version:
  • Homebridge Version:
  • Node.js Version:
  • NPM Version:
  • Operating System:

Display Inputs as inputs, not as separate devices?

Hello,

thanks for your plugin :) Finally I managed to install the plugin and add it to HomeKit now.

The only thing which is not so nice is, that the plugin adds an device for each input. I know that it can be grouped and it is by default, but it still does not look nice.
Why don't you display the inputs really as inputs? Like it is done for example by the homebridge-harmony plugin? https://github.com/nicoduj/homebridge-harmony

Hisense:
image

image

Harmony:
image

image

Authorise Issue

Describe Your Problem:
I'm attempting to Authorise in terminal to remove the error while fetching inputs (as seen in logs). Currently Home knows if the device is on or off but does not know what input is active. Whenever I try to authorise I get an error about importing main as seen below. I have installed the pip install hisensetv from the plugin thread with no change in error. Still relatively new to this.

Logs:

28/11/21, 12:46:09 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:19 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:29 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:39 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:49 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:59 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

When trying to authorise in terminal:

hoobs@hoobs:/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv $ python hisensetv.py ***.***.**.** --get state --ifname eth0
Traceback (most recent call last):
  File "/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/hisensetv.py", line 3, in <module>
    from hisensetv import __main__
  File "/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/hisensetv.py", line 3, in <module>
    from hisensetv import __main__
ImportError: cannot import name '__main__' from partially initialized module 'hisensetv' (most likely due to a circular import) (/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/hisensetv.py)
hoobs@hoobs:/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv $ 

Plugin Config:

{
    "accessories": [],
    "platforms": [
        {
            "platform": "HiSenseTV",
            "ifname": "eth0",
            "devices": [
                {
                    "id": "HiSenseTV****",
                    "name": "HiSense TV",
                    "ipaddress": "***.***.**.**",
                    "macaddress": "**:**:**:**:**:**",
                    "sslmode": "default"
                }
            ]
        }
    ]
}

Screenshots:

Environment:

  • Plugin Version:
  • Homebridge Version: 1.3.5
  • Node.js Version: 14.18.1
  • NPM Version:
  • Operating System: Raspbian (hoobs)

Use channel_name or progname in replacement of "On" in Home

Is your feature request related to a problem? Please describe:

Not related to a problem.

Describe the solution you'd like:

When the TV is On, when running python3 hisensetv.py IP_ADDRESS --get state -ifname ifname, the resulting output includes a "progname" and "channel_name".

{
    "statetype": "livetv",
    "list_param": "1#0",
    "channel_num": "70",
    "eventid": "",
    "progname": "Farmer Wants A Wife",
    "starttime": 1681205530,
    "endtime": 1681211900,
    "detail": "Two farmers meet their love matches before choosing five to return to their farms. All farmers each take one special lady on a 24 hour date and the fallout leads to heartbreak.",
    "channel_param": "1#18350209#0#0",
    "channel_name": "7HD Brisbane",
    "sourceid": "0"
}

When the TV is on TV input/statetype is livetv, to replace the "On" in Home to either the progname or channel_name data.

Describe alternatives you've considered:

Not applicable.

Additional context:

Came across this thought from another Homebridge plugin - https://github.com/grzegorz914/homebridge-lgwebos-tv

Input selection shows unknown

Describe The Bug:

Sometimes when I restart homebridge the plugin shows the input selection as "unknown" (see screenshot) and shows the input as devices with which the home app cannot do anything (see other screenshot).

To Reproduce:

This sometimes happens when I restart homebridge and can be "fixed" by restarting homebridge several times. Sometimes it resolves it, sometimes it does not.

Expected behavior:

I should be able to always select the inputs I want and it should be displayed in the home app:
IMG_0037

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

...
        {
            "ifname": "eth0",
            "devices": [
                {
                    "id": "<tvserial>",
                    "name": "Fernseher",
                    "ipaddress": "10.0.11.72",
                    "macaddress": "aa:bb:cc:dd:ee:ff",
                    "sslmode": "default"
                }
            ],
            "platform": "HiSenseTV"
        },
...

Screenshots:

IMG_0034
IMG_0035

Environment:

  • Plugin Version: 1.1.0
  • Homebridge Version: 1.3.4
  • Node.js Version: 14.17.0
  • NPM Version: 6.14.13
  • Operating System: DietPi 7.1.2 (Raspbian Buster)

Python works but Homebridge does not

First off, great work on this plugin, I really appreciate the effort put in.

I went through the setup on Ubuntu 20.04 and am able to control the TV by sending commands directly from hisensetv.py, however, I am not able to control it using Homebridge. I suspect this error that I receive every 10 seconds is part of it but I have not been able to decipher what is going on:

[10/21/2021, 9:17:22 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[10/21/2021, 9:17:32 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[10/21/2021, 9:17:42 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[10/21/2021, 9:17:52 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[10/21/2021, 9:18:02 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[10/21/2021, 9:18:12 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

Do you have any idea of why this may be?

Setting up the TV does not work on Homebridge due to missing module "paho"

Describe Your Problem:
When setting up the TV the following command:

sudo python3.7 hisensetv.py 192.168.XX.XX --authorize --ifname eth0

Gives me the following error:

Traceback (most recent call last):
  File "hisensetv.py", line 3, in <module>
    from hisensetv import __main__
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 12, in <module>
    import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'

Logs:

Loading logs using native method...
File: /var/lib/homebridge/homebridge.log

[13/08/2021, 11:44:42] [HB Supervisor] OS: Linux 5.10.52-v7l+ arm
[13/08/2021, 11:44:42] [HB Supervisor] Node.js v14.17.5 /usr/local/bin/node
[13/08/2021, 11:44:42] [HB Supervisor] Homebridge Path: /usr/local/lib/node_modules/homebridge/bin/homebridge
[13/08/2021, 11:44:42] [HB Supervisor] UI Path: /usr/local/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[13/08/2021, 11:44:48] [Homebridge UI] Homebridge Config UI X v4.41.2 is listening on :: port XXXX
[13/08/2021, 11:44:49] [HB Supervisor] Starting Homebridge with extra flags: -I
[13/08/2021, 11:44:49] [HB Supervisor] Started Homebridge v1.3.4 with PID: 757
Initializing HAP-NodeJS v0.9.4...
[13/08/2021, 11:44:50] Loaded config.json with 0 accessories and 8 platforms.
[13/08/2021, 11:44:50] Loaded 24 cached accessories from cachedAccessories.
[13/08/2021, 11:44:50] ---
[13/08/2021, 11:44:51] Loaded plugin: [email protected]
[13/08/2021, 11:44:51] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg'
[13/08/2021, 11:44:51] ---
[13/08/2021, 11:44:52] Loaded plugin: [email protected]
[13/08/2021, 11:44:52] Registering platform 'homebridge-config-ui-x.config'
[13/08/2021, 11:44:52] ---
[13/08/2021, 11:44:52] Loaded plugin: [email protected]
[13/08/2021, 11:44:52] Registering platform 'homebridge-hisense-tv-remotenow.HiSenseTV'
[13/08/2021, 11:44:52] ---
[13/08/2021, 11:44:55] Loaded plugin: [email protected]
[13/08/2021, 11:44:55] Registering platform 'homebridge-hue.Hue'
[13/08/2021, 11:44:55] ---
[13/08/2021, 11:44:55] Loaded plugin: [email protected]
[13/08/2021, 11:44:55] Registering platform 'homebridge-ifttt.IFTTT'
[13/08/2021, 11:44:55] ---
[13/08/2021, 11:45:11] Loaded plugin: [email protected]
[13/08/2021, 11:45:11] Registering platform 'homebridge-onkyo-pioneer.OnkyoPioneer'
[13/08/2021, 11:45:11] ---
[13/08/2021, 11:45:11] Loaded plugin: [email protected]
[13/08/2021, 11:45:11] Registering platform 'homebridge-smtp-motion.smtpMotion'
[13/08/2021, 11:45:11] ---
[13/08/2021, 11:45:12] Loaded plugin: [email protected]
[13/08/2021, 11:45:15] Registering platform 'homebridge-weather-plus.WeatherPlus'
[13/08/2021, 11:45:15] ---
[13/08/2021, 11:45:15] Loaded plugin: @milo526/[email protected]
[13/08/2021, 11:45:15] Registering platform '@milo526/homebridge-tuya-web.TuyaWebPlatform'
[13/08/2021, 11:45:15] ---
[13/08/2021, 11:45:15] Loading 8 platforms...
[13/08/2021, 11:45:15] [Config] Initializing config platform...
[13/08/2021, 11:45:15] [Config] Running in Service Mode
[13/08/2021, 11:45:15] [TuyaWebPlatform] Initializing TuyaWebPlatform platform...
[13/08/2021, 11:45:15] [OnkyoPioneer] Initializing OnkyoPioneer platform...
[13/08/2021, 11:45:15] [Camera FFmpeg] Initializing Camera-ffmpeg platform...
[13/08/2021, 11:45:15] [IFTTT] Initializing IFTTT platform...
[...]
[...]
[...]
[...]
[13/08/2021, 11:45:15] [HiSenseTV] Adding new accessory: HiSense
Setup Payload:
X-HM://XXXXXXXXXXXX
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ XXX-XX-XXX │     
    └────────────┘     
                       
Starting to advertise 'HiSense 24C8' using bonjour-hap backend!
[13/08/2021, 11:45:15] HiSense 24C8 is running on port XXXXX.
[13/08/2021, 11:45:15] Please add [HiSense 24C8] manually in Home app. Setup Code: XXX-XX-XXX
Starting to advertise 'Homebridge 905F 054D' using bonjour-hap backend!
[13/08/2021, 11:45:15] Homebridge v1.3.4 (Homebridge 905F) is running on port XXXXX.
[13/08/2021, 11:45:16] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[13/08/2021, 11:45:25] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[13/08/2021, 11:45:35] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

Plugin Config:

{
    "bridge": {
        "name": "Homebridge XXXX",
        "username": "XX:XX:XX:XX:XX:XX",
        "port": 51009,
        "pin": "XXX-XX-XXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": XXXX,
            "platform": "config"
        },
        {...},
        {...},
        {...},
        {
            "ifname": "eth0",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "HiSense",
                    "ipaddress": "192.168.XX.XX",
                    "macaddress": "XX:XX:XX:XX:XX:XX",
                    "sslmode": "default"
                }
            ],
            "platform": "HiSenseTV"
        }
    ]
}

Environment:

  • Plugin Version: v1.1.0
  • Homebridge Version: v1.3.4
  • Node.js Version: v14.17.5
  • NPM Version: v6.14.14
  • Operating System: Raspbian GNU/Linux Buster (10)

An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')

I can't do nothing from home app.

Logs:

"An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')"

Plugin Config:

{
    "bridge": {
        "name": "Homebridge B63B",
        "username": "xxxx",
        "port": 51868,
        "pin": "xxxx",
        "advertiser": "bonjour-hap"
    },
 
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Shelly",
            "admin": {
                "enabled": true
            },
            "platform": "Shelly"
        },
        {
            "platform": "Yeelighter",
            "name": "Yeelighter",
            "timeout": 5000,
            "interval": 60000
        },
        {
            "ifname": "eth0",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "HiSense",
                    "ipaddress": "yyyyy",
                    "macaddress": "xxxx",
                    "sslmode": "disabled"
                }
            ],
            "platform": "HiSenseTV"
        }
    ]
}

Screenshots:

Immagine 2023-02-23 134507

Environment:

  • Plugin Version: v2.0.0
  • Homebridge Version: Hmebridge v1.6.0 (HAP v0.11.0
  • Node.js Version:18.13.0
  • NPM Version :6.14.17
  • Operating System:Docker

I've installed apt install python3-paho-mqtt python3-netifaces
I've checked network interface, changed SSL to disabled also I run the pair script and I could pair successfully with code returned by Hisense TV,even tried to restart the container.
The problem is that I can't do nothing from home app.

Error unknown network interface

Hi, I need help to install this plugin on my homebridge on macOS (I would like to try this on my Mac before to buy a Raspberry)

When I do python3.8 hisensetv.py <TV_IP_ADDRESS> --authorize --ifname <NETWORK_INTERFACE_NAME> I get this error :
Unknown network interface: en0

I'm on Mac so ip a doesn't work but I do a route -n get "MyIP" | awk '/interface: / {print $2}'
this getting me "en0"

how to do this please ?

Connection refused

Hi, first of all thanks for this wonderful plugin. Whilst setting this up on Homebridge I encountered some strange problems which I hope I can get help on. Apologies if this has been addressed thru a closed issue earlier.

I have no problem running the python script hisensetv.py. pairing, get state, and even trying to press the buttons works! :)

The problem starts when I try to run this in home bridge. I have tried with both ssl on (using Custom option), and default, and both doesn't work. With the defaults, I have ended up with a "Connection Refused" error, as follows. Appreciate some insights into this ...

[9/8/2021, 11:35:09 PM] [HiSenseTV] Received Python command error: Error: [2021-09-08 23:35:09,104] [INFO ] Unverified SSL context created.
Traceback (most recent call last):
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in
main.main()
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/main.py", line 128, in main
with tv:
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 137, in enter
self._mqtt_client.connect(self.hostname, self.port)
File "/home/homebridge/.local/lib/python3.8/site-packages/paho/mqtt/client.py", line 941, in connect
return self.reconnect()
File "/home/homebridge/.local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1075, in reconnect
sock = self._create_socket_connection()
File "/home/homebridge/.local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3546, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File "/usr/lib/python3.8/socket.py", line 807, in create_connection
raise err
File "/usr/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

[9/8/2021, 11:35:09 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

Plugin Config:

   {
        "ifname": "xxxx",
        "devices": [
            {
                "id": "u7a",
                "name": "Living Room TV",
                "ipaddress": "192.168.xx.xx",
                "macaddress": "5C:34:00:xx:xx:xx",
                "sslmode": "default",
                "sslcertificate": "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_certchain_pem.cer",
                "sslprivatekey": "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_pem_privkey.pkcs8"
            }
        ],
        "platform": "HiSenseTV"
    },

Environment:

  • Plugin Version:
  • Homebridge Version: 1.3.4
  • Node.js Version: v14.17.6
  • NPM Version: v6.14.15
  • Operating System: Ubuntu 18.04

Windows Installation

7A533116-39FB-4F56-93DE-D57F3EA8107E

Im currently stuck on this step as my windows installation doesn’t have the hisense folder

25EEB870-5C56-49BC-A009-540C0BD73DB8

Improve Inputs by showing installed apps

Not an issue :) just wanted to reach out as I had not seen your plug-in until now. I have been sitting on and testing for months (when I had time) to implement a shell script working through homebridge-cmd4; today I only just rolled out my TV Accessory to the public. I did not have the skill set to make a proper plug-in. I have not tried to install your plug-in yet (will more than likely shift over to it), but feel free to have a look at my shell script and see if there is anything you can steal from it that could help here. Have a nice day!

Hisense 100L5

Describe The Bug:

I have finally been able to get the device to authorise, please see NewAM thread about this. However the plugin doesn't work in home bridge and not working in the home app. I am able to successful send commands via command line e.g. python3.8 hisensetv.py --key home XX.XX.XX.XX --ifname XXX
To Reproduce:

Expected behavior:

For commands in home app/keyboard to work.
Logs:

[4/15/2021, 6:40:16 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[4/15/2021, 6:40:26 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[4/15/2021, 6:40:36 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[4/15/2021, 6:40:46 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[4/15/2021, 6:40:56 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[4/15/2021, 6:41:06 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

{
"ifname": "eth1",
"devices": [
{
"id": "Hisense 100L5FTUK",
"name": "Hisense PTV",
"ipaddress": "192.168.86.15",
"macaddress": "18:30:0c:c6:22:d8"
}
],
"platform": "HiSenseTV"

Screenshots:

Environment:

  • Plugin Version:1.0
  • Homebridge Version: 1.3.1
  • Node.js Version:
  • NPM Version:
  • Operating System: Synology DSM 6.2

Unable to Connect

Homebridge Logs:

[18/06/2021, 02:34:43] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

Terminal Logs:

python3.8 /usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py 192.168.1.239 --ifname wlan0 --get sources
[2021-06-18 02:31:25,851] [INFO    ] Unverified SSL context created.
[
    {
        "displayname": "TV",
        "hotel_mode": "0",
        "is_lock": "false",
        "is_signal": "1",
        "sourceid": "1",
        "sourcename": "TV"
    },
    {
        "displayname": "Cable",
        "hotel_mode": "0",
        "is_lock": "false",
        "is_signal": "1",
        "sourceid": "2",
        "sourcename": "HDMI 1"
    },
    {
        "displayname": "Game console",
        "hotel_mode": "0",
        "is_lock": "false",
        "is_signal": "0",
        "sourceid": "3",
        "sourcename": "HDMI 2"
    },
    {
        "displayname": "AV",
        "hotel_mode": "0",
        "is_lock": "false",
        "is_signal": "0",
        "sourceid": "4",
        "sourcename": "AV"
    }
]
pi@raspberrypi:~ $ python3.8 /usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py 192.168.1.239 --ifname wlan0 --get state
[2021-06-18 02:31:45,621] [INFO    ] Unverified SSL context created.
Traceback (most recent call last):
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 208, in _wait_for_response
    return self._queue[topic].get(block=True, timeout=self.timeout)
  File "/usr/local/lib/python3.8/queue.py", line 178, in get
    raise Empty
_queue.Empty

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module>
    __main__.main()
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 141, in main
    output = func()
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 56, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 661, in get_state
    return self._wait_for_response(topic=self._BROADCAST_TOPIC)
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 210, in _wait_for_response
    raise HisenseTvTimeoutError(
hisensetv.HisenseTvTimeoutError: failed to recieve a response in 10.000s

Error in hisensetv.py

Describe Your Problem:

Not able to run Phyton Script to autherize TV
on Raspbian with Python 3.8.9

Logs:

python hisensetv.py 192.168.2.21 --authorize --ifname eth0
Traceback (most recent call last):
File "hisensetv.py", line 3, in
from hisensetv import main
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 47
def _check_connected(func: Callable):
^
SyntaxError: invalid syntax

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.
"ifname": "eth0",
    "devices": [
        {
            "id": "HiSenseTV",
            "name": "HiSense",
            "ipaddress": "192.168.2.21",
            "macaddress": "7C:B3:7B:76:5D:B6",
            "sslmode": "custom",
            "sslcertificate": "/tmp/ssl.cer",
            "sslprivatekey": "/tmp/priv.pkcs8"
        }
    ],
    "platform": "HiSenseTV"


**Environment:**

* **Plugin Version**:
* **Homebridge Version**: <!-- homebridge -V -->
   
1.3.5

* **Node.js Version**: <!-- node -v --> 

 v16.13.0

* **NPM Version**: <!-- npm -v -->

  8.1.0

* **Operating System**: <!-- Raspbian / Ubuntu / Debian / Windows / macOS / Docker / hb-service -->

 Raspbian

sslv3 alert handshake failure

Hello,

I always get that SSL errors. Can you please help me how to fixthis?

root@Server:/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin# python3.9 hisensetv.py 192.168.1.40 --authorize --ifname ens3 [2022-01-16 20:09:04,355] [INFO ] Unverified SSL context created. Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module> __main__.main() File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 128, in main with tv: File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 137, in __enter__ self._mqtt_client.connect(self.hostname, self.port) File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 941, in connect return self.reconnect() File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1104, in reconnect sock.do_handshake() File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1123)

Also --no-ssl also does not help:

root@Server:/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin# python3.9 hisensetv.py 192.168.1.40 --authorize --ifname ens3 --no-ssl [2022-01-16 20:12:54,347] [INFO ] No SSL context specified. Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module> __main__.main() File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 128, in main with tv: File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 145, in __enter__ raise HisenseTvTimeoutError(f"failed to connect in {self.timeout:.3f}s") hisensetv.HisenseTvTimeoutError: failed to connect in 10.000s

SyntaxError

Hey!

I am trying for a day to work this plugin, but I can not pair my TV with Debian. When I run this: python3.5 hisensetv.py 192.168.10.99 --authorize --ifname enp30s0 --no-ssl

TV type: Hisense 55a7gq

I always get this syntax error:

Logs:

Traceback (most recent call last):
File "hisensetv.py", line 3, in
from hisensetv import main
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 52
f"you must be connected to call {func.name}"
^
SyntaxError: invalid syntax

Environment:

  • Plugin Version: v2.0.0
  • Homebridge Version: homebridge -V1.4.0
  • Node.js Version: node -v14.19.2
  • NPM Version: npm -v6.14.17
  • Operating System: Debian

ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details

Describe The Bug:

After weeks and weeks of trying to get this plugin to work, as a lot of the perquisites are now on new versions, I am still unable to 'pair' the TV. The latest error I'm getting is...

ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details

To Reproduce:

Running script:

python3 hisensetv.py 172.16.0.13 --authorize --ifname ens18 --certfile tvcert.cer --keyfile tvkey.key

Expected behavior:

As per the readme - I'd expect the TV to produce a code and the script ask for this.

Logs:

sysadmin@pve-homebridge-1:/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin$ python3.8 hisensetv.py 172.16.0.13 --authorize --ifname ens18 --certfile tvcert.cer --keyfile tvkey.key

[2024-04-11 21:40:02,732] [INFO    ] SSL context created with cert file (tvcert.cer) and private key (tvkey.key)

[2024-04-11 21:40:02,733] [INFO    ] Network interface MAC Address: bc:24:11:87:ec:e9

Traceback (most recent call last):
  File "hisensetv.py", line 6, in <module>
    __main__.main()
  File "/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 130, in main
    with tv:
  File "/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 124, in __enter__
    self._mqtt_client = mqtt.Client(self.client_id)
  File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 766, in __init__
    raise ValueError(

ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

  • Plugin Version: v2.0.0
  • Homebridge Version: v1.7.0
  • Node.js Version: v18.19.0
  • NPM Version:
  • Operating System: Ubuntu Jammy Jellyfish (22.04.4 LTS)

Thanks.

setup code is missing in log

hi i have managed to setup my hisense tv on hoobs running on a pi4
hoobs has the tv listed and if i click on it in the hoobs website it does turn my tv on or off so i can confirm the plugin is communicating with it.

the prpoblem i have is the log is not showing the setup code. my iphone is showing the tv to add when i try to add it to home app. is there another way to get the code. or am i looking in the wrong log?

heres the log from hoobs when it boots up

19/04/2023, 00:24:09hub is running on port 80
19/04/2023, 00:24:10Tuya Platform Bridge starting
19/04/2023, 00:24:11Hisense Tv Bridge starting
19/04/2023, 00:24:14Hisense Tv BridgeLoaded plugin 'homebridge-hisense-tv-remotenow'
19/04/2023, 00:24:14Hisense Tv BridgeLoading 1 platforms...
19/04/2023, 00:24:14Hisense Tv BridgeHiSenseTVAdding new accessory: HiSense
19/04/2023, 00:24:14Hisense Tv BridgeHiSense 24C8 is running on port 42947.
19/04/2023, 00:24:14Hisense Tv BridgeBridge is running on port 51836.
19/04/2023, 00:24:14Tuya Platform BridgeLoaded plugin 'homebridge-tuya-platform'
19/04/2023, 00:24:14Tuya Platform BridgeLoading 1 platforms...
19/04/2023, 00:24:14Tuya Platform BridgeBridge is running on port 51826.

i hope you can help me fimd the code as im this step away from asaying hey siri turn the tv on.

thanks
alan

Cannot Authorise

Describe The Bug:

Unable to authorise device
To Reproduce:

python3.8 hisensetv.py --authorize 192.168.86.15 --ifname eth1

Expected behavior:

For device to authorise

Logs:
Traceback (most recent call last):
File "hisensetv.py", line 6, in
main.main()
File "/volume1/docker/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/main.py", line 115, in main
with tv:
File "/volume1/docker/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 137, in enter
self._mqtt_client.connect(self.hostname, self.port)
File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 941, in connect
return self.reconnect()
File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1104, in reconnect
sock.do_handshake()
File "/var/packages/py3k/target/usr/local/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1108)

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

  • Plugin Version:
  • Homebridge Version:
  • Node.js Version:
  • NPM Version:
  • Operating System: Docker

Issues to pair TV on pi

Describe The Bug:

Issue when I try to pair TV with Homebridge
To Reproduce:

python3.7 hisensetv.py 10.0.1.43 --authorize --ifname eth0
Expected behavior:

It should connect to the TV and provide a code to pair home kit
Logs:

Show the Homebridge logs here, remove any sensitive information.

root@homebridge:/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin# python3.7 hisensetv.py 10.0.1.43 --authorize --ifname eth0Traceback (most recent call last):
File "hisensetv.py", line 3, in
from hisensetv import main
File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 12, in
import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'
Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.
    {
        "ifname": "eth0",
        "devices": [
            {
                "id": "HiSenseTV",
                "name": "TV",
                "ipaddress": "10.0.1.43",
                "macaddress": "64:ae:f1:3c:40:d0 "
            }
        ],
        "platform": "HiSenseTV"
    }
]

}

Screenshots:

Environment:

  • Plugin Version:
    1.0.0
  • Homebridge Version:
    Initializing HAP-NodeJS v0.9.4...
    1.3.4
  • Node.js Version:
    v12.19.0
  • NPM Version:
    6.14.8
  • Operating System:
    Raspbian

Incompatible models

Im seeing this error consistently in the HB logs:

An error occurred while fetching the current input: SyntaxError: Unexpected token b in JSON at position 0

Can someone help me pair the tv with Homebridge

Describe Your Problem:
After moving the Node_Modules folder into hisense-tv-remotenow i cannot run the script.
I've tried this in windows first, now im running a Hyper-V instance with Ubuntu and Docker.
Could someone help me or remote support me?

Environment:

  • plugin version 2.0.0:
  • Homebridge Version: <1.6.1>
  • Node.js Version: <18.13.0>
  • NPM Version: <8.19.3>
  • Operating System: Ubuntu on Hyper-V VM with docker

hisensetv.py

Hi im using Hoobs latest update, but on RPI box,
I install all what i must from your manual.
But i dont know how to run hisensetv.py script to get code from tv. I tried everything but nothing works. Can you help me?

Setting up TV , getting error "bash: python3.8: command not found"

Describe Your Problem:

I am attempting to follow the "Setting up the TV" directions pasted below but am getting an error response.

https://github.com/MrAsterisco/homebridge-hisense-tv

Setting up the TV
First, you need to get the name of the network interface that your Homebridge machine will use to connect to the TV. On Linux, you can get a list of all the network interfaces on your machine by running:

ip a
The name of a network interface usually looks similar to this: ens33.

For 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 hisensetv.py script. To do this, find the node_modules folder in your system (on Linux, it is located in /usr/local/lib/node_modules) and move to homebridge-hisense-tv/bin, then run:

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 telnet <TV_IP_ADDRESS> 36669 to make sure your Homebridge instance can reach your TV. If telnet works but this command doesn't, try to run a different command, such as --get state (just replace authorize with this in the command above): if this command succeeds, it means your TV and your machine are already paired.

From this location
homebridge:/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin

I run this command:
python3.8 hisensetv.py 192.168.X.XXX --authorize --ifname wlan01

Response:
bash: python3.8: command not found

Logs:

[8/21/2021, 1:57:29 PM] ---
[8/21/2021, 1:57:29 PM] Loaded plugin: [email protected]
[8/21/2021, 1:57:29 PM] Registering platform 'homebridge-hisense-tv-remotenow.HiSenseTV'
[8/21/2021, 1:57:29 PM] ---
[8/21/2021, 1:57:39 PM] [HiSenseTV] Initializing HiSenseTV platform...
[8/21/2021, 1:57:40 PM] [HiSenseTV] Adding new accessory: Sly TV
Preparing Advertiser for 'Sly TV 40CE' using bonjour-hap backend!
Starting to advertise 'Sly TV 40CE' using bonjour-hap backend!
[8/21/2021, 1:57:41 PM] Sly TV 40CE is running on port 44705.
[8/21/2021, 1:57:41 PM] Please add [Sly TV 40CE] manually in Home app. Setup Code: 863-75-332
[8/21/2021, 1:57:51 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[8/21/2021, 1:58:01 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[8/21/2021, 1:58:21 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[8/21/2021, 1:58:31 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
[8/21/2021, 1:58:41 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

Plugin Config:

{
    "ifname": "wlan01",
    "devices": [
        {
            "id": "Sly TV",
            "name": "Sly TV",
            "ipaddress": "192.168.X.XXX",
            "macaddress": "XX:XX:XX:XX:XX:XX",
            "sslmode": "disabled"
        }
    ],
    "platform": "HiSenseTV"

Environment:

  • Plugin Version: homebridge-hisense-tv-remotenow v1.1.0
  • Homebridge Version: homebridge -v1.3.4
  • Node.js Version: node -v14.17.5
  • NPM Version: npm -v6.14.14
  • Operating System: Raspbian GNU/Linux Buster (10)

Cannot run hisensetv.py

Describe Your Problem:
Hello !

I have a problem for running the python script hisensetv.py, to pairing the TV. I'm running home bridge on Raspberry pi. Trying different ssl mode. Disable mode allow me to turn the TV off.

The PIN code do not display on the TV

When I run the command :

pi@homebridge:/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin $ python3.9 hisensetv.py 192.168.1.XX --authorize --ifname eth0

Logs:

[2023-01-14 10:43:24,305] [INFO    ] Unverified SSL context created.
[2023-01-14 10:43:24,307] [INFO    ] Network interface MAC Address: b8:27:eb:73:a5:9f
Traceback (most recent call last):
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module>
    __main__.main()
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 128, in main
    with tv:
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 136, in __enter__
    self._mqtt_client.connect(self.hostname, self.port)
  File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1073, in reconnect
    sock.do_handshake()
  File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

Plugin Config:

{
            "ifname": "eth0",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "Hisense TV",
                    "ipaddress": "192.168.1.XX",
                    "macaddress": "40:CD:7A:XX:XX:XX",
                    "sslmode": "default"
                }
            ],
            "platform": "HiSenseTV"
        }

Screenshots:

Environment:

  • Plugin Version: 2.0.0
  • Homebridge Version: 1.6.0
  • Node.js Version: 18.13.0
  • NPM Version:
  • Operating System: Raspbian

SSL handshake error on u9g

I'm by no means an experienced linux user but have been trying to get my new tv connected for a few hours to no avail.

Log
30/12/2021, 12:45:06 pmHisense Tv Remotenow BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')

Hoobs/Homebridge installed on Raspberry Pi4
Can't connect to set nossl
hoobs@hoobs:/usr/local/bin $ hisensetv 192.168.0.42 --no-ssl
Traceback (most recent call last):
File "/usr/local/bin/hisensetv", line 10, in
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/hisensetv/main.py", line 108, in main
with tv:
File "/usr/local/lib/python3.7/dist-packages/hisensetv/init.py", line 125, in enter
raise HisenseTvTimeoutError(f"failed to connect in {self.timeout:.3f}s")
hisensetv.HisenseTvTimeoutError: failed to connect in 10.000s

Same handshake failure when using the Hisense cmd and via python

hoobs@hoobs:/usr/local/bin $ hisensetv 192.168.0.42 --authorize
Traceback (most recent call last):
File "/usr/local/bin/hisensetv", line 10, in
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/hisensetv/main.py", line 108, in main
with tv:
File "/usr/local/lib/python3.7/dist-packages/hisensetv/init.py", line 117, in enter
self._mqtt_client.connect(self.hostname, self.port)
File "/home/hoobs/.local/lib/python3.7/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
File "/home/hoobs/.local/lib/python3.7/site-packages/paho/mqtt/client.py", line 1073, in reconnect
sock.do_handshake()
File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1056)

hoobs@hoobs:/var/lib/hoobs/hisensetvremotenowbridge/node_modules/homebridge-hisense-tv-remotenow/bin $ python3.7 hisensetv.py 192.168.0.42 --authorize --ifname wlan0
[2021-12-30 12:53:43,538] [INFO ] Unverified SSL context created.
Traceback (most recent call last):
File "hisensetv.py", line 6, in
main.main()
File "/var/lib/hoobs/hisensetvremotenowbridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/main.py", line 128, in main
with tv:
File "/var/lib/hoobs/hisensetvremotenowbridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 137, in enter
self._mqtt_client.connect(self.hostname, self.port)
File "/home/hoobs/.local/lib/python3.7/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
File "/home/hoobs/.local/lib/python3.7/site-packages/paho/mqtt/client.py", line 1073, in reconnect
sock.do_handshake()
File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1056)

hoobs@hoobs:/var/lib/hoobs/hisensetvremotenowbridge/node_modules/homebridge-hisense-tv-remotenow/bin $ python3.7 hisensetv.py 192.168.0.42 --authorize --ifname wlan0 --no-ssl
[2021-12-30 12:54:24,480] [INFO ] No SSL context specified.
Traceback (most recent call last):
File "hisensetv.py", line 6, in
main.main()
File "/var/lib/hoobs/hisensetvremotenowbridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/main.py", line 128, in main
with tv:
File "/var/lib/hoobs/hisensetvremotenowbridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 145, in enter
raise HisenseTvTimeoutError(f"failed to connect in {self.timeout:.3f}s")
hisensetv.HisenseTvTimeoutError: failed to connect in 10.000s

Do not crash when the TV doesn't respond to "sources"

Describe Your Problem:
Reinstalling due to SD card failure in Hoobs raspberry pi.
Installed plugin and connected to TV. Error in logs. Power button not doing anything in Apple Home app.

Logs:
21/08/2023, 17:09:56Hisense Tv Remotenow BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')

Show the Homebridge logs here, remove any sensitive information.


**Plugin Config:**
{
    "platform": "HiSenseTV",
    "devices": [
        {
            "id": "HiSenseTV",
            "name": "HiSense",
            "ipaddress": "192.168.68.60",
            "macaddress": "80:CB:BC:83:9B:9E",
            "sslmode": "custom",
            "sslcertificate": "~/cert.cer",
            "sslprivatekey": "~/key.pkcs8"
        }
    ]
}
```json
Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

  • Plugin Version:2.0.0
  • Homebridge Version: NA - Hoobs
  • Node.js Version: v16.20.0
  • NPM Version: 8.19.4
  • Operating System: Hoobs - Raspberry Pi

Cannot connect to more than 1 Hisense TVs

Describe Your Problem

G'day and happy new year! Thank you so much for making this plugin available.

I own three Hisense TVs:

  • 50S8, running VIDAA U 3. Its IP address on my LAN is 192.168.1.45
  • 55PX, running VIDAA 2.5. Its IP address on my LAN is 192.168.1.46
  • 55Q8, running VIDAA U 4. Its IP address on my LAN is 192.168.1.47

I'm based in Australia, so these are Australian model numbers. However I understand that Hisense use VIDAA OS in the UK and other EU markets in addition to Australia, and having browsed other Issues raised here it is pretty clear that at least some of us are also Aussies, so I am pretty confident in this working for all three TVs.

All three TVs are connected to WiFi and work correctly with the RemoteNOW app on my iPhone 14 Pro.

I'm running Homebridge in Docker on a Synology NAS.
My Homebridge Docker image has Python 3.10 installed, so I have modified my commands from "python3.8" to just "python3" accordingly.

I have

  1. Installed homebridge-hisense-tv-remotenow in Homebridge
  2. From the Terminal window in the Homebridge Web UI, I ran the commands
pip3 install netifaces
pip3 install paho-mqtt

Both of these installed correctly. If I re-run the commands, I get

Requirement already satisfied: netifaces in /usr/local/lib/python3.10/dist-packages (0.11.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

and

Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.10/dist-packages (1.6.1)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  1. I then ran the commands
cd /var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin
python3 hisensetv.py 192.168.1.45 --authorize --ifname bond0
  1. Entered the 4-digit code displayed on my 50S8 TV, into the Terminal prompt
  2. Restarted Homebridge
  3. Homebridge then showed this in its logs (Setup Code redacted):
[1/2/2024, 1:24:42 PM] [HiSenseTV] Adding new accessory: Hisense 50S8
[1/2/2024, 1:24:43 PM] Hisense 50S8 2251 is running on port 42907.
[1/2/2024, 1:24:43 PM] Please add [Hisense 50S8 2251] manually in Home app. Setup Code: xxx-xx-xxx
  1. I then added the following to my config.json (MAC address redacted), and restarted Homebridge:
{
    "ifname": "bond0",
    "devices": [
        {
            "id": "Hisense 50S8",
            "name": "Bed 3 Hisense TV",
            "ipaddress": "192.168.1.45",
            "macaddress": "xx:xx:xx:xx:xx:xx",
            "sslmode": "default"
        }
    ],
    "platform": "HiSenseTV"
}
  1. From my iPhone, I successfully added the TV as a new Accessory to the Home app. I was prompted to name the Inputs. One of them shows up as "Unknown" but all the show up as-expected.
  2. I am able to successfully control the 50S8 TV without issue. Great! Now let's add the other two TVs. I started with the older 55PX running VIDAA 2.5
  3. Still from the Terminal window in the Homebridge Web UI, I tried running the following:
python3 hisensetv.py 192.168.1.46 --authorize --ifname bond0

Sadly, I get an error message (full details in the Logs section)

ConnectionResetError: [Errno 104] Connection reset by peer

So, I tried running the same command but with the --no-ssl switch, but get a timeout error instead:

hisensetv.HisenseTvTimeoutError: failed to recieve a response in 10.000s

I have tried adding the newer 55Q8 (VIDAA U 4) TV, both

python3 hisensetv.py 192.168.1.47 --authorize --ifname bond0

and with the --no-ssl switch:

python3 hisensetv.py 192.168.1.47 --authorize --no-ssl --ifname bond0

But again I get the same errors.

  1. I tried going ahead and adding the TVs to my config.json anyway, then restarting Homebridge
  2. The logs show as if things are going well...
[1/2/2024, 2:16:31 PM] Bed 3 Hisense TV A917 is running on port 35197.
[1/2/2024, 2:16:31 PM] Please add [Bed 3 Hisense TV A917] manually in Home app. Setup Code: xxx-xx-xxx
[1/2/2024, 2:16:31 PM] Bed 1 Hisense TV 2132 is running on port 40621.
[1/2/2024, 2:16:31 PM] Please add [Bed 1 Hisense TV 2132] manually in Home app. Setup Code: xxx-xx-xxx
[1/2/2024, 2:16:31 PM] Living Room Hisense TV 3236 is running on port 43178.
[1/2/2024, 2:16:31 PM] Please add [Living Room Hisense TV 3236] manually in Home app. Setup Code: xxx-xx-xxx

But moments later, the logs were overrun with dozens of identical entries every few seconds:

[1/2/2024, 2:16:41 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[1/2/2024, 2:16:41 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[1/2/2024, 2:16:51 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[1/2/2024, 2:16:51 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[1/2/2024, 2:17:01 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
  1. I added the TVs to the Home app on my iPhone, but they just show a single input of "Unknown" and don't respond to Power or any other button press.
  2. I tried uninstalling homebridge-hisense-tv-remotenow and removing the entry from config.json along with it, then reinstalling and re-doing setup (starting with the 50S8), but the same issue persists.

At this point, I'm at a loss.

  • Is something wrong with Python?
  • Could it be Docker?
  • Could it be Synology?
  • Did I just happen to get lucky and VIDAA 3 works but VIDAA 2.5 and VIDAA U 4 don't work with this Homebridge plugin?
  • Am I doing something wrong in my commands?

I would be most grateful for any advice or insight you may be able to offer!

Logs

root@homebridge:/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin $ python3 hisensetv.py 192.168.1.46 --authorize --ifname bond0
[2024-01-02 17:56:59,643] [INFO    ] Unverified SSL context created.
[2024-01-02 17:56:59,645] [INFO    ] Network interface MAC Address: xx:xx:xx:xx:xx:xx
Traceback (most recent call last):
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module>
    __main__.main()
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 128, in main
    with tv:
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 136, in __enter__
    self._mqtt_client.connect(self.hostname, self.port)
  File "/usr/local/lib/python3.10/dist-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.10/dist-packages/paho/mqtt/client.py", line 1073, in reconnect
    sock.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1371, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer 
root@homebridge:/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin $ python3 hisensetv.py 192.168.1.46 --authorize --no-ssl --ifname bond0
[2024-01-02 17:56:00,183] [INFO    ] No SSL context specified.
[2024-01-02 17:56:00,184] [INFO    ] Network interface MAC Address: xx:xx:xx:xx:xx:xx
Traceback (most recent call last):
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 207, in _wait_for_response
    return self._queue[topic].get(block=True, timeout=self.timeout)
  File "/usr/lib/python3.10/queue.py", line 179, in get
    raise Empty
_queue.Empty

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module>
    __main__.main()
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 130, in main
    tv.start_authorization()
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 54, in wrapper
    return func(self, *args, **kwargs)
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 632, in start_authorization
    self._wait_for_response(topic=self._our_topic)
  File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 209, in _wait_for_response
    raise HisenseTvTimeoutError(
hisensetv.HisenseTvTimeoutError: failed to recieve a response in 10.000s
root@homebridge:/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin $ 

Config

{
    "ifname": "bond0",
    "devices": [
        {
            "id": "Hisense 50S8",
            "name": "Bed 3 Hisense TV",
            "ipaddress": "192.168.1.45",
            "macaddress": "xx:xx:xx:xx:xx:xx",
            "sslmode": "default"
        },
        {
            "id": "Hisense 55Q8",
            "name": "Bed 1 Hisense TV",
            "ipaddress": "192.168.1.47",
            "macaddress": "xx:xx:xx:xx:xx:xx",
            "sslmode": "default"
        },
        {
            "id": "Hisense 55PX",
            "name": "Living Room Hisense TV",
            "ipaddress": "192.168.1.46",
            "macaddress": "xx:xx:xx:xx:xx:xx",
            "sslmode": "default"
        }
    ],
    "platform": "HiSenseTV"
}

Screenshots

If you need any screenshots, please let me know - I'm not sure there are any relevant screenshots I can provide here though!

Environment

  • Plugin Version: v2.0.0
  • Homebridge Version: v1.7.0
  • Node.js Version: v20.10.0
  • NPM Version: v10.2.3
  • Operating System: Docker on Synology DSM 7.1.1-42962 Update 6

Pairing fails, ConnectionResetError: [Errno 104] Connection reset by peer

I have installed the plugin, then installed paho-mqtt. Now I am trying to pair the tv to my Raspberry Pi Zero 2 running Homebridge with the command:

python3.9 hisensetv.py 192.168.1.XXX --authorize --ifname wlan0

But this throws the error:

ConnectionResetError: [Errno 104] Connection reset by peer

Here's the log:

pi@homebridge:/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin $ python3.9 hisensetv.py 192.168.1.XXX --authorize --ifname wlan0[2022-01-16 21:28:00,056] [INFO    ] Unverified SSL context created.
Traceback (most recent call last):
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module>
    __main__.main()
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 128, in main
    with tv:
  File "/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 137, in __enter__
    self._mqtt_client.connect(self.hostname, self.port)
  File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1073, in reconnect
    sock.do_handshake()
  File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

I have read all of the other issues, including the solved ones, maybe there's an issue with the ssl certificates? Not sure what to do though.

Environment:

  • Plugin Version: v1.1.0
  • Homebridge Version: v1.3.9
  • Node.js Version: v16.13.1
  • NPM Version: v8.3.0
  • Operating System: Raspbian GNU/Linux Bullseye (11)

Cannot create a client socket with a PROTOCOL_TLS_SERVER context

/

Describe The Bug:
When running python3.10 hisensetv.py --authorize it errors out with cannot "ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:801)" so I am unable to create a binding with the TV. On MQTT explorer I am able to auth with the certs that are in the /ssl/ folder in the root of the drive that is passed to the python script. This folder has read/write/execute (777) access to all users. This error happens on both --authorize and --getstatus.

To Reproduce:

[2023-07-22 21:52:24,994] [INFO    ] SSL context created with cert file (/ssl/rcm_certchain_pem.cer) and private key (/ssl/rcm_pem_privkey.pkcs8)
[2023-07-22 21:52:24,996] [INFO    ] Network interface MAC Address: c8:d3:ff:3b:XX:XX
Traceback (most recent call last):
  File "/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in <module>
    __main__.main()
  File "/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 128, in main
    with tv:
  File "/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 136, in __enter__
    self._mqtt_client.connect(self.hostname, self.port)
  File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 941, in connect
    return self.reconnect()
  File "/usr/lib/python3/dist-packages/paho/mqtt/client.py", line 1083, in reconnect
    sock = self._ssl_context.wrap_socket(
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1062, in _create
    self._sslobj = self._context._wrap_socket(
ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:801)
homebridge@homebridge:/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin $ 

Expected behavior:

Once running the script I should be prompted to enter a pairing key in the terminal that is shown on tv to complete the pairing.
Logs:

Show the Homebridge logs here, remove any sensitive information.
''''' Loading logs using native method...
File: /var/lib/homebridge/homebridge.log

 report this to the developer!
Setup Payload:
X-HM://XXXXXXXXXXXXX
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ XXX_XX-XXX │     
    └────────────┘     
[22/07/2023, 21:40:36] [Homebridge UI] Homebridge restart request received
[22/07/2023, 21:40:36] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[22/07/2023, 21:40:36] [Homebridge UI] Sending SIGTERM to Homebridge
[22/07/2023, 21:40:36] Got SIGTERM, shutting down Homebridge...
[22/07/2023, 21:40:36] [Camera FFmpeg] [Marble Cam] Stopped video stream.
[22/07/2023, 21:40:36] Got SIGTERM, shutting down child bridge process...
[22/07/2023, 21:40:41] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[22/07/2023, 21:40:46] [HB Supervisor] Restarting Homebridge...
[22/07/2023, 21:40:46] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[22/07/2023, 21:40:46] [HB Supervisor] Started Homebridge v1.6.1 with PID: 3918
[22/07/2023, 21:40:47] Loaded config.json with 0 accessories and 6 platforms.
[22/07/2023, 21:40:47] Loaded 8 cached accessories from cachedAccessories.
[22/07/2023, 21:40:48] ---
[22/07/2023, 21:40:48] Loaded plugin: [email protected]
[22/07/2023, 21:40:48] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg'
[22/07/2023, 21:40:48] ---
[22/07/2023, 21:40:48] Loaded plugin: [email protected]
[22/07/2023, 21:40:48] Registering platform 'homebridge-hisense-tv-remotenow.HiSenseTV'
[22/07/2023, 21:40:48] ---
[22/07/2023, 21:40:48] Disabled plugin: [email protected]
[22/07/2023, 21:40:48] ---
[22/07/2023, 21:40:48] Loaded plugin: [email protected]
[22/07/2023, 21:40:48] Registering platform 'homebridge-nest.Nest'
[22/07/2023, 21:40:48] ---
[22/07/2023, 21:40:49] Loaded plugin: @0x5e/[email protected]
[22/07/2023, 21:40:49] Registering platform '@0x5e/homebridge-tuya-platform.TuyaPlatform'
[22/07/2023, 21:40:49] ---
[22/07/2023, 21:40:49] Loading 6 platforms...
[22/07/2023, 21:40:49] [Tuya] Initializing TuyaPlatform platform...
[22/07/2023, 21:40:49] [Nest] Initializing Nest platform...
[22/07/2023, 21:40:49] Ignoring config for the platform "Camera-IP" in your config.json as the plugin "homebridge-ip-camera" has been disabled.
[22/07/2023, 21:40:49] [HiSenseTV] Initializing HiSenseTV platform...
[22/07/2023, 21:40:49] [HiSenseTV] Initializing child bridge 0E:55:88:7B:XX:XX
[22/07/2023, 21:40:49] [Camera FFmpeg] Initializing Camera-ffmpeg platform...
[22/07/2023, 21:40:50] [Tuya] Loading accessory from cache: Bedroom
[22/07/2023, 21:40:50] [Tuya] Loading accessory from cache: Christmas tree 🎄 
[22/07/2023, 21:40:50] [Tuya] Loading accessory from cache: Smart Plug
[22/07/2023, 21:40:50] [Tuya] Loading accessory from cache: Smart Plug 2
[22/07/2023, 21:40:50] [Tuya] Loading accessory from cache: Smart Plug 1
[22/07/2023, 21:40:50] [Camera FFmpeg] [Marble Cam] Configuring cached bridged accessory...
[22/07/2023, 21:40:50] [Tuya] Log in to Tuya Cloud.
[22/07/2023, 21:40:50] [Tuya] [TuyaOpenAPI] Login to: https://XXXXXXXXXXXXXXXXX
[22/07/2023, 21:40:50] [Nest] Fetching Nest devices.
Setup Payload:
X-HM://XXXXXXXXXXXXX
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ XXX-XX-XXX │     
    └────────────┘     
                       
[22/07/2023, 21:40:50] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge F2FE) is running on port 51527.
[22/07/2023, 21:40:50] [Tuya] Start MQTT connection.
[22/07/2023, 21:40:50] [Tuya] Fetching home list.
[22/07/2023, 21:40:51] [Tuya] Got home_id=XXXXXXXXXX, name=Home
[22/07/2023, 21:40:51] [Tuya] Fetching device list.
[22/07/2023, 21:40:51] [homebridge-hisense-tv-remotenow] Launched child bridge with PID 3943
[22/07/2023, 21:40:51] Registering platform 'homebridge-hisense-tv-remotenow.HiSenseTV'
[22/07/2023, 21:40:52] [homebridge-hisense-tv-remotenow] Loaded homebridge-hisense-tv-remotenow v2.0.0 child bridge successfully
[22/07/2023, 21:40:52] Loaded 0 cached accessories from cachedAccessories.0E55887XXXX.
[22/07/2023, 21:40:52] [homebridge-hisense-tv-remotenow] Adding new accessory: HiSense
[22/07/2023, 21:40:52] Homebridge v1.6.1 (HAP v0.11.1) (homebridge-hisense-tv-remotenow) is running on port 58717.
[22/07/2023, 21:40:52] HiSense 24C8 is running on port 33325.
[22/07/2023, 21:40:52] Please add [HiSense 24C8] manually in Home app. Setup Code: XXX-XX-XXX
[22/07/2023, 21:40:53] [Tuya] Fetching scene list.
[22/07/2023, 21:40:53] [Tuya] Got 5 device(s) and scene(s).
[22/07/2023, 21:40:53] [Tuya] Device list saved at /var/lib/homebridge/persist/TuyaDeviceList.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json
[22/07/2023, 21:40:53] [Tuya] Restoring existing accessory from cache: Bedroom
[22/07/2023, 21:40:53] [Tuya] [Bedroom] Light type: RGBCW
[22/07/2023, 21:40:53] [Tuya] [Bedroom] Adaptive Lighting disabled.
[22/07/2023, 21:40:53] [Tuya] Restoring existing accessory from cache: Smart Plug
[22/07/2023, 21:40:53] [Tuya] Restoring existing accessory from cache: Christmas tree 🎄 
[22/07/2023, 21:40:53] [Tuya] Restoring existing accessory from cache: Smart Plug 2
[22/07/2023, 21:40:53] [Tuya] Restoring existing accessory from cache: Smart Plug 1
[22/07/2023, 21:40:57] [Nest] initing thermostat (P) "Living Room Thermostat": deviceId: XXXXXXXXXXXXXXXX structureId: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Living Room Thermostat@@Heating Threshold Temperature] characteristic was supplied illegal value: number 0 exceeded minimum of 9
[22/07/2023, 21:40:57] [Nest] initing home_away_sensor "Home Occupied": deviceId: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX structureId: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[22/07/2023, 21:41:08] [Camera FFmpeg] [Marble Cam] Starting video stream: native x native, native fps, ??? kbps
[22/07/2023, 21:41:36] [Homebridge UI] Changes to config.json saved.
[22/07/2023, 21:41:37] [Homebridge UI] Running Command: npm uninstall --save homebridge-ip-camera
[22/07/2023, 21:51:45] [Homebridge UI] Starting terminal session
[22/07/2023, 21:52:22] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:52:32] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:52:42] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:52:52] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:53:02] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:53:12] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:53:22] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:53:32] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:53:42] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:53:52] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:54:02] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:54:12] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:54:22] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:54:32] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:54:42] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:54:52] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:55:02] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:55:12] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:55:22] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:55:32] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:55:42] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:55:52] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:56:02] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:56:12] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:56:22] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:56:32] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:56:42] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:56:52] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:57:02] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:57:12] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:57:22] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:57:32] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:57:42] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:57:52] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:58:02] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:58:12] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:58:22] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:58:26] [Homebridge UI] Terminal session ended.
[22/07/2023, 21:58:32] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:58:42] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')
[22/07/2023, 21:58:52] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')

Plugin Config:

        {
            "ifname": "enp1s0",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "HiSense",
                    "ipaddress": "192.168.139.89",
                    "macaddress": "30:32:35:b4:XX:XX",
                    "sslmode": "default",
                    "sslcertificate": "/ssl/rcm_certchain_pem.cer",
                    "sslprivatekey": "/ssl/rcm_pem_privkey.pkcs8"
                }
            ],
            "_bridge": {
                "username": "0E:55:88:7B:XX:XX",
                "port": 58717
            },
            "platform": "HiSenseTV"
       }

Show your Homebridge config.json here, remove any sensitive information.

            "accessories": [],
    "bridge": {
        "port": 51527,
        "name": "Homebridge F2FE",
        "username": "XXXXXXXXXX",
        "advertiser": "bonjour-hap",
        "pin": "XXXXXXXX"
    },
    "platforms": [
        {
            "port": 8581,
            "platform": "config",
            "name": "Config"
        },
        {
            "platform": "TuyaPlatform",
            "options": {
                "projectType": "2",
                "debug": false,
                "password": "XXXXXXXXXXX",
                "countryCode": 44,
                "accessId": "XXXXXXXXXXXX",
                "deviceOverrides": [
                    {
                        "id": "global"
                    }
                ],
                "accessKey": "XXXXXXXXXXXXXX",
                "appSchema": "tuyaSmart",
                "username": "XXXXXXXXXXXXXXXXX"
            },
            "name": "Tuya"
        },
        {
            "name": "Nest",
            "platform": "Nest",
            "googleAuth": {
                "issueToken": "XXXXXXXXXXXXXXXX",
                "apiKey": "XXXXXXXXXXXXXXXXXXXXXXXX"
            }
        },
        {
            "ifname": "enp1s0",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "HiSense",
                    "ipaddress": "192.168.139.89",
                    "macaddress": "30:32:35:b4:XX:XX",
                    "sslmode": "default",
                    "sslcertificate": "/ssl/rcm_certchain_pem.cer",
                    "sslprivatekey": "/ssl/rcm_pem_privkey.pkcs8"
                }
            ],
            "_bridge": {
                "username": "0E:55:88:7B:XX:XX",
                "port": 58717
            },
            "platform": "HiSenseTV"
       }

Show your Homebridge config.json here, remove any sensitive information.
Screenshots:
[]
(https://github-production-user-asset-6210df.s3.amazonaws.com/39278241/255351605-f2da80fd-3f50-4f60-b20a-0a986034d389.png)

Environment:

  • Plugin Version:v1.7.0-beta.49
  • Homebridge Version: V1.6.1
  • Node.js Version: V18.17.0
  • NPM Version: 8.5.1
  • Operating System: Ubuntu Server Lite 22.04.01
  • TV model: 55A7100FTUK
  • TV firmware:V0001.01.00L.L1103

the plugin doesn't work

Describe Your Problem:
the plugin doesn't seem to work

Logs:

20/8/2021, 19:17:58Hisense Tv Remotenow Bridge starting
20/8/2021, 19:18:01Hisense Tv Remotenow BridgeLoaded plugin 'homebridge-hisense-tv-remotenow'
20/8/2021, 19:18:01Hisense Tv Remotenow BridgeLoading 1 platforms...
20/8/2021, 19:18:01Hisense Tv Remotenow BridgeHiSenseTVAdding new accessory: HiSense
20/8/2021, 19:18:01Hisense Tv Remotenow BridgeHiSense 24C8 is running on port 34445.
20/8/2021, 19:18:01Hisense Tv Remotenow BridgeBridge is running on port 51866.
20/8/2021, 19:18:01Hisense Tv Remotenow BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
20/8/2021, 19:18:11Hisense Tv Remotenow BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

Plugin Config:

{
    "accessories": [],
    "platforms": [
        {
            "platform": "HiSenseTV",
            "ifname": "dc:ax:xx:x6:xx:ac",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "HiSense",
                    "ipaddress": "192.168.0.92",
                    "macaddress": "x0:x7:xx:xx:xx:xa",
                    "sslmode": "disabled"
                }
            ]
        }
    ]
}

Screenshots:

Environment:

  • Plugin Version: Hisense TV Remotenow 1.1.0
  • Homebridge Version: Hoobs 4.0.100 - Homebridge 1.3.4
  • Node.js Version: 14.17.5
  • NPM Version:
  • Operating System: Raspbian

Network Interface Name is Not Accepted

Describe Your Problem:
Upon running python3 hisensetv.py <TV_IP_ADDRESS> --authorize --ifname <NETWORK_INTERFACE_NAME>, with the correct network interface name, the script returns with Unknown network interface, naming the network interface.

I have looked everywhere for the network identifier for my iMac and the only possible one is "en4".

This is on the "Setting up the TV" step of the README, so no Homebridge logs nor plugin config is relevant (I think? -- happy to provide what I can if it's necessary). I'm on macOS, and used network setup -listallhardwareports to get the correct network interface. It's very possible that I've messed up a few other things in my setup; I've attached screenshots with the input and output.

I have no idea what I'm doing at this point (relatively new to Python) so any help would be greatly appreciated :)

Logs:

N/A (it is not inside of Homebridge)

Plugin Config:

N/A as the plugin has not been configured yet

Screenshots:
Here's what I'm typing in to the command line:
image

And here's what it results in:
image

Environment:

  • Plugin Version:
  • Homebridge Version: v1.3.4
  • Node.js Version: v14.16.0
  • NPM Version: v6.14.11
  • Operating System: macOS

Switching Input Source throws error

Describe The Bug:
Switching Input throws error

To Reproduce:
Use Homekit to switch the input source.

Expected behavior:
I guess shouldn't throw an error

Logs:

[5/17/2024, 8:32:45 PM] [homebridge-hisense-tv-remotenow] Characteristic 'Active Identifier': SET handler returned write response value, though the characteristic doesn't support write response. See https://homebridge.io/w/JtMGR for more info.
[5/17/2024, 8:32:45 PM] [homebridge-hisense-tv-remotenow] Error: 
    at ActiveIdentifier.Characteristic.characteristicWarning (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105)
    at /var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2627:22
    at /var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:15:18
    at /home/homebridge/homebridge-hisense-tv/src/platformAccessory.ts:221:9
    at /home/homebridge/homebridge-hisense-tv/src/platformAccessory.ts:432:7
    at PythonShell._endCallback (/home/homebridge/homebridge-hisense-tv/node_modules/python-shell/index.ts:288:20)
    at terminateIfNeeded (/home/homebridge/homebridge-hisense-tv/node_modules/python-shell/index.ts:210:39)
    at ChildProcess.<anonymous> (/home/homebridge/homebridge-hisense-tv/node_modules/python-shell/index.ts:182:13)
    at ChildProcess.emit (node:events:518:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12)

Plugin Config:
Not relevant

Environment:

  • Plugin Version: 2.0.0
  • Homebridge Version: v1.8.2
  • Node.js Version: 20.12.2
  • NPM Version: 10.5.0
  • Operating System: Raspbian

Installation instructions

installation instructions

Describe Your Problem:

I am not understanding how to install the dependencies, I am using the windows platform to install plugins but my homebridge on a pi

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

image
image

Environment:

  • Plugin Version:
  • Homebridge Version:
  • Node.js Version:
  • NPM Version:
  • Operating System:

Off Status Not Reflecting & Input's Not Changing

First off, thank you for developing this! I recently purchased a Hisense 55" U8G and it works fine with the RemoteNow app on my iPhone. Yesterday I tried setting up this Homebridge plugin, and got the TV added to my Home app. However I am running into a few issues that I wanted to make you aware of.

  1. When I turn off the TV using my remote, the Home app still says the TV is on. When I turn off the TV using the Home app (which does work), the TV shows as off for about 10 seconds, and then reverts to displays as on - even though the TV is indeed still off.
  2. I'm unable to switch inputs using the Home app. Also the current input I'm on doesn't seem to reflect in the Home app.

Here is my config snippet for this platform:

{
    "ifname": "eth0",
    "devices": [
        {
            "id": "officetvu8g",
            "name": "Office TV",
            "ipaddress": "192.168.4.58",
            "macaddress": "30:32:35:b0:30:8c",
            "sslmode": "default"
        }
    ],
    "platform": "HiSenseTV"
}

Also I see this error in my Homebridge console repeating sometimes:
[23/06/2021, 18:04:18] [HiSenseTV] An error occurred while fetching the current input: SyntaxError: Unexpected token b in JSON at position 0

I'm running Homebridge on a Raspberry Pi 4 if that matters.

Please let me know if there is any additional information I can provide! I'm also a developer, but don't have experience with Homebridge plugins other than as a consumer - but I'm happy to get my feet wet if you're able to point me in the right direction!

Trying to turn off the TV when it's already turned off shouldn't report an error

Describe The Bug:
When including TV power state changes in an automation, HomeKit will send a specific power state regardless of the current state. Trying to turn on the TV while it's already on works fine (because the magic packet is sent anyway), but turning it off while it's already off reports an (expected) connection error.

To Reproduce:

  • Configure a HomeKit automation that turns off the TV.
  • Turn the TV off.
  • Run the automation.

Expected behavior:

  • The automation runs correctly, as the TV is already in the correct state.

Improve support TVs that are always on

The plug-in does not report on/off state to HomeKit therefore I can’t use it for automations. I can really only use it if I know the TVs current power state.

Sent power off, error: null

Describe The Bug:
TV does not always turn off hisense 88l5vg

Logs:

[1/30/2022, 12:15:09 PM] [HiSenseTV] Set Characteristic On -> 0
[1/30/2022, 12:15:09 PM] [HiSenseTV] Run Python command: /homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py --key power 192.168.1.163 --ifname eth0 --certfile /homebridge/node_modules/homebridge-hisense-tv-remotenow/certificate.cer --keyfile /homebridge/node_modules/homebridge-hisense-tv-remotenow/privateKey.pkcs8
[1/30/2022, 12:15:09 PM] [HiSenseTV] Received Python command response: {,    "statetype": "sourceswitch",,    "sourceid": "HDMI1",,    "sourcename": "HDMI1",,    "is_signal": 1,,    "is_lock": 0,,    "hotel_mode": 0,,    "displayname": "HDMI1",}
[1/30/2022, 12:15:09 PM] [HiSenseTV] Current input is: HDMI1
[1/30/2022, 12:15:09 PM] [HiSenseTV] Received Python command response: null
[1/30/2022, 12:15:09 PM] [HiSenseTV] Sent power off, error: null
[1/30/2022, 12:15:19 PM] [HiSenseTV] Checking state for TV at IP: 192.168.1.163
[1/30/2022, 12:15:19 PM] [HiSenseTV] Connection to TV timed out.
[1/30/2022, 12:15:29 PM] [HiSenseTV] Checking state for TV at IP: 192.168.1.163
[1/30/2022, 12:15:29 PM] [HiSenseTV] Connection to TV timed out.
[1/30/2022, 12:15:39 PM] [HiSenseTV] Checking state for TV at IP: 192.168.1.163
[1/30/2022, 12:15:39 PM] [HiSenseTV] Connection to TV timed out.

Plugin Config:

{
            "ifname": "eth0",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "HiSense",
                    "ipaddress": "192.168.1.163",
                    "macaddress": "5c:34:00:cc:c9:18",
                    "sslmode": "custom",
                    "sslcertificate": "/homebridge/node_modules/homebridge-hisense-tv-remotenow/certificate.cer",
                    "sslprivatekey": "/homebridge/node_modules/homebridge-hisense-tv-remotenow/privateKey.pkcs8"
                }
            ],
            "platform": "HiSenseTV"
        }

Environment:

  • Plugin Version: v2.0.0
  • Homebridge Version: v1.4.0
  • Node.js Version: v16.13.2
  • NPM Version: v8.1.2
  • Operating System: Docker

SSLv3 Alert Handshake Failure

Describe The Bug:

When running the authorisation script, an error is produced which shows the below:

root@homebridge-vm:/var/lib/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin $ python3.8 hisensetv.py 172.16.0.13 --authorize --ifname eth0 [2024-03-28 19:27:12,472] [INFO ] Unverified SSL context created. [2024-03-28 19:27:12,473] [INFO ] Network interface MAC Address: 00:15:5d:00:23:00 Traceback (most recent call last): File "hisensetv.py", line 6, in <module> __main__.main() File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__main__.py", line 128, in main with tv: File "/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/__init__.py", line 136, in __enter__ self._mqtt_client.connect(self.hostname, self.port) File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 914, in connect return self.reconnect() File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 1073, in reconnect sock.do_handshake() File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1131)

To Reproduce:
Run the script python3.8 hisensetv.py 172.16.0.13 --authorize --ifname eth0

Expected behavior:
Should allow user to enter TV authorisation code.

Plugin Config:

    {
            "devices": [
                {
                    "id": "TV1",
                    "name": "Living Room TV",
                    "ipaddress": "172.16.0.13",
                    "macaddress": "38:64:07:ee:79:26",
                    "sslmode": "default"
                }
            ],
            "platform": "HiSenseTV"
    

Screenshots:

Environment:

  • Plugin Version: 2.0.0
  • Homebridge Version:
  • Node.js Version:
  • NPM Version:
  • Operating System:

Can see Hisense TV but no input sources appear, cant adjust volume or change channel

Describe The Bug:
Television joins via Homekit nicely. Button appears, can switch TV on.

To Reproduce:
Tried to disable SSL, didnt work. Added 'custom' and progressed but no inputs.

Expected behavior:
Wanted to see the input sources appear

Logs:
Received Python command error: Error: [2021-09-14 20:56:40,992] [INFO ] SSL context created with cert file (/home/pi/rcm_certchain_pem.cer) and private key (/home/pi/rcm_pem_privkey.pkcs8)
Traceback (most recent call last):
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv.py", line 6, in
main.main()
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/main.py", line 128, in main
with tv:
File "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/init.py", line 137, in enter
self._mqtt_client.connect(self.hostname, self.port)
File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 941, in connect
return self.reconnect()
File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1104, in reconnect
sock.do_handshake()
File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.
{
            "ifname": "eth0",
            "devices": [
                {
                    "id": "HiSenseTV",
                    "name": "HiSense",
                    "ipaddress": "192.168.0.197",
                    "macaddress": "removed",
                    "sslmode": "custom",
                    "sslcertificate": "/home/pi/rcm_certchain_pem.cer",
                    "sslprivatekey": "/home/pi/rcm_pem_privkey.pkcs8"
                }
            ],
            "platform": "HiSenseTV"
        }```

**Screenshots:**
<!-- If applicable, add screenshots to help explain your problem. -->

**Environment:**
Pi 

* **Plugin Version**:
* **Homebridge Version**: <!-- homebridge -V -->1.3.4
* **Node.js Version**: <!-- node -v -->14.6.1
* **NPM Version**: <!-- npm -v -->6.14.2
* **Operating System**: <!-- Raspbian / Ubuntu / Debian / Windows / macOS / Docker / hb-service --> Raspbian

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->

An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')

Hello,

I am running HomeBridge on my Debian Linux VM and it is running fine.
Installing and authorising that plugin worked fine now by this command. I did enter the key which was displayed on the TV after that command:

python3.9 hisensetv.py 192.168.1.40 --authorize --ifname ens3 --certfile /usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_certchain_pem.cer --keyfile /usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_pem_privkey.pkcs8

HomeKit config is:

{
		"platform": "HiSenseTV",
		"ifname": "ens33",
		"devices": [{
			"id": "Studio Fernseher",
			"name": "Studio Fernseher",
			"ipaddress": "192.168.1.40",
			"macaddress": "f0:35:75:29:5a:e0",
			"sslmode": "custom",
			"sslcertificate": "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_certchain_pem.cer",
			"sslprivatekey": "/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_pem_privkey.pkcs8"
		}]
}

I was also able to add the TV in HomeKit, but I can't turn it on or off in HomeKit and the homebridge log is full with that message every 10 seconds:

[1/16/2022, 8:36:23 PM] [HiSenseTV] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')

Get state and power off from command line do work:

root@Server:/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin# python3.9 hisensetv.py 192.168.1.40 --ifname ens3 --certfile /usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_certchain_pem.cer --keyfile /usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_pem_privkey.pkcs8 --get state
[2022-01-16 20:41:56,148] [INFO    ] SSL context created with cert file (/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_certchain_pem.cer) and private key (/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_pem_privkey.pkcs8)
{
    "statetype": "sourceswitch",
    "sourceid": "HDMI1",
    "sourcename": "HDMI1",
    "is_signal": 0,
    "is_lock": 0,
    "hotel_mode": 0,
    "displayname": "HDMI1"
}
root@Server:/usr/lib/node_modules/homebridge-hisense-tv-remotenow/bin# python3.9 hisensetv.py 192.168.1.40 --ifname ens3 --certfile /usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_certchain_pem.cer --keyfile /usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_pem_privkey.pkcs8 --key power
[2022-01-16 20:42:38,304] [INFO    ] SSL context created with cert file (/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_certchain_pem.cer) and private key (/usr/lib/node_modules/homebridge-hisense-tv-remotenow/rcm_pem_privkey.pkcs8)
[2022-01-16 20:42:38,446] [INFO    ] sending keypress: power

Can you please help me to get it also to work correctly in HomeKit?

README Needs Updated Instructions or Simpler Steps

Describe Your Problem:
I thought I would try migrate from my Hisense repo over to yours seen as my installation steps are quite complicated and after hours I still cannot get through your installation steps; and I do not feel like I am new to all this stuff. I am on the official RPi image which it seems is a more difficult distro to use based on your closed issues. I think the README needs updating as a new user should not have to navigate that, several closed issues and links to tool installation guides. I still cannot get 'paho' to be happy after following all the instructions, google guides, etc. Not really after support, just frustrated and going to stay on my repo sorry; but thought I would let you know there might need to be some work done here; I hope this does not read as rude.

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

  • Plugin Version:
  • Homebridge Version:
  • Node.js Version:
  • NPM Version:
  • Operating System:

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.