Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. JavaScript
  5. Javascript "missing or unrecognized endTime expression: NaN"

NEWS

  • Neuer ioBroker-Blog online: Monatsrückblick März/April 2026
    BluefoxB
    Bluefox
    8
    1
    1.7k

  • Verwendung von KI bitte immer deutlich kennzeichnen
    HomoranH
    Homoran
    10
    1
    678

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    1.2k

Javascript "missing or unrecognized endTime expression: NaN"

Scheduled Pinned Locked Moved JavaScript
1 Posts 1 Posters 463 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xmace
    wrote on last edited by
    #1

    Hi,

    in meinem Anwesenheits-Programm bekomm ich immer folgenden Logeintrag

    javascript.0	2019-03-22 13:59:45.007	warn	missing or unrecognized endTime expression: NaN
    javascript.0	2019-03-22 13:59:45.005	info	script.js.common.Umwelt.Anwesenheit: Anwesenheit TRUE durch Bewegung
    

    wenn ein Bewegungsmelder ausgelöst wird.

    var debug, text, Handy_erkannt, debounce, Intervall, timeout2, verz, timeout, timeout3;
    
    function speak(text) {
        setState(getState("javascript.0.Alexa_ID").val,text);
    }
    
    function handy_update() {
      if (getState("javascript.0.Handy_Amy_erkannt").val == true || getState("javascript.0.Handy_Matze_erkannt").val == true) {
        if (Handy_erkannt == false) {
          Handy_erkannt = true;
          (function () {if (timeout) {clearTimeout(timeout); timeout = null;}})();
        }
        setState("javascript.0.Anwesend"/*Anwesend*/, true, true);
        if (debug == true) {
          console.log('Anwesenheit TRUE durch Handy');
        }
      }
      if (getState("javascript.0.Handy_Amy_erkannt").val == false && getState("javascript.0.Handy_Matze_erkannt").val == false) {
        if (Handy_erkannt == true) {
          Handy_erkannt = false;
        }
      }
      if (debug == true) {
        console.log((String('Handy erkannt: ') + String(Handy_erkannt)));
      }
    }
    
    function einbruch() {
      speak('Bewegung erkannt obwohl niemand anwesend sein sollte');
      Intervall = setInterval(function () {
        sendTo("telegram.0", "send", {
            text: (String('Einbruchalarm!!'))
        });
      }, 5000);
      timeout2 = setTimeout(function () {
        (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
      }, 20000);
    }
    
    
    debug = true;
    Handy_erkannt = false;
    debounce = false;
    on({id: new RegExp('tr-064\\.0\\.devices\\.Amys-iPhone-6\\.active' + "|" + 'tr-064\\.0\\.devices\\.Matze-Galaxy-S9\\.active'), change: "ne"}, function (obj) {
        setState("javascript.0.Handy_Amy_erkannt"/*Handy_Amy_erkannt*/, getState("tr-064.0.devices.Amys-iPhone-6.active").val, true);
      setState("javascript.0.Handy_Matze_erkannt"/*Handy_Matze_erkannt*/, getState("tr-064.0.devices.Matze-Galaxy-S9.active").val, true);
      handy_update();
    });
    on({id: new RegExp('ical\\.0\\.events\\.0\\.now\\.Gast' + "|" + 'ical\\.0\\.events\\.0\\.now\\.Urlaub'), change: "ne"}, function (obj) {
        setState("javascript.0.Kalender.Gast"/*Kalender.Gast*/, getState("ical.0.events.0.now.Gast").val, true);
      setState("javascript.0.Kalender.Urlaub"/*Kalender.Urlaub*/, getState("ical.0.events.0.now.Urlaub").val, true);
    });
    on({id: new RegExp('hm-rpc\\.0\\.OEQ0536087\\.3\\.MOTION' + "|" + 'hm-rpc\\.0\\.OEQ0540423\\.3\\.MOTION' + "|" + 'zigbee\\.0\\.00158d000257e9df\\.occupancy' + "|" + 'zigbee\\.0\\.00158d000257f576\\.occupancy' + "|" + 'zigbee\\.0\\.00158d00025847d6\\.occupancy' + "|" + 'zigbee\\.0\\.00158d0002cb4308\\.occupancy'), val: true, ack: true}, function (obj) {
        if (getState("javascript.0.Alarmmeldung").val == true) {
        if (Handy_erkannt == false && getState("javascript.0.Kalender.Gast").val == false && debounce == false) {
          debounce = true;
          if (getState("javascript.0.Kalender.Urlaub").val == true) {
            verz = 0;
          } else {
            verz = 300000;
          }
          timeout = setTimeout(function () {
            einbruch();
          }, verz);
          timeout3 = setTimeout(function () {
            debounce = false;
          }, 120000);
        }
      }
      setState("javascript.0.Anwesend"/*Anwesend*/, true, true);
      if (debug == true) {
        console.log('Anwesenheit TRUE durch Bewegung');
      }
    });
    schedule("* * * * *", function () {
      handy_update();
      if (getState("javascript.0.Auto_OFF").val == true && Handy_erkannt == false ? (function () {var v = new Date(); return v.getHours() * 60 + v.getMinutes();})() - (function () {var v = getDateObject(getState("javascript.0.Anwesend").ts); return v.getHours() * 60 + v.getMinutes();})() > getState("javascript.0.Anwesenheit_Countdown").val && getState("javascript.0.Anwesend").val == true && getState("javascript.0.Kalender.Gast").val == false : (function () {var v = new Date(); return v.getHours() * 60 + v.getMinutes();})() - (function () {var v = getDateObject(getState("javascript.0.Anwesend").ts); return v.getHours() * 60 + v.getMinutes();})() > 240 && getState("javascript.0.Anwesend").val == true) {
        setState("javascript.0.Anwesend"/*Anwesend*/, false);
        if (debug == true) {
          console.log('Anwesenheit FALSE');
        }
      }
    });
    

    Kann mir jemand einen Hinweis geben an was das liegt?

    Danke & Grüße,
    xmace

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    Support us

    ioBroker
    Community Adapters
    Donate

    481

    Online

    32.9k

    Users

    83.0k

    Topics

    1.3m

    Posts
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
    ioBroker Community 2014-2025
    logo
    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Home
    • Recent
    • Tags
    • Unread 0
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe