Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. WUCHTTIGER

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Groups 1

    WUCHTTIGER

    @WUCHTTIGER

    0
    Reputation
    3
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Location Germany Age 49

    WUCHTTIGER Follow
    Starter

    Latest posts made by WUCHTTIGER

    • RE: Brauche Hilfe bei Anrufer Ansage

      @paul53 Habe es gefunden. Vielen Dank für den Tipp. Es war in der Java Script Instanz.

      posted in JavaScript
      WUCHTTIGER
      WUCHTTIGER
    • RE: Brauche Hilfe bei Anrufer Ansage

      @paul53 Danke für deine schnelle Antwort. Ich gehe davon aus, dass du die TR-064 Instanz meinst.
      Aber welcher Haken ist das ?

      posted in JavaScript
      WUCHTTIGER
      WUCHTTIGER
    • RE: Brauche Hilfe bei Anrufer Ansage

      @homoran Das Script war im original Thread zu sehen, deswegen habe ich es nicht erneut gepostet. Hatte nur auf Empfehlung hin einen neuen Thread eröffnet, weil der originale schon etwas älter war.

      Anbei der Code, welche ich nutze

      //* Insert own numbers with description
      const numbers = {
          '01234512345': 'privat',
          '01234522222': 'Büro'
      };
       
      function tellMeWhoCalls(sayattention) {
          let curtime = new Date();
          //* not between 21pm and 7am UTC
          if(curtime.getHours() < 7 || curtime.getHours() > 21) {
              return;
          }
          let targ = getState('tr-064.0.callmonitor.inbound.callee').val;
          let src = getState('tr-064.0.callmonitor.inbound.caller').val;
          let srcName = getState('tr-064.0.callmonitor.inbound.callerName').val;
       
          let targName = numbers[targ];
          if(!targName) {
              targName = 'unbekannt';
          }
       
          let text = (sayattention ? 'Achtung! ' : '') + 'Anruf für ' + targName + ' von ';
          if(srcName) {
              text += srcName;
          } else if(src) {
              text += '<say-as interpret-as="digits">' + src + '</say-as>';
          } else {
              text += 'unbekannter Nummer';
          }
          text += '.';
       
          text = '<speak>' + text + '</speak>';
       
          //* replace XXXXX by your echo device id and add further lines for more devices
          setState('alexa2.0.Echo-Devices.XXXXXXX.Commands.ssml', text);
       
          if(targName === 'privat') {
              //* replace YYYYYY by your echo device id or delete this part if you don't need it
              setState('alexa2.0.Echo-Devices.YYYYYYYY.Commands.ssml', text);
          }
      }
       
      let ringInterval = null;
       
      on({id: 'tr-064.0.callmonitor.ringing', change: 'ne'}, function(obj) {
          if(obj.state.val !== true) {
              //* no longer ringing
              if(ringInterval) {
                  clearInterval(ringInterval);
                  ringInterval = null;
              }
              return;
          }
       
          if(ringInterval) {
              clearInterval(ringInterval);
          }
          //* repeat caller anouncement each 10 secs
          ringInterval = setInterval(function() {
              tellMeWhoCalls();
          }, 10000);
       
          //* first time add "Achtung!" in front of the text
          setTimeout(function() {
              tellMeWhoCalls(true);
          }, 1000);
      });
      
      posted in JavaScript
      WUCHTTIGER
      WUCHTTIGER
    • Brauche Hilfe bei Anrufer Ansage

      Re: [Vorlage] Simple Anrufer-Ansage via Alexa/tr-064

      Das Script läuft an ohne Fehler. Jedoch wenn ein Anruf reinkommt werden folgende Fehler rausgeschmissen.
      Wie kann ich das reparieren? Ich wäre Euch dankbar für Eure Hilfe oder einen funktionierenden Code 😉

      
      31.5.2024, 13:49:05.347	[error]: javascript.0 (5076) script.js.common.ANRUFER_ANSAGE_: The "getState" method cannot be used synchronously, because the adapter setting "Do not subscribe to all states on start" is enabled.
      31.5.2024, 13:49:05.348	[error]: javascript.0 (5076) script.js.common.ANRUFER_ANSAGE_: Please disable that setting or use "getState" with a callback, e.g.: getState('tr-064.0.callmonitor.inbound.callee', (err, state) => { ... });
      31.5.2024, 13:49:05.359	[error]: javascript.0 (5076)     at tellMeWhoCalls (script.js.common.ANRUFER_ANSAGE_:14:63)
      31.5.2024, 13:49:05.360	[error]: javascript.0 (5076)     at Object.<anonymous> (script.js.common.ANRUFER_ANSAGE_:66:9)
      31.5.2024, 13:49:09.347	[error]: javascript.0 (5076) script.js.common.ANRUFER_ANSAGE_: The "getState" method cannot be used synchronously, because the adapter setting "Do not subscribe to all states on start" is enabled.
      31.5.2024, 13:49:09.348	[error]: javascript.0 (5076) script.js.common.ANRUFER_ANSAGE_: Please disable that setting or use "getState" with a callback, e.g.: getState('tr-064.0.callmonitor.inbound.callee', (err, state) => { ... });
      31.5.2024, 13:49:09.354	[error]: javascript.0 (5076)     at tellMeWhoCalls (script.js.common.ANRUFER_ANSAGE_:14:63)
      31.5.2024, 13:49:09.355	[error]: javascript.0 (5076)     at Object.<anonymous> (script.js.common.ANRUFER_ANSAGE_:61:9)
      

      MOD-EDIT: Code in code-tags gesetzt!

      posted in JavaScript
      WUCHTTIGER
      WUCHTTIGER
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo