MrAsterisco / homebridge-hisense-tv

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

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

Closed Tomcraft1980 closed 2 years ago

Tomcraft1980 commented 2 years ago

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: homebridge-camera-ffmpeg@3.1.2
[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: homebridge-config-ui-x@4.41.2
[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: homebridge-hisense-tv-remotenow@1.1.0
[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: homebridge-hue@0.13.19
[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: homebridge-ifttt@1.0.3
[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: homebridge-onkyo-pioneer@0.0.18
[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: homebridge-smtp-motion@1.2.1
[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: homebridge-weather-plus@3.2.6
[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/homebridge-tuya-web@1.0.2
[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:

MrAsterisco commented 2 years ago

Hi @Tomcraft1980 , thanks for reporting this!

I feel like this is not an issue with the plugin, but more with your instance of Homebridge that is missing some Python dependency. Have you tried looking for that error online?

A quick Google search gave me this: https://stackoverflow.com/questions/41480256/import-error-paho-mqtt-client-not-found

I'm happy to help further, but I wouldn't know how to. Closing this for now, as it looks like a system configuration issue.

Tomcraft1980 commented 2 years ago

I thought there are no other prerequisites when using the official homebridge for raspberry image from here: https://github.com/homebridge/homebridge-raspbian-image/wiki/Getting-Started

But I'll give it a try and check the solution from your link, thx.

ryanshand commented 2 years ago

I thought there are no other prerequisites when using the official homebridge for raspberry image from here: https://github.com/homebridge/homebridge-raspbian-image/wiki/Getting-Started

But I'll give it a try and check the solution from your link, thx.

If you have a look at some of the other discussion threads from previous issues raised you will likely find the answer. I had to install mqtt paho seperately for my rasperian image. It works for me no problem now

Tomcraft1980 commented 2 years ago

Ah okay, got it! I looked at the closed topics before but didn't find any discussion that covered this topic. This was due to the fact that some of the topics are somehow named imprecisely. ;-)

MrAsterisco commented 2 years ago

@ryanshand thanks for jumping in. I wasn't aware of additional requirements for the Raspberry image, as I don't use it myself.

Would any of you guys like to push a PR to update the install guide with the steps necessary to install the additional dependency?

Tomcraft1980 commented 2 years ago

This would be great @ryanshand Thanks in advance.