Javascript Editor einbinden

Begonnen von papa, 18 Februar 2014, 20:30:04

Vorheriges Thema - Nächstes Thema

abc2006

Jupp, besser :-)
Danke für den schnellen fix 8)

Grüße
Stephan
FHEM nightly auf Intel Atom (lubuntu) mit VDSL 50000 ;-)
Nutze zur Zeit OneWire und KNX

papa

Könnte das dann jemand mal einchecken ?
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

rudolfkoenig

Laut MAINTAINER.txt ist rapster dafuer zustaendig, also nicht irgendjemand.

rapster


krikan

Zitat von: justme1968 am 13 April 2016, 16:02:15
.... es scheint ein problem zu geben wenn man codemirror und das neue perlSynatxCheck feature gemeinsam verwendet.

scheinbar wird unter bestimmten bedingungen nicht mehr der text aus codemirror verwendet sondern der im dahinterliegende text feld. ich tippe auf ein timing problem oder ähnliches beim überschreiben der event handler.
...
Bei mir ergibt sich leider auch ein Problem im Zusammenspiel codemirror und perlSyntaxCheck. Wurde hier https://forum.fhem.de/index.php/topic,52319.msg440652.html#msg440652 detaillierter von einem andern Nutzer beschrieben. Ich kann derzeit nur codemirror oder perlSyntaxCheck nutzen. Falls ich über den verlinkten Thread hinaus Problembeschreibungen liefern soll oder irgendetwas ausprobieren/testen soll/darf, bitte melden.

Gruß, Christian

rapster

Hi Christian,

bei mir ist perlSyntaxCheck ebenfalls aktiviert, allerdings treten bei mir keine Probleme bzgl. Codemirror auf.

Was hast du denn unter FHEMWEB codemirrorParam stehen?
Welchen Browser verwendest du?
Welche Probleme treten genau auf?

Wäre gut wenn ich das ganze irgendwie Nachstellen könnte :-)

Gruß
Claudiu

abc2006

codemirrorParam: { "lineWrapping":true }
Browser Firefox 45.0.1 und Chrome Version 49.0.2623.110 unknown (64-bit)

Probleme:
https://forum.fhem.de/index.php/topic,52319.msg440819.html#msg440819

Wenn du noch mehr Infos brauchst, sag Bescheid.
Grüße
Stephan

FHEM nightly auf Intel Atom (lubuntu) mit VDSL 50000 ;-)
Nutze zur Zeit OneWire und KNX

rapster

Hallo Stephan,

wie sieht dein FHEMWEB Attribut "JavaScripts" aus?

Es sollte zumindest so aussehen:
attr TYPE=FHEMWEB JavaScripts codemirror/fhem_codemirror.js

abc2006

Hi, screenshot anbei.
ich denke das ist korrekt.

Mit deinem Code kann ich nicht viel anfangen, ich verstehe zwar, was der Befehl machen würde (allen Devices vom Typ FHEMWEB das attribut zuordnen), also vermute ich, dass meine Definition korrekt ist, aber wie wäre denn der Weg (ausser einen Screenshot zu posten), dass ich selbst prüfen kann, ob das bei mir so ist (und das nicht anderen (=dir) überlassen muss)?

Abweichend davon ist codemirror bei mir auch nur einem FHEMWEB zugeordnet, nämlich WEB. Die anderen brauchen das nicht.

Viele Grüße
Stephan
FHEM nightly auf Intel Atom (lubuntu) mit VDSL 50000 ;-)
Nutze zur Zeit OneWire und KNX

rapster

Um selbst zu prüfen ob eine Konfiguration korrekt ist, hilft am besten die Commandref, das Wiki, oder das Forum.
In diesem Fall findet man die gesuchten Infos unter diesen beiden Links: http://www.fhemwiki.de/wiki/Konfiguration#Integrierter_Editor http://fhem.de/commandref_DE.html#FHEMWEB

