[Lösung] Standard dummy und off-for-timer off-till on-till

Begonnen von mi.ke, 24 Mai 2014, 20:33:33

Vorheriges Thema - Nächstes Thema

mi.ke

Guten Tach auch,

was ich nicht verstehe ist folgendes . . .

define Dummy dummy
attr Dummy webCmd on:off


was funktioniert ist:
set Dummy on-for-timer 10

was nicht funktioniert ist:

set Dummy off-for-timer 10
set Dummy on-till 20:45
set Dummy off-till 20:45


Nicht funktionieren will heißen:
Das Icon wird geändert, state + STATE sind gesetzt.
Aber das passende at wird nicht erzeugt !?!

Wie gesagt kein FS20 sondern ein einfaches dummy.

Hoffe ich hab mich verständlich machen können.
Vielleicht könnte mich jemand erhellen.

Danke im Voraus  8)

Cheers

mi.ke
FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

justme1968

#1
ein normaler dummy kann kein on-for-timer.

du musst das entweder vom hand machen oder schauen ob dir readingsProxy vielleicht weiter hilft. das ist eine art dummy mit on-for-timer unterstützung.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

Puschel74

Hallo,

wie andre schon geschrieben hat.

Grad ausprobiert:
set Dummy1 on-for-timer 10
macht genau nichts.

Bastel dir ein notify mit einem at darin das den dummy nach x wieder ausschaltet - oder einschaltet oder wie auch immer  ;)

Grüße
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

mi.ke

Das ist ja genau das, was mich wundert......
Bei mir geht:
set Dummy on-for-timer 10

Gesendet von unterwegs mit Tapatalk

FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

Zrrronggg!

FHEM auf Linkstation Mini, CUL 868 SlowRF, 2xCUL 868 RFR, CUL 433 für IT, 2xHMLAN-Configurator mit VCCU, ITV-100 Repeater, Sender und Aktoren von FHT, FS20, S300, HM, IT, RSL

mi.ke

Naja...
geht heißt, läuft halt  8)

define Dummy dummy

set Dummy on-for-timer 10


erzeugt automatisch ein at:
define Dummy_off at +00:00:10 set Dummy off


Wenn ich jetzt wüsste warum . . .
. . . hätte ich vermutlich diesem Post nicht gestartet. :-X

Ich muss ich halt suchen warum....
... ich bin davon ausgegangen, dass die Erweiterung durch irgendein Update im vergangenen Jahr kam.
Genau wie bein RFXtrx oder den ITs, die dass anfänglich auch nicht konnten.

FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

mi.ke

#6
Habs gefunden:

Hatte ich vor ca. einem 3/4 Jahr mal aus einem Wiki oder aus dem "Alten Forum" rauskopiert.
Eigentlich wollte ich damals DevStateIcons von Dummys dazu bringen, sich automatisch zu aktualisieren.
Hatte den Code nie aus der CFG rausgelöscht.

Naja, Faulheit hat manchmal auch was für sich.

Jetzt auch für off-for-timer in quick'n'dirty erweitert.





Wer's haben möchte . . . bitte sehr.
Ist wie gesagt nicht von mir . . . Dank bitte an den unbekannten Genius.

###########################################
# on-for-timer 4 dummys
###########################################
define OnForTimer_n .*:on-for-timer.* { my @@args= split(" ", "%EVENT"); if($defs{%NAME_off}) { my $mod_cmd= sprintf ( "modify %NAME_off +%%02d:%%02d:%%02d", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $mod_cmd; } else { my $room = AttrVal("%NAME", "room", "Unsorted"); my $def_cmd= sprintf ( "define %NAME_off at +%%02d:%%02d:%%02d set %NAME off", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $def_cmd; fhem "attr %NAME_off room $room" } }


###########################################
# off-for-timer 4 dummys
###########################################
define OffForTimer_n .*:off-for-timer.* { my @@args= split(" ", "%EVENT"); if($defs{%NAME_on}) { my $mod_cmd= sprintf ( "modify %NAME_on +%%02d:%%02d:%%02d", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $mod_cmd; } else { my $room = AttrVal("%NAME", "room", "Unsorted"); my $def_cmd= sprintf ( "define %NAME_on at +%%02d:%%02d:%%02d set %NAME on", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $def_cmd; fhem "attr %NAME_on room $room" } }

FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

fruit

I've spent hours today on a  similar problem until I found this thread - and finally a solution. Thanks

The only reason I am resurrecting this rather old topic is to correct a slight mistake, the notify module names are missing in the above post

# on-for-timer 4 dummys
###########################################
define OnForTimer_n notify .*:on-for-timer.* { my @@args= split(" ", "%EVENT"); if($defs{%NAME_off}) { my $mod_cmd= sprintf ( "modify %NAME_off +%%02d:%%02d:%%02d", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $mod_cmd; } else { my $room = AttrVal("%NAME", "room", "Unsorted"); my $def_cmd= sprintf ( "define %NAME_off at +%%02d:%%02d:%%02d set %NAME off", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $def_cmd; fhem "attr %NAME_off room $room" } }


###########################################
# off-for-timer 4 dummys
###########################################
define OffForTimer_n notify .*:off-for-timer.* { my @@args= split(" ", "%EVENT"); if($defs{%NAME_on}) { my $mod_cmd= sprintf ( "modify %NAME_on +%%02d:%%02d:%%02d", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $mod_cmd; } else { my $room = AttrVal("%NAME", "room", "Unsorted"); my $def_cmd= sprintf ( "define %NAME_on at +%%02d:%%02d:%%02d set %NAME on", $args[1] / 3600, ($args[1] / 60) %% 60, $args[1] %%60); fhem $def_cmd; fhem "attr %NAME_on room $room" } }


I hope it helps the next person who needs it and ends up here. (I eventually found the wiki article too http://www.fhemwiki.de/wiki/On-for-timer_zurücksetzen)
Feel free to follow up in German if you prefer

dadoc

Bei fhem Version > 5.6 müssen einige Änderungen vorgenommen werden:

# on-for-timer 4 dummys
###########################################
define OnForTimer_n notify .*:on-for-timer.* {\
my $NAME_off = "x";;\
my @args= split(" ", "$EVENT");; \
if($defs{$NAME_off}) { \
my $mod_cmd= sprintf ( \
"modify $NAME_off +%02d:%02d:%02d", \
$args[1] / 3600, ($args[1] / 60) % 60, $args[1] %60);; \
fhem $mod_cmd;; \
} else { my $room = AttrVal("$NAME", "room", "Unsorted");; \
my $def_cmd= sprintf ( \
"define $NAME_off at +%02d:%02d:%02d set $NAME off", \
$args[1] / 3600, ($args[1] / 60) % 60, $args[1] %60);; \
fhem $def_cmd;; \
fhem "attr $NAME_off room $room" \
} \
}

###########################################
# off-for-timer 4 dummys
###########################################
define OffForTimer_n notify .*:off-for-timer.* { \
my $NAME_on = "x";;\
my @args= split(" ", "%EVENT");; \
if($defs{$NAME_on}) { \
my $mod_cmd= sprintf ( \
"modify $NAME_on +%02d:%02d:%02d", \
$args[1] / 3600, ($args[1] / 60) % 60, $args[1] %60);; \
fhem $mod_cmd;; \
} else { my $room = AttrVal("$NAME", "room", "Unsorted");; \
my $def_cmd= sprintf ( \
"define $NAME_on at +%02d:%02d:%02d set $NAME on", \
$args[1] / 3600, ($args[1] / 60) % 60, $args[1] %60);; \
fhem $def_cmd;; \
fhem "attr $NAME_on room $room" \
} \
}

Grüße
Martin
Standort 1: FS20 mit CUL und FHEM auf Raspi. HM-Komponenten (Heizung, Rollladen, Schalter). HM IP über Raspimatic (testweise)
Standort 2: Homematic (Wired) über CCU2 und PocketHome HD
3 x Raspi3 mit piCorePlayer/Kodi für Multiroom Audio (+ Tablets/iPeng/iPods

mi.ke

hier die funktionierende Version, die den richtigen Dateinamen erzeugt (für's DEF).
Für off-for-timer, on-till, off-till einfach den RegexpPart und die Variable $ext anpassen.

####################################################

.*:on-for-timer.* {
my $ext = "_off";
my $name = $NAME . $ext;
my @args= split(" ", "$EVENT");
    if($defs{$name}) {
        my $mod_cmd= sprintf (
        "modify $name +%02d:%02d:%02d",
        $args[1] / 3600, ($args[1] / 60) %60, $args[1] %60);
        fhem $mod_cmd;
        }
           else {
                my $raum = AttrVal("$NAME","room","Unsorted");
        my $def_cmd= sprintf (
        "define $name at +%02d:%02d:%02d set $NAME off",
        $args[1] / 3600, ($args[1] / 60) %60, $args[1] %60);
        fhem $def_cmd;
                fhem "attr $name room $raum";     
                }
}

#####################################################


Cheers

mi.ke
FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

RheinEnergie

würde mir jemand verraten wo ich diesen Code hin schreiben muss damit er funktioniert?!
in die fhem.cfg habe ich es versuchsweise gepackt. das funktioniert nicht :(

danke!

justme1968

wenn man einen readingsProxy statt dem dummy nimmt kann man sich den ganzen aufwand sparen. man bekommt dann on-for-timer automatisch von ganz alleine dazu. übrigens auch off-for-timer und alles mögliche andere.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

RheinEnergie

ok, muss ich mir mal ansehen.
Aus reinem Interesse würde mich aber dennoch interessieren wo der Code hin kommt.

gruß!

marvin78

Es steht aber dabei, wo das hin gehört. Ins DEF eines notifys.

RheinEnergie

ah, ok.
soory. fange mit fhem grade erst an und wollte mal ein bisschen mit on-till / on-for rumspielen.