Hello,
I have the function like:
real c_time = (0.01 * system.Date("%M").ToInteger()) + system.Date("%H").ToInteger();
real c_daysbeginning = (0.01 * system.SunriseTime("%M").ToInteger()) + system.SunriseTime("%H").ToInteger();
real c_dayend = (0.01 * system.SunsetTime("%M").ToInteger()) + system.SunsetTime("%H").ToInteger();
integer v_daytime = 0; ! night
if (c_time < c_dayend + 2) {
v_daytime = 3; ! evening
}
if (c_time < c_dayend) {
v_daytime = 2; ! afternoon
}
if (c_time < c_daysbeginning) {
v_daytime = 1; ! dawn
}
if (c_time < c_daysbeginning - 2) {
v_daytime = 0; ! night
}
dom.GetObject("Daytime").State(v_daytime);
How can I use the function to switch the light on when is night?
Thanks in advance for help.
BR
Janusz L.
Time-/ position settings - script to light
Support for our english speaking visitors
Moderator: Co-Administratoren
Zurück zu „HomeMatic - english“
Gehe zu
- Allgemein
- ↳ Informationen zum HomeMatic-Forum
- ↳ Neubau - Renovierung - Planung
- ↳ Projektvorstellungen
- ↳ Usertreffen und Stammtische
- ↳ Vergangene Aktivitäten
- ↳ OffTopic
- ↳ Tiergarten
- HomeMatic
- ↳ HomeMatic allgemein
- ↳ HomeMatic Tipps & Tricks - keine Fragen!
- ↳ HomeMatic Zentrale (CCU / CCU2 / CCU3 / Charly)
- ↳ HmIP-HCU - Home Control Unit
- ↳ HomeMatic OCCU
- ↳ Allgemeines zur OCCU
- ↳ OCCU Entwicklung
- ↳ debmatic
- ↳ piVCCU
- ↳ RaspberryMatic
- ↳ x86-CCU
- ↳ YAHM
- ↳ HomeMatic Aktoren und Sensoren (klassisch)
- ↳ HomeMatic IP Aktoren und Sensoren
- ↳ HomeMatic IP wired Aktoren und Sensoren
- ↳ HomeMatic IP mit Access Point
- ↳ HomeMatic IP mit CCU
- ↳ HomeMatic - bekannte Bugs
- ↳ HomeMatic Addons
- ↳ CCU-Historian
- ↳ CCU.IO
- ↳ CCU-Jack
- ↳ CloudMatic
- ↳ CUxD
- ↳ Hue-Addon
- ↳ RedMatic
- ↳ WebMatic
- ↳ Sonstige Addons
- ↳ HomeMatic Entwicklung
- ↳ Softwareentwicklung für die HomeMatic CCU
- ↳ Softwareentwicklung von externen Applikationen
- ↳ Hardwareentwicklung und Selbstbau von Aktoren und Sensoren
- ↳ 3D-Druck
- ↳ HomeMatic Apps und Desktop-Anwendungen
- ↳ TinyMatic
- ↳ Externe Steuerungen und Visualisierungen
- ↳ Home Assistant
- ↳ homeputer CL
- ↳ homeputer CL - Bugs & Updatewünsche
- ↳ IP-Symcon
- ↳ mediola
- ↳ openHAB
- ↳ Sonstige Steuerungen und Visualisierungen
- ↳ HomeMatic - english
- FHZ-, FS20-, HMS100-, FHT-, KeyMatic- & sonstige Hardware
- ↳ ELV FHZ Funk-Hauszentralen
- ↳ ELV FS20 Sender, Empfänger und Aktoren
- ↳ ELV HMS-Alarm Sensoren und Aktoren
- ↳ ELV FHT-Komponenten
- ↳ ELV Wettersensoren / Wetterstationen
- ↳ ELV KeyMatic Funk-Codeschloss & Türschlossantrieb
- ↳ Sonstige Hardware (Vellemann USB-Board, IRTrans, ALLNET)
- FHZ Software / Programmierung
- ↳ homeputer Studio / Standard: allgemeine Fragen
- ↳ homeputer Studio / Standard: Programmierbeispiele
- ↳ homeputer Studio / Standard: Bugs & Updatewünsche
- ↳ FHZ unter Linux / MacOSX
- Markt
- ↳ Private Kleinanzeigen