Initiator: Shelly Timeout
Ressource automatisch nach Leerlaufzeit freigeben mit Shelly
Das folgende Script setzt ein Shelly nach einer Idle-Zeit (wenn der Stromschwellwert länger als TIME_THRESHOLD
Minuten (Standard: 15 Minuten) unterhalb Schwellwert POWER_THRESHOLD
(Standard: 0) ist) zurück in die Ausgangslange (führt einen Reset zum Status FREE
durch).
Code: https://gitlab.com/fabinfra/fabaccess/shelly-timeout
Installation
mkdir -p /opt/fabinfra/adapters/
cd /opt/fabinfra/adapters/
git clone https://gitlab.com/fabinfra/fabaccess/initiators/shelly-timeout.git
cd /opt/fabinfra/adapters/shelly-timeout/
chmod +x shelly-timeout/main.py
chown -R bffh:bffh /opt/fabinfra/adapters/shelly-timeout/
cd /opt/fabinfra/adapters/shelly-timeout/
python3 -m venv env
. env/bin/activate #activate venv
pip install -r requirements.txt
In FabAccess einbinden
bffh.dhall Snippet
YOUR_INITIATOR_ID =
{
module = "Process",
params =
{
cmd = "/usr/bin/python3",
args = "/opt/fabinfra/adapters/shelly-timeout/main.py 127.0.0.1 shelly1-REDACTED_ID 5.0",
}
},