MrAsterisco / homebridge-hisense-tv

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

Unsupported callback API version: version 2.0 #64

Closed lucamancusodev closed 3 months ago

lucamancusodev commented 4 months ago

Seems that plugin not work with version 2.1.0 of paho-mqtt, downgrading to 1.6.1 solves the bug

Logs:

[2024-06-07 19:09:03,973] [INFO    ] Unverified SSL context created.
[2024-06-07 19:09:03,973] [INFO    ] Network interface MAC Address: 64:00:6a:3d:5c:21
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
    with tv:
  File "/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.10/dist-packages/paho/mqtt/client.py", line 772, in __init__
    raise ValueError(
ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details

Plugin Config:

{
    "ifname": "enp2s0",
    "devices": [
        {
            "id": "hisensetv43",
            "name": "TV",
            "ipaddress": "10.9.8.5",
            "macaddress": "44:D8:78:8A:E9:5C",
            "sslmode": "default"
        }
    ],
    "platform": "HiSenseTV"
}

Screenshots:

Screenshot 2024-06-07 alle 19 14 02

Environment:

I've checked network interface, changed SSL to disabled also I run the pair script and I got the same error so it can't pair

LeLunZ commented 3 months ago

Thx for reporting. @MrAsterisco already added that part in the readme :) Screenshot 2024-06-08 at 17 20 38

And I also created a PR to the python plugin here to fix this issue for newer versions of paho-mqtt.

But just to clarify: These changes won't make it into this plugin anymore. In the next few days I am going to merge the PR #62 here which entirely removes the python plugin, and instead does all the communication natively in JS. It will improve the responsiveness and some other things. (When its ready, the config needs to be updated so watch out for that)

I will let this issue stay open and add another comment when I created a release for v3. To keep you up to date ;)

LeLunZ commented 3 months ago

@Luccio96 I just released a beta for version 3. You can update to it in homebridge, if you go to the plugins and click on manage versions :)

Would be great if you read through the readme here again as the config changed a bit. For example you need to replace the ifname with your homebridge MAC address and so on...

Please also leave a comment here if it works ;)

MrAsterisco commented 3 months ago

Linked PR on the Python plugin is merged!

lucamancusodev commented 3 months ago

@Luccio96 I just released a beta for version 3. You can update to it in homebridge, if you go to the plugins and click on manage versions :)

Would be great if you read through the readme here again as the config changed a bit. For example you need to replace the ifname with your homebridge MAC address and so on...

Please also leave a comment here if it works ;)

Is possible to have the changelog between 3.0.0 and 2.0.2 version?

LeLunZ commented 3 months ago

@Luccio96 I just released a beta for version 3. You can update to it in homebridge, if you go to the plugins and click on manage versions :) Would be great if you read through the readme here again as the config changed a bit. For example you need to replace the ifname with your homebridge MAC address and so on... Please also leave a comment here if it works ;)

Is possible to have the changelog between 3.0.0 and 2.0.2 version?

Sure. After upgrading in the homebridge-ui its visible or here

This config should do the same, as the one you provided in the issue (if the ssl mode 'default' worked for you). You just need to input the mac address of your homebridge instance:

{
    "macaddress": "<your homebridge mac address>",
    "devices": [
        {
            "id": "hisensetv43",
            "name": "TV",
            "ipaddress": "10.9.8.5",
            "tvType": "default",
            "showApps": false,
            "apps": [],
            "macaddress": "44:D8:78:8A:E9:5C",
            "sslmode": "default"
        }
    ],
    "platform": "HiSenseTV"
}
LeLunZ commented 3 months ago

Hey @Luccio96 did you install the beta? I am currently the only one testing the plugin, so thats why I am asking. If yes did it work?

lucamancusodev commented 3 months ago

Yes I did, updated also paho-mqtt to version 2.1.0 without errors. (Yes I know you have removed the usage of python plugin but want to test it..) Nice to have the switch to all apps! 😀

LeLunZ commented 3 months ago

Ahh thats nice to hear :) All apps are like 200 on my system and I don't know why. Never installed these xD

But the good thing is you can filter them if you put the app name in the apps array like

"devices": {
      ....
      apps: ["Netflix", "Prime Video"],
     ....
}

If you encounter any problems, please open an issue again 👍