[gelöst] FHEMWidget2 Problem mit Daten senden

Begonnen von Schalter, 06 Juli 2018, 00:27:53

Vorheriges Thema - Nächstes Thema

Schalter

Hallo Zusammen,

derweil plagt mich ein Problem mit der FHEM Widget 2 App und bereitet mir Kopfzerbrechen:

Die Einrichtung hat funktioniert, das Log der App meldet:

ZitatPerforming FHEM Request: ?cmd=jsonlist2global&XHR=1

Global Attributes configured correctly

Performing FHEM request: ?cmd=jsonlist2&XHR=1

Watch Session not paired

Controls found:

Deckenfluter: isUsable: true
Allowed Values: ["off", "on"]
Controlled Attributes: STATE
Display Locations: APP WIDGET

Websocket connected.

Nun sehe ich in meiner Device Liste meinen eingeschalteten Deckenfluter. Wenn ich ihn ausschalten möchte passiert jedoch nichts (der Switch geht zwar auf ausgeschaltet, aber die Steckdose schaltet nicht). Im Log fügt sich nun folgendes an:

ZitatPerforming FHEM Request: ?cmd=jsonlist2 Deckenfluter STATE&XHR=1&XHR=1

Performing FHEM Request: ?cmd=jsonlist2 Deckenfluter STATE&XHR=1&XHR=1

Performing FHEM Request: ?cmd=set Deckenfluter STATEoff&XHR=1

Unter Device List lässt sich derzeit also nur der Status auslesen. Schalte ich über den Browser den Deckenfluter aus, bewegt sich auch in der App der Switch.

Meine fhem Konfiguration:

attr global userattr cmdIcon devStateIcon devStateStyle fhem_widget_channels fhem_widget_command fhem_widget_command_2 fhem_widget_command_3 icon sortby webCmd widgetOverride
attr global autoload_undefined_devices 1
attr global logfile ./log/fhem-%Y-%m.log
attr global modpath .
attr global motd SecurityCheck:\
\
WEB has no associated allowed device with basicAuth.\
telnetPort has no associated allowed device with password/globalpassword.\
\
Restart FHEM for a new check if the problem is fixed,\
or set the global attribute motd to none to supress this message.\

attr global statefile ./log/fhem.save
attr global updateInBackground 1
attr global verbose 3

define telnetPort telnet 7072 global
attr telnetPort allowfrom ^11\.11\.11\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$

define WEB FHEMWEB 8083 global
attr WEB allowfrom ^11\.11\.11\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$
attr WEB csrfToken none
attr WEB editConfig 1
attr WEB longpoll websocket
attr WEB stylesheetPrefix dark



# Fake FileLog entry, to access the fhem log from FHEMWEB
define Logfile FileLog ./log/fhem-%Y-%m.log fakelog
attr Logfile verbose 1

define autocreate autocreate
attr autocreate filelog ./log/%NAME-%Y.log

define eventTypes eventTypes ./log/eventTypes.txt

# Disable this to avoid looking for new USB devices on startup
define initialUsbCheck notify global:INITIALIZED usb create
define Receiver CUL /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0@38400 1234
define Deckenfluter IT 000000000F FF F0
attr Deckenfluter IODev Receiver
attr Deckenfluter fhem_widget_channels [{"allowed_values":["off","on"],"controlled_attribute":"STATE"}]
attr Deckenfluter protocol V1
attr Deckenfluter room Unten
define Musik IT 0000F0000F FF F0
attr Musik IODev Receiver
attr Musik room Unten
define Unused1 IT 00000F000F FF F0
attr Unused1 IODev Receiver
define Unused2 IT 0000FF000F FF F0
attr Unused2 IODev Receiver


Mein IP-Adressbereich ist 11.11.11.0-255, weswegen ich die Werte bei "allowfrom" gesetzt habe.
Als Serverbetriebssystem kommt Ubuntu Minimal 18.04 LTS zum Einsatz. Auf dem iPhone ist 11.4 installiert bzw. iOS 10 auf einem anderen Gerät.
ZitatDie FHEM Log-file:
2018.07.05 23:27:55 1: Including fhem.cfg
2018.07.05 23:27:55 3: telnetPort: port 7072 opened
2018.07.05 23:27:56 3: WEB: port 8083 opened
2018.07.05 23:27:57 2: eventTypes: loaded 19 events from ./log/eventTypes.txt
2018.07.05 23:27:57 3: Opening Receiver device /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
2018.07.05 23:27:57 3: Setting Receiver serial parameters to 38400,8,N,1
2018.07.05 23:28:00 3: Receiver: Possible commands: ABCEeFfGhiKklMmRTtUVWXxYZz
2018.07.05 23:28:00 3: Receiver device opened
2018.07.05 23:28:00 1: Including ./log/fhem.save
2018.07.05 23:28:00 1: usb create starting
2018.07.05 23:28:01 1: usb create end
2018.07.05 23:28:01 2: SecurityCheck:  WEB has no associated allowed device with basicAuth. telnetPort has no associated allowed device with password/globalpassword.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2018.07.05 23:28:01 0: Featurelevel: 5.8
2018.07.05 23:28:01 0: Server started with 14 defined entities (fhem.pl:13447/2017-02-19 perl:5.026001 os:linux user:fhem pid:700)
2018.07.05 23:58:11 3: Receiver IT_set: Deckenfluter on
2018.07.05 23:58:12 3: Receiver IT_set: Deckenfluter off
2018.07.05 23:58:14 3: Receiver IT_set: Deckenfluter on

Wo liegt das Problem? Was verstehe ich hier falsch?

Übrigens: gebe ich im Safari auf dem iPhone die Adresse <IP-Adresse>:8083/fhem??cmd=set%20Deckenfluter%20STATEoff&XHR=1 ein, schaltet sich der Deckenfluter aus.
                und die iOS App FHEM Control funktioniert einwandfrei.
                Der Befehl echo -en "list\nquit\n" | /bin/nc -w5 <IP-Adresse des FHEM-Servers> 7072 spuckt folgendes aus:
Type list <name> for detailed info.

Global:
  global               (no definition)

CUL:
  Receiver             (Initialized)

FHEMWEB:
  WEB                  (Initialized)
  WEB_<IP-Adresse des iPhones>_49207 (Connected)
  WEB_<IP-Adresse des MacBooks>_56130 (Connected)

IT:
  Deckenfluter         (on)
  Musik                (off)
  Unused1              (off)
  Unused2              (off)

eventTypes:
  eventTypes           (active)

notify:
  initialUsbCheck      (2018-07-05 23:28:00)

FileLog:
  Logfile              (active)

autocreate:
  autocreate           (active)

telnet:
  telnetPort           (Initialized)
  telnetPort_<IP-Adresse des FHEM-Servers>_52480 (Connected)

Bye...


Habe jetzt schon Stunden damit verbracht den Fehler zu suchen, bin für jeden Tipp dankbar.

Danke und Gruß,
Schalter

Schalter

folgendes habe ich in der FHEM Log Datei noch gefunden...

wenn ich mit dem Widget schalte:

Zitat/
2018.07.09 19:21:44 4: WEB_<IP-Adresse Iphone>_54573 GET /fhem?cmd=set%20Deckenfluter%20STATE%20off&XHR=1&fwcsrf=fhem_3573238957111.83; BUFLEN:0
2018.07.09 19:21:44 5: Cmd: >set Deckenfluter STATE off<
2018.07.09 19:21:44 4: name: /fhem?cmd=set%20Deckenfluter%20STATE%20off&XHR=1&fwcsrf=fhem_3573238957111.83 / RL:128 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/

Wenn ich über FHEM Control schalte:

Zitat/
2018.07.09 19:21:47 4: WEB_<Ip Adresse Iphone>_54574 GET /fhem?room=all&XHR=1&inform=type=status;filter=.*×tamp=1531156907; BUFLEN:0
2018.07.09 19:21:47 4: Connection closed for WEB_11.11.11.60_54573: Connection reset by peer
2018.07.09 19:21:48 4: Connection accepted from WEB_11.11.11.60_54575
2018.07.09 19:21:48 4: WEB_11.11.11.60_54575 GET /fhem?XHR=1&cmd=set%20Deckenfluter%20off; BUFLEN:0
2018.07.09 19:21:48 5: Cmd: >set Deckenfluter off<
2018.07.09 19:21:48 3: Receiver IT_set: Deckenfluter off
2018.07.09 19:21:48 5: Starting notify loop for Deckenfluter, 1 event(s), first is off
2018.07.09 19:21:48 5: createNotifyHash
2018.07.09 19:21:48 5: End notify loop for Deckenfluter
2018.07.09 19:21:48 5: Receiver IT_set: Type=CUL Protocol=V1
2018.07.09 19:21:48 5: SW: is000000000FF0
2018.07.09 19:21:48 5: CUL/RAW (ReadAnswer): is000000000FF0

2018.07.09 19:21:48 5: Starting notify loop for Receiver, 1 event(s), first is raw: is000000000FF0
2018.07.09 19:21:48 5: End notify loop for Receiver
2018.07.09 19:21:48 5: IT_Set: GetFn(raw): message = is000000000FF0 Antwort =   raw => is000000000FF0
2018.07.09 19:21:48 4: ITSet: Answer from Receiver:   raw => is000000000FF0
2018.07.09 19:21:48 4: name: /fhem?XHR=1&cmd=set%20Deckenfluter%20off / RL:20 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/

Schalter

Ok. Jetzt sehe ich es auch selbst.

Das Attribut STATE darf in der App nicht gesetzt sein. Mein Fehler... gelöst