[HMdeviceTools.js (hm.js)] WebUI zur Register-Konfiguration/Templatehandling

Begonnen von frank, 03 Januar 2020, 01:49:01

Vorheriges Thema - Nächstes Thema

Otto123

Hallo Frank,

danke für die umfangreiche Erklärung :) und die Bestätigung: Ich habe eigentlich nichts verkehrt gemacht ;)
Ich habe es quasi sogar verstanden 😂
Zitatdie position (ganz, ganz weit rechts  :)) habe ich absichtlich so gewählt, da sie wahrscheinlich eher für "poweruser"
Wobei der normale User da derzeit fast verloren hat (auf Grund des Fehlers) Temporär Hinweis einblenden? Geht so was einfach im js ?

Aber: Ja! Die Position ist an sich schon logisch, ist mir auch gestern schon klar geworden. ;)

Na ich bin gespannt wie es weitergeht.

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

frank

hallo martin.

1. ich habe gerade entdeckt, dass der befehl "set hminfo templateSet"  nicht wirklich nach der beschreibung in der commandRef funktioniert.

ZitattemplateSet <entity> <template> <peer:[long|short]> [<param1> ...]
sets a bunch of register accroding to a given template. Parameter may be added depending on the template setup.
templateSet will collect and accumulate all changes. Finally the results are written streamlined.
entity: peer is the source entity. Peer needs to be given if a peer behabior beeds to be copied
template: one of the programmed template
peer: [long|short]:if necessary a peer needs to be given. If no peer is used enter '0'. with a peer it should be given whether it is for long or short keypress
param: number and meaning of parameter depends on the given template
Example could be (templates not provided, just theoretical)

    set hm templateSet Licht1 staircase FB1:short 20
    set hm templateSet Licht1 staircase FB1:long 100

Restrictions:

    User must ensure to read configuration prior to execution.
    templateSet may not setup a complete register block but only a part if it. This is up to template design.


der befehlsabschnitt "<peer:[long|short]>" erwartet scheinbar "peer:both", wenn es sich um ein "normales" template für "short AND long" handelt, denn mit:

set hminfo templateSet SwitchUP01 genUP2 self01

erhalte ich den fehler: "give :[short|long|both] with peer, not self01 self01,". mit folgendem befehl scheint es zu funktioniere:

set hminfo templateSet SwitchUP01 genUP2 self01:both

wahrscheinlich ist nur die commandref falsch. allerdings könnte es auch ein fehler in hminfo sein, da der type=both für das template eigentlich überflüssig ist, weil es ja in hminfo bekannt sein sollte.

der befehlsteil "<peer:[long|short]>" existiert ebenfalls noch bei "set templateDel", "set templateDef fromMaster" und "get templateChk". das beispiel bei templateChk:

set hm templateChk -f RolloNord BlStopUpLg peerName # RolloNord peerName, long and short

lässt mich aber vermuten, das es eventuell doch ein fehler in hminfo ist.
für "basic"-templates mit peer=0 wird ja zb auch nur der peer angegeben.

vielleicht könntest du dich dazu mal äussern.


2. immer noch fehlende set tplSet_ befehle
ich habe hier https://forum.fhem.de/index.php/topic,107137.0.html neulich eine vermutung kund getan.
könntest du dir das mal anschauen?


gruss frank
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

frank

moin otto.

im ersten post gibt es ein update.

rev 2004 25.02.2020
    fix: probleme mit templates vom typ "both"
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

frank

moin,
neues update im 1. post.

    rev 2005 04.04.2020
        fix: probleme bei der erkennung von genutzten templates mit langen namen
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

frank

moin,
für die vielen ungeduldigen user endlich wieder ein update im 1. post.  :)

rev 2006 29.05.2020
    new: template nutzung für single-channel-peers
    fix: some bugs
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

frank

neues update im ersten post.

neu:
hm.js heisst nun HMdeviceTools.js.
wenn HMinfoTools.js HMdeviceTools.js entdeckt, integriert es dort die entsprechenden icons.
dadurch ist der code deutlich reduziert und die icons inklusive deren verhalten sind immer identisch mit HMinfoTools.

nicht vergessen:
im webif das "attr JavaScripts" anpassen, also hm.js ändern zu HMdeviceTools.js.
hm.js kann dann auch gelöscht werden.
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

