Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Native directory of cmdswitch2 with hb-service and homebridge user #58

Open
bencharlesrhys opened this issue Apr 28, 2020 · 0 comments
Open

Comments

@bencharlesrhys
Copy link

I'm having issues with this plugin now I've updated to v1.0.2 Homebridge and using the hb-service with homebridge user rather than systemd. Worked previously, and my other cmdtrigger plugin is working fine using these script files.

Can someone confirm the working directory being used by the plugin?

I've copied the files from /home/pi/ to /var/lib/homebridge:
on.sh
off.sh
state.sh

config.json:

{
            "platform": "cmdSwitch2",
            "name": "CMD Switch",
            "switches": [
                {
                    "name": "Apartment Door Buzzer",
                    "on_cmd": "./on.sh",
                    "off_cmd": "./off.sh",
                    "state_cmd": "./state.sh"
                }
            ]
        }

state.sh

#!/bin/bash

gpio mode 0 out
gpio read 0

on.sh

#!/bin/bash

gpio mode 0 out
gpio write 0 1

off.sh

#!/bin/bash

gpio mode 0 out
gpio write 0 0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant