Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. [gelöst] Farbwechsel bei verschiedenen Verbräuchen

NEWS

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

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

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

[gelöst] Farbwechsel bei verschiedenen Verbräuchen

Scheduled Pinned Locked Moved ioBroker Allgemein
44 Posts 6 Posters 6.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ykuendig
    wrote on last edited by
    #41

    Probier mal so:

    ! ````
    // Im Keller nach der Waschmaschine und dem Trockner sehen
    //
    // Status der Waschmaschine und des Trockners führen
    // Stati: 0 = aus/Standby, 1 = Maschine aus/fertig / 2 = Maschine läuft
    //
    // Angepasst für 2 Waschmaschinen
    // Leistungsgrenzen im Konfig
    ! // Erstellen der Datenpunkte
    createState("javascript.0.Keller.Waschmaschine1.State", 0, {"type": "number", "role": "state"});
    createState("javascript.0.Keller.Waschmaschine1.Farbe", "white", {type: "string"});
    createState("javascript.0.Keller.Waschmaschine1.OptinSayit", false, { name: 'Optin Waschmaschine 1 Sayit',
    desc: 'Soll der Waschmaschinenstatus 1 gesprochen werden??', type: 'boolean', role: "state.enabled" });
    ! createState("javascript.0.Keller.Waschmaschine2.State", 0, {"type": "number", "role": "state"});
    createState("javascript.0.Keller.Waschmaschine3.Farbe", "white", {type: "string"});
    createState("javascript.0.Keller.Waschmaschine4.OptinSayit", false, { name: 'Optin Waschmaschine 2 Sayit',
    desc: 'Soll der Waschmaschinenstatus 2 gesprochen werden??', type: 'boolean', role: "state.enabled" });
    ! createState("javascript.0.Keller.Trockner.State", 0, {"type": "number", "role": "state"});
    createState("javascript.0.Keller.Trockner.Farbe", "white", {type: "string"});
    createState("javascript.0.Keller.Trockner.OptinSayit", false, { name: 'Optin Trockner Sayit',
    desc: 'Soll der Trocknerstatus gesprochen werden??', type: 'boolean', role: "state.enabled" });
    ! var WattWaschmaschine1 = "hm-rpc.0.XYZ7654321.2.POWER"/Waschmaschine Energy.POWER/;
    var StateWaschmaschine1 = "javascript.0.Keller.Waschmaschine1.State";
    var FarbeWaschmaschine1 = "javascript.0.Keller.Waschmaschine1.Farbe";
    var OptinSayitW1 = "javascript.0.Keller.Waschmaschine1.OptinSayit";
    ! var WattWaschmaschine2 = "hm-rpc.0.XYZ7654321.2.POWER"/Waschmaschine Energy.POWER/;
    var StateWaschmaschine2 = "javascript.0.Keller.Waschmaschine2.State";
    var FarbeWaschmaschine2 = "javascript.0.Keller.Waschmaschine2.Farbe";
    var OptinSayitW2 = "javascript.0.Keller.Waschmaschine2.OptinSayit";
    ! var WattTrockner = "hm-rpc.0.XYZ1234567.2.POWER"/Trockner Energy.POWER/;
    var StateTrockner = "javascript.0.Keller.Trockner.State";
    var FarbeTrockner = "javascript.0.Keller.Trockner.Farbe";
    var OptinSayitT = "javascript.0.Keller.Trockner.OptinSayit";
    ! var SayitID = "sayit.1.tts.text";
    var Pon = 200;
    var Poff = 2;
    var Pstby = 4;
    ! subscribe ({id: WattWaschmaschine1, change: "ne"}, checkState);
    subscribe ({id: WattWaschmaschine2, change: "ne"}, checkState);
    subscribe ({id: WattTrockner, change: "ne"}, checkState);
    ! function checkState() { // Abfrage ob Waschmaschine oder Tumbler laufen
    // Waschmaschine 1
    var StatusWaschmaschine1 = getState(StateWaschmaschine1).val;
    var LeistungWaschmaschine1 = getState(WattWaschmaschine1).val;
    if (StatusWaschmaschine1 < 2) { // Status Maschine aus
    if (LeistungWaschmaschine1 > Pon) {
    setState(StateWaschmaschine1, 2, true);
    setState(FarbeWaschmaschine1, "red", true);
    log('Script Keller-Geräte; Status: Waschmaschine 1 läuft. (' + LeistungWaschmaschine1 + "W)", "info");
    } else if (LeistungWaschmaschine1 < Pstby) {
    if (LeistungWaschmaschine1 < Poff) {
    setState(StateWaschmaschine1, 0, true);
    setState(FarbeWaschmaschine1, "blue", true);
    log("Script Keller-Geräte; Status: Waschmaschine 1 ist ausgeschaltet. (" + LeistungWaschmaschine1 + "W)", "info");
    } else {
    setState(StateWaschmaschine1, 1, true);
    setState(FarbeWaschmaschine1, "green", true);
    log("Script Keller-Geräte; Status: Waschmaschine 1 ist im Standby. (" + LeistungWaschmaschine1 + "W)", "info");
    }
    }
    } else if (StatusWaschmaschine1 === 2 || StatusWaschmaschine1 === null) {
    if (LeistungWaschmaschine1 < Pstby) {
    setState(StateWaschmaschine1, 1, true);
    setState(FarbeWaschmaschine1, "green", true);
    if (getState(OptinSayitW1).val) {
    setState(SayitID, "Die Waschmaschine Eins ist fertig.");
    }
    log("Script Keller-Geräte; Status: Waschmaschine 1 ist fertig. (" + LeistungWaschmaschine1 + "W)", "info");
    }
    }
    ! // Waschmaschine 2
    var StatusWaschmaschine2 = getState(StateWaschmaschine2).val;
    var LeistungWaschmaschine2 = getState(WattWaschmaschine2).val;
    if (StatusWaschmaschine2 < 2) { // Status Maschine aus
    if (LeistungWaschmaschine2 > Pon) {
    setState(StateWaschmaschine2, 2, true);
    setState(FarbeWaschmaschine2, "red", true);
    log('Script Keller-Geräte; Status: Waschmaschine 2 läuft. (' + LeistungWaschmaschine2 + "W)", "info");
    } else if (LeistungWaschmaschine2 < Pstby) {
    if (LeistungWaschmaschine2 < Poff) {
    setState(StateWaschmaschine2, 0, true);
    setState(FarbeWaschmaschine2, "blue", true);
    log("Script Keller-Geräte; Status: Waschmaschine 2 ist ausgeschaltet. (" + LeistungWaschmaschine2 + "W)", "info");
    } else {
    setState(StateWaschmaschine2, 1, true);
    setState(FarbeWaschmaschine2, "green", true);
    log("Script Keller-Geräte; Status: Waschmaschine 2 ist im Standby. (" + LeistungWaschmaschine2 + "W)", "info");
    }
    }
    } else if (StatusWaschmaschine2 === 2 || StatusWaschmaschine2 === null) {
    if (LeistungWaschmaschine2 < Pstby) {
    setState(StateWaschmaschine2, 1, true);
    setState(FarbeWaschmaschine2, "green", true);
    if (getState(OptinSayitW2).val) {
    setState(SayitID, "Die Waschmaschine Zwei ist fertig.");
    }
    log("Script Keller-Geräte; Status: Waschmaschine 2 ist fertig. (" + LeistungWaschmaschine2 + "W)", "info");
    }
    }
    ! // Trockner
    var StatusTrockner = getState(StateTrockner).val;
    var LeistungTrockner = getState(WattTrockner).val;
    if (StatusTrockner < 2) {
    if (LeistungTrockner > Pon) {
    setState(StateTrockner, 2, true);
    setState(FarbeTrockner, "red", true);
    log("Script Keller-Geräte; Status: Trockner läuft. (" + LeistungTrockner + "W)", "info");
    } else if (LeistungTrockner < Pstby) {
    if (LeistungTrockner < Poff) {
    setState(StateTrockner, 0, true);
    setState(FarbeTrockner, "blue", true);
    log("Script Keller-Geräte; Status: Trockner ist ausgeschaltet. (" + LeistungTrockner + "W)", "info");
    } else {
    setState(StateTrockner, 1, true);
    setState(FarbeTrockner, "green", true);
    log("Script Keller-Geräte; Status: Trockner ist im Standby. (" + LeistungTrockner + "W)", "info");
    }
    }
    } else if (StatusTrockner === 2 || StatusTrockner === null) {
    if (LeistungTrockner < Pstby) {
    setState(StateTrockner, 1, true);
    setState(FarbeTrockner, "green", true);
    if (getState(OptinSayitW).val) {
    setState(SayitID, "Der Trockner ist fertig.");
    }
    log("Script Keller-Geräte; Status: Trockner ist fertig. (" + LeistungTrockner + "W)", "info");
    }
    }
    }
    ! checkState(); // Beim Script-Start einmal durchlaufen lassen

    Ich habe zusätzlich noch die Leistungkonfig ind oberen Teil des Scripts genommen.
    
    Den Objektpfad javascript.0.Keller-Waschmaschine (ohne Nummer) kannst nun löschen.

    Gruss Yves

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SigiMOE
      wrote on last edited by
      #42

      OK prima, scheint zu klappen :-) Vielen Dank

      Zum Thema "Löschen", kann ich die mit dem roten Pfeil über den Papierkorb löschen ?

      Sind diese "unnütze" ?
      1121_2017-03-19_19-27-24.jpg

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        ykuendig
        wrote on last edited by
        #43

        Die alte Waschmaschine JA, Die Script enabled Dinger NEIN. Die braucht es für den Javascript Adapter

        Gruss Yves

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SigiMOE
          wrote on last edited by
          #44

          sehr cool vielen Dank

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          Support us

          ioBroker
          Community Adapters
          Donate
          FAQ Cloud / IOT
          HowTo: Node.js-Update
          HowTo: Backup/Restore
          Downloads
          BLOG

          285

          Online

          32.8k

          Users

          82.8k

          Topics

          1.3m

          Posts
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
          ioBroker Community 2014-2025
          logo
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Home
          • Recent
          • Tags
          • Unread 0
          • Categories
          • Unreplied
          • Popular
          • GitHub
          • Docu
          • Hilfe