Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • 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

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

  1. ioBroker Community Home
  2. Deutsch
  3. Praktische Anwendungen (Showcase)
  4. CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.3k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.9k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.3k

CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor

Geplant Angeheftet Gesperrt Verschoben Praktische Anwendungen (Showcase)
zigbeediyptvo
166 Beiträge 10 Kommentatoren 24.3k Aufrufe 12 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • skvarelS Offline
    skvarelS Offline
    skvarel
    Developer
    schrieb am zuletzt editiert von
    #84

    Hallo zusammen.

    Ich habe mittlerweile ein paar eigene Zigbee Geräte in meinem Netzwerk. Klappt soweit sehr stabil.
    Ich stehe nur vor einem 'Problem' bei einem externen Konverter. Kennst sich da jemand aus? Ich würde gern einen Wert direkt im Konverter umrechnen.

    Alles unter 300mm soll als 'true' und alles darüber als 'false' angezeigt werden. Mit einem Alias ist das kein Problem! Ich hätte es aber gern direkt in der Zigbee-Kachel anders stehen.

    Ich messe hier in der Mähroboter-Garage, ob Roberta drin steht oder unterwegs ist.

    477111538_3070106873136313_7589983493516186053_n.jpg

    So mache ich es zur Zeit (via Alias)

    476391189_3070107329802934_5044627440779325810_n.jpg

    Ausschnitt vom Konverter. Könnte man es nicht schon direkt hier umrechnen?

    476403640_3070107776469556_1700162112400831784_n.jpg

    Das wäre meine Wunschvorstellung (Photoshop)

    476254301_3070109516469382_3767719117024236975_n.jpg

    #TeamInventwo
    • vis-inventwo & vis-2-widgets-inventwo
    • vis-icontwo & vis-2-widgets-icontwo

    AsgothianA 1 Antwort Letzte Antwort
    0
    • skvarelS skvarel

      Hallo zusammen.

      Ich habe mittlerweile ein paar eigene Zigbee Geräte in meinem Netzwerk. Klappt soweit sehr stabil.
      Ich stehe nur vor einem 'Problem' bei einem externen Konverter. Kennst sich da jemand aus? Ich würde gern einen Wert direkt im Konverter umrechnen.

      Alles unter 300mm soll als 'true' und alles darüber als 'false' angezeigt werden. Mit einem Alias ist das kein Problem! Ich hätte es aber gern direkt in der Zigbee-Kachel anders stehen.

      Ich messe hier in der Mähroboter-Garage, ob Roberta drin steht oder unterwegs ist.

      477111538_3070106873136313_7589983493516186053_n.jpg

      So mache ich es zur Zeit (via Alias)

      476391189_3070107329802934_5044627440779325810_n.jpg

      Ausschnitt vom Konverter. Könnte man es nicht schon direkt hier umrechnen?

      476403640_3070107776469556_1700162112400831784_n.jpg

      Das wäre meine Wunschvorstellung (Photoshop)

      476254301_3070109516469382_3767719117024236975_n.jpg

      AsgothianA Offline
      AsgothianA Offline
      Asgothian
      Developer
      schrieb am zuletzt editiert von Asgothian
      #85

      @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

      Hallo zusammen.

      […]

      Ausschnitt vom Konverter. Könnte man es nicht schon direkt hier umrechnen?

      Kann man.

      Dazu musst du 2 Dinge tun

      • eine Funktion schreiben die die zigbee Nachricht abfängt um setzt
      • das korrekte ‘expose’ dafür finden / definieren

      Das hört sich jetzt sehr komplex an, ist es aber nicht.

      • Du schaust dir die Funktion fz.ptvo_switch_analog_Input an. Wichtig sind die Parameter beim Aufruf sowie der rückgabewert
      • du schreibst eine Funktion die mit den gleichen Parametern aufgerufen wird und rufst darin als erstes besagte fz… Funktion auf. Dann nimmst du den rückgabewert und baust den so um das deine Wunsch Bedingung erfüllt ist.
      • Unter fromZigbee trägst du dann diese Funktion an Stelle der ptvo_switch_analog_Input ein.
      • als letztes musst du schauen welcher Expose am besten dazu passt. Ich bin gerade unterwegs, kann da aber heute Nachmittag mal einen Vorschlag machen.

      A.

      ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
      "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

      skvarelS 1 Antwort Letzte Antwort
      1
      • AsgothianA Asgothian

        @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

        Hallo zusammen.

        […]

        Ausschnitt vom Konverter. Könnte man es nicht schon direkt hier umrechnen?

        Kann man.

        Dazu musst du 2 Dinge tun

        • eine Funktion schreiben die die zigbee Nachricht abfängt um setzt
        • das korrekte ‘expose’ dafür finden / definieren

        Das hört sich jetzt sehr komplex an, ist es aber nicht.

        • Du schaust dir die Funktion fz.ptvo_switch_analog_Input an. Wichtig sind die Parameter beim Aufruf sowie der rückgabewert
        • du schreibst eine Funktion die mit den gleichen Parametern aufgerufen wird und rufst darin als erstes besagte fz… Funktion auf. Dann nimmst du den rückgabewert und baust den so um das deine Wunsch Bedingung erfüllt ist.
        • Unter fromZigbee trägst du dann diese Funktion an Stelle der ptvo_switch_analog_Input ein.
        • als letztes musst du schauen welcher Expose am besten dazu passt. Ich bin gerade unterwegs, kann da aber heute Nachmittag mal einen Vorschlag machen.

        A.

        skvarelS Offline
        skvarelS Offline
        skvarel
        Developer
        schrieb am zuletzt editiert von
        #86

        @asgothian .. puhh, das klingt doch schon kompliziert.

        #TeamInventwo
        • vis-inventwo & vis-2-widgets-inventwo
        • vis-icontwo & vis-2-widgets-icontwo

        AsgothianA 1 Antwort Letzte Antwort
        0
        • skvarelS Offline
          skvarelS Offline
          skvarel
          Developer
          schrieb am zuletzt editiert von
          #87

          Hier nochmal der aktuelle Konverter:

          https://github.com/inventwo/custom-zigbee/blob/main/Converter/CC2531.US100.js

          #TeamInventwo
          • vis-inventwo & vis-2-widgets-inventwo
          • vis-icontwo & vis-2-widgets-icontwo

          1 Antwort Letzte Antwort
          -1
          • skvarelS skvarel

            @asgothian .. puhh, das klingt doch schon kompliziert.

            AsgothianA Offline
            AsgothianA Offline
            Asgothian
            Developer
            schrieb am zuletzt editiert von Asgothian
            #88

            @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

            @asgothian .. puhh, das klingt doch schon kompliziert.

            Es ist einfacher als du denkst. Ich hatte bei der Beschreibung aber auch einen Denkfehler. Versuch mal so:

            const fzlocal = {
            ptvo_switch_analog_to_boolean: {
                    cluster: 'genAnalogInput',
                    type: ['attributeReport', 'readResponse'],
                    convert: (model, msg, publish, options, meta) => {
                        const value =( msg.data['presentValue'] > 300 );
                        const action = (value ? 'occupied':'free');
                        return {action: postfixWithEndpointName(action, msg, model, meta)};
                     },
            };
            
            const device = {
                zigbeeModel: ['CC2531.US100'],
                model: 'CC2531.US100',
                vendor: 'inventwo',
                description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fz.ptvo_switch_analog_input,fzlocal.ptvo_switch_analog_to_boolean],
                toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                exposes: [
                  exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                  exposes.action(['occupied'].withDescription('Innenraum belegt'),
                  exposes.action(['free'].withDescription('Innenraum frei'),
                    ],
                meta: {
                    multiEndpoint: true,
                            
                },
                endpoint: (device) => {
                    return {
                        l1: 1,
                    };
                },
            
                configure: async (device, coordinatorEndpoint, logger) => {
                  const endpoint = device.getEndpoint(1);
                  await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                },
            
            };
            

            A.

            Nachtrag: ich hab das icon aus dem code genommen, und den Kopf nicht mit angegeben - das sollte aber kein problem für Dich sein

            Nachtrag2: ich hatte noch einen Denkfehler - ist jetzt korrigiert.

            ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
            "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

            skvarelS 2 Antworten Letzte Antwort
            0
            • AsgothianA Asgothian

              @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

              @asgothian .. puhh, das klingt doch schon kompliziert.

              Es ist einfacher als du denkst. Ich hatte bei der Beschreibung aber auch einen Denkfehler. Versuch mal so:

              const fzlocal = {
              ptvo_switch_analog_to_boolean: {
                      cluster: 'genAnalogInput',
                      type: ['attributeReport', 'readResponse'],
                      convert: (model, msg, publish, options, meta) => {
                          const value =( msg.data['presentValue'] > 300 );
                          const action = (value ? 'occupied':'free');
                          return {action: postfixWithEndpointName(action, msg, model, meta)};
                       },
              };
              
              const device = {
                  zigbeeModel: ['CC2531.US100'],
                  model: 'CC2531.US100',
                  vendor: 'inventwo',
                  description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                  fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fz.ptvo_switch_analog_input,fzlocal.ptvo_switch_analog_to_boolean],
                  toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                  exposes: [
                    exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                    exposes.action(['occupied'].withDescription('Innenraum belegt'),
                    exposes.action(['free'].withDescription('Innenraum frei'),
                      ],
                  meta: {
                      multiEndpoint: true,
                              
                  },
                  endpoint: (device) => {
                      return {
                          l1: 1,
                      };
                  },
              
                  configure: async (device, coordinatorEndpoint, logger) => {
                    const endpoint = device.getEndpoint(1);
                    await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                  },
              
              };
              

              A.

              Nachtrag: ich hab das icon aus dem code genommen, und den Kopf nicht mit angegeben - das sollte aber kein problem für Dich sein

              Nachtrag2: ich hatte noch einen Denkfehler - ist jetzt korrigiert.

              skvarelS Offline
              skvarelS Offline
              skvarel
              Developer
              schrieb am zuletzt editiert von skvarel
              #89

              @asgothian .. teste ich!

              #TeamInventwo
              • vis-inventwo & vis-2-widgets-inventwo
              • vis-icontwo & vis-2-widgets-icontwo

              1 Antwort Letzte Antwort
              0
              • AsgothianA Asgothian

                @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

                @asgothian .. puhh, das klingt doch schon kompliziert.

                Es ist einfacher als du denkst. Ich hatte bei der Beschreibung aber auch einen Denkfehler. Versuch mal so:

                const fzlocal = {
                ptvo_switch_analog_to_boolean: {
                        cluster: 'genAnalogInput',
                        type: ['attributeReport', 'readResponse'],
                        convert: (model, msg, publish, options, meta) => {
                            const value =( msg.data['presentValue'] > 300 );
                            const action = (value ? 'occupied':'free');
                            return {action: postfixWithEndpointName(action, msg, model, meta)};
                         },
                };
                
                const device = {
                    zigbeeModel: ['CC2531.US100'],
                    model: 'CC2531.US100',
                    vendor: 'inventwo',
                    description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                    fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fz.ptvo_switch_analog_input,fzlocal.ptvo_switch_analog_to_boolean],
                    toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                    exposes: [
                      exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                      exposes.action(['occupied'].withDescription('Innenraum belegt'),
                      exposes.action(['free'].withDescription('Innenraum frei'),
                        ],
                    meta: {
                        multiEndpoint: true,
                                
                    },
                    endpoint: (device) => {
                        return {
                            l1: 1,
                        };
                    },
                
                    configure: async (device, coordinatorEndpoint, logger) => {
                      const endpoint = device.getEndpoint(1);
                      await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                    },
                
                };
                

                A.

                Nachtrag: ich hab das icon aus dem code genommen, und den Kopf nicht mit angegeben - das sollte aber kein problem für Dich sein

                Nachtrag2: ich hatte noch einen Denkfehler - ist jetzt korrigiert.

                skvarelS Offline
                skvarelS Offline
                skvarel
                Developer
                schrieb am zuletzt editiert von
                #90

                @asgothian .. das funktioniert leider überhaupt nicht

                94dc8da6-ed93-4fa0-aafd-40524a50b9d4-image.png

                Sobald ich deine Teile einsetze, kommt gar nichts mehr an. Bei dir waren noch ein paar Klammern offen. Die habe ich geschlossen.

                So hatte ich den Code verwendet:

                const fzlocal = {
                  ptvo_switch_analog_to_boolean: {
                          cluster: 'genAnalogInput',
                          type: ['attributeReport', 'readResponse'],
                          convert: (model, msg, publish, options, meta) => {
                              const value =( msg.data['presentValue'] > 300 );
                              const action = (value ? 'occupied':'free');
                              return {action: postfixWithEndpointName(action, msg, model, meta)};
                           },
                  }
                };
                
                const device = {
                    zigbeeModel: ['CC2531.US100'],
                    model: 'CC2531.US100',
                    vendor: 'inventwo',
                    description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                    fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fz.ptvo_switch_analog_input, fzlocal.ptvo_switch_analog_to_boolean],
                    toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                    exposes: [
                      exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                      exposes.action(['occupied']).withDescription('Innenraum belegt'),
                      exposes.action(['free']).withDescription('Innenraum frei'),
                    ],
                    meta: {
                        multiEndpoint: true,
                                
                    },
                    endpoint: (device) => {
                        return {
                            l1: 1,
                        };
                    },
                    
                    configure: async (device, coordinatorEndpoint, logger) => {
                      const endpoint = device.getEndpoint(1);
                      await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                    },
                
                };
                

                #TeamInventwo
                • vis-inventwo & vis-2-widgets-inventwo
                • vis-icontwo & vis-2-widgets-icontwo

                AsgothianA 2 Antworten Letzte Antwort
                0
                • skvarelS skvarel

                  @asgothian .. das funktioniert leider überhaupt nicht

                  94dc8da6-ed93-4fa0-aafd-40524a50b9d4-image.png

                  Sobald ich deine Teile einsetze, kommt gar nichts mehr an. Bei dir waren noch ein paar Klammern offen. Die habe ich geschlossen.

                  So hatte ich den Code verwendet:

                  const fzlocal = {
                    ptvo_switch_analog_to_boolean: {
                            cluster: 'genAnalogInput',
                            type: ['attributeReport', 'readResponse'],
                            convert: (model, msg, publish, options, meta) => {
                                const value =( msg.data['presentValue'] > 300 );
                                const action = (value ? 'occupied':'free');
                                return {action: postfixWithEndpointName(action, msg, model, meta)};
                             },
                    }
                  };
                  
                  const device = {
                      zigbeeModel: ['CC2531.US100'],
                      model: 'CC2531.US100',
                      vendor: 'inventwo',
                      description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                      fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fz.ptvo_switch_analog_input, fzlocal.ptvo_switch_analog_to_boolean],
                      toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                      exposes: [
                        exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                        exposes.action(['occupied']).withDescription('Innenraum belegt'),
                        exposes.action(['free']).withDescription('Innenraum frei'),
                      ],
                      meta: {
                          multiEndpoint: true,
                                  
                      },
                      endpoint: (device) => {
                          return {
                              l1: 1,
                          };
                      },
                      
                      configure: async (device, coordinatorEndpoint, logger) => {
                        const endpoint = device.getEndpoint(1);
                        await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                      },
                  
                  };
                  
                  AsgothianA Offline
                  AsgothianA Offline
                  Asgothian
                  Developer
                  schrieb am zuletzt editiert von
                  #91

                  @skvarel gibt es Meldungen im log ? Ich bin wieder unterwegs und schau mal wenn ich wieder zu Hause bin

                  ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
                  "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

                  1 Antwort Letzte Antwort
                  0
                  • skvarelS skvarel

                    @asgothian .. das funktioniert leider überhaupt nicht

                    94dc8da6-ed93-4fa0-aafd-40524a50b9d4-image.png

                    Sobald ich deine Teile einsetze, kommt gar nichts mehr an. Bei dir waren noch ein paar Klammern offen. Die habe ich geschlossen.

                    So hatte ich den Code verwendet:

                    const fzlocal = {
                      ptvo_switch_analog_to_boolean: {
                              cluster: 'genAnalogInput',
                              type: ['attributeReport', 'readResponse'],
                              convert: (model, msg, publish, options, meta) => {
                                  const value =( msg.data['presentValue'] > 300 );
                                  const action = (value ? 'occupied':'free');
                                  return {action: postfixWithEndpointName(action, msg, model, meta)};
                               },
                      }
                    };
                    
                    const device = {
                        zigbeeModel: ['CC2531.US100'],
                        model: 'CC2531.US100',
                        vendor: 'inventwo',
                        description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                        fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fz.ptvo_switch_analog_input, fzlocal.ptvo_switch_analog_to_boolean],
                        toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                        exposes: [
                          exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                          exposes.action(['occupied']).withDescription('Innenraum belegt'),
                          exposes.action(['free']).withDescription('Innenraum frei'),
                        ],
                        meta: {
                            multiEndpoint: true,
                                    
                        },
                        endpoint: (device) => {
                            return {
                                l1: 1,
                            };
                        },
                        
                        configure: async (device, coordinatorEndpoint, logger) => {
                          const endpoint = device.getEndpoint(1);
                          await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                        },
                    
                    };
                    
                    AsgothianA Offline
                    AsgothianA Offline
                    Asgothian
                    Developer
                    schrieb am zuletzt editiert von
                    #92

                    @skvarel ich hab nochmal was angepasst. Versuch bitte mal so:

                    const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
                    const zigbeeHerdsmanUtils = require('zigbee-herdsman-converters/lib/utils');
                    
                    
                    const exposes = zigbeeHerdsmanConverters['exposes'] || require("zigbee-herdsman-converters/lib/exposes");
                    const ea = exposes.access;
                    const e = exposes.presets;
                    const modernExposes = (e.hasOwnProperty('illuminance_lux'))? false: true;
                    
                    const fz = zigbeeHerdsmanConverters.fromZigbeeConverters || zigbeeHerdsmanConverters.fromZigbee;
                    const tz = zigbeeHerdsmanConverters.toZigbeeConverters || zigbeeHerdsmanConverters.toZigbee;
                    
                    const ptvo_switch = (zigbeeHerdsmanConverters.findByModel)?zigbeeHerdsmanConverters.findByModel('ptvo.switch'):zigbeeHerdsmanConverters.findByDevice({modelID: 'ptvo.switch'});
                    fz.legacy = ptvo_switch.meta.tuyaThermostatPreset;
                    fz.ptvo_on_off = {
                      cluster: 'genOnOff',
                      type: ['attributeReport', 'readResponse'],
                      convert: (model, msg, publish, options, meta) => {
                          if (msg.data.hasOwnProperty('onOff')) {
                              const channel = msg.endpoint.ID;
                              const endpointName = `l${channel}`;
                              const binaryEndpoint = model.meta && model.meta.binaryEndpoints && model.meta.binaryEndpoints[endpointName];
                              const prefix = (binaryEndpoint) ? model.meta.binaryEndpoints[endpointName] : 'state';
                              const property = `${prefix}_${endpointName}`;
                    	  if (binaryEndpoint) {
                                return {[property]: msg.data['onOff'] === 1};
                              }
                              return {[property]: msg.data['onOff'] === 1 ? 'ON' : 'OFF'};
                          }
                      },
                    };
                    const fzlocal = {
                      local_analog_switch: {
                        cluster: 'genAnalogInput',
                        type: ['attributeReport', 'readResponse'],
                        convert: (model, msg, publish, options, meta) => {
                            const payload = {};
                            const channel = msg.endpoint.ID;
                            const name = `l${channel}`;
                            const endpoint = msg.endpoint;
                            payload[name] = precisionRound(msg.data['presentValue'], 3);
                            payload[`contact_${channel}`] = (msg.data['presentValue']  < 300)
                            const cluster = 'genLevelCtrl';
                            if (endpoint && (endpoint.supportsInputCluster(cluster) || endpoint.supportsOutputCluster(cluster))) {
                                payload['brightness_' + name] = msg.data['presentValue'];
                            } else if (msg.data.description !== undefined) {
                                const data1 = msg.data['description'];
                                if (data1) {
                                    const data2 = data1.split(',');
                                    const devid = data2[1];
                                    const unit = data2[0];
                                    if (devid) {
                                        payload['device_' + name] = devid;
                                    }
                    
                                    const valRaw = msg.data['presentValue'];
                                    if (unit) {
                                        let val = precisionRound(valRaw, 1);
                    
                                        const nameLookup = {
                                            C: 'temperature',
                                            '%': 'humidity',
                                            m: 'altitude',
                                            Pa: 'pressure',
                                            ppm: 'quality',
                                            psize: 'particle_size',
                                            V: 'voltage',
                                            A: 'current',
                                            Wh: 'energy',
                                            W: 'power',
                                            Hz: 'frequency',
                                            pf: 'power_factor',
                                            lx: 'illuminance',
                                        };
                    
                                        let nameAlt = '';
                                        if (unit === 'A' || unit === 'pf') {
                                            if (valRaw < 1) {
                                                val = precisionRound(valRaw, 3);
                                            }
                                        }
                                        if (unit.startsWith('mcpm') || unit.startsWith('ncpm')) {
                                            const num = unit.substr(4, 1);
                                            nameAlt = num === 'A' ? unit.substr(0, 4) + '10' : unit;
                                            val = precisionRound(valRaw, 2);
                                        } else {
                                            nameAlt = nameLookup[unit];
                                        }
                                        if (nameAlt === undefined) {
                                            const valueIndex = parseInt(unit, 10);
                                            if (!isNaN(valueIndex)) {
                                                nameAlt = 'val' + unit;
                                            }
                                        }
                    
                                        if (nameAlt !== undefined) {
                                            payload[nameAlt + '_' + name] = val;
                                        }
                                    }
                                }
                            }
                            return payload;
                        },
                      },
                    
                      
                    }
                    
                    const device = {
                        zigbeeModel: ['CC2531.US100'],
                        model: 'CC2531.US100',
                        vendor: 'inventwo',
                        description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                        fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fzlocal.local_analog_switch,],
                        toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                        exposes: [
                          exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                          e.contact().withEndpoint('l1'),
                        ],
                        meta: {
                            multiEndpoint: true,
                                    
                        },
                        endpoint: (device) => {
                            return {
                                l1: 1,
                            };
                        },
                          configure: async (device, coordinatorEndpoint, logger) => {
                          const endpoint = device.getEndpoint(1);
                          await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                        },
                    
                    };
                    
                    module.exports = device;
                    

                    (wieder ohne icon)

                    ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
                    "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

                    skvarelS 1 Antwort Letzte Antwort
                    0
                    • AsgothianA Asgothian

                      @skvarel ich hab nochmal was angepasst. Versuch bitte mal so:

                      const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
                      const zigbeeHerdsmanUtils = require('zigbee-herdsman-converters/lib/utils');
                      
                      
                      const exposes = zigbeeHerdsmanConverters['exposes'] || require("zigbee-herdsman-converters/lib/exposes");
                      const ea = exposes.access;
                      const e = exposes.presets;
                      const modernExposes = (e.hasOwnProperty('illuminance_lux'))? false: true;
                      
                      const fz = zigbeeHerdsmanConverters.fromZigbeeConverters || zigbeeHerdsmanConverters.fromZigbee;
                      const tz = zigbeeHerdsmanConverters.toZigbeeConverters || zigbeeHerdsmanConverters.toZigbee;
                      
                      const ptvo_switch = (zigbeeHerdsmanConverters.findByModel)?zigbeeHerdsmanConverters.findByModel('ptvo.switch'):zigbeeHerdsmanConverters.findByDevice({modelID: 'ptvo.switch'});
                      fz.legacy = ptvo_switch.meta.tuyaThermostatPreset;
                      fz.ptvo_on_off = {
                        cluster: 'genOnOff',
                        type: ['attributeReport', 'readResponse'],
                        convert: (model, msg, publish, options, meta) => {
                            if (msg.data.hasOwnProperty('onOff')) {
                                const channel = msg.endpoint.ID;
                                const endpointName = `l${channel}`;
                                const binaryEndpoint = model.meta && model.meta.binaryEndpoints && model.meta.binaryEndpoints[endpointName];
                                const prefix = (binaryEndpoint) ? model.meta.binaryEndpoints[endpointName] : 'state';
                                const property = `${prefix}_${endpointName}`;
                      	  if (binaryEndpoint) {
                                  return {[property]: msg.data['onOff'] === 1};
                                }
                                return {[property]: msg.data['onOff'] === 1 ? 'ON' : 'OFF'};
                            }
                        },
                      };
                      const fzlocal = {
                        local_analog_switch: {
                          cluster: 'genAnalogInput',
                          type: ['attributeReport', 'readResponse'],
                          convert: (model, msg, publish, options, meta) => {
                              const payload = {};
                              const channel = msg.endpoint.ID;
                              const name = `l${channel}`;
                              const endpoint = msg.endpoint;
                              payload[name] = precisionRound(msg.data['presentValue'], 3);
                              payload[`contact_${channel}`] = (msg.data['presentValue']  < 300)
                              const cluster = 'genLevelCtrl';
                              if (endpoint && (endpoint.supportsInputCluster(cluster) || endpoint.supportsOutputCluster(cluster))) {
                                  payload['brightness_' + name] = msg.data['presentValue'];
                              } else if (msg.data.description !== undefined) {
                                  const data1 = msg.data['description'];
                                  if (data1) {
                                      const data2 = data1.split(',');
                                      const devid = data2[1];
                                      const unit = data2[0];
                                      if (devid) {
                                          payload['device_' + name] = devid;
                                      }
                      
                                      const valRaw = msg.data['presentValue'];
                                      if (unit) {
                                          let val = precisionRound(valRaw, 1);
                      
                                          const nameLookup = {
                                              C: 'temperature',
                                              '%': 'humidity',
                                              m: 'altitude',
                                              Pa: 'pressure',
                                              ppm: 'quality',
                                              psize: 'particle_size',
                                              V: 'voltage',
                                              A: 'current',
                                              Wh: 'energy',
                                              W: 'power',
                                              Hz: 'frequency',
                                              pf: 'power_factor',
                                              lx: 'illuminance',
                                          };
                      
                                          let nameAlt = '';
                                          if (unit === 'A' || unit === 'pf') {
                                              if (valRaw < 1) {
                                                  val = precisionRound(valRaw, 3);
                                              }
                                          }
                                          if (unit.startsWith('mcpm') || unit.startsWith('ncpm')) {
                                              const num = unit.substr(4, 1);
                                              nameAlt = num === 'A' ? unit.substr(0, 4) + '10' : unit;
                                              val = precisionRound(valRaw, 2);
                                          } else {
                                              nameAlt = nameLookup[unit];
                                          }
                                          if (nameAlt === undefined) {
                                              const valueIndex = parseInt(unit, 10);
                                              if (!isNaN(valueIndex)) {
                                                  nameAlt = 'val' + unit;
                                              }
                                          }
                      
                                          if (nameAlt !== undefined) {
                                              payload[nameAlt + '_' + name] = val;
                                          }
                                      }
                                  }
                              }
                              return payload;
                          },
                        },
                      
                        
                      }
                      
                      const device = {
                          zigbeeModel: ['CC2531.US100'],
                          model: 'CC2531.US100',
                          vendor: 'inventwo',
                          description: '[CC2531 w. US-100 Sensor](https://github.com/inventwo/custom-zigbee)',
                          fromZigbee: [fz.ignore_basic_report, fz.ptvo_switch_uart, fzlocal.local_analog_switch,],
                          toZigbee: [tz.ptvo_switch_trigger, tz.ptvo_switch_uart,],
                          exposes: [
                            exposes.numeric('l1', ea.STATE).withDescription('Innenraummessung').withUnit('mm'),
                            e.contact().withEndpoint('l1'),
                          ],
                          meta: {
                              multiEndpoint: true,
                                      
                          },
                          endpoint: (device) => {
                              return {
                                  l1: 1,
                              };
                          },
                            configure: async (device, coordinatorEndpoint, logger) => {
                            const endpoint = device.getEndpoint(1);
                            await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
                          },
                      
                      };
                      
                      module.exports = device;
                      

                      (wieder ohne icon)

                      skvarelS Offline
                      skvarelS Offline
                      skvarel
                      Developer
                      schrieb am zuletzt editiert von skvarel
                      #93

                      @asgothian .. Meldungen im Log:

                      z2m: Exception while calling fromZigbee converter: precisionRound is not defined}

                      So sieht es beim neuen Code aus:

                      094d1bc2-1361-46c9-b010-0f985c4d64c0-image.png

                      #TeamInventwo
                      • vis-inventwo & vis-2-widgets-inventwo
                      • vis-icontwo & vis-2-widgets-icontwo

                      AsgothianA 1 Antwort Letzte Antwort
                      0
                      • skvarelS skvarel

                        @asgothian .. Meldungen im Log:

                        z2m: Exception while calling fromZigbee converter: precisionRound is not defined}

                        So sieht es beim neuen Code aus:

                        094d1bc2-1361-46c9-b010-0f985c4d64c0-image.png

                        AsgothianA Offline
                        AsgothianA Offline
                        Asgothian
                        Developer
                        schrieb am zuletzt editiert von
                        #94

                        @skvarel das ist nachdem du die Fehlermeldung eliminiert hast oder vorher ? einfach den Aufruf zu precisionRound entfernen und den Wert direkt nutzen

                        aus

                        precisionRound(msg.data['presentValue'], 3);
                        

                        wird

                        msg.data['presentValue'];
                        

                        A.

                        ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
                        "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

                        skvarelS 1 Antwort Letzte Antwort
                        0
                        • AsgothianA Asgothian

                          @skvarel das ist nachdem du die Fehlermeldung eliminiert hast oder vorher ? einfach den Aufruf zu precisionRound entfernen und den Wert direkt nutzen

                          aus

                          precisionRound(msg.data['presentValue'], 3);
                          

                          wird

                          msg.data['presentValue'];
                          

                          A.

                          skvarelS Offline
                          skvarelS Offline
                          skvarel
                          Developer
                          schrieb am zuletzt editiert von skvarel
                          #95

                          @asgothian sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

                          msg.data['presentValue'];

                          Der Fehler ist jetzt weg! Die Änderung hat geholfen.

                          Es bleibt aber bei N/A

                          89733758-4587-4db1-a1b3-84316476d3e5-image.png

                          #TeamInventwo
                          • vis-inventwo & vis-2-widgets-inventwo
                          • vis-icontwo & vis-2-widgets-icontwo

                          AsgothianA 1 Antwort Letzte Antwort
                          0
                          • skvarelS skvarel

                            @asgothian sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

                            msg.data['presentValue'];

                            Der Fehler ist jetzt weg! Die Änderung hat geholfen.

                            Es bleibt aber bei N/A

                            89733758-4587-4db1-a1b3-84316476d3e5-image.png

                            AsgothianA Offline
                            AsgothianA Offline
                            Asgothian
                            Developer
                            schrieb am zuletzt editiert von
                            #96

                            @skvarel Du bist doch auf dem ioBroker discord. Wollen wir uns da kurz zusammen hängen - geht einfacher als hier per posts.

                            Ich bin einfach mal im '2 user only' channel :)

                            A.

                            ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
                            "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

                            skvarelS 1 Antwort Letzte Antwort
                            1
                            • AsgothianA Asgothian

                              @skvarel Du bist doch auf dem ioBroker discord. Wollen wir uns da kurz zusammen hängen - geht einfacher als hier per posts.

                              Ich bin einfach mal im '2 user only' channel :)

                              A.

                              skvarelS Offline
                              skvarelS Offline
                              skvarel
                              Developer
                              schrieb am zuletzt editiert von
                              #97

                              @asgothian .. heute schaffe ich es leider nicht mehr. Morgen hätte ich Zeit.

                              #TeamInventwo
                              • vis-inventwo & vis-2-widgets-inventwo
                              • vis-icontwo & vis-2-widgets-icontwo

                              AsgothianA 1 Antwort Letzte Antwort
                              0
                              • skvarelS skvarel

                                @asgothian .. heute schaffe ich es leider nicht mehr. Morgen hätte ich Zeit.

                                AsgothianA Offline
                                AsgothianA Offline
                                Asgothian
                                Developer
                                schrieb am zuletzt editiert von
                                #98

                                @skvarel morgen tuts. Wann ?

                                ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
                                "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

                                skvarelS 1 Antwort Letzte Antwort
                                1
                                • AsgothianA Asgothian

                                  @skvarel morgen tuts. Wann ?

                                  skvarelS Offline
                                  skvarelS Offline
                                  skvarel
                                  Developer
                                  schrieb am zuletzt editiert von
                                  #99

                                  @asgothian .. ab späten Vormittag. Uhrzeit ist mir egal. Ich habe nichts weiter vor!

                                  #TeamInventwo
                                  • vis-inventwo & vis-2-widgets-inventwo
                                  • vis-icontwo & vis-2-widgets-icontwo

                                  AsgothianA 1 Antwort Letzte Antwort
                                  0
                                  • skvarelS skvarel

                                    @asgothian .. ab späten Vormittag. Uhrzeit ist mir egal. Ich habe nichts weiter vor!

                                    AsgothianA Offline
                                    AsgothianA Offline
                                    Asgothian
                                    Developer
                                    schrieb am zuletzt editiert von
                                    #100

                                    @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

                                    @asgothian .. ab späten Vormittag. Uhrzeit ist mir egal. Ich habe nichts weiter vor!

                                    sagen wir 11 ?

                                    ioBroker auf RPi4 - Hardware soweit wie möglich via Zigbee.
                                    "Shit don't work" ist keine Fehlermeldung, sondern ein Fluch.

                                    skvarelS 2 Antworten Letzte Antwort
                                    1
                                    • AsgothianA Asgothian

                                      @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

                                      @asgothian .. ab späten Vormittag. Uhrzeit ist mir egal. Ich habe nichts weiter vor!

                                      sagen wir 11 ?

                                      skvarelS Offline
                                      skvarelS Offline
                                      skvarel
                                      Developer
                                      schrieb am zuletzt editiert von
                                      #101

                                      @asgothian .. das passt! Vielen Dank nochmal, bis morgen :)

                                      #TeamInventwo
                                      • vis-inventwo & vis-2-widgets-inventwo
                                      • vis-icontwo & vis-2-widgets-icontwo

                                      1 Antwort Letzte Antwort
                                      1
                                      • AsgothianA Asgothian

                                        @skvarel sagte in CC2530/CC2531 als Custom-Zigbee-Aktor/Sensor:

                                        @asgothian .. ab späten Vormittag. Uhrzeit ist mir egal. Ich habe nichts weiter vor!

                                        sagen wir 11 ?

                                        skvarelS Offline
                                        skvarelS Offline
                                        skvarel
                                        Developer
                                        schrieb am zuletzt editiert von skvarel
                                        #102

                                        @asgothian .. vielen Dank! Ich bin begeistert :)

                                        bfc9cc53-9425-46fa-a8a6-3e4224019a1f-image.png

                                        Jetzt gehe ich an die anderen Konverter. Da müssen die Namen noch angepasst werden.

                                        Das wichtigste wäre mir beim Gewächshaus, direkt Fenster und Tür sowie Heizung und Licht .. anstatt Kontakt und State

                                        #TeamInventwo
                                        • vis-inventwo & vis-2-widgets-inventwo
                                        • vis-icontwo & vis-2-widgets-icontwo

                                        1 Antwort Letzte Antwort
                                        1
                                        • skvarelS Offline
                                          skvarelS Offline
                                          skvarel
                                          Developer
                                          schrieb am zuletzt editiert von
                                          #103

                                          1fca3515-6735-46f1-9b50-190484b150fc-image.png

                                          ed0865ec-52b7-4192-9f30-90a953d12f74-image.png

                                          #TeamInventwo
                                          • vis-inventwo & vis-2-widgets-inventwo
                                          • vis-icontwo & vis-2-widgets-icontwo

                                          1 Antwort Letzte Antwort
                                          0
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          290

                                          Online

                                          32.4k

                                          Benutzer

                                          81.4k

                                          Themen

                                          1.3m

                                          Beiträge
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Anmelden

                                          • Du hast noch kein Konto? Registrieren

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Home
                                          • Aktuell
                                          • Tags
                                          • Ungelesen 0
                                          • Kategorien
                                          • Unreplied
                                          • Beliebt
                                          • GitHub
                                          • Docu
                                          • Hilfe