mentalfl0w / homebridge-raspberrypi-switch

This is Raspberry Pi Remote plugin for Homebridge which can shutdown or reboot your Pi through HomeKit.
MIT License
4 stars 1 forks source link

How to install since not available within homebridge-config-ui-x #1

Open roger-richards opened 2 years ago

roger-richards commented 2 years ago

This plugin is not registered wherever it needs to be for easy install within homebridge-config-ui-x. Can someone point me to manual plugin install how to do it from my pi cli? I've tried following several manual install guides in reddit and other help pages to no avail.

mentalfl0w commented 2 years ago

Hello: I am glad that you are using the program. Could you please describe in detail the operation process and the problems that occurred? As far as I can see, this project can be installed in the following steps:

  1. Install the node and npm sudo apt install node npm
  2. clone this project git clone https://github.com/mentalfl0w/homebridge-raspberrypi-switch.git
  3. enter the project's folder cd homebridge-raspberrypi-switch
  4. use npm to install npm install -g

I hope this can help you and wish you a happy life!

dibehome commented 1 year ago

Hi, I followed these steps but I couldn't install the plugin

mentalfl0w commented 1 year ago

Hi, I followed these steps but I couldn't install the plugin

Hello, I tested those steps in my another raspberry pi, it works well. Note that this command needs to be executed with the privileges of the root user, i.e.: sudo npm install -g.

qwertz2021 commented 8 months ago

Hello @mentalfl0w,

I've tried multiple times but don't get it. What am I doing wrong?

Bildschirmfoto 2024-03-11 um 08 36 35 Bildschirmfoto 2024-03-11 um 08 42 12

Log says after restarting my homebridge: No plugin was found for the accessory "pi_switch" in your config.json. Please make sure the corresponding plugin is installed correctly.

Regards

mentalfl0w commented 8 months ago

@qwertz2021 Hello! Seems like you didn't install nodejs and npm in a correct way. Just execute this: sudo apt install nodejs npm Then follow the former steps, let's see what will happen. PS: It's no need to clone this repo to /var/lib/homebridge, the ~(which is /home/pi) path is ok. Please note the sudo nom install -g is needed.If there is something wrong, please let me know.😊

qwertz2021 commented 8 months ago

Thanks for your fast reply. I tried it but it didn't solve the problem. :( For background: I installed the Homebridge using the Raspberry Pi Imager. From what I understand, nodjs and npm are included in the installation process.

mentalfl0w commented 8 months ago

@qwertz2021 I see, from your screenshots, your npm and nodejs didn't install for root(it means you can't use it like a apt installed one in other users besides pi), so you can't use it by sudo npm install -g. There are some steps for you to try: 1.cd ~/.homebridge 2.npm install /path/to/homebridge-raspberrypi-switch 3.restart your homebridge

qwertz2021 commented 8 months ago

many thanks, @mentalfl0w. Here are my steps with the exact path I used to finish the installation successfully. Maybe it is useful for all, which installed the Homebridge over the Raspberry Pi Imager like me:

  1. cd ~/.homebridge
  2. npm install /var/lib/homebridge/homebridge-raspberrypi-switch
  3. restart
mentalfl0w commented 8 months ago

Congratulations, enjoy😉!