Skip to content

Does not execute all the lines in the .sh file. #32

@DavideVito

Description

@DavideVito

Hi,

I do have a lamp that I can control using a IR Remote, I've bought IR Receiver and Transmitter and made a Python script that can Turn on and turn off the light.

Then I've created 2 files, accendiLampada.sh and spegniLampada.sh, and both works using the command line, so I thought, I'm ok, just add another configuration inside the hombridge's config.json file , but it seems to not completely execute the 2 scripts.

Code of: accendiLampada.sh

#!/bin/sh
echo "ON"
echo "LAMPADA ON" > ~/statoLampada.flag
python3 AccendiLuce.py

Code of: spegniLampada.sh

#!/bin/sh
echo "Spengo la luce"
rm ~/statoLampada.flag
python3 SpengiLuce.py

When I tap on the switch on my Apple Device I can see that te statoLampada.flag is removed or created, but the status led on the IR Transmitter doesn't blink and my light doesn't shut down/turn on.

Here's part of my config.json

"accessories": [
                {
                        "accessory": "GPIODevice",
                        "name": "Leddino",
                        "type": "Switch",
                        "pin": 1
                },
                {
                        "accessory": "Script2",
                        "name": "LED Strip",
                        "on": "./USBPowerOn.sh",
                        "off": "./USBPowerOff.sh",
                        "fileState": "./script.flag",
                        "on_value" : "true"
                },
                {
                        "accessory": "Script2",
                        "name": "Luce Grande",
                        "on": "~/accendiLampada.sh",
                        "off": "~/spegniLampada.sh",
                        "fileState": "~/statoLampada.flag",
                        "on_value" : "true"
                }
        ],

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions