Ironie fließend ...
Per Zeitsteuerung...was natürlich blöd ist...ich stelle daher auch um auf den Programmansatz
Danke und Gruß, Philipp
Moderator: Co-Administratoren
Ironie fließend ...
Per Zeitsteuerung...was natürlich blöd ist...ich stelle daher auch um auf den Programmansatz
Code: Alles auswählen
! Alle Aktoren in wählbaren verschiedenen Räumen/Gewerken/Favoriten (trennen mit \t )
! Ausgabe der eingeschalteten Lichter
! (c)by Alchy
string liste = "Beleuchtung-Innen";
! Dont touch behind this Line
string index;
string slist ="";
string list = "";
integer counter = 0;
foreach (index, liste) {
object sec = dom.GetObject(""#index#"");
string itemId;
foreach(itemId, sec.EnumUsedIDs()) {
var item = dom.GetObject(itemId);
if (item.IsTypeOf(OT_CHANNEL)) {
var device = dom.GetObject(item.Device());
var hssType = item.HssType();
if ( (hssType == "SWITCH") && (item.State()) ) {
counter = counter +1;
list = list #item.Name() #" ";
}
if ( (hssType == "DIMMER") && (item.State()) ) {
counter = counter +1;
list = list #item.Name() #" ";
}
}
}
}
if (counter > 0) {
if (counter == 1) { slist = counter#" Licht ist an, das Licht " #list ; }
if (counter > 1) { slist = counter#" Lichter sind an, die Lichter " #list; }
} else{
slist = "kein Licht ist an";
}
dom.GetObject("_Test").State(slist);
!WriteLine(slist);
Eine Seite zurück hatte ich ein Beispiel für IP-Geräte (unvollständig) gepostet.
Code: Alles auswählen
if ( (hssType == "SWITCH") && (item.State()) ) {
Code: Alles auswählen
if ( ((hssType == "SWITCH") || (hssType == "SWITCH_TRANSMITTER")) && (item.DPByHssDP("STATE").Value())) {
Code: Alles auswählen
if ( ((hssType == "SWITCH") || (hssType == "SWITCH_VIRTUAL_RECEIVER")) && (item.DPByHssDP("STATE").Value())) {
Code: Alles auswählen
string liste = "Beleuchtung-Innen\tWohnzimmer"
Code: Alles auswählen
! Alle Kanäle in wählbaren verschiedenen Räumen/Gewerken/Favoriten (trennen mit \t )
! Ist ein Kanal an dann Logikvariable true
! v0.1 by Alchy
string liste = "Licht";
! Dont touch behind this Line
string index;
string slist ="";
integer counter = 0;
foreach (index, liste) {
object sec = dom.GetObject(""#index#"");
string itemId;
foreach(itemId, sec.EnumUsedIDs()) {
var item = dom.GetObject(itemId);
if (item.IsTypeOf(OT_CHANNEL)) {
if (item.DPByHssDP("STATE").Value())
{counter = counter +1; WriteLine(item);}
}}}
if (counter > 0) {
slist = counter#" Lichter sind noch an";
} else{
slist = "alle Lichter sind aus";
}
! Ausgabe in Systemvariable
(dom.GetObject(ID_SYSTEM_VARIABLES).Get("Licht an")).State(slist);
!WriteLine(slist);
Code: Alles auswählen
WZ-Licht Fenster SÜD 02
WZ-Licht Schrankwand 02
Balkon-Licht 01
3 Lichter sind noch an
Code: Alles auswählen
! Alle Kanäle in wählbaren verschiedenen Räumen/Gewerken/Favoriten (trennen mit \t )
! Ist ein Kanal an dann Logikvariable true
! v0.1 by Alchy
string liste = "Licht";
! Dont touch behind this Line
string index;
string slist ="";
string list ="";
integer counter = 0;
foreach (index, liste) {
object sec = dom.GetObject(""#index#"");
string itemId;
foreach(itemId, sec.EnumUsedIDs()) {
var item = dom.GetObject(itemId);
if (item.IsTypeOf(OT_CHANNEL)) {
if (item.DPByHssDP("STATE").Value())
{counter = counter +1; WriteLine(item);list = list #item.Name() #"; \n";}
}}}
if (counter > 0) {slist = counter#" Lichter sind noch an: \n" #list ;} else{
slist = "alle Lichter sind aus";
}
! Ausgabe in Systemvariable
(dom.GetObject(ID_SYSTEM_VARIABLES).Get("Licht an")).State(slist);
WriteLine(slist);
Code: Alles auswählen
5 Lichter sind noch an:
WZ-Licht Fenster SÜD 02;
WZ-Licht Schrankwand 02;
Balkon-Licht 01;
WZ-Licht Fenster klein 02;
Shelly RGBW2 EIN/AUS 01;
Da du ja schon die (von mir) erweiterte Version des Scriptes adaptiert hast sollten IP-Schaltaktoren angezeigt werden.
Code: Alles auswählen
if ( (hssType == "SWITCH") && (item.DPByHssDP("STATE").Value()) ) {counter = counter +1; info = info # counter # ": "#item.Name() #" im "#wo # " ("#item.LastDPActionTime().ToTime().ToString("%H:%M")#")\n";}
if ( (hssType == "DIMMER") && (item.DPByHssDP("LEVEL").Value()) ) {counter = counter +1; info = info # counter # ": "#item.Name() #" im "#wo # " ("#item.LastDPActionTime().ToTime().ToString("%H:%M")#")\n";}
if ( (hssType == "VIR-LG-RGBW-DIM-CH") && (item.DPByHssDP("LEVEL").Value()) ) {counter = counter +1;info = info # counter # ": "#item.Name() #" im "#wo # " ("#item.LastDPActionTime().ToTime().ToString("%H:%M")#")\n";}
if ( (hssType == "SWITCH_VIRTUAL_RECEIVER") && (item.DPByHssDP("STATE").Value()) ) {counter = counter +1;info = info # counter # ": "#item.Name() #" im "#wo # " ("#item.LastDPActionTime().ToTime().ToString("%H:%M")#")\n";}
if ( (hssType == "VIRTUAL_DIMMER") && (item.DPByHssDP("LEVEL").Value()) ) {counter = counter +1;info = info # counter # ": "#item.Name() #" im "#wo # " ("#item.LastDPActionTime().ToTime().ToString("%H:%M")#")\n";}
if ( (hssType == "DIMMER_VIRTUAL_RECEIVER") && (item.DPByHssDP("LEVEL").Value()) ) {counter = counter +1;info = info # counter # ": "#item.Name() #" im "#wo # " ("#item.LastDPActionTime().ToTime().ToString("%H:%M")#")\n";}
Code: Alles auswählen
string sDP = "";
if ( (hssType == "SWITCH") || (hssType == "SWITCH_VIRTUAL_RECEIVER") ) { sDP = "STATE"; }
if ( (hssType == "DIMMER") || (hssType == "VIR-LG-RGBW-DIM-CH") || (hssType == "VIRTUAL_DIMMER") || (hssType == "DIMMER_VIRTUAL_RECEIVER") ) { sDP = "LEVEL"; }
if ( (sDP != "" ) && item.DPByHssDP(sDP).Value()){ counter = counter + 1; info = info # counter # ": "#item.Name() #" im "#wo # " ("#item.LastDPActionTime().ToTime().ToString("%H:%M")#")\n";}