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. Kamera Steuerung (PTZ) mit Bewegungsmelder htp

NEWS

  • Neuer ioBroker-Blog online: Monatsrückblick März/April 2026
    BluefoxB
    Bluefox
    6
    1
    226

  • Verwendung von KI bitte immer deutlich kennzeichnen
    HomoranH
    Homoran
    8
    1
    220

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

Kamera Steuerung (PTZ) mit Bewegungsmelder htp

Scheduled Pinned Locked Moved JavaScript
45 Posts 3 Posters 3.8k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kasperfunsurfer
    wrote on last edited by kasperfunsurfer
    #41

    Hmm das gibt es schon wieder kleine Probleme

    19:44:14.373 info javascript.0 Stop script script.js.Skript_158_neuer
    19:44:14.415 info javascript.0 Start javascript script.js.Skript_158_neuer
    19:44:14.416 info javascript.0 script.js.Skript_158_neuer: registered 3 subscriptions and 0 schedules
    19:45:00.948 info javascript.0 script.js.Skript_158_neuer: mihome.0.devices.sensor_motion_aq2_158d0002e30682.state: true
    19:45:00.951 warn javascript.0 at kamera (script.js.Skript_158_neuer:11:7)
    19:45:00.952 warn javascript.0 at Object.<anonymous> (script.js.Skript_158_neuer:34:21)
    19:47:00.758 info javascript.0 script.js.Skript_158_neuer: mihome.0.devices.sensor_motion_aq2_158d0002e30682.state: false

    paul53P 1 Reply Last reply
    0
    • K kasperfunsurfer

      Hmm das gibt es schon wieder kleine Probleme

      19:44:14.373 info javascript.0 Stop script script.js.Skript_158_neuer
      19:44:14.415 info javascript.0 Start javascript script.js.Skript_158_neuer
      19:44:14.416 info javascript.0 script.js.Skript_158_neuer: registered 3 subscriptions and 0 schedules
      19:45:00.948 info javascript.0 script.js.Skript_158_neuer: mihome.0.devices.sensor_motion_aq2_158d0002e30682.state: true
      19:45:00.951 warn javascript.0 at kamera (script.js.Skript_158_neuer:11:7)
      19:45:00.952 warn javascript.0 at Object.<anonymous> (script.js.Skript_158_neuer:34:21)
      19:47:00.758 info javascript.0 script.js.Skript_158_neuer: mihome.0.devices.sensor_motion_aq2_158d0002e30682.state: false

      paul53P Offline
      paul53P Offline
      paul53
      wrote on last edited by
      #42

      @kasperfunsurfer
      Damit ich ich die Zeilennummern in den Warnungen zuordnen kann, muss ich das Skript so sehen, wie es bei Dir läuft.

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kasperfunsurfer
        wrote on last edited by kasperfunsurfer
        #43
        const url = 'http://+++++@192.168.2.110:81'; 
        const idMotion  = "mihome.0.devices.sensor_motion_aq2_158d000";
        const idMotion1 = idMotion + "236b7e6.state";
        const idMotion2 = idMotion + "2e922d3.state";
        const idMotion3 = idMotion + "2e30682.state";
        const idAbwesend = 'hm-rega.950';
        
         var timer = null;
        
           function kamera(id, pos) {
           if(getState(idAbwesend).val && !timer) {	
              request(url + '/param.cgi?cmd=preset&-act=goto&-number=' + pos);
              timer = setTimeout(function() {
              request(url + '/CGI-COMMAND/param.cgi?cmd=pushhostalarm');
              setState(id, false);  
              timer = null;
                log('Verzögert: ' + id);
              }, 10000); // nach 10 s
         }
        }
        
         on(idMotion1, function(dp) {
           log(dp.id + ': ' + dp.state.val); // eingefügte Log-Zeile
           if(dp.state.val) kamera(dp.id, 0);
        });
        
         on(idMotion2, function(dp) {
           log(dp.id + ': ' + dp.state.val); // eingefügte Log-Zeile
           if(dp.state.val) kamera(dp.id, 0);
        });
        
         on(idMotion3, function(dp) {
           log(dp.id + ': ' + dp.state.val); // eingefügte Log-Zeile
           if(dp.state.val) kamera(dp.id, 1);
        });
        

        Der Bewegungsmelder setzt sich auch wieder nicht zurück.....

        paul53P 1 Reply Last reply
        0
        • K kasperfunsurfer
          const url = 'http://+++++@192.168.2.110:81'; 
          const idMotion  = "mihome.0.devices.sensor_motion_aq2_158d000";
          const idMotion1 = idMotion + "236b7e6.state";
          const idMotion2 = idMotion + "2e922d3.state";
          const idMotion3 = idMotion + "2e30682.state";
          const idAbwesend = 'hm-rega.950';
          
           var timer = null;
          
             function kamera(id, pos) {
             if(getState(idAbwesend).val && !timer) {	
                request(url + '/param.cgi?cmd=preset&-act=goto&-number=' + pos);
                timer = setTimeout(function() {
                request(url + '/CGI-COMMAND/param.cgi?cmd=pushhostalarm');
                setState(id, false);  
                timer = null;
                  log('Verzögert: ' + id);
                }, 10000); // nach 10 s
           }
          }
          
           on(idMotion1, function(dp) {
             log(dp.id + ': ' + dp.state.val); // eingefügte Log-Zeile
             if(dp.state.val) kamera(dp.id, 0);
          });
          
           on(idMotion2, function(dp) {
             log(dp.id + ': ' + dp.state.val); // eingefügte Log-Zeile
             if(dp.state.val) kamera(dp.id, 0);
          });
          
           on(idMotion3, function(dp) {
             log(dp.id + ': ' + dp.state.val); // eingefügte Log-Zeile
             if(dp.state.val) kamera(dp.id, 1);
          });
          

          Der Bewegungsmelder setzt sich auch wieder nicht zurück.....

          paul53P Offline
          paul53P Offline
          paul53
          wrote on last edited by
          #44

          @kasperfunsurfe:

          const idAbwesend = 'hm-rega.950';

          Fehlt da nicht die Instanz-Nummer ?

          const idAbwesend = 'hm-rega.0.950';
          

          Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
          Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

          K 1 Reply Last reply
          0
          • paul53P paul53

            @kasperfunsurfe:

            const idAbwesend = 'hm-rega.950';

            Fehlt da nicht die Instanz-Nummer ?

            const idAbwesend = 'hm-rega.0.950';
            
            K Offline
            K Offline
            kasperfunsurfer
            wrote on last edited by
            #45

            @paul53 ja logisch Sorry mein Fehler. Jetzt passt es. Noch mal vielen vielen DANK...….

            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

            590

            Online

            32.8k

            Users

            82.8k

            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