MrAsterisco / homebridge-hisense-tv

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

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

Closed lucamancusodev closed 1 year ago

lucamancusodev commented 1 year ago

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:

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.

MrAsterisco commented 1 year ago

Hey @Luccio96 !

Thanks for reaching out. Have you checked if your TV is compatible with this plugin? 😊 There are some known models that don't work nicely with the plugin because of different SSL certificates. There are multiple mentions of this problem across other issues in the repo, as well.

What model is your TV?

lucamancusodev commented 1 year ago

My tv model is H43B7100, is it in the incompatible model list? How can I help you to sniff the SSL cert?

MrAsterisco commented 1 year ago

Hey @Luccio96 ! So, you're the only one that can sniff the certificates, unfortunately, as you need to be on the local network while playing with the RemoteNOW app.

I have zero experience on how to do it, as my TV model did not require any SSL certificate, but you may refer to this repo: there seems to be some very high-level instructions on how to do it. You will need an Android device, as it seems.

lucamancusodev commented 1 year ago

Hi @MrAsterisco meanwhile I've tried some commands with the python bin and tv return the response successfully. Here some working example:

Screenshot 2023-02-28 alle 21 55 35

So I think the problem is not with SSL certs, maybe the problem can be with docker environment? Do you have any kind of advice?

MrAsterisco commented 1 year ago

Oh... that's very interesting, thanks for trying that! I guess something else is wrong. So, first thing would be to reset the sslmode to default, which is what you're using from the Python command (you can see it from the log Unverified SSL context created).

After that, could you please try to downgrade Node.JS to version 10? You can use n to manage your node environments.

I understand this means downgrading 8 major versions 🙄 this plugin was written when Node 10 was the latest version. You should install the latest on the 10.17 track, as it's the minimum requirement for Homebridge (see here)

Docker should not influence the plugin, as long as you're using a standard distro as base image (eg. Ubuntu).

lucamancusodev commented 1 year ago

Hi @MrAsterisco I've tried to downgrade node version to 10.17 inside docker container but Homebridge not start, I see a lot of errors of syntax, ports and other things....maybe this version is very old and to supported as they says.

Do you think is possible to upgrade the plugin to support node 18?

MrAsterisco commented 1 year ago

@Luccio96 I have no idea, to be honest, but before making changes to the code, I'd like to see if that's the problem. Could you try with Node 14?

lucamancusodev commented 1 year ago

Meanwhile I've enabled debug on homebridge and found that is missing netifaces and paho-mqtt, which I've already installed outside docker.

So I run pip3 install netifaces pip3 install paho-mqtt inside the container and now it's fully working!!! 🚀

MrAsterisco commented 1 year ago

That's great to hear, @Luccio96 ! I'm happy you managed to make it work 😊 Enjoy!