Allerdings schaut bei dir alles soweit OK aus, jetzt stellt sich natürlich die Frage warum bei dir (und manch anderem) Probleme mit Codemirror auftreten...

Kannst du mir ein Beispiel Device Posten bei dem es zu Problemen kommt, da du sagtest es tritt nicht immer auf?

Hierzu ist ein "list" im Codeblock besser geeignet als ein Screenshot, also in der fhem-Befehlszeile "list devicename" eingeben.

Gruß
Claudiu

abc2006

Hi, ich glaube du hast mich falsch verstanden,
es ging nicht darum zu prüfen, ob die config allgemein korrekt ist, sondern ob mein Systemzustand mit dem von dir abgefragten Zustand ( attr ... ) übereinstimmt. Im DEF-Editor sehe ich ja immer nur einen Teil ( das TYPE=) zum beispiel ja nicht.


Hier das list eines Devices, bei dem das problem auftrat (es trat bei ALLEN Devices dieses Typs (Homematic Wired) auf:


Internals:
   DEF        0000D125_19
   IODev
   MODEL      HMW_IO_12_Sw7_DR
   NAME       HMW03.O07_Leuchte_Dusche_Decke
   NR         258
   PeerList
   STATE      off
   TYPE       HM485
   chanNo     19
   device     HMW03.HMW_IO_12_Sw7_DR_LEQ0233076
   Readings:
     2016-04-17 21:32:46   R-logging       on
     2016-04-18 10:43:37   state           off
     2016-04-18 10:43:37   working         off
   Devhash:
     DEF        0000D125
     FW_VERSION 3.06
     FailedConfigReads 0
     IODev      MyHMLAN
     MODEL      HMW_IO_12_Sw7_DR
     NAME       HMW03.HMW_IO_12_Sw7_DR_LEQ0233076
     NR         239
     STATE      ACK
     TYPE       HM485
     channel_01 HMW03.I01
     channel_02 HMW03.I02
     channel_03 HMW03.I03
     channel_04 HMW03.I04
     channel_05 HMW03.I05
     channel_06 HMW03.I06
     channel_07 HMW03.I07
     channel_08 HMW03.I08
     channel_09 HMW03.I09
     channel_10 HMW03.I10
     channel_11 HMW03.I11
     channel_12 HMW03.I12
     channel_13 HMW03.O01_Leuchte_Esszimmer_Decke
     channel_14 HMW03.O02_Leuchte_Buero_Decke
     channel_15 HMW03.O03_Leuchte_Dachboden_Decke
     channel_16 HMW03.O04_Leuchte_Wohnzimmer_Decke
     channel_17 HMW03.O05_Leuchte_Wegelicht_Decke
     channel_18 HMW03.O06_Leuchte_Kueche_Decke
     channel_19 HMW03.O07_Leuchte_Dusche_Decke
     Readings:
       2016-04-17 21:32:46   R-central_address 00000001
       2016-04-17 21:32:46   R-logging_time  2.00
       2016-04-18 10:54:01   configStatus    PENDING
       2016-04-18 11:47:30   state           ACK
     Cache:
       Linkparams:
         Actuator:
           address_start 857
           address_step 6
           channel_param channel
           channels   01 02 03 04 05 06 07 08 09 10 11 12
           count      27
           peer_param actuator
           type       link
           Parameter:
             Actuator:
               hidden     1
               operations none
               Logical:
                 type       address
               physical:
                 HASH(0x26ffe88)
                 HASH(0x26fff60)
             Channel:
               hidden     1
               operations none
               Logical:
                 default    255
                 max        255
                 min        0
                 type       integer
               Physical:
                 interface  eeprom
                 size       1
                 type       integer
                 Address:
                   index      0
         Sensor:
           address_start 45
           address_step 28
           channel_param channel
           channels   13 14 15 16 17 18 19
           count      29
           peer_param sensor
           type       link
           Parameter:
             Channel:
               hidden     1
               operations none
               Logical:
                 default    255
                 max        255
                 min        0
                 type       integer
               Physical:
                 interface  eeprom
                 size       1
                 type       integer
                 Address:
                   index      5
             Long_action_type:
               Logical:
                 type       option
                 option:
                   HASH(0x27075b0)
                   HASH(0x27075f8)
               Physical:
                 interface  eeprom
                 size       0.1
                 type       integer
                 Address:
                   index      17
             Long_jt_off:
               Logical:
                 type       option
                 option:
                   HASH(0x2707850)
                   HASH(0x27078b0)
                   HASH(0x27078f8)
                   HASH(0x2707940)
                   HASH(0x2707988)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      26.9
             Long_jt_offdelay:
               Logical:
                 type       option
                 option:
                   HASH(0x27097a8)
                   HASH(0x27097f0)
                   HASH(0x2709838)
                   HASH(0x2709880)
                   HASH(0x27098e0)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      26.6
             Long_jt_on:
               Logical:
                 type       option
                 option:
                   HASH(0x2709b98)
                   HASH(0x2709be0)
                   HASH(0x2709c28)
                   HASH(0x2709c88)
                   HASH(0x2709cd0)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      26.3
             Long_jt_ondelay:
               Logical:
                 type       option
                 option:
                   HASH(0x2709f88)
                   HASH(0x2709fd0)
                   HASH(0x270a030)
                   HASH(0x270a078)
                   HASH(0x270a0c0)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      26
             Long_multiexecute:
               Logical:
                 default    1
                 type       boolean
               Physical:
                 interface  eeprom
                 size       0.1
                 type       integer
                 Address:
                   index      17.2
             Long_off_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    16383000
                 max        982980
                 min        0
                 type       float
                 unit       s
                 Special_value:
                   id         not_used
                   value      16383000
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      24
             Long_off_time_mode:
               Logical:
                 type       option
                 option:
                   HASH(0x270b820)
                   HASH(0x270b868)
               Physical:
                 interface  eeprom
                 size       0.1
                 type       integer
                 Address:
                   index      17.6
             Long_offdelay_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    0
                 max        982980
                 min        0
                 type       float
                 unit       s
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      22
             Long_on_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    16383000
                 max        982980
                 min        0
                 type       float
                 unit       s
                 Special_value:
                   id         not_used
                   value      16383000
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      20
             Long_on_time_mode:
               Logical:
                 type       option
                 option:
                   HASH(0x270fb50)
                   HASH(0x270fb98)
               Physical:
                 interface  eeprom
                 size       0.1
                 type       integer
                 Address:
                   index      17.7
             Long_ondelay_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    0
                 max        982980
                 min        0
                 type       float
                 unit       s
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      18
             Long_toggle_use:
               Conversion:
                 type       option_integer
                 Value_map:
                   1:
                     device_value 3
                     from_device 1
                     parameter_value 0
                     to_device  1
                   2:
                     device_value 2
                     from_device 1
                     parameter_value 1
                     to_device  1
                   3:
                     device_value 0
                     from_device 1
                     parameter_value 2
                     to_device  1
               Logical:
                 type       option
                 option:
                   HASH(0x2710078)
                   HASH(0x27100d8)
                   HASH(0x2710120)
               Physical:
                 interface  eeprom
                 size       0.2
                 type       integer
                 Address:
                   index      17.4
             Sensor:
               hidden     1
               operations none
               Logical:
                 type       address
               physical:
                 HASH(0x2710420)
                 HASH(0x27104f8)
             Short_action_type:
               Logical:
                 type       option
                 option:
                   HASH(0x2710678)
                   HASH(0x27106c0)
               Physical:
                 interface  eeprom
                 size       0.1
                 type       integer
                 Address:
                   index      6
             Short_jt_off:
               Logical:
                 type       option
                 option:
                   HASH(0x2712430)
                   HASH(0x2712490)
                   HASH(0x27124d8)
                   HASH(0x2712520)
                   HASH(0x2712568)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      15.9
             Short_jt_offdelay:
               Logical:
                 type       option
                 option:
                   HASH(0x2712820)
                   HASH(0x2712868)
                   HASH(0x27128b0)
                   HASH(0x27128f8)
                   HASH(0x2712958)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      15.6
             Short_jt_on:
               Logical:
                 type       option
                 option:
                   HASH(0x2712c10)
                   HASH(0x2712c58)
                   HASH(0x2712ca0)
                   HASH(0x2712d00)
                   HASH(0x2712d48)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      15.3
             Short_jt_ondelay:
               Logical:
                 type       option
                 option:
                   HASH(0x2713000)
                   HASH(0x2713048)
                   HASH(0x27130a8)
                   HASH(0x27130f0)
                   HASH(0x2713138)
               Physical:
                 endian     little
                 interface  eeprom
                 read_size  2
                 size       0.3
                 type       integer
                 Address:
                   index      15
             Short_off_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    16383000
                 max        982980
                 min        0
                 type       float
                 unit       s
                 Special_value:
                   id         not_used
                   value      16383000
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      13
             Short_off_time_mode:
               Logical:
                 type       option
                 option:
                   HASH(0x2715750)
                   HASH(0x2715798)
               Physical:
                 interface  eeprom
                 size       0.1
                 type       integer
                 Address:
                   index      6.6
             Short_offdelay_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    0
                 max        982980
                 min        0
                 type       float
                 unit       s
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      11
             Short_on_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    16383000
                 max        982980
                 min        0
                 type       float
                 unit       s
                 Special_value:
                   id         not_used
                   value      16383000
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      9
             Short_on_time_mode:
               Logical:
                 type       option
                 option:
                   HASH(0x2716cb0)
                   HASH(0x2716cf8)
               Physical:
                 interface  eeprom
                 size       0.1
                 type       integer
                 Address:
                   index      6.7
             Short_ondelay_time:
               Conversion:
                 1:
                   factors    0.1,1,60,1000
                   type       float_configtime
                   value_size 1.6
                 2:
                   type       integer_integer_map
                   Value_map:
                     device_value 49152
                     mask       49152
                     parameter_value 65535
               Logical:
                 default    0
                 max        982980
                 min        0
                 type       float
                 unit       s
               Physical:
                 endian     little
                 interface  eeprom
                 size       2
                 type       integer
                 Address:
                   index      7
             Short_toggle_use:
               Conversion:
                 type       option_integer
                 Value_map:
                   1:
                     device_value 3
                     from_device 1
                     parameter_value 0
                     to_device  1
                   2:
                     device_value 2
                     from_device 1
                     parameter_value 1
                     to_device  1
                   3:
                     device_value 0
                     from_device 1
                     parameter_value 2
                     to_device  1
               Logical:
                 type       option
                 option:
                   HASH(0x27171d8)
                   HASH(0x2717238)
                   HASH(0x2717280)
               Physical:
                 interface  eeprom
                 size       0.2
                 type       integer
                 Address:
                   index      6.4
             Ui_hint:
               Logical:
                 default
                 type       string
                 use_default_on_failure 1
               Physical:
                 id         ui_hint
                 interface  store
                 save_on_change 1
                 type       string
       Peers:
         Sensors:
           0:
             Sensor:
               channel    255
Attributes:
   DbLogExclude .*
   building   S_Haus
   floor      S_OG
   model      HMW_IO_12_Sw7_DR
   room       HM485
   subType    switch
   userattr   building building_map floor floor_map room_map structexclude




Hier das list eines notify, bei dem das problem auftrat (es trat bei allen von mir probierten notifys auf, dass ich attribute (room) nicht ändern konnte und die DEF nicht modifizieren:

Internals:
   DEF        D_MischerPID.* {
my $tuwas = 0;
my $cnt = ReadingsVal("D_MischerWert","state","0");
if ( ReadingsVal("DS18B20_VorlaufHK","temperature","100") > 45){
$tuwas = -100;
} else {
$tuwas = int(ReadingsVal("PID.FUBO","actuation","0")/10);
}
$cnt += $tuwas;
if ($tuwas >= 1)
{
# waermer
fhem "
        set HMW01.O01_Mischer_kalt off;
        set HMW01.O02_Mischer_warm on-for-timer $tuwas;
        set D_MischerWert $cnt;
        "
}
elsif ($tuwas <= 1)
{
$tuwas = abs($tuwas);
# kaelter
fhem "
        set HMW01.O02_Mischer_warm off;
        set HMW01.O01_Mischer_kalt on-for-timer $tuwas;
        set D_MischerWert $cnt;
        "
}
}
   NAME       N_changeVL
   NR         206
   NTFY_ORDER 50-N_changeVL
   REGEXP     D_MischerPID.*
   STATE      2016-04-18 11:55:42
   TYPE       notify
   Readings:
     2016-04-18 10:53:50   state           active
     2016-04-17 21:38:58   tuwas           0
Attributes:
   disable    0
   room       Heizung,_notify
   userReadings tuwas { ReadingsVal("MischerPID","state","0")/10; }


Und dann vollständigerweise noch ein Device, bei dem es *NICHT* auftrat (ich also das attr. ändern konnte)

Internals:
   BTN        00
   DEF        48c5 00
   IODev      CUL_0
   NAME       FS20_Garage
   NR         128
   STATE      off
   TYPE       FS20
   XMIT       48c5
   Code:
     1          48c5 00
   Readings:
     2016-04-18 10:43:36   state           off
Attributes:
   DbLogExclude .*
   IODev      CUL_0
   building   S_Haus
   floor      S_EG
   group      FS20,LichtAktoren
   room       Fernsteuerung,FS20
   userattr   building building_map floor floor_map room_map structexclude


Wobei zu berücksichtigen ist, das die Structure heute erst dazukam.

Viele Grüße
Stephan
FHEM nightly auf Intel Atom (lubuntu) mit VDSL 50000 ;-)
Nutze zur Zeit OneWire und KNX

rapster

Hi Stephan,

Danke hierfür, ich konnte das Problem jetzt bei mir Nachstellen und gucke mal :-)

Bzgl. deiner Frage hab ich dich wirklich falsch verstanden, allerdings ist das TYPE=... keine direkte Konfiguration die in der fhem.cfg landet, sondern die fhem devspec Angabe, hier nachzulesen: http://fhem.de/commandref_DE.html#devspec

Gruß
Claudiu

abc2006

Zitat von: rapster am 18 April 2016, 12:46:54
Danke hierfür, ich konnte das Problem jetzt bei mir Nachstellen und gucke mal :-)

cool!

Zitat
Bzgl. deiner Frage hab ich dich wirklich falsch verstanden, allerdings ist das TYPE=... keine direkte Konfiguration die in der fhem.cfg landet, sondern die fhem devspec Angabe, hier nachzulesen: http://fhem.de/commandref_DE.html#devspec
genau darum ging es ja, dass die Zeile so nicht auftaucht und beim bewerten, ob diese zutrifft, je nach Erfahrung des Nutzers ein mehr oder weniger großer Spielraum entsteht :-)
mit dem list kann man es ja umbauen, von daher für mich okay! Danke :-)  /OT
FHEM nightly auf Intel Atom (lubuntu) mit VDSL 50000 ;-)
Nutze zur Zeit OneWire und KNX

rapster

Problem mit Codemirror und perlSyntaxCheck sollte (zumindest im DEF) behoben sein nachdem Rudi den Patch eingecheckt hat: https://forum.fhem.de/index.php?topic=52379

Falls anschließend noch an anderer Stelle Probleme im Zusammenhang dieser beiden Features auftreten bitte nochmal bescheid geben.

Gruß
Claudiu

justme1968

ich hatte das problem auch bei attributen mit Textfeld-long. vielleicht kannst du auch mal nach sehen?

danke
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968