Skip to content

Skripten / Logik

Hilfe zu JavaScript, Blockly, TypeScript, Node-RED, Scenes und text2command

16.5k Themen 213.3k Beiträge

NEWS

Unterkategorien


  • Hilfe für Skripterstellung mit JavaScript

    2k 49k
    2k Themen
    49k Beiträge
    R
    hier noch etwas überarbeitet und ohne Warnungen // version: 0.2.6 ////////////////////////////////////////////////// const locationName = 'wo auch immer'; ////////////////////////////////////////////////// // Schriftgrößen-Konfiguration const fontSizeCurrentLabel = '1.3rem'; const fontSizeTempBig = '3.8rem'; const fontSizeDescription = '1.1rem'; const fontSizeInfoGrid = '0.85rem'; const fontSizeSunMoon = '0.8rem'; const fontSizeHourly = '0.75rem'; const fontSizeHourlyRain = '0.65rem'; const fontSizeForecastDay = '0.75rem'; const fontSizeForecastText = '0.65rem'; const fontSizeForecastTempMax = '1rem'; const fontSizeForecastTempMin = '0.85rem'; const fontSizeForecastDetails = '0.65rem'; const version = '0.2.6'; const dpBase = 'open-meteo-weather.0.' + locationName + '.weather'; const forecast = dpBase + '.forecast'; const targetDP = '0_userdata.0.Wetter_Widget_HTML'; // Sprach-Check let sysLang = 'de'; try { const systemConfig = getObject("system.config"); sysLang = systemConfig.common.language || 'de'; } catch (e) { sysLang = 'de'; } const i18n = { de: { current: "Aktuell" }, en: { current: "Current" } }; const lang = i18n[sysLang] || i18n['en']; // DP anlegen falls nicht vorhanden if (!existsState(targetDP)) { createState(targetDP, '', { name: 'Weather Widget for VIS', type: 'string', role: 'html' }); } // ------------------------------------------------------------ // Hilfsfunktionen // ------------------------------------------------------------ // HEUTE aus JavaScript, kompakt function getToday() { const d = new Date(); const day = String(d.getDate()).padStart(2, "0"); const month = String(d.getMonth() + 1).padStart(2, "0"); const year = d.getFullYear(); return `${day}.${month}.${year}`; } function getVal(id, unit = "") { if (!existsState(id)) return "--" + unit; let state = getState(id); if (!state || state.val === null || state.val === undefined) return "--" + unit; return state.val + unit; } function getImg(id, size = "20px") { if (!existsState(id)) return ""; let state = getState(id); if (!state || !state.val) return ""; return `<img src="${state.val}" style="width:${size}; height:${size}; object-fit:contain;">`; } function getNum(id) { let s = getState(id); return (!s || s.val === null || s.val === undefined) ? null : Number(s.val); } function getSunHours(id) { let sec = getNum(id); if (sec === null) return "--h"; return (sec / 3600).toFixed(1) + "h"; } // ------------------------------------------------------------ // Hauptfunktion // ------------------------------------------------------------ function updateWeatherWidget() { // ⭐ AB HIER: ALLES UNVERÄNDERT GELASSEN let html = ` <style> @keyframes moonGlow { 0% { filter: drop-shadow(0 0 2px #fbbf24); opacity: 0.85; } 50% { filter: drop-shadow(0 0 6px #fbbf24); opacity: 1; } 100% { filter: drop-shadow(0 0 2px #fbbf24); opacity: 0.85; } } .moon-anim { animation: moonGlow 3.5s ease-in-out infinite; } .w-container { font-family: 'Segoe UI', sans-serif; background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%); color: #f1f5f9; padding: 10px; border-radius: 20px; border: 1px solid #334155; box-shadow: 0 10px 30px rgba(0,0,0,0.5); } .w-header { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr; gap: 10px; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 10px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); } .w-temp-big { font-size: ${fontSizeTempBig}; font-weight: 900; color: #fbbf24; line-height: 1; } .w-desc { font-size: ${fontSizeDescription}; color: #38bdf8; font-weight: 600; } .w-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: ${fontSizeInfoGrid}; margin-top: 10px; } .w-info-item { background: rgba(0,0,0,0.2); padding: 6px 10px; border-radius: 10px; display: flex; align-items: center; gap: 5px; } .w-sun-moon { font-size: ${fontSizeSunMoon}; line-height: 1.6; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 15px; } .w-hourly { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 10px; background: rgba(0,0,0,0.15); padding: 10px; border-radius: 15px; } .w-h-item { text-align: center; font-size: ${fontSizeHourly}; } .w-h-time { font-weight: bold; color: #38bdf8; } .w-h-temp { font-weight: bold; color: #fbbf24; display: block; } .w-h-rain { font-size: ${fontSizeHourlyRain}; color: #94a3b8; } .w-forecast { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; } .w-fc-day { background: rgba(255,255,255,0.03); padding: 12px 8px; border-radius: 18px; text-align: center; border: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; justify-content: space-between; } .w-fc-name { font-weight: bold; color: #38bdf8; font-size: ${fontSizeForecastDay}; text-transform: uppercase; margin-bottom: 2px; } .w-fc-text { font-size: ${fontSizeForecastText}; color: #94a3b8; min-height: 2.2em; display: flex; align-items: center; justify-content: center; text-align: center; margin-bottom: 5px; } .w-fc-temp-max { color: #f87171; font-weight: bold; font-size: ${fontSizeForecastTempMax}; display: block; text-align: center; } .w-fc-temp-min { color: #60a5fa; font-size: ${fontSizeForecastTempMin}; display: block; margin-bottom: 5px; text-align: center; } .w-fc-day img { margin: 2px 0 4px 0; } .w-fc-details { font-size: ${fontSizeForecastDetails}; color: #94a3b8; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 8px; padding-top: 8px; } </style> <div class="w-container"> <div class="w-header"> <div style="text-align: center;"> <div style="font-size:${fontSizeCurrentLabel}; font-weight:bold;"> ${lang.current} / ${getVal(forecast + '.day0.name_day')} </div> <div style="font-size:0.75rem; color:#94a3b8; margin-top:0;"> ${getToday()} </div> ${getImg(dpBase + '.current.icon_url', "80px")} <div class="w-desc">${getVal(dpBase + '.current.weather_text')}</div> </div> <div> <div class="w-temp-big">${getVal(dpBase + '.current.temperature_2m', " °C")}</div> <div style="font-weight:bold; margin-bottom:10px;"> <span style="color:#f87171">${getVal(forecast + '.day0.temperature_2m_max', " °C")}</span> | <span style="color:#60a5fa">${getVal(forecast + '.day0.temperature_2m_min', " °C")}</span> </div> <div class="w-info-grid"> <div class="w-info-item">💧 ${getVal(dpBase + '.current.relative_humidity_2m', "%")}</div> <div class="w-info-item">🌧️ ${getVal(forecast + '.day0.precipitation_sum', "mm")}</div> <div class="w-info-item">☀️ ${getSunHours(forecast + '.day0.sunshine_duration')}</div> <div class="w-info-item">☁️ ${getVal(dpBase + '.current.cloud_cover', "%")}</div> <div class="w-info-item">💨 Wind ${getVal(dpBase + '.current.wind_speed_10m', " km/h")}</div> <div class="w-info-item">🌬️ Böen ${getVal(dpBase + '.current.wind_gusts_10m', " km/h")}</div> </div> </div> <div class="w-sun-moon" style="position:relative;"> 🌅 ${getVal(forecast + '.day0.sunrise')}<br> 🌇 ${getVal(forecast + '.day0.sunset')}<br> 🌙 ${getVal(forecast + '.day0.moonrise')}<br> 🌘 ${getVal(forecast + '.day0.moonset')}<br> <div style="margin-top:6px;"> ${getImg(forecast + '.day0.moon_phase_icon', "34px")} <div class="moon-anim" style="font-size:0.75rem; color:#cbd5e1;"> ${getVal(forecast + '.day0.moon_phase_text')} </div> </div> <div style="margin-top:10px;"> 💨 Richtung: ${getVal(dpBase + '.current.wind_direction_text')}<br> ${getImg(dpBase + '.current.wind_direction_icon', "30px")} </div> <div style="position:absolute; bottom:-10px; right:0; font-size:0.6rem; color:#475569; opacity:0.8;"> Script Version ${version} </div> </div> </div> <div class="w-hourly"> `; // Stunden – mit Wind + Mond for (let h = 0; h <= 5; h++) { let hPath = forecast + '.hourly.next_hours.hour' + h; let isNight = getNum(hPath + '.is_day') === 0; html += ` <div class="w-h-item"> <div class="w-h-time">${getVal(hPath + '.time')}</div> ${getImg(hPath + '.icon_url', "30px")} <span class="w-h-temp">${getVal(hPath + '.temperature_2m', " °C")}</span> <span class="w-h-rain"> 🌧️${getVal(hPath + '.precipitation_probability', "%")} / ${getVal(hPath + '.precipitation', "mm")} </span> <div style="margin-top:4px; font-size:0.7rem; color:#cbd5e1;"> 💨 ${getVal(hPath + '.wind_speed_10m', " km/h")} 🌬️ ${getVal(hPath + '.wind_gusts_10m', " km/h")} </div> <div style="margin-top:2px;"> ${getImg(hPath + '.wind_direction_icon', "32px")} <span style="font-size:0.7rem; color:#94a3b8;"> ${getVal(hPath + '.wind_direction_text')} </span> </div> ${ isNight ? ` <div style="margin-top:4px;"> ${getImg(hPath + '.moon_phase_icon', "24px")} <div style="font-size:0.65rem; color:#cbd5e1;"> ${getVal(hPath + '.moon_phase_text')} </div> </div> ` : "" } </div> `; } html += ` </div> <div class="w-forecast"> `; // 6-Tage-Vorhersage for (let i = 1; i <= 6; i++) { let d = forecast + '.day' + i; html += ` <div class="w-fc-day"> <div> <div class="w-fc-name">${getVal(d + '.name_day')}</div> <div class="w-fc-text">${getVal(d + '.weather_text')}</div> ${getImg(d + '.icon_url', "50px")} <span class="w-fc-temp-max">${getVal(d + '.temperature_2m_max', " °C")}</span> <span class="w-fc-temp-min">${getVal(d + '.temperature_2m_min', " °C")}</span> </div> <div class="w-fc-details"> 🌧️ ${getVal(d + '.precipitation_sum', "mm")} (${getVal(d + '.precipitation_probability_max', "%")})<br> 💧 ${getVal(d + '.relative_humidity_2m_mean', "%")}<br> 💨 Wind ${getVal(d + '.wind_speed_10m_max', " km/h")}<br> 🌬️ Böen ${getVal(d + '.wind_gusts_10m_max', " km/h")}<br> ${getVal(d + '.wind_direction_text')}<br> ${getImg(d + '.wind_direction_icon', "32px")}<br> ${getImg(d + '.wind_gust_icon', "24px")}<br> ☀️ ${getSunHours(d + '.sunshine_duration')} </div> </div> `; } html += `</div></div>`; setState(targetDP, html, true); console.log("Weather widget: HTML successfully generated (v0.2.6-XYZ-SUN-CLOUD-C-DATE-COMPACT)."); } // Trigger updateWeatherWidget(); schedule("*/5 * * * *", updateWeatherWidget); on({id: dpBase + '.current.temperature_2m', change: 'any'}, updateWeatherWidget); on({id: forecast + '.hourly.next_hours.hour0.time', change: 'any'}, updateWeatherWidget); [image: 1770566801260-43377c6a-c836-4580-8f67-56ca3bac553b-image.png]
  • Hilfe für Skripterstellung mit Blockly

    7k 79k
    7k Themen
    79k Beiträge
    AsgothianA
    Ich denke in deinem Fall greift diese Lösung nicht. Die Lösung ist den Baustein [image: 1770589884460-screenshot-2026-02-08-at-23.31.01.png] durch das folgende Konstrukt zu ersetzen: [image: 1770590133517-screenshot-2026-02-08-at-23.35.29.png] Zusätzlich muss vor jeder anderen Ansteuerung der Aussenlampe Ecke ein [image: 1770590157266-screenshot-2026-02-08-at-23.35.55.png] gesetzt werden. A.
  • Hilfe für Skripterstellung mit Node-RED

    953 13k
    953 Themen
    13k Beiträge
    S
    welche Palette hast du installiert, damit du den "AND" Baustein hast?
  • Wifi box lautstärke

    Verschoben
    1
    0 Stimmen
    1 Beiträge
    291 Aufrufe
    Niemand hat geantwortet
  • Push per PocketControl

    Verschoben
    2
    1
    0 Stimmen
    2 Beiträge
    326 Aufrufe
    eric2905E
    Braucht es wirklich einen neuen Thread zu dem Thema? viewtopic.php?f=21&t=10778 Gruß, Eric
  • [Unerwartet Gelöst] Frage zu Lichtsteuerung per Bewegungssensor mit Skript (Blockly)

    Verschoben
    17
    1
    0 Stimmen
    17 Beiträge
    2k Aufrufe
    M
    Jungs, ich danke euch vielmals für euren Support! Und auf euer Verständnis auch auf Anfängerfragen geduldig einzugehen ;-)
  • Skript beim Systemstart unterbinden oder zumindest SayIt deaktivieren

    Verschoben
    12
    0 Stimmen
    12 Beiträge
    2k Aufrufe
    wendy2702W
    @BuZZy: @wendy2702: Sorry…Der Lach Smiley ist unangebracht und kommt ziemlich überheblich rüber! ` Ach Herrje.. Entschuldige bitte… Selbstverständlich sollte das nicht negativ gemeint sein oder ähnliches. Ich bin selber erst seit knapp 6 Monaten dabei.. Wir sind hier alle keine Professionals.. Wenn mich in der Firma jemand ruft weil eine Maschine nicht mehr läuft gehe ich auch manchmal hin und sage "Na? Hast die Maschine wieder kaputt gespielt?? :lol: " Das heißt doch nicht gleich dass ich mich über den Mitarbeiter lustig mache weil er die Maschine falsch bedient hat oder ähnliches. Ich gebe anhand der Mimik und Gestik klar zu erkennen dass es ironisch gemeint ist. (Ist wohl etwas schwer übers Internet bzgl. Mimik und Gestik :D ) Der Fehler wird dann analysiert und der Mitarbeiter bekommt zu wissen was er falsch gemacht hat. Wenn ich aber gesagt hätte "Du Trottel! Was hast du schon wieder gemacht?? :evil: " dann wäre es was anderes gewesen. Wenn man dabei "lacht" ist es norddeutscher Humor - und sollte nicht ernst genommen werden. Ich bin ein total netter Mensch und helfe immer und überall wo ich kann.. Leute die andere Menschen "schlecht" machen oder "auslachen" kriegen im echten Leben Ärger von mir. :) Kam in diesem Fall wohl total falsch rüber. Sorry nochmals dafür. Gruß ` Hi, dann sag ich mal "Sche.ß" Smileys. Etwas geschriebenes kann halt leicht falsch verstanden werden, erst recht wenn man sein gegenüber nicht kennt. Das passiert bei Unterhaltungen, erst recht Face to Face, seltener weil da noch Mimik, Gestik und Betonung dabei sind. Ich nehme eigentlich auch alles mit Humor…hatte vielleicht gestern auch einen schlechten Tag. Nix für ungut! Hoffe du kannst mir verzeihen :oops: Mirko
  • [Gelöst] Taster 2x drücken soll Aktion auslösen

    Verschoben
    24
    0 Stimmen
    24 Beiträge
    5k Aufrufe
    E
    Hallo zusammen, ich habe mir erlaubt das Skript noch mit einem dritten Druck und einer true/false Überprüfung zu erweitern. Vll kann es ja jemand brauchen: Hier der Export ! ```` <xml xmlns="http://www.w3.org/1999/xhtml"><block type="comment" id="9%#,LtcJ3[Ypi9yjAt" x="362" y="37"><field name="COMMENT">Initialisierung</field> <next><block type="variables_set" id="c1)uP|+u2k[GC!CBPH.h"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="@KwpbL?u2uRu5GAjQjh"><field name="NUM">0</field></block></value> <next><block type="comment" id="4Y}Kw8:h34T}fh.0I1"><field name="COMMENT">Triggern Tastendruck</field> <next><block type="on" id="cvy,j;|02hJ7hB?kzD]"><field name="OID">hm-rpc.0.NEQ1318448.1.PRESS_SHORT</field> <field name="CONDITION">any</field> <statement name="STATEMENT"><block type="comment" id="8]kap%V4jkWKe.)Hfjp|"><field name="COMMENT">prüfen ob schon einmal gedrückt wurde</field> <next><block type="controls_if" id="|7MIg5b@eQM??L3KZZ2c"><mutation elseif="2"></mutation> <value name="IF0"><block type="logic_compare" id="KZE7mDRq|lPUbM2xqrOW"><field name="OP">EQ</field> <value name="A"><block type="variables_get" id="?8{/u%f5gwHmHp)/RRW9"><field name="VAR">DruckZähler</field></block></value> <value name="B"><block type="math_number" id="BiB:5{|jJ@Hh9%t7I{ck"><field name="NUM">0</field></block></value></block></value> <statement name="DO0"><block type="comment" id="d,z^]GT+I0Vl/6zYlbM;"><field name="COMMENT">true false Prüfung</field> <next><block type="controls_if" id="=)Pt:^v(4@S)NyCrX3Q_"><mutation elseif="1"></mutation> <value name="IF0"><block type="logic_compare" id=",Rfjv~}N:oTtub/2_T5m"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="vjqhi=F)[Y.7UAU1s%@R"><field name="ATTR">val</field> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck1</field></block></value> <value name="B"><block type="logic_boolean" id="oSDSt@gO8B,~7Ux`HWWU"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="comment" id="t{sAcn]5:PmHIbj,mChB"><field name="COMMENT">Aktion für einmal drücken AN</field> <next><block type="variables_set" id="ujIw#@I^r8riK1m@?)J%"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="^f0*cO_P;kU|HvVp_v1y"><field name="NUM">1</field></block></value> <next><block type="timeouts_settimeout" id="BdTjcghIRtQ~:b|kH!Q:"><field name="NAME">timeout1AN</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"><block type="control" id="Uto+c93`ezXp7gWkvZw9"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck1</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="alUpOB[Ao-P]=fvRsU+m"><field name="BOOL">TRUE</field></block></value> <next><block type="variables_set" id="K?qL*xhPR*tnXvnjfDW_"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="l_QR0q9%5+k.PM]/t{,A"><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></next></block></statement> <value name="IF1"><block type="logic_compare" id="eSvTTR;;7tOw[Y8eAJ/Z"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="qj8e#2MA;G^E#z3k)_!_"><field name="ATTR">val</field> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck1</field></block></value> <value name="B"><block type="logic_boolean" id=")UJ3-ocJ(;%*Kw,g1ISZ"><field name="BOOL">TRUE</field></block></value></block></value> <statement name="DO1"><block type="comment" id="3_DgqEBjo*e(QiTry2d3"><field name="COMMENT">Aktion für einmal drücken AUS</field> <next><block type="variables_set" id="!h!a4}Z/l1PlqakPtTik"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="Z94)~7E~iZCrGbuK@.Bj"><field name="NUM">1</field></block></value> <next><block type="timeouts_settimeout" id="()qzCp8Bnm@*jV3OP]2c"><field name="NAME">timeout1AUS</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"><block type="control" id="pJp(828_C/,{#EKU+NnC"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck1</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="1-owk8DLLP(Xne:.9_oG"><field name="BOOL">FALSE</field></block></value> <next><block type="variables_set" id="MFH!{;{FHE9]M7(Tf?gO"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="z6yfI|(y/FaP3evk)%Aj"><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></next></block></statement></block></next></block></statement> <value name="IF1"><block type="logic_compare" id="(ma!2n%7ndNCg(1r*5qG"><field name="OP">EQ</field> <value name="A"><block type="variables_get" id="30kogsu9Y68pi0rLVu@A"><field name="VAR">DruckZähler</field></block></value> <value name="B"><block type="math_number" id="FOxDr~PfX[refd6{Ns]y"><field name="NUM">1</field></block></value></block></value> <statement name="DO1"><block type="controls_if" id="u3_*(93=0}!Zy_Stz6i+"><mutation elseif="1"></mutation> <value name="IF0"><block type="logic_compare" id="ve:]G8/fz~!6iOF`;e{5"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="Co,U6Vvi[3x8MD5]?omj"><field name="ATTR">val</field> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck2</field></block></value> <value name="B"><block type="logic_boolean" id="7[QEf+x`9[[CZj){xy,V"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="comment" id="H`KOFQf3a1dXYk*,a?MO"><field name="COMMENT">Aktion für zweimal drücken AN</field> <next><block type="variables_set" id="TH8--J0vG3^u{CfPFMwY"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="5)7GD%*A~GDpq@a[^g-8"><field name="NUM">2</field></block></value> <next><block type="timeouts_cleartimeout" id="{E+u;wOs/@HBWAhTi7zC"><field name="NAME">timeout1AN</field> <next><block type="timeouts_cleartimeout" id="k,I*j8|v!W7TYfd+Z^i5"><field name="NAME">timeout1AUS</field> <next><block type="timeouts_settimeout" id="[jZVj?oHs7O(6;7@LgU+"><field name="NAME">timeout2AN</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"><block type="control" id="G=Wg-%IX,87Uay-I{||X"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck2</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="A9@V.KKaUjyDlj;S64%1"><field name="BOOL">TRUE</field></block></value> <next><block type="variables_set" id="Ga*dp|5[T/YG=AmKt@7y"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="Px^Hqm=k,)Ehn6L+]R9b"><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></next></block></next></block></next></block></statement> <value name="IF1"><block type="logic_compare" id="JiLBFe-;z#cr?grp=UEV"><field name="OP">EQ</field> <value name="A"><block type="get_value" id=":NN2aYkCkjj1fAQgchLS"><field name="ATTR">val</field> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck2</field></block></value> <value name="B"><block type="logic_boolean" id="aM=@Ph-?].xJ1G)V~+uy"><field name="BOOL">TRUE</field></block></value></block></value> <statement name="DO1"><block type="comment" id="c~PDw-@!u2a3cv;.:KP?"><field name="COMMENT">Aktion für zweimal drücken AUS</field> <next><block type="variables_set" id="N}Wd?Q2`Q*Gto]+6O[E1"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="U#2EvHXc(39p!V~xx!P?"><field name="NUM">2</field></block></value> <next><block type="timeouts_cleartimeout" id="S1(-#lfhP^RhMuKqgRG0"><field name="NAME">timeout1AN</field> <next><block type="timeouts_cleartimeout" id="H*%=2dpTeCYWj.2|p_v:"><field name="NAME">timeout1AUS</field> <next><block type="timeouts_settimeout" id="^[5bZB^~:4IG#2JJ.fl7"><field name="NAME">timeout2AUS</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"><block type="control" id="T=.a#{)ZQvJ^lIfi6%-M"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck2</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="M`W:ndj=~,**yXI~;=N%"><field name="BOOL">FALSE</field></block></value> <next><block type="variables_set" id=";WrPZGQ,gRrJPfG1`?7l"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="::rs0.q]IKC0dxk?WM;}"><field name="NUM">0</field></block></value></block></next></block></statement></block></next></block></next></block></next></block></next></block></statement></block></statement> <value name="IF2"><block type="logic_compare" id="!y[u~pT{c/W:M7w67WnC"><field name="OP">EQ</field> <value name="A"><block type="variables_get" id="1}z)f3|=]pzL#3ZaIC]2"><field name="VAR">DruckZähler</field></block></value> <value name="B"><block type="math_number" id="1Yx+yff0uF_[}KOynT?P"><field name="NUM">2</field></block></value></block></value> <statement name="DO2"><block type="controls_if" id="M,Qb;lYH~r#2}p6_Z6Kt"><mutation elseif="1"></mutation> <value name="IF0"><block type="logic_compare" id="D-ris0p9MUR9Ydg_t*pU"><field name="OP">EQ</field> <value name="A"><block type="get_value" id=":mIijzNYm2A9-uoHs-CZ"><field name="ATTR">val</field> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck3</field></block></value> <value name="B"><block type="logic_boolean" id="_qL0v~`ZSgMMTgU=SD_u"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="comment" id=";1P,#/XkKAx;/)/{4:MQ"><field name="COMMENT">Aktion für dreimal drücken AN</field> <next><block type="timeouts_cleartimeout" id="Bh%(eF!@-,gNODH=_PIs"><field name="NAME">timeout1AN</field> <next><block type="timeouts_cleartimeout" id="h_[:9;OS;{l).0xq1fWT"><field name="NAME">timeout1AUS</field> <next><block type="timeouts_cleartimeout" id="B%@r;w4}22pIDws)!;de"><field name="NAME">timeout2AN</field> <next><block type="timeouts_cleartimeout" id="I.Z.;Bo#Qfwuk]o%k7d~"><field name="NAME">timeout2AUS</field> <next><block type="control" id="ajs4o}e^-KjuVmR:L}#S"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck3</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="6lS]BhOk%DE(5wI_YPHG"><field name="BOOL">TRUE</field></block></value> <next><block type="variables_set" id="u}O`YJLJq2xZxCxxgc,;"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="p)dA1s@;koPJ~/s]%C=D"><field name="NUM">0</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></statement> <value name="IF1"><block type="logic_compare" id=")4R!hd:%ScB%W)L+hBq3"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="}#}Z-yu}N[Y_,kw+a9U="><field name="ATTR">val</field> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck3</field></block></value> <value name="B"><block type="logic_boolean" id="JfO^SY#+40nhL]ozlejI"><field name="BOOL">TRUE</field></block></value></block></value> <statement name="DO1"><block type="comment" id="vB.H9u=P{kQ(mshj4fRz"><field name="COMMENT">Aktion für dreimal drücken AN</field> <next><block type="timeouts_cleartimeout" id="mCHW186_+vE/~#P=ZBWM"><field name="NAME">timeout1AN</field> <next><block type="timeouts_cleartimeout" id="1@4w#;0sJ=UDj9h7=kT1"><field name="NAME">timeout1AUS</field> <next><block type="timeouts_cleartimeout" id="UQqPuSMuMZF1%a`uboO+"><field name="NAME">timeout2AN</field> <next><block type="timeouts_cleartimeout" id="0Ivl!0GYp)9-a9s/=HVV"><field name="NAME">timeout2AUS</field> <next><block type="control" id=".Ee6V7z3o.1qkB|AfFHq"><mutation delay_input="false"></mutation> <field name="OID">javascript.0.Eigene_Variablen.Mehrfachdruck.TestDruck3</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="logic_boolean" id="3jT,x#Q]F%-1h}tGwlj,"><field name="BOOL">FALSE</field></block></value> <next><block type="variables_set" id="#fh1NQv-GBO[{8s9/F)V"><field name="VAR">DruckZähler</field> <value name="VALUE"><block type="math_number" id="bThjr]VTdwHX?DIWQYdp"><field name="NUM">0</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></statement></block></next></block></statement></block></next></block></next></block></next></block></xml> ! ```` 3950_mehrfachdruck.png
  • (eigenes/externes) node-red <-> IOBroker

    Verschoben
    5
    0 Stimmen
    5 Beiträge
    1k Aufrufe
    N
    Ok, verstehe den Aufwand dahinter und wie die Kommunikation abgewickelt wird, das macht es deutlicher.
  • Blockly Homematic Wandsender Drück-Code

    Verschoben
    8
    0 Stimmen
    8 Beiträge
    431 Aufrufe
    E
    Vielen Dank für den Export! Hast du aber auch das Problem, wenn du auf Aktualisierung triggerst, das Skript bei einem iobroker restart automatisch gestartet wird?
  • [gelöst / Workaround] Boolean Objekt per Befehl ändern

    Verschoben
    3
    0 Stimmen
    3 Beiträge
    288 Aufrufe
    K
    Ich ändere den Status per Powershell Befehl in meinem Backup Skript. habe jetzt aber eien Workaround gefunden: [image: 3467_konvertierung.png]
  • Blockly Sonnenaufgang und Untergang funktioniert nicht

    Verschoben
    7
    1
    0 Stimmen
    7 Beiträge
    2k Aufrufe
    S
    Mit diesem blockly scheint das ganz zu funktionieren :D vielen dank!!! das andere blockly wo der sonnenaufgang im trigger ist, muss ich mal schauen ob das so hinbekomm wie du gesagt hast. wenn nicht melde ich mich bestimmt noch mal :roll:
  • Thema: Scenen, Timeouts, Intervalle, Wiederholungen –> Start, Stop, Pause?

    Verschoben
    5
    4
    0 Stimmen
    5 Beiträge
    2k Aufrufe
    smileS
    Mega, das sieht besser aus. Ja Blockly hat leider nicht die Funktion die du ansprichst. Leider kann ich kein JS und mache daher alles in Blockly. Mit der Liste sieht das hervorragend aus. So hat man nur noch ein Intervall zu stoppen anstatt 6. Vielen Dank!! Das Thema Schleifen / Wiederholungen wird wohl kaum genutzt oder? Und mit dem Szenen Adapter finde ich so etwas auch schwierig zu programmieren, obwohl der ja eigentlich genau dafür gemacht sein sollte.
  • IoBroker - JavaScript Import Klassen/Funktionen/Methoden

    Verschoben
    3
    0 Stimmen
    3 Beiträge
    2k Aufrufe
    foxriver76F
    Ganz, ganz vielen Dank. Hat mir schon enorm weiter geholfen. :)
  • Universal-Codeschloss Skript Suche/Wunsch

    Verschoben
    3
    0 Stimmen
    3 Beiträge
    689 Aufrufe
    A
    dass sieht sehr danach aus. ich werde es mal Tesen. Danke!
  • JS Instanz starten und stoppen

    Verschoben
    6
    0 Stimmen
    6 Beiträge
    2k Aufrufe
    PlasmachefP
    danke für den Tipp! Ich schau mal was ich da rausbekomme …
  • Node Red Problem beim start

    Verschoben
    5
    1
    0 Stimmen
    5 Beiträge
    1k Aufrufe
    L
    Nach Deinstallation von > node-red-contrib-netatmo startet Node-red wieder normal. Das Ganze lässt sich reproduzieren, scheint also bei mir am Netatmo Modul zu liegen. Ich hatte es installiert, aber noch nicht eingerichtet.
  • Frage zur Scriptprogrammierung

    Verschoben
    7
    0 Stimmen
    7 Beiträge
    983 Aufrufe
    SteffS
    Hallo pix und AlCalzone, danke für Eure Erklärungen, hat prima funktioniert! @Pix: Das die Funktionen außerhalb des Schedule liegen sollten habe ich gestern Abend noch rausgefunden, aber da waren die Finger dann irgendwann zu lahm zum tippen und kein Kaffee mehr in der Nähe :lol: Danke nochmals Euch beiden Gruß Steffen
  • [Noch eine Frage] Neue enum.functions automatisch erstellen möglich?

    Verschoben
    7
    0 Stimmen
    7 Beiträge
    1k Aufrufe
    PeoplesP
    @paul53: Versuche es mal so: ` Ist es auch Möglich die Inhalte des Objekts auf existenz zu prüfen? bspw. enum.function.meinGewerk und ich will abfragen ob:" javascript.0.test.testdurchlauf" vorhanden ist. Möchte das gerne verwenden um beim ersten Scriptdurchlauf die Warnings zu unterdrücken. Habe da was mit:```` (object.toSource());
  • Blockly und timeout

    Verschoben
    12
    0 Stimmen
    12 Beiträge
    4k Aufrufe
    S
    ich hab es jetzt so gemacht und es funktioniert ganz gut 6377_blockly.jpg
  • Rolladen mit Block Steuern

    Verschoben
    5
    0 Stimmen
    5 Beiträge
    990 Aufrufe
    snotechS
    @kxn: Hi snotech, was für Rolladen steuerst du damit? Ich hab Funkrollos von Jarolift (433Mhz) und scheinbar kann man die nicht über broadlink steuern! Ich kann aber in Iobroker alle Signale anleren -auf -ab -stop und pair. Wenn ich jetzt den Rollo auf einlernen stelle und dann die pair taste über iobroker auslöse geht das, dann kann ich z.b. den Rollo auf fahren und dann stop drücken, aber danach geht nix mehr. Der reagiert auf kein Signal mehr. Es gibt wohl wieder eine extra bridge dafür, aber ist das nicht anders zu lösen. z.b. RF sender für mein pi? ` Ich habe verschiedene Systeme. Habe aber die einzelnen Buttons in den Objekten bei Broadlink angelernt und sie funktionieren :) Gruß SNO
  • Blocky Beleuchtung mit externen Schalter

    Verschoben
    3
    0 Stimmen
    3 Beiträge
    400 Aufrufe
    L
    Ich hole mal etwas mehr aus, und zwar habe ich mir ein Vis erstellt welches ich durch durch drücken einzelner Buttons von mir programmierten Stimmungen, An bzw Ausschaltet. Wenn ich nun Manuel per Fernbedienung z.b. die helligkeit ändere bekommt das momentan mein VIS nicht mit und der Button bleibt auch An stehen obwohl diese Stimmung ja nicht mehr ist. Und da habe ich ein denk Fehler wie das realisieren kann. Das problem was ich mit meinem Programm habe das, das Blocky Programm wahrscheinlich schneller Durchläuft als das die Tradfri Datenpunkte aktualisiert sind, also denkt der Blocky Script es ist immer noch False und schaltet sofort wieder False ein. Also sehr unsauber Programmiert
  • Blockly Intervall alle *X* Min ausführen

    Verschoben
    2
    1
    0 Stimmen
    2 Beiträge
    620 Aufrufe
    E
    Hat nicht vll jemand ne Idee wie ich das Lösen könnte? Gerne auch mit einem anderen Ansatz.

421

Online

32.6k

Benutzer

82.3k

Themen

1.3m

Beiträge