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 :Hallo und schon mal danke für die Mühe. Funktion... jein
      Die Scriptzeilen habe ich angepasst:

      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'; // Pfad für die Benutzerdatenpunkte
      

      Allerdings kommt eine Reihe Fehlermeldungen:

      28.1.2025, 17:43:12.810	[info ]: javascript.0 (5956) Compiling TypeScript source script.js.TRVs.Sonoff_Display
      28.1.2025, 17:43:12.829	[info ]: javascript.0 (5956) script.js.TRVs.Sonoff_Display: source code did not change, using cached compilation result...
      28.1.2025, 17:43:12.840	[info ]: javascript.0 (5956) script.js.TRVs.Sonoff_Display: registered 5 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      28.1.2025, 17:43:12.883	[error]: javascript.0 (5956) script.js.TRVs.Sonoff_Display: Alias source object "zigbee.1.0ceff6fffedc84ef.Mode" does not exist.
      28.1.2025, 17:43:12.887	[error]: javascript.0 (5956) script.js.TRVs.Sonoff_Display: Error: Alias source object "zigbee.1.0ceff6fffedc84ef.Mode" does not exist.
      28.1.2025, 17:43:12.888	[error]: javascript.0 (5956)     at script.js.TRVs.Sonoff_Display:93:42
      28.1.2025, 17:43:12.888	[error]: javascript.0 (5956)     at step (script.js.TRVs.Sonoff_Display:33:23)
      28.1.2025, 17:43:12.888	[error]: javascript.0 (5956)     at Object.next (script.js.TRVs.Sonoff_Display:14:53)
      28.1.2025, 17:43:12.888	[error]: javascript.0 (5956)     at fulfilled (script.js.TRVs.Sonoff_Display:5:58)
      28.1.2025, 17:43:34.352	[warn ]: javascript.0 (5956)     at Object.<anonymous> (script.js.TRVs.Sonoff_Display:137:9)
      28.1.2025, 17:43:34.368	[info ]: javascript.0 (5956) Stopping script script.js.TRVs.Sonoff_Display
      28.1.2025, 17:43:34.934	[error]: host.ioBroker(SmartHome) Caught by controller[1]:     at script.js.TRVs.Sonoff_Display:7008:42
      28.1.2025, 17:43:34.934	[error]: host.ioBroker(SmartHome) Caught by controller[1]:     at step (script.js.TRVs.Sonoff_Display:6948:23)
      28.1.2025, 17:43:34.934	[error]: host.ioBroker(SmartHome) Caught by controller[1]:     at Object.next (script.js.TRVs.Sonoff_Display:6929:53)
      28.1.2025, 17:43:34.934	[error]: host.ioBroker(SmartHome) Caught by controller[1]:     at fulfilled (script.js.TRVs.Sonoff_Display:6920:58)
      

      Im Display tauchen ein paar zusätzliche Symbole auf, die sich auch schalten lassen. Jeden Falls die "A","M" und "On/Off"
      A und M lassen auch den Zustand ändern.
      Allerdings ist mir schon einmal der JS Adapter dabei abgestürzt...
      Dis01.jpg

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

        @darksoul

        habe es jetzt zwar nicht getestet. aber tausche mal das Script gegen dieses aus.

        Hintergrund:

        1. Der Pfad zu den Thermostat Datenpunkten dürfte zigbee.1.0ceff6fffedc84ef.mode sein - nicht 0_userdata.0...
        2. Selbst wenn das korrekt angepasst wäre, stand ".Mode" statt ".mode" im Script und das könnte JS auch nicht finden
        const devicePath = 'zigbee.1.0ceff6fffedc84ef'; // Pfad zu den Thermostat Datenpunkten
        const aliasPath = 'alias.0.Thermostat_TRV-sonoff'; // Pfad zu den Thermostat Alias
        const userPath = '0_userdata.0.Thermostat_TRV-sonoff'; // 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');
            }
        });
        
        T D 2 Replies Last reply Reply Quote 1
        • T
          TT-Tom @Armilar last edited by

          @armilar

          Danke, für rüber schauen.
          Das Script so hat funktioniert, bei den Datenpunkte kann ein Fehler bei sein. Musste ja alles simulieren. Na mal sehen was zurück kommt.

          1 Reply Last reply Reply Quote 1
          • D
            DarkSoul @Armilar last edited by DarkSoul

            @armilar Moin.
            So das geänderte Script ausprobiert läuft soweit...
            Die beiden Punkte "Set" und Actual" haben ja funktioniert in dem original Alias. Ich habe mir mal erlaubt die im Script auszuklammern.

            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' });
            }
            

            Wenn sie noch im Script drin sind funktioniert die Temperatureinstellung nur zeitweise.

            Die Modi Umschaltung klemmt ein wenig. Mal geht es mal nicht. Hat fast den Anschein als muss man den richtigen Moment für das Umschalten erwischen?!?!

            Mal so eine ketzerische Frage. Eine kleine html Seite, z.B. ein extra vis aus dem Broker, kann man nicht auf dem Display darstellen? Das würde alles wesentlich vereinfachen. Nur so ein Gedanke...😇

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

              @darksoul

              Du kannst ja keine 2 Alias-Channel haben. Das Script von @TT-Tom hat also automatisch einen vollständigen Alias-Channel mit allen Alias-States zu den erforderlichen Datenpunkten angelegt. Ich hätte jetzt den alten weggeworfen und den aliasPath so angepasst, dass er der alte ist. Dann den aliasPath in das item in der Variable des Thermostaten im NSPanelTs eingetragen und alles wäre korrekt. 😊

              Mal so eine ketzerische Frage. Eine kleine html Seite, z.B. ein extra vis aus dem Broker, kann man nicht auf dem Display darstellen? Das würde alles wesentlich vereinfachen. Nur so ein Gedanke...😇

              Nein, ist halt ein Nextion-TFT und angesteuert über Tasmota/Berry (ESP32). Wäre in etwa so als würdest du zu Apple sagen, dass du die Oberfläche eines iPhones selbst gestalten möchtest 😉

              Ein getweaktes "NSPanel Pro" könnte HTML, kostet aber auch etwas mehr.

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

                @darksoul

                die beiden States auszuklammern hat kein Einfluss auf die Kommunikation, diese Funktion erstellt nur die Datenpunkte, mehr nicht.
                Du kommunizierst über zwei Funksysteme WLAN und Zigbee, da kann es schon mal passieren das es zum timeout kommt, wenn die Funkverbindung nicht optimal sind.

                1 Reply Last reply Reply Quote 1
                • D
                  DarkSoul @Armilar last edited by

                  @armilar Ist nur ein Alias. Ein Teril besteht aus den Daten des Scripts, ein Teil aus den direkten DP.
                  aliasHeizungBad.jpg

                  Und ja an das Pro hatte ich auch schon gedacht, aber ich brauche die beiden echten Tasten mit den Relais. Wenn alles klappt ersetzt es einen Doppellichtschalter.

                  @TT-Tom Ist auch kein Problem mit der Verzögerung. Die Modi werden sehr selten umgeschaltet.

                  Dank euch beiden noch einmal recht herzlich, toller Service 👍

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

                    @darksoul

                    den Datenpunkt BATTERY kannst du löschen, macht im alias kein Sinn.

                    Wenn noch Fragen zum Script oder Panel sind dann schreibe bitte im offiziellen Thread weiter.
                    https://forum.iobroker.net/topic/58170/sonoff-nspanel-mit-lovelace-ui/6802

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

                      @darksoul
                      Läuft das Script jetzt mit dem Thermostat oder muss noch etwas angepasst werden. Würde es dann ins Wiki übernehmen.

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

                        @tt-tom Ja läuft.
                        Ich habe bei mir noch die Zeile mit dem Unreach raus genommen. Irgendwie habe ich da immer ein rotes Sysmbol gehabt.
                        Denke da ist irgenwo noch ein Dreher der Zustände drin.

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

                          @darksoul
                          Ja stimmt der Wert muss negiert werden. Du kannst im alias in der read Konvertierung !val eintragen. Dann wird aus true false

                          D 1 Reply Last reply Reply Quote 0
                          • 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
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            629
                                            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