Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. miggedy

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 43
    • Best 1
    • Groups 1

    miggedy

    @miggedy

    Starter

    1
    Reputation
    50
    Profile views
    43
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    miggedy Follow
    Starter

    Best posts made by miggedy

    • RE: [gelöst] Bildschirm abdunkeln

      Ja, mit vcgencmd funktioniert es. Danke!

      Hat mich noch einiges an Zeit gekostet den entsprechenden Befehl dort per SSH hin zu senden, aber nun klappt es.

      Wer ähnliches versuchen möchte:

      • Auf iobroker raspberry per SSH anmelden
      • Zu iobroker User wechseln:
      sudo su iobroker -s /bin/bash
      
      • keys generieren:
      ssh-keygen
      
      • keys auf Ziel Host kopieren (user und IP Adresse des Zielrechners):
      ssh-copy-id <user>@<MonitorIP>
      
      • Dann im iobroker script mit exec Befehl senden:
      exec("ssh '<user>@<MonitorIP>' vcgencmd display_power 0");
      
      posted in Visualisierung
      M
      miggedy

    Latest posts made by miggedy

    • RE: Test Withings v0.0.x

      @tombox Bei mir crashed die Instanz beim Start. Vielleicht weil ich mehrere Benutzer in meinem Withings-Account habe? Wie man im HTML des logs sieht kommt nach dem Login eine Abfrage von Withings welchen Profil man laden möchte (welcher womöglich nicht kommt wenn man nur eine Person in seinem Account hat). Ziel des Adapters sollte natürlich sein die Daten von allen Profilen zu laden.

      (Anyonymisiertes) Log:

      host.iobroker-pi4
      2022-01-06 17:24:48.121	warn	Do not restart adapter system.adapter.withings.0 because restart loop detected
      host.iobroker-pi4
      2022-01-06 17:24:48.121	error	instance system.adapter.withings.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
      host.iobroker-pi4
      2022-01-06 17:24:48.121	error	Caught by controller[2]: at Withings.onReady (/opt/iobroker/node_modules/iobroker.withings/main.js:62:9)
      host.iobroker-pi4
      2022-01-06 17:24:48.120	error	Caught by controller[2]: at Withings.login (/opt/iobroker/node_modules/iobroker.withings/main.js:134:22)
      host.iobroker-pi4
      2022-01-06 17:24:48.120	error	Caught by controller[2]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
      host.iobroker-pi4
      2022-01-06 17:24:48.120	error	Caught by controller[2]: at /opt/iobroker/node_modules/iobroker.withings/main.js:155:77
      host.iobroker-pi4
      2022-01-06 17:24:48.120	error	Caught by controller[2]: TypeError: Cannot read property 'split' of undefined
      host.iobroker-pi4
      2022-01-06 17:24:48.119	error	Caught by controller[1]: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
      host.iobroker-pi4
      2022-01-06 17:24:48.119	error	Caught by controller[0]: at Withings.onReady (/opt/iobroker/node_modules/iobroker.withings/main.js:62:9)
      host.iobroker-pi4
      2022-01-06 17:24:48.119	error	Caught by controller[0]: at Withings.login (/opt/iobroker/node_modules/iobroker.withings/main.js:134:22)
      host.iobroker-pi4
      2022-01-06 17:24:48.119	error	Caught by controller[0]: at processTicksAndRejections (internal/process/task_queues.js:97:5)
      host.iobroker-pi4
      2022-01-06 17:24:48.118	error	Caught by controller[0]: at /opt/iobroker/node_modules/iobroker.withings/main.js:155:77
      host.iobroker-pi4
      2022-01-06 17:24:48.118	error	Caught by controller[0]: TypeError: Cannot read property 'split' of undefined
      host.iobroker-pi4
      2022-01-06 17:24:48.113	error	Caught by controller[0]: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
      
      withings.0
      2022-01-06 17:24:47.552	silly	States user redis pmessage withings.0.*/withings.0.info.connection:{"val":false,"ack":true,"ts":1641486287548,"q":0,"from":"system.adapter.withings.0","user":"system.user.admin","lc":1641485890382}
      
      withings.0
      2022-01-06 17:24:47.492	warn	Terminated (UNCAUGHT_EXCEPTION): Without reason
      
      withings.0
      2022-01-06 17:24:47.491	debug	Plugin sentry destroyed
      
      withings.0
      2022-01-06 17:24:47.489	info	terminating
      
      withings.0
      2022-01-06 17:24:47.466	error	Cannot read property 'split' of undefined
      
      withings.0
      2022-01-06 17:24:47.465	error	TypeError: Cannot read property 'split' of undefined at /opt/iobroker/node_modules/iobroker.withings/main.js:155:77 at processTicksAndRejections (internal/process/task_queues.js:97:5) at Withings.login (/opt/iobroker/node_modules/iobroker.withings/main.js:134:22) at Withings.onReady (/opt/iobroker/node_modules/iobroker.withings/main.js:62:9)
      
      withings.0
      2022-01-06 17:24:47.454	error	unhandled promise rejection: Cannot read property 'split' of undefined
      
      withings.0
      2022-01-06 17:24:47.452	error	Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
      
      withings.0
      2022-01-06 17:24:47.449	debug	{"date":"Thu, 06 Jan 2022 16:24:47 GMT","server":"Apache","content-security-policy":"frame-ancestors 'self' https://healthmate.withings.com/ https://care.withings.com/ https://care.us.withingsmed.com/","strict-transport-security":"max-age=10368000","x-xss-protection":"1","x-content-type-options":"nosniff","referrer-policy":"strict-origin-when-cross-origin","cache-control":"no-store","set-cookie":["session_key=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=withings.com","session_is_verified=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=withings.com","cookie_2fa_validation_key=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=withings.com","ns_af=DhwiD832nkkfj2; path=/; HttpOnly; Secure; SameSite=Lax"],"location":"/oauth2_user/account_login?response_type=code&client_id=<myClientId>&state=h4fhjnc2daoc3m&scope=user.activity%2Cuser.metrics%2Cuser.info&redirect_uri=http%3A%2F%2Flocalhost&b=authorize2&b=user_select","x-frame-options":"ALLOW-FROM https://healthmate.withings.com/","content-length":"0","content-type":"text/html; charset=UTF-8","connection":"close"}
      
      withings.0
      2022-01-06 17:24:47.207	debug	"<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<!-- aaf8d2b4 -->\n\t\t<title>Wählen Sie einen Nutzer aus</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\">\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t\t<link rel=\"shortcut icon\" href=\"/favicon.png\" type=\"image/x-icon\">\n\n\t\t<link rel=\"apple-touch-icon\" href=\"/favicon.png\" sizes=\"57x57\">\n\t <link rel=\"apple-touch-icon\" href=\"/favicon.png\" sizes=\"72x72\">\n\t <link rel=\"apple-touch-icon\" href=\"/favicon.png\" sizes=\"76x76\">\n\t <link rel=\"apple-touch-icon\" href=\"/favicon.png\" sizes=\"114x114\">\n\t <link rel=\"apple-touch-icon\" href=\"/favicon.png\" sizes=\"120x120\">\n\t <link rel=\"apple-touch-icon\" href=\"/favicon.png\" sizes=\"144x144\">\n\t <link rel=\"apple-touch-icon\" href=\"/favicon.png\" sizes=\"152x152\">\n\n\t\t\t\t\t<link href=\"/min/g=baseCSS&amp;aaf8d2b4\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\">\n\t\t\t<link href=\"/min/g=blockCSS&amp;aaf8d2b4\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\">\n\t\t\n\t\t<script type=\"text/javascript\"src=\"/js/libs/analytics.js\"></script>\n\n\t\t<script></script>\n\t\t\t</head>\n\t<body>\n\t\t\t\t\t\t\t\t\t<!-- COOKIE BAR-->\n\t\t\t\t\t<div id=\"cookies\">\n <div class=\"cookie-container\">\n <div class=\"cookie-body\">\n <span class=\"title header1\">Before you continue</span>\n <p class=\"cookie-message body1\">Durch das Anklicken oder Navigieren auf dieser Website stimmen Sie unserer Verwendung von Cookies zu, die wir benutzen, um Ihnen ein besseres Erlebnis und individuelle Werbung unserer Partner bieten zu können.</p>\n <div class=\"cookie-dropdown\">\n <div class=\"dropdown-title\">\n <div class=\"checkbox-component no-mt\">\n <input id=\"essential_cookie\" type=\"checkbox\" name=\"essential_cookie\" checked disabled class=\"HMIcons_check\">\n <label for=\"essential_cookie\">Essential cookies</label>\n </div>\n <span class=\"icon HMIcons_downsm\"></span>\n </div>\n <div class=\"content\">\n <p class=\"bodyRegular\">They enable you to move around the website properly. They do not store any personally identifiable information and enable features such as accessing secure areas of the website or remembering what is in your shopping cart. They are mandatory for withings.com to operate.</p>\n </div>\n </div>\n <div class=\"cookie-dropdown\">\n <div class=\"dropdown-title\">\n <div class=\"checkbox-component no-mt\">\n <input id=\"analytics_cookie\" type=\"checkbox\" name=\"analytics_cookie\" class=\"HMIcons_check\">\n <label for=\"analytics_cookie\">Analytical cookies</label>\n </div>\n <span class=\"icon HMIcons_downsm\"></span>\n </div>\n <div class=\"content\">\n <p class=\"bodyRegular\">They allow us to collect information about how visitors use our website. For instance, we may see the total number of visits, or which pages visitors go to most often. We use this information to make sure our users find the information they are looking for, help monitor website performance indicators and solve potential bugs.</p>\n </div>\n </div>\n <div class=\"action-wrapper\">\n <div class=\"button-component no-mt\">\n <button class=\"accept-selection\">Accept selected</button>\n </div>\n <div class=\"button-component no-mt\">\n <button class=\"accept-all primary\">Accept all and close</button>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<script src=\"/js/helpers/utils.js\"></script>\n<script>\n const cookiesWrapper = document.querySelector('#cookies');\n const dropDownTitles = cookiesWrapper.querySelectorAll('.dropdown-title');\n const buttons = cookiesWrapper.querySelectorAll('.action-wrapper button');\n const analyticBox = cookiesWrapper.querySelector('input#analytics_cookie');\n\n const sections = [];\n const margin = 15;\n\n // Constants\n const COOKIE_STATISTICS = 'cookieconsent_statistics';\n\tconst COOKIE_ADVERTISING = 'cookieconsent_advertising';\n\tconst COOKIE_SOCIAL = 'cookieconsent_social';\n\tconst COOKIE_WITHINGS_DISMISSED = 'withings_cookieconsent_dismissed';\n\n buttons.forEach(btn => btn.addEventListener('click', (e) => onSubmit(e)));\n cookiesWrapper.addEventListener('click', onOverlayClick);\n\n window.addEventListener('resize', closeAllSections, false);\n\n dropDownTitles.forEach((el, index) => {\n const currentContent = el.nextElementSibling;\n sections.push({ el, content: currentContent });\n\n el.addEventListener('click', (e) => toggleDropDown(e, index));\n });\n\n if (getCookie(COOKIE_STATISTICS)) {\n analyticBox.setAttribute('checked', true);\n }\n\n function closeAllSections() {\n if (!sections) return;\n\n sections.forEach((section, i) => {\n if (!section.el.classList.contains('active')) return;\n\n section.el.classList.remove('active');\n section.content.style.height = 0;\n });\n }\n\n function closeCookieModal() {\n setCookie(COOKIE_WITHINGS_DISMISSED, 'yes');\n cookiesWrapper.classList.remove('active');\n };\n\n function onUserDontConsent() {\n setCookie(COOKIE_STATISTICS, false);\n\t\tsetCookie(COOKIE_ADVERTISING, false);\n\t\tsetCookie(COOKIE_SOCIAL, false);\n }\n\n function onSubmit(e) {\n const { target: currentButtonClicked } = e;\n const isAllAccepted = currentButtonClicked && currentButtonClicked.classList.contains('accept-all');\n\n // If the checkbox is checked or the user clicked on the accept all button\n if (analyticBox.checked || isAllAccepted) {\n // Accept the analytics cookie\n setCookie(COOKIE_STATISTICS, true);\n window.location.reload();\n } else {\n onUserDontConsent();\n }\n\n closeCookieModal();\n };\n\n function toggleDropDown(e, index) {\n if (e && e.target.tagName === \"INPUT\") return;\n\n e.preventDefault();\n\n const { content: currentContent, height } = sections[index];\n\n const currentSection = sections[index].el;\n currentSection.classList.toggle('active');\n\n const isActive = currentSection.classList.contains('active');\n if (isActive) return currentContent.style.height = `${currentContent.scrollHeight + margin}px`;\n return currentContent.style.height = 0;\n };\n\n function onOverlayClick(e) {\n // Clicked on modal => return\n if (e.target.id !== 'cookies') return;\n\n // Clicked on overlay => continue\n // Close the modal and set essential cookie to true\n onUserDontConsent();\n closeCookieModal();\n };\n</script>\t\t\t\t<!-- END COOKIE BAR-->\n\t\t\t\t\t\n\t\t\t\t\t<div class=\"app-wrapper-component\">\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t<div class=\"sidebar-component \">\n\t\t\t\t\t<div class=\"sidebar-content sidebar-full \">\n\t\t\t\t\t\t<div class=\"page-title\">\n\t\t\t\t\t\t\t\t<h1 class=\"header1\">Wählen Sie einen Nutzer aus</h1>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div id=\"user_selection\">\n\t\t<div class=\"user-selection-content\">\n\t\t\t<div class=\"button-component small\">\n\t\t\t\t\t\t\t\t\t<a href=\"/logout?r=https%3A%2F%2Faccount.withings.com%2Foauth2_user%2Fuser_select%3Fresponse_type%3Dcode%26client_id%3D<myClientId>%26state%3Dh4fhjnc2daoc3m%26scope%3Duser.activity%252Cuser.metrics%252Cuser.info%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%26b%3Dauthorize2\">Sind das nicht Sie?</a>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\n\t\t\t<ul class=\"list-component\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"?response_type=code&amp;client_id=<myClientId>&amp;state=h4fhjnc2daoc3m&amp;scope=user.activity%2Cuser.metrics%2Cuser.info&amp;redirect_uri=http%3A%2F%2Flocalhost&amp;b=authorize2&amp;selecteduser=1362620\" class=\"list-group-item\">Name User 1</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"?response_type=code&amp;client_id=<myClientId>&amp;state=h4fhjnc2daoc3m&amp;scope=user.activity%2Cuser.metrics%2Cuser.info&amp;redirect_uri=http%3A%2F%2Flocalhost&amp;b=authorize2&amp;selecteduser=1362621\" class=\"list-group-item\">Name User 2</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"?response_type=code&amp;client_id=<myClientId>&amp;state=h4fhjnc2daoc3m&amp;scope=user.activity%2Cuser.metrics%2Cuser.info&amp;redirect_uri=http%3A%2F%2Flocalhost&amp;b=authorize2&amp;selecteduser=11622612\" class=\"list-group-item\">Name User 3</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"?response_type=code&amp;client_id=<myClientId>&amp;state=h4fhjnc2daoc3m&amp;scope=user.activity%2Cuser.metrics%2Cuser.info&amp;redirect_uri=http%3A%2F%2Flocalhost&amp;b=authorize2&amp;selecteduser=19700099\" class=\"list-group-item\">Name User 4</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\n\t\t\t\t\t</div>\n\t</div>\n\n\t\t\t\t\t\t<div class=\"footer-component\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"image-view-component\">\n\t\t\t\t\t<img src=\"/images/withings/side_picture.png\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\n\n\t\t\t\t\t<script type=\"text/javascript\" src=\"/min/g=baseJS&amp;aaf8d2b4\"></script>\n\t\t\n\t\t<script type=\"text/javascript\">\n\t\t\twiService.sessionid = \"1bIq1pnOa2KzF-1t8PLfys-WsBOsEtm\";\n\t\t\tconstants.REV = \"aaf8d2b4\";\n\t\t\tconstants.COOKIE_CONSENT_DOMAIN = \"withings.com\";\n\t\t\tconst IS_PARTNER = false;\n\n\t\t\t\n\t\t\t// TODO: rework this script. Disabled because lost focus on mobile phone\n\t\t\t// Prevent autofill to stick to the inputs on scrolling sidebar\n\t\t\t// const hasInputOnPage = document.querySelector('input');\n\n\t\t\t// if (hasInputOnPage) {\n\t\t\t// \tconst sidebar = document.querySelector('.sidebar-component');\n\n\t\t\t// \tif (sidebar) {\n\t\t\t// \t\tsidebar.addEventListener('scroll', () => {\n\t\t\t// \t\t\tconst activeInput = document.querySelector('input:focus');\n\t\t\t// \t\t\tif (activeInput) activeInput.blur();\n\t\t\t// \t\t});\n\t\t\t// \t}\n\t\t\t// }\n\t\t</script>\n\t\t\t</body>\n</html>\n"
      
      withings.0
      2022-01-06 17:24:46.075	debug	/oauth2_user/account_login?response_type=code&client_id=<myClientId>&state=h4fhjnc2daoc3m&scope=user.activity%2Cuser.metrics%2Cuser.info&redirect_uri=http%3A%2F%2Flocalhost&b=authorize2
      
      
      posted in Tester
      M
      miggedy
    • RE: "iobroker upgrade self" not working [SOLVED]

      I tested the manual installation @thomas-braun mentioned (npm install...) and this worked. I'm now on 3.3.5 and running iobroker upgrade self now doesn't show any errors anymore (just that it's up-to-date).

      In case this happens again for the next update I will try the different repo @crunchip mentioned.
      Thank you both for your support.

      posted in Error/Bug
      M
      miggedy
    • RE: "iobroker upgrade self" not working [SOLVED]

      No, nothing is running anymore. That command doesn't return anything.
      Maybe also interesting:
      While iobroker is not running, these commands also fail (but work if iobroker is running):

       pi@iobroker-pi4:~ $ iobroker repo list
      No connection to databases possible ...
      Cannot get list: Error: Connection is closed.
      pi@iobroker-pi4:~ $ iobroker upgrade
      No connection to databases possible ...
      No repositories defined.
      /opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js:982
                              for (const name of Object.keys(links)) {
                                                        ^
      
      TypeError: Cannot convert undefined or null to object
          at Function.keys (<anonymous>)
          at /opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js:982:51
          at Immediate.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js:2615:37)
          at processImmediate (internal/timers.js:463:21)
      pi@iobroker-pi4:~ $
      
      posted in Error/Bug
      M
      miggedy
    • RE: "iobroker upgrade self" not working [SOLVED]

      Thanks @thomas-braun, sadly this didn't help.

      pi@iobroker-pi4:~ $ iobroker repo list
      stable      : http://download.iobroker.net/sources-dist.json
      beta        : http://download.iobroker.net/sources-dist-latest.json
      
      Active repo: beta
      pi@iobroker-pi4:~ $ iobroker update
      ...
      pi@iobroker-pi4:~ $ iobroker upgrade
      ...
      pi@iobroker-pi4:~ $ iobroker stop
      pi@iobroker-pi4:~ $ iobroker upgrade self
      No connection to databases possible ...
       redis get system.host.iobroker-pi4.alive, error - Connection is closed.
      No repositories defined.
      Cannot get repository under "undefined"
      
      
      posted in Error/Bug
      M
      miggedy
    • "iobroker upgrade self" not working [SOLVED]
      Systemdata Bitte Ausfüllen
      Hardwaresystem: Pi3
      Arbeitsspeicher: 4GB
      Festplattenart: SD-Karte
      Betriebssystem: Ubuntu
      Node-Version: 12.20.0
      Nodejs-Version: 12.20.0
      NPM-Version: 6.14,.8
      Installationsart: Skript

      System is running without any issues but upgrading it not working. I'm on js-controller 3.2.16 and if I execute iobroker upgrade self I get the following output:

      pi@iobroker-pi4:~ $ iobroker upgrade self
      No connection to databases possible ...
       redis get system.host.iobroker-pi4.alive, error - Connection is closed.
      No repositories defined.
      Cannot get repository under "undefined"
      pi@iobroker-pi4:~ $
      
      posted in Error/Bug
      M
      miggedy
    • RE: statistics Adapter keine Objekte

      Hab das gleiche Problem und deswegen mal ein issue auf github aufgemacht (https://github.com/foxthefox/ioBroker.statistics/issues/50).
      Hast du mittlerweile eine Lösung gefunden?

      mswiege created this issue in foxthefox/ioBroker.statistics

      closed No objects created #50

      posted in Skripten / Logik
      M
      miggedy
    • RE: [gelöst] SetState schreibt was anderes als übergeben

      Jetzt hatte ich gerade noch einen Geistesblitz: Was ist wenn vielleicht im Hintergrund eine zweite Instanz des Scriptes parallel läuft mit einem älteren Code den ich wärend der Entwicklung gestartet habe und mir ständig meinen korrekten neuen Status überschreibt und ich denke nur, dass mein Script verrückt spielt? Das würde auch erklären, warum ich das Verhalten nicht in 100% der Fälle sehe, sondern nur zu 50%.

      Also mal den ganzen PI neugestartet um sicher zu gehen, dass alle Prozess frisch sind...

      Und Zack: Problem ist weg. 🤦

      Danke trotzdem!

      posted in Skripten / Logik
      M
      miggedy
    • RE: [gelöst] SetState schreibt was anderes als übergeben

      @AlCalzone said in SetState schreibt was anderes als ihr übergeben wurde:

      .toFixed(0)

      Wenn ich .toFixed(0) anfüge, kommt sogar ein JS error, wil toFixed() nicht auf einen String angewendet werden kann. Ist also bereits ein String. Die Methode baut nämlich auch bereits einen String zusammen:

      function getWalktime(i, json) {
          let departure = json.journeys[i].legs[0].departure;
          departure = moment(departure).subtract(10, "minute");
      
          let departureDiff = moment.duration(departure.diff(moment())).minutes();
          return `<span style='color:${departureDiff < 0 ? "red" : departureDiff < 5 ? "green" : "white"}'>${departure.format(moment.HTML5_FMT.TIME)} (${departureDiff})</span>`;
      }
      

      Hab sicherheitshalber da jetzt auch mal ein .toFixed(0) an das departureDiff gemacht (auch wenn es irgendwie alles keinen Sinn macht), aber auch das resultiert in das gleiche Ergebnis. Log Ausgabe korrekt, im state mit Nachkommastellen.

      Echt verrückt! 😉

      posted in Skripten / Logik
      M
      miggedy
    • [gelöst] SetState schreibt was anderes als übergeben

      Hallo,
      ich habe ein sehr seltsames Problem (wie ich finde) und komme nicht drauf wo das Problem liegt.
      Ich erstelle einen String der ein HTML-Table ist und schreibe diesen dann per SetState in einen state um es dann in der vis anzuzeigen.
      Der Code ist einfach das hier:

        	let json = JSON.parse(getState(JSON_ID).val);
              const TABLE =  `<table width='100%'>\n \
                          <thead>\n \
                              <tr>\n \
                                  <td>&#128646;</td><td>&#128034;</td><td>&#127919;</td><td>&#128694;</td>\n \
                              </tr>\n \
                          </thead>\n \
                          <tr>\n \
                              <td>${getDeparture(0,json)}</td><td>${getDelay(0,json)}</td><td>${getArrival(0,json)}</td><td>${getWalktime(0,json)}</td>\n \
                          </tr>\n \
                          <tr>\n \
                              <td>${getDeparture(1,json)}</td><td>${getDelay(1,json)}</td><td>${getArrival(1,json)}</td><td>${getWalktime(1,json)}</td>\n \
                          </tr>\n \
                          <tr>\n \
                              <td>${getDeparture(2,json)}</td><td>${getDelay(2,json)}</td><td>${getArrival(2,json)}</td><td>${getWalktime(2,json)}</td>\n \
                          </tr>\n \
                      </table>`;
              log ("TABLE: " + TABLE);
      	setState(oid, TABLE);
      

      Wie man sieht, schreibe ich am Ende das "Ergbnis" ins log und da steht dann auch der von mir erwartete String:

      TABLE: <table width='100%'> <thead> <tr> <td>&#128646;</td><td>&#128034;</td><td>&#127919;</td><td>&#128694;</td> </tr> </thead> <tr> <td>12:10</td><td><span style='color:red'>2</span></td><td>12:29</td><td><span style='color:red'>12:00 (-7)</span></td> </tr> <tr> <td>12:28</td><td><span style='color:white'>0</span></td><td>12:49</td><td><span style='color:white'>12:18 (10)</span></td> </tr> <tr> <td>12:48</td><td><span style='color:white'>0</span></td><td>13:09</td><td><span style='color:white'>12:38 (30)</span></td> </tr> </table>
      

      Im Objekt-Browser (sowie in der vis die einfach nur diesen state als HTML anzeigt) steht aber folgendes:

      <table width='100%'>
                           <thead>
                               <tr>
                                   <td>&#128646;</td><td>&#128034;</td><td>&#127919;</td><td>&#128694;</td>
                               </tr>
                           </thead>
                           <tr>
                               <td>12:10</td><td><span style='color:red'>2</span></td><td>12:29</td><td><span style='color:red'>12:00 (-7.000216666666667)</span></td>
                           </tr>
                           <tr>
                               <td>12:28</td><td><span style='color:green'>0</span></td><td>12:49</td><td><span style='color:white'>12:18 (10.999766666666666)</span></td>
                           </tr>
                           <tr>
                               <td>12:48</td><td><span style='color:green'>0</span></td><td>13:09</td><td><span style='color:white'>12:38 (30.999766666666666)</span></td>
                           </tr>
                       </table>
      

      Man siehe diese vielen Nachkommastellen rechts in der Tabelle die vorher nicht da waren. Wie kann sowas passieren? Übergebe das ganze Ding doch als String, wie schafft es das JS innerhalb von setState da so einen Rundungsfehler rein zu bekommen? Passiert übrigens nicht immer, in ca. 50% der Fälle passt es, dann sind auch im Objekt die gerundeten Werte.

      Was ich auch schon probiert habe aber mit gleichem Ergebnis, ist dass ich den String vorher kopiert habe, um sicher zu gehen, dass das String replacement nicht doch irgendwie innerhalb von setState noch mal ausgeführt wird und dann was anderes rauskommt. Also auch wenn ich das hier mache, ist es im log richtig, im Objekt aber mit Nachkommastellen:

          let test = JSON.parse(JSON.stringify(TABLE));
          log ("TABLE: " + test);
          setState(oid, test);
      
      posted in Skripten / Logik
      M
      miggedy
    • RE: Netzwerk Traffic überwachen/prüfen

      Das ist der gesamte Traffic auf die IP des iobrokers, also auch empfangene Daten.

      posted in ioBroker Allgemein
      M
      miggedy
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo