MrAsterisco / homebridge-hisense-tv

A Homebridge plugin to control RemoteNow-compatible HiSense TVs.
MIT License
18 stars 8 forks source link

Cannot run hisensetv.py #41

Open Hawkceister opened 1 year ago

Hawkceister commented 1 year ago

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:

MrAsterisco commented 1 year ago

Hey @Hawkceister ! Thanks for reaching out. Based on this line of your log:

ConnectionResetError: [Errno 104] Connection reset by peer

It looks like your TV is either:

Does your TV work with the RemoteNOW app?

Hawkceister commented 1 year ago

Yes it work with RemoteNow app :/

MrAsterisco commented 1 year ago

I would then say your TV is unfortunately not supported. You are welcome to fork the repo and look more into it: if you find a solution, I'm happy to accept it into the main repo and release an update 😊

Unfortunately, I cannot help you further, as I don't know how to sniff the SSL certificates that your TV is using. I have no experience with that and the supported SSL certificates were taken from another repo.

Would you mind giving me your TV model, so I can add it to the unsupported list?

LeLunZ commented 1 month ago

@Hawkceister the app got an update where something with python>3.8 got fixed. (you used 3.9) You can also try the certs here: https://github.com/d3nd3/Hisense-mqtt-keyfiles

Which TV model do you have?