Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Einsteigerfragen
    4. NSPanel/Lovelace und Sonoff TRV

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    NSPanel/Lovelace und Sonoff TRV

    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DarkSoul @TT-Tom last edited by

      @tt-tom Ähm, jaaa, nur kann ich den Alias dann nicht Speichern. Das Feld ist ausgegraut. Es geht nur Abbrechen und damit wird die Änderung dann nicht übernommen ???

      T 1 Reply Last reply Reply Quote 0
      • T
        TT-Tom @DarkSoul last edited by

        @darksoul zeige mal ein Screenshot

        D 1 Reply Last reply Reply Quote 0
        • D
          DarkSoul @TT-Tom last edited by DarkSoul

          @tt-tom
          Mit !val im fx
          Nummer1.png
          Nach dem "OK"
          Nummer2.png
          Kein Speichern verfügbar ...

          Ich habe gerade gesehen, das der Punkt avaible zeimal drin ist, aber selbst wenn ich einen raus lösche geht es nicht.

          T Armilar 2 Replies Last reply Reply Quote 0
          • T
            TT-Tom @DarkSoul last edited by

            @darksoul

            Ich bin persönlich nicht so begeistert von diesem Adapter. Du kannst es im Alias direkt ändern bzw. poste mal deine aktuelle Version vom Script. Dann passe ich es dort an, dann wird der Alias richtig gesetzt.

            1 Reply Last reply Reply Quote 0
            • Armilar
              Armilar Most Active Forum Testing @DarkSoul last edited by

              @darksoul

              Ich bin ehrlich gesagt etwas verwirrt...

              Das Skript von @TT-Tom erzeugt andere Alias-States:

              2af4683a-bb73-4b4d-ba98-717884ba4c49-image.png

              Die sind auch korrekt im Case-Sensitiv (Alle Buchstaben groß) erzeugt worden.

              In deinem Bild sehe ich lauter abweichende Bezeichner:

              3c06dc7e-362b-49a9-8daa-95d9ba9d4b8e-image.png

              und statt eines erwarteten Thermostaten sehe ich:

              e83e6210-9e8d-41ac-b4ea-adfd3d3fdd6f-image.png

              T 1 Reply Last reply Reply Quote 0
              • T
                TT-Tom @Armilar last edited by

                @armilar oh ja, so genau habe ich da nicht hingeschaut. Da läuft anscheinend noch mehr schief.

                Armilar 1 Reply Last reply Reply Quote 0
                • Armilar
                  Armilar Most Active Forum Testing @TT-Tom last edited by Armilar

                  @tt-tom

                  eben. Ich musste etwas schlucken, als ich selbstgebaute Typen wie available gesehen habe und weitere die hinten kleingeschrieben sind. Das NSPanelTs.ts kann nur handelsübliche Alias-States zum jeweiligen Alias-Channel auswerten (ist ja keine KI 😊)

                  T 1 Reply Last reply Reply Quote 1
                  • T
                    TT-Tom @Armilar last edited by

                    @armilar hier sieht der Alias aber okay aus.

                    Armilar 1 Reply Last reply Reply Quote 1
                    • Armilar
                      Armilar Most Active Forum Testing @TT-Tom last edited by

                      @tt-tom

                      @armilar hier sieht der Alias aber okay aus.

                      ja, da "war" es noch okay.

                      T 1 Reply Last reply Reply Quote 0
                      • T
                        TT-Tom @Armilar last edited by

                        @armilar ich werde das Script mal anpassen, und dann schauen wir mal was kommt.

                        D 1 Reply Last reply Reply Quote 0
                        • D
                          DarkSoul @TT-Tom last edited by DarkSoul

                          @tt-tom Also mein aktuelles Skript sieht aus:

                          
                          const devicePath = 'zigbee.1.0ceff6fffedc84ef'; // Pfad zu den Thermostat Datenpunkten
                          const aliasPath = 'alias.0.Heizungen.HeizungBad'; // Pfad zu den Thermostat Alias
                          const userPath = '0_userdata.0.Heizungen.HeizungBad'; // Pfad für die Benutzerdatenpunkte
                           
                          async function createUserdata() {
                              extendObject(userPath, { type: 'folder', common: { name: 'Thermostat' }, native: {} });
                              await createStateAsync(userPath + '.lowbat', false, { type: 'boolean', write: true });
                              await createStateAsync(userPath + '.Auto', false, { type: 'boolean', write: true });
                              await createStateAsync(userPath + '.Manual', false, { type: 'boolean', write: true });
                              await createStateAsync(userPath + '.power', false, { type: 'boolean', write: true });
                          }
                          createUserdata();
                           
                          async function createAliasThermostat() {
                              extendObjectAsync(aliasPath, { type: 'channel', common: { name: 'Thermostat', role: 'thermostat' }, native: {} });
                              await createAliasAsync(aliasPath + '.UNREACH', devicePath + '.available', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch', name: 'available', write: false });
                              await createAliasAsync(aliasPath + '.LOWBAT', userPath + '.lowbat', true, <iobJS.StateCommon>{ type: 'boolean', role: 'indicator.maintenance', name: 'Battery', write: false });
                              /*await createAliasAsync(aliasPath + '.ACTUAL', devicePath + '.local_temperature', true, <iobJS.StateCommon>{ type: 'number', role: 'value.themperature', name: 'Temperature', write: false });*/
                              /*await createAliasAsync(aliasPath + '.SET', devicePath + '.occupied_heating_setpoint', true, <iobJS.StateCommon>{ type: 'number', role: 'level.themperature', name: 'Setpoint', write: true });*/
                              await createAliasAsync(aliasPath + '.AUTOMATIC', userPath + '.Auto', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch.mode.enable', name: 'Auto', write: true });
                              await createAliasAsync(aliasPath + '.MANUAL', userPath + '.Manual', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch.mode.enable', name: 'Manual', write: true });
                              await createAliasAsync(aliasPath + '.POWER', userPath + '.power', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch.power', name: 'Power', write: true });
                              await createAliasAsync(aliasPath + '.MODE', devicePath + '.mode', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'Modus' });
                          }
                           
                          createAliasThermostat();
                           
                          // überwacht Batterielevel
                          // kleiner als 25% wird angezeigt
                          on({ id: [devicePath + '.battery'], change: 'ne' }, function (obj) {
                              if (obj.state.val < 25) {
                                  setStateAsync(userPath + '.lowbat', true);
                              } else {
                                  setStateAsync(userPath + '.lowbat', false);
                              }
                          });
                           
                          // überwacht den Modus vom Thermostat
                          // setzt die Benutzerdatenpunkte entsprechend
                          on({ id: [devicePath + '.mode'], change: 'ne' }, function (obj) {
                              switch (obj.state.val) {
                                  case 'auto':
                                      setStateAsync(userPath + '.Auto', true);
                                      setStateAsync(userPath + '.Manual', false);
                                      setStateAsync(userPath + '.power', true);
                                      break;
                           
                                  case 'heat':
                                      setStateAsync(userPath + '.Auto', false);
                                      setStateAsync(userPath + '.Manual', true);
                                      setStateAsync(userPath + '.power', true);
                                      break;
                           
                                  default:
                                      setStateAsync(userPath + '.Auto', false);
                                      setStateAsync(userPath + '.Manual', false);
                                      setStateAsync(userPath + '.power', false);
                                      break;
                              }
                          });
                           
                          // überwacht den Modus der Benutzerdatenpunkte
                          // setzt den Thermostat Modus entsprechend
                          on({ id: [userPath + '.Auto'], change: 'ne' }, function (obj) {
                              if (obj.state.val) {
                                  setStateAsync(devicePath + '.mode', 'auto');
                              }
                          });
                           
                          on({ id: [userPath + '.Manual'], change: 'ne' }, function (obj) {
                              if (obj.state.val) {
                                  setStateAsync(devicePath + '.mode', 'heat');
                              }
                          });
                           
                          on({ id: [userPath + '.power'], change: 'ne' }, function (obj) {
                              if (obj.state.val) {
                                  setStateAsync(devicePath + '.mode', 'auto');
                              } else {
                                  setStateAsync(devicePath + '.mode', 'off');
                              }
                          });
                          
                          

                          Die ersten drei Zeilen an die Gegebenheiten angepasst.
                          Und unter "async function" die beiden Zeilen abgeschaltet, da die in dem Alias nicht passten. Da habe ich die originalen DP aus dem ZigBee/Sonoff eingetragen.
                          HeizungBad.png
                          Der Rest des Skript sieht aus wie in der Vorlage.
                          Und bis auf das Symbol für die Verbindung "unreach" läuft es auch bestens.
                          Warum der Geräte Adapter einen Schieberegler als Gerät anzeigt und nicht Thermostat weiß ich auch nicht.

                          T 1 Reply Last reply Reply Quote 0
                          • T
                            TT-Tom @DarkSoul last edited by

                            @darksoul

                            ersetze mal diese Funktion.

                            async function createAliasThermostat() {
                                extendObjectAsync(aliasPath, { type: 'channel', common: { name: 'Thermostat', role: 'thermostat' }, native: {} });
                                await createAliasAsync(aliasPath + '.UNREACH', devicePath + '.available', true, <iobJS.StateCommon>{
                                    type: 'boolean',
                                    role: 'switch',
                                    name: 'available',
                                    write: false,
                                    alias: { id: devicePath + '.available', read: '!val' },
                                });
                                await createAliasAsync(aliasPath + '.LOWBAT', userPath + '.lowbat', true, <iobJS.StateCommon>{ type: 'boolean', role: 'indicator.maintenance', name: 'Battery', write: false });
                                await createAliasAsync(aliasPath + '.ACTUAL', devicePath + '.local_temperature', true, <iobJS.StateCommon>{ type: 'number', role: 'value.themperature', name: 'Temperature', write: false });
                                await createAliasAsync(aliasPath + '.SET', devicePath + '.occupied_heating_setpoint', true, <iobJS.StateCommon>{ type: 'number', role: 'level.themperature', name: 'Setpoint', write: true });
                                await createAliasAsync(aliasPath + '.AUTOMATIC', userPath + '.Auto', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch.mode.enable', name: 'Auto', write: true });
                                await createAliasAsync(aliasPath + '.MANUAL', userPath + '.Manual', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch.mode.enable', name: 'Manual', write: true });
                                await createAliasAsync(aliasPath + '.POWER', userPath + '.power', true, <iobJS.StateCommon>{ type: 'boolean', role: 'switch.power', name: 'Power', write: true });
                                await createAliasAsync(aliasPath + '.MODE', devicePath + '.mode', true, <iobJS.StateCommon>{ type: 'string', role: 'state', name: 'Modus' });
                            }
                            
                            D 1 Reply Last reply Reply Quote 0
                            • D
                              DarkSoul @TT-Tom last edited by

                              @tt-tom 'nabend.
                              Scheint zu funktionieren.
                              Ich weiß nur nicht, ob der abgefragte DP auch das wiedergibt was er soll. Ich habe eine gute Stunde die Batterien aus dem Thermostat raus genommen und er hat seinen Status nicht geändert. Auch ein Mehrmaliges neustarten der Instance hat da nichts geändert. Aber das ist kein Problem des Scriptes. ZigBee halt, ist wohl ein wenig sehr träge.

                              Dank dir und schönen Abend noch

                              1 Reply Last reply Reply Quote 1
                              • First post
                                Last post

                              Support us

                              ioBroker
                              Community Adapters
                              Donate

                              483
                              Online

                              31.6k
                              Users

                              79.6k
                              Topics

                              1.3m
                              Posts

                              3
                              34
                              1002
                              Loading More Posts
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes
                              Reply
                              • Reply as topic
                              Log in to reply
                              Community
                              Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                              The ioBroker Community 2014-2023
                              logo