frank

FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

locodriver

Guten Morgen.

Ich habe hm.js durch HMdeviceTools.js ersetzt. Allerdings bleibt bei mir die Zeile "HMdeviceTools" überall leer.

Die Dateien sind in www so abgelegt:

-rwxrwxrwx  1 fhem dialout  85650 Nov 23 10:21 HMdeviceTools.js
-rwxrwxrwx  1 fhem dialout  62739 Nov 23 10:31 HMinfoTools.js


In WEB habe ich:

   JavaScripts codemirror/fhem_codemirror.js pgm2/HMdeviceTools.js

Und hmInfo sieht so aus:

Internals:
   CFGFN     
   FUUID      619cb92c-f33f-b425-1f09-916ade6ec86fcbec
   NAME       HMinfo
   NOTIFYDEV  global
   NR         1090
   NTFY_ORDER 49-HMinfo
   STATE      updated:2021-11-23 10:35:17
   TYPE       HMinfo
   Version    01
   READINGS:
     2018-01-07 13:32:01   CRIT__protocol  -
     2021-11-23 10:35:17   CRI__protocol   0
     2021-04-30 19:05:11   C_sumDefined    entities:75,device:25,channel:65,virtual:16
     2021-11-23 10:35:17   ERR_IODev       HMLAN1:19,myHmUART:5,
     2021-11-23 10:35:17   ERR__protocol   0
     2020-06-25 09:02:33   ERR__unreachable 0
     2021-11-23 10:35:17   ERR_battery     0
     2021-11-23 10:35:17   ERR_cfgState    PeerVerf:2,TempChk:2,
     2021-11-14 12:26:14   ERR_sabotageError on:1,
     2021-11-23 10:35:17   I_actTotal      alive:18,dead:0,unkn:2,off:0
     2017-02-20 20:41:21   I_autoReadPend  0
     2021-11-23 10:35:17   I_rssiMinLevel  59<:3 60>:3 80>:3 99>:0
     2021-11-13 17:41:14   I_sum_battery   ok:10,
     2021-11-23 10:35:17   I_sum_motor     stop:on:7,
     2021-11-14 12:26:14   I_sum_sabotageError off:3,on:1,
     2021-11-23 10:35:17   W__protocol     0
     2021-11-23 10:35:17   lastErrChange   updated:2021-11-23 10:35:17
   helper:
     autoUpdate 13500
     cfgChkResult configCheck done:-ret--ret- peer not verified. Check that peer is set on both sides-ret-    WZ_Hk0_WindowRec: p:virSEC-ret-    WZ_Hk1_WindowRec: p:virSEC-ret--ret- templist mismatch-ret-    WZ_Hk0_Clima: failed Entries:-ret-     WZ_Hk0_Clima: R_0_tempListSat mismatch 07:30 17.0 09:00 21.0 16:00 17.0 20:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk0_Clima: R_1_tempListSun mismatch 07:30 17.0 09:00 21.0 16:00 17.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk0_Clima: R_2_tempListMon mismatch 07:00 17.0 09:00 21.0 16:00 17.0 20:00 21.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk0_Clima: R_3_tempListTue mismatch 07:00 17.0 09:00 17.0 16:00 17.0 20:00 21.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk0_Clima: R_4_tempListWed mismatch 07:00 17.0 09:00 21.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk0_Clima: R_5_tempListThu mismatch 07:00 17.0 09:00 21.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk0_Clima: R_6_tempListFri mismatch 06:00 17.0 09:00 17.0 17:00 17.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-    WZ_Hk1_Clima: failed Entries:-ret-     WZ_Hk1_Clima: R_0_tempListSat mismatch 07:30 17.0 09:00 21.0 16:00 17.0 20:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk1_Clima: R_1_tempListSun mismatch 07:30 17.0 09:00 21.0 16:00 17.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk1_Clima: R_2_tempListMon mismatch 07:00 17.0 09:00 21.0 16:00 17.0 20:00 21.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk1_Clima: R_3_tempListTue mismatch 07:00 17.0 09:00 17.0 16:00 17.0 20:00 21.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk1_Clima: R_4_tempListWed mismatch 07:00 17.0 09:00 21.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk1_Clima: R_5_tempListThu mismatch 07:00 17.0 09:00 21.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-     WZ_Hk1_Clima: R_6_tempListFri mismatch 06:00 17.0 09:00 17.0 17:00 17.0 20:00 17.0 22:00 21.0 24:00 17.0 ne 14:00 17.0 16:00 17.0 19:00 21.0 21:30 21.0 24:00 17.0 ##-ret-
     weekplanListDef ./FHEM/tempList.cfg
     weekplanListDir ./FHEM/
     weekplanList:
       BD_Hk4_Clima
       BD_Regler_Climate
       WZ_Hk0_Clima
       WZ_Hk1_Clima
       Früh
       Tag
       Spät
       Nacht
       UrlaubUnterwegs
       UrlaubZuhause
   nb:
     cnt        2
Attributes:
   alias      HM Geräteinfos
   autoArchive 1
   autoLoadArchive 1_load
   autoUpdate 03:45
   configDir  ./FHEM
   group      Tools
   icon       icoTool
   room       085System
   sumERROR   battery:ok,sabotageError:off,powerError:ok,overload:off,overheat:off,reduced:off,motorError:no,error:none,uncertain:yes,smoke_detect:none,cover:closed,IODev:ok,cfgState:ok
   sumStatus  battery,sabotageError,powerError,motor
   webCmd     protoEvents:rssi:peerXref:configCheck:models


Fhem habe ich neu gestartet...

Wo "steckt" der Fehler...?
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

frank

ZitatWo "steckt" der Fehler...?
im attr JavaScripts fehlt HMinfoTools.js.
vermutlich so:
   JavaScripts codemirror/fhem_codemirror.js pgm2/HMdeviceTools.js pgm2/HMinfoTools.js

edit:
ZitatFhem habe ich neu gestartet...
das ist nicht nötig.
ein reload der webseite sollte reichen. im handy eventuell die app beenden und neu starten.
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

locodriver

Dankeschön, manchmal sieht man den Wald vor lauter Bäumen nicht...

Jetzt versucht fhem immer einen Reconnect, wenn ich Hminfo aufrufe und der Status ist:"waiting for problems..."

Beim Aufruf eines HM-Gerätes kommt diese Meldung:
"HMinfoTools.js line 1116:
TypeError: vcculist is undefined"
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

locodriver

HMinfo listet jetzt alles auf - das dauert wohl ein wenig... die Reconnects sind auch weg.

Das besteht leider immer noch:

ZitatBeim Aufruf eines HM-Gerätes kommt diese Meldung:
"HMinfoTools.js line 1116:
TypeError: vcculist is undefined"
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

frank

ok, 3 probleme.

1. connection lost
welchen browser nutzt du?
hast du im webdevice attr longpoll=websocket gesetzt?
werden die reconnects beendet, wenn du die seite neu lädst?

2. "waiting for problems..."
ohne erkannte probleme ist der zustand normal.
probleme ermittelt hminfo immer über "set hminfo update". das kann man entweder immer mal wieder manuell auslösen, oder automatisch durchführen lassen => siehe HMinfoTools beschreibung => attr hminfo autoUpdate

3. probiere die neue HMinfoTools.js v2002
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

locodriver

zu 1.: Problem hat sich erledigt (s.o.), websocket war gesetzt, Browser FF 94.0.2

zu 2.: zeigt jetzt alle Geräte an, autoUpdate auf 10 Minuten gesetzt

zu 3.: mache ich gleich...
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

locodriver

Mit der 2002 funzt es...

Dankeschön für die schnelle Unterstützung.
fhem 6.0 auf Rpi3 Bookworm
HM-LAN-CFG (FW 0.965), HM-MOD-UART, 2x HM-TC-IT-WM-W-EU, 4x HM-Sec-RHS und 3x HM-CC-RT-DN, 6x HM-LC-Bl1-FM mit je 1x Somfy-Motor,
2x HM-LC-SW2-FM für Licht und Lüfter, 2x HM-PB-6-WM55, Alexa, Jeelinkcross, CUL, CUNO2, IR-Blaster

frank

prima, dass es nun tut.
dann warst du bisher der erste, der eine detailseite von einem device aufgerufen hat, das kein prefered io nutzt.
ein oder mehrere prefered io bei "stationären" devices zu setzen, ist übrigens sehr sinnvoll. zb wegen load verteilung.
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html