Switch Widget - kein Update des Switch Widget (longpoll Problem)

Begonnen von throbin, 09 April 2017, 20:02:59

Vorheriges Thema - Nächstes Thema

throbin

Hi,

ich kämpfe gerade mit dem Beispiel aus dem Wiki (4-fach Schalter aus https://wiki.fhem.de/wiki/FTUI_Widget_Switch). Ich verwende drei Schalter um drei Zustände eines Dummy zu schalten:


<div class="row">
    <div data-type="switch" data-device="dHomeStatus" data-get-off="!on" data-get-on="home" data-set-off="" class="green" data-icon="fa-home"
        data-background-icon="fa-square"></div>
    <div data-type="label" class="inline darker w1x">Home</div>

    <div data-type="switch" data-device="dHomeStatus" data-get-off="!on" data-get-on="away" data-set-off="" class="blue" data-icon="fa-car"
        data-background-icon="fa-square"></div>
    <div data-type="label" class="inline darker w1x">Kurzurlaub</div>

    <div data-type="switch" data-device="dHomeStatus" data-get-off="!on" data-get-on="holiday" data-set-off="" class="orange" data-icon="fa-suitcase"
        data-background-icon="fa-square"></div>
    <div data-type="label" class="inline darker w1x">Urlaub</div>
</div>


Leider wird der Status bei mir nicht aktualisiert, d.h. alle die Zustände werden an FHEM zwar korrekt übermittelt, aber die Icons bleiben im Zustand "ON". Das Widget ist das einzige auf meiner Seite.
Was muss man machen, damit die Icons beim Umschalten aktualisiert werden?
Mit F5 (Browser update) werden die Icons korrekt angezeigt...

MKeY

ist bei dir in der fhem.cfg attr WEB longpoll 1 gesetzt?

https://wiki.fhem.de/wiki/FHEM_Tablet_UI

0: Longpoll deaktiviert; alle 30s ein Shortpoll (Neuladen der gesamten Statusänderungen)

1: Longpoll aktiv; geänderte Stati werden sofort aktualisiert, zusätzlich werden alle 15min die gesamten Statusänderungen geladen.
Wer Fehler findet, darf sie behalten!
RPi's, D1Mini
Homematic, Hue, Sonoff, Alexa, Xiaomi, ConBee
Prusa MK2.5, Prusa MK3S (MMU2S vorhanden, aber nervtötend)
Lowrider 2CNC

throbin

Hi, die Parameter sind wie folgt definiert:

longpoll ist aktiv: in FHEM steht longpoll auf 1

in TabletUI: <meta name="longpoll" content="1">


MKeY

Hmm, wenn du danach ein shutdown restart gemacht hast (nach dem Setzen von Longpoll in der cfg) kann ich dir leider nicht weiterhelfen
dein Code funktioniert bei mir ohne Probleme  :(
Wer Fehler findet, darf sie behalten!
RPi's, D1Mini
Homematic, Hue, Sonoff, Alexa, Xiaomi, ConBee
Prusa MK2.5, Prusa MK3S (MMU2S vorhanden, aber nervtötend)
Lowrider 2CNC

throbin

Ok, ich habe mal die Ausgabe der Java-Script-Console von Chrome angehängt.
Folgendes wird ausgegeben, sobald ich den Zustand (Schalter) über die TabletUI ändere:

fhem-tablet-ui.js:1720 start shortpoll in (ms):900000
fhem-tablet-ui.js:1720 send to FHEM: set dHomeStatus home

Als Ergebnis wird der Schalter aktiviert, aber der andere bleibt immer noch an. Anschließend kommen Health-Checks. Auch neustart hat nicht geholfen. Auf anderen Seiten funktioniert es aber. Eventuell liegt es am Pagebutton???

Die Zeit: No longpoll event since 1489177748.255secondes
ist sehr merkwürdig

Die Meldung: ajax lomgpoll responseURL= scheint auch falsch zu sein...


fhem-tablet-ui.js:1360 --------- start healthCheck --------------
fhem-tablet-ui.js:1361 now: Mon Apr 10 2017 21:28:57 GMT+0200 (Mitteleuropäische Sommerzeit)
fhem-tablet-ui.js:1362 FTUI version: 2.6.15
fhem-tablet-ui.js:1363 Longpoll: true
fhem-tablet-ui.js:1364 Longpoll type: ajax
fhem-tablet-ui.js:1365 Longpoll objects there: true
fhem-tablet-ui.js:1366 Longpoll curent line: 0
fhem-tablet-ui.js:1367 Longpoll last event before: 17235 Tag(e) 20 Stunde(n) 28 Minute(n) 57 Sekunde(n)
fhem-tablet-ui.js:1368 Longpoll last reading update before: 17235 Tag(e) 20 Stunde(n) 28 Minute(n) 57 Sekunde(n)
fhem-tablet-ui.js:1369 Shortpoll interval: 900
fhem-tablet-ui.js:1370 Shortpoll last run before: 59 Sekunde(n)
fhem-tablet-ui.js:1371 FHEM dev/par count: 4
fhem-tablet-ui.js:1372 FTUI known devices count: 18
fhem-tablet-ui.js:1373 Page length: 29070
fhem-tablet-ui.js:1374 Widgets count: 21
fhem-tablet-ui.js:1375 --------- end healthCheck ---------------
fhem-tablet-ui.js:1720 No longpoll event since 1489177737.136secondes -> restart polling
fhem-tablet-ui.js:1720 start shortpoll in (ms):1000
fhem-tablet-ui.js:1720 FTUI is online
fhem-tablet-ui.js:1720 restartLongpoll
fhem-tablet-ui.js:1720 stopLongpoll
fhem-tablet-ui.js:1720 Error while longpoll: abort: abort
fhem-tablet-ui.js:1720 restartLongpoll
fhem-tablet-ui.js:1720 stopLongpoll
fhem-tablet-ui.js:1720 start shortpoll
fhem-tablet-ui.js:1720 send to FHEM: jsonlist2 WEB,dHomeStatus STATE longpoll setList
fhem-tablet-ui.js:1720 start shortpoll in (ms):900000
fhem-tablet-ui.js:767 get jsonlist2: 12.8ms
fhem-tablet-ui.js:1720 shortpoll: fhemJSON.Results.length=2
fhem-tablet-ui.js:1720 update done for "dHomeStatus:STATE"
fhem-tablet-ui.js:1720 shortPoll - Done
fhem-tablet-ui.js:852 read jsonlist2: 14.2ms
fhem-tablet-ui.js:1720 Page became visible again -> start healthCheck in 3 secondes
fhem-tablet-ui.js:1720 startLongpoll: true
fhem-tablet-ui.js:1720 startLongpoll: true
fhem-tablet-ui.js:1720 longpoll: websockets not supportetd or not activated > fall back to AJAX
fhem-tablet-ui.js:1720 Longpoll started
fhem-tablet-ui.js:1720 ajax lomgpoll responseURL=
fhem-tablet-ui.js:1720 ajax longpol  statusText=
fhem-tablet-ui.js:1720 longpoll: websockets not supportetd or not activated > fall back to AJAX
fhem-tablet-ui.js:1360 --------- start healthCheck --------------
fhem-tablet-ui.js:1361 now: Mon Apr 10 2017 21:29:08 GMT+0200 (Mitteleuropäische Sommerzeit)
fhem-tablet-ui.js:1362 FTUI version: 2.6.15
fhem-tablet-ui.js:1363 Longpoll: true
fhem-tablet-ui.js:1364 Longpoll type: ajax
fhem-tablet-ui.js:1365 Longpoll objects there: true
fhem-tablet-ui.js:1366 Longpoll curent line: 0
fhem-tablet-ui.js:1367 Longpoll last event before: 17235 Tag(e) 20 Stunde(n) 29 Minute(n) 8 Sekunde(n)
fhem-tablet-ui.js:1368 Longpoll last reading update before: 17235 Tag(e) 20 Stunde(n) 29 Minute(n) 8 Sekunde(n)
fhem-tablet-ui.js:1369 Shortpoll interval: 900
fhem-tablet-ui.js:1370 Shortpoll last run before: 9 Sekunde(n)
fhem-tablet-ui.js:1371 FHEM dev/par count: 4
fhem-tablet-ui.js:1372 FTUI known devices count: 18
fhem-tablet-ui.js:1373 Page length: 29299
fhem-tablet-ui.js:1374 Widgets count: 21
fhem-tablet-ui.js:1375 --------- end healthCheck ---------------
fhem-tablet-ui.js:1720 No longpoll event since 1489177748.255secondes -> restart polling
fhem-tablet-ui.js:1720 restartLongpoll
fhem-tablet-ui.js:1720 stopLongpoll
fhem-tablet-ui.js:1720 Error while longpoll: abort: abort
fhem-tablet-ui.js:1720 restartLongpoll
fhem-tablet-ui.js:1720 stopLongpoll
fhem-tablet-ui.js:1720 startLongpoll: true
fhem-tablet-ui.js:1720 startLongpoll: true
fhem-tablet-ui.js:1720 longpoll: websockets not supportetd or not activated > fall back to AJAX
fhem-tablet-ui.js:1720 Longpoll started
fhem-tablet-ui.js:1720 ajax lomgpoll responseURL=
fhem-tablet-ui.js:1720 ajax longpol  statusText=
fhem-tablet-ui.js:1720 longpoll: websockets not supportetd or not activated > fall back to AJAX
fhem-tablet-ui.js:1360 --------- start healthCheck --------------
fhem-tablet-ui.js:1361 now: Mon Apr 10 2017 21:29:56 GMT+0200 (Mitteleuropäische Sommerzeit)
fhem-tablet-ui.js:1362 FTUI version: 2.6.15
fhem-tablet-ui.js:1363 Longpoll: true
fhem-tablet-ui.js:1364 Longpoll type: ajax
fhem-tablet-ui.js:1365 Longpoll objects there: true
fhem-tablet-ui.js:1366 Longpoll curent line: 0
fhem-tablet-ui.js:1367 Longpoll last event before: 17235 Tag(e) 20 Stunde(n) 29 Minute(n) 56 Sekunde(n)
fhem-tablet-ui.js:1368 Longpoll last reading update before: 17235 Tag(e) 20 Stunde(n) 29 Minute(n) 56 Sekunde(n)
fhem-tablet-ui.js:1369 Shortpoll interval: 900
fhem-tablet-ui.js:1370 Shortpoll last run before: 57 Sekunde(n)
fhem-tablet-ui.js:1371 FHEM dev/par count: 4
fhem-tablet-ui.js:1372 FTUI known devices count: 18
fhem-tablet-ui.js:1373 Page length: 29608
fhem-tablet-ui.js:1374 Widgets count: 21
fhem-tablet-ui.js:1375 --------- end healthCheck ---------------
fhem-tablet-ui.js:1720 No longpoll event since 1489177796.524secondes -> restart polling
fhem-tablet-ui.js:1720 restartLongpoll
fhem-tablet-ui.js:1720 stopLongpoll
fhem-tablet-ui.js:1720 Error while longpoll: abort: abort
fhem-tablet-ui.js:1720 restartLongpoll
fhem-tablet-ui.js:1720 stopLongpoll


Gruß
throbin