Neuigkeiten:

Am Sonntag den 8.12.2024 kann es ab ca. 8:00 Uhr zu kurzzeitigen Einschränkungen / Ausfällen bei den Diensten des FHEM Vereines kommen.
Die Server müssen mal gewartet und dabei neu gestartet werden ;)

Hauptmenü

Garagentor Homebridge mapping

Begonnen von Frank6320, 25 Oktober 2024, 00:29:42

Vorheriges Thema - Nächstes Thema

Frank6320

Hallo zusammen,

ich habe ein Garagentor, dass nicht über toggeln einer Taste hoch oder runter fährt. Es hat jeweils einen Taster für Hochfahren und einen für Runterfahren.
Zusätzlich soll bald noch ein Taster für Stopp eingebaut werden.
Angesteuert wird das über KNX Aktoren, die für ne halbe Sekunde schalten und wieder aus gehen.
Dann gibt es eine Rückmeldung für Tor komplett offen oder komplett zu. Bald dann noch für die 1/2 Position und Moving.

In fhem gibt es folgendes device:
define Scheune.Tor KNX 6/1/1:dpt1.001:set:nosuffix\    Befehl öffnen
6/1/2:dpt1.001:set:nosuffix\                                 Befehl schließen
6/2/1:dpt1.001:get:nosuffix\                                 Rückmeldung komplett auf
6/2/2:dpt1.001:get:nosuffix                                  Rückmeldung komplett zu
attr Scheune.Tor HomeBridge off
attr Scheune.Tor alias Tor
attr Scheune.Tor cmdIcon Open:fts_garage_door_up Close:fts_garage_door_down
attr Scheune.Tor eventMap /on g1:Open/on g2:Close
attr Scheune.Tor genericDeviceType garage
attr Scheune.Tor group Scheunentor
attr Scheune.Tor homebridgeMapping clear CurrentDoorState=Scheune.Tor:DoorState,values=opened:OPEN;;closed:CLOSED TargetDoorState=state,cmds=OPEN:Open;;CLOSED:Close,values=Close:CLOSED;;Open:OPEN
attr Scheune.Tor room Scheune
attr Scheune.Tor sortby 1
attr Scheune.Tor stateFormat {\
my $b1 = ReadingsVal("Scheune.Tor","g3","off");;\
my $b2 = ReadingsVal("Scheune.Tor","g4","off");;\
\
if ($b1 eq "on") {return "opened";;}\
if ($b2 eq "on") {return "closed";;}\
if (($b1 eq "off") && ($b2 eq "off")) {return "intermediate";;}\
}
attr Scheune.Tor userReadings DoorState {\
my $b1 = ReadingsVal("Scheune.Tor","g3","off");;\
my $b2 = ReadingsVal("Scheune.Tor","g4","off");;\
\
if ($b1 eq "on") {return "opened";;}\
if ($b2 eq "on") {return "closed";;}\
if (($b1 eq "off") && ($b2 eq "off")) {return "intermediate";;}\
}
attr Scheune.Tor webCmd Open:Close
#   DEF        6/1/1:dpt1.001:set:nosuffix
#6/1/2:dpt1.001:set:nosuffix
#6/2/1:dpt1.001:get:nosuffix
#6/2/2:dpt1.001:get:nosuffix
#   FUUID      653b6b00-f33f-d9f2-a0b0-bac4a1ebf325f2bd
#   IODev      knxbridge
#   LASTInputDev knxbridge
#   MSGCNT     135
#   NAME       Scheune.Tor
#   NR         160
#   STATE      closed
#   TYPE       KNX
#   eventCount 183
#   knxbridge_MSGCNT 135
#   knxbridge_RAWMSG C02105w0620201
#   knxbridge_TIME 2024-10-25 00:06:55
#   model      dpt1
#   GADDETAILS:
#     g1:
#       CODE       06101
#       MODEL      dpt1.001
#       NO         1
#       OPTION     set
#       RDNAMEGET  g1
#       RDNAMESET  g1
#       SETLIST    :on,off,toggle
#     g2:
#       CODE       06102
#       MODEL      dpt1.001
#       NO         2
#       OPTION     set
#       RDNAMEGET  g2
#       RDNAMESET  g2
#       SETLIST    :on,off,toggle
#     g3:
#       CODE       06201
#       MODEL      dpt1.001
#       NO         3
#       OPTION     get
#       RDNAMEGET  g3
#       RDNAMESET  g3
#       SETLIST    :on,off,toggle
#     g4:
#       CODE       06202
#       MODEL      dpt1.001
#       NO         4
#       OPTION     get
#       RDNAMEGET  g4
#       RDNAMESET  g4
#       SETLIST    :on,off,toggle
#   GADTABLE:
#     06101      g1
#     06102      g2
#     06201      g3
#     06202      g4
#   READINGS:
#     2024-10-25 00:06:55   DoorState       closed
#     2024-10-23 21:49:00   IODev           knxbridge
#     2024-10-25 00:05:55   g1              on
#     2024-10-25 00:06:32   g2              on
#     2024-10-25 00:06:33   g3              off
#     2024-10-25 00:06:55   g4              on
#     2024-10-13 12:24:12   getG1           on
#     2024-10-18 18:38:57   getG2           off
#     2024-10-25 00:06:55   last-sender     2.1.5
#     2024-09-17 06:54:55   setG1           on
#     2024-10-25 00:06:55   state           on
#   hmccu:
#
setstate Scheune.Tor closed
setstate Scheune.Tor 2024-10-25 00:06:55 DoorState closed
setstate Scheune.Tor 2024-10-23 21:49:00 IODev knxbridge
setstate Scheune.Tor 2024-10-25 00:05:55 g1 on
setstate Scheune.Tor 2024-10-25 00:06:32 g2 on
setstate Scheune.Tor 2024-10-25 00:06:33 g3 off
setstate Scheune.Tor 2024-10-25 00:06:55 g4 on
setstate Scheune.Tor 2024-10-13 12:24:12 getG1 on
setstate Scheune.Tor 2024-10-18 18:38:57 getG2 off
setstate Scheune.Tor 2024-10-25 00:06:55 last-sender 2.1.5
setstate Scheune.Tor 2024-09-17 06:54:55 setG1 on
setstate Scheune.Tor 2024-10-25 00:06:55 state on

Wenn ich in Fhem oder KNX die Fahrt anstoße, zeigt mir Homekit die richtige Endlage an. Stoße ich die Fahrt über Homekit an, fährt das Tor los und erreicht physisch die Endlage. Auf dem Iphone wird die Endlage nie erreicht.
Was mache ich falsch?
Liegt es daran, dass ich auf state nicht mit current und target DoorState arbeite?
Hier ein logfile Auszug wenn ich beim iphone auf öffnen gehe
[10/25/2024, 12:20:17 AM] [FHEM] Scheune.Tor: executing set cmd for TargetDoorState with value 0
[10/25/2024, 12:20:17 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=set%20Scheune.Tor%20Open&fwcsrf=csrf_36249404856577&XHR=1
  2024-10-25 00:20:17 caching: Scheune.Tor-state: off
[10/25/2024, 12:20:17 AM] [FHEM] Scheune.Tor-state not a number: off
  2024-10-25 00:20:17 caching: Scheune.Tor-DoorState: intermediate
[10/25/2024, 12:20:17 AM] [FHEM] Scheune.Tor-DoorState value intermediate not handled in values
[10/25/2024, 12:20:29 AM] [FHEM] longpoll ended, reconnect in: 200msec
starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=1729808417.843;fmt=JSON&timestamp=1729808429581
[10/25/2024, 12:20:29 AM] [FHEM] Checking devices and attributes...
[10/25/2024, 12:20:29 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22,%22userattr%22,%22%22)%7D&fwcsrf=csrf_36249404856577&XHR=1
[10/25/2024, 12:20:29 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE=siri&fwcsrf=csrf_36249404856577&XHR=1
[10/25/2024, 12:20:29 AM] [FHEM] siri device is siri
[10/25/2024, 12:20:29 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7B$defs%7Bsiri%7D-%3E%7B%22homebridge-fhem%20version%22%7D%20=%20%220.5.38%22%7D&fwcsrf=csrf_36249404856577&XHR=1
[10/25/2024, 12:20:31 AM] [FHEM] longpoll ended, reconnect in: 200msec
starting longpoll: http://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=1729808417.843;fmt=JSON&timestamp=1729808431339
[10/25/2024, 12:20:31 AM] [FHEM] Checking devices and attributes...
[10/25/2024, 12:20:31 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22,%22userattr%22,%22%22)%7D&fwcsrf=csrf_36249404856577&XHR=1
[10/25/2024, 12:20:31 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE=siri&fwcsrf=csrf_36249404856577&XHR=1
[10/25/2024, 12:20:31 AM] [FHEM] siri device is siri
[10/25/2024, 12:20:31 AM] [FHEM]   executing: http://127.0.0.1:8083/fhem?cmd=%7B$defs%7Bsiri%7D-%3E%7B%22homebridge-fhem%20version%22%7D%20=%20%220.5.38%22%7D&fwcsrf=csrf_36249404856577&XHR=1
  2024-10-25 00:20:41 caching: Scheune.Tor-state: on
  2024-10-25 00:20:41 caching: Scheune.Tor-DoorState: opened
[10/25/2024, 12:20:41 AM] [FHEM]     caching: CurrentDoorState: 0 (as number; means OPEN; from 'opened')
[10/25/2024, 12:20:41 AM] [FHEM] Scheune.Tor-state not a number: on