ich habe mir aus verschiedenen Produkten eine USV und eine Lüftersteuerung für das Asus Board zusammengebaut.
Was ich nicht hinbekomme ein Shutdown nach Zeit bei Stromausfall. Das gleiche Szenario auf einem Raspi 3 funktioniert.
Ich habe folgende rule:
Code: Alles auswählen
rule "Lüfter einschalten"
when
Item FF_testKnopf changed to ON
then
FF_DualRelay1.sendCommand(ON)
end
rule "Lüfter ausschalten"
when
Item FF_testKnopf changed to OFF
then
FF_DualRelay1.sendCommand(OFF)
end
rule "Lüfter Automatik"
when
Item FF_Office_TemperaturPi changed
then
if (FF_Office_TemperaturPi.state > 65) {
FF_DualRelay1.sendCommand(ON)
}
if (FF_Office_TemperaturPi.state < 41) {
FF_DualRelay1.sendCommand(OFF)
}
end
rule "Pi herunterfahren bei Stromausfall"
when
Item FF_io16ina0 changed to CLOSED
then
executeCommandLine("sudo sh /etc/openhab2/scripts/rebootHomer.sh",5000)
end
rule "Tinkerboard ausschalten"
when
Item FF_ShutdownKnopf changed to OPEN
then
executeCommandLine("sudo sh /etc/openhab2/scripts/rebootHomer.sh",5000)
end
rule "Tinkerboard ausschalten anhalten"
when
Item FF_ShutdownKnopf changed to closed
then
executeCommandLine("sudo sh /etc/openhab2/scripts/stoprebootHomer.sh",5000)
end
Code: Alles auswählen
#!/bin/bash
# /usr/share/openhab2/runtime/bin/backup
sudo /sbin/shutdown -k +60
Meine sudoers Datei sieht so aus:
Code: Alles auswählen
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
openhab ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=NOPASSWD:ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
# User alias specification
User_Alias ABSCHALTER = ralf, openhab, pi
# Cmnd alias specification
Cmnd_Alias DOWN = /sbin/shutdown, /sbin/halt, /sbin/reboot
# User privilege specification
ABSCHALTER ALL = NOPASSWD: DOWN
Ich weis nicht weiter.
Viele Grüße,
Ralf