Module für pilight (Senden und Empfangen)

Begonnen von Risiko, 03 März 2015, 20:33:54

Vorheriges Thema - Nächstes Thema

Risiko

Hallo Hauswart,

pilight.pm ist von A. Fey. Mit diesem Modul kann man nur Senden und es unterstützt nur pilight Version < 5.0
Meine Kontaktaufnahme zu einer gemeinsamen Weiterentwicklung ist damals gescheitert, so dass ich mich für diesen Weg (neue Module) entschieden habe.

Risiko.

Risiko

@update71
1. Führ mal bitte list pilight in der FHEM-Befehlszeile aus
2. Stelle verbose mal auf 5 - dann kommen mehr Log's

Was für eine pilight Version verwendest du?

Risiko

update71

Hi, hier mal "list Pilight"
Internals:
   API        6.0
   CFGFN
   DEF        localhost:5000
   DeviceName localhost:5000
   NAME       Pilight
   NR         28
   PARTIAL
   RETRY_INTERVAL 60
   STATE      disconnected
   TYPE       pilight_ctrl
   Readings:
     2015-04-09 20:34:26   state           disconnected
   Helper:
     CHECK      0
     CON        diconnected
     NEXT_TRY   1428604526
Attributes:
   room       test

Und was aus dem LOG:
2015.04.09 20:28:38 3: Opening Pilight device localhost:5000
2015.04.09 20:28:39 3: Pilight device opened
2015.04.09 20:28:51 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:29:54 3: Opening Pilight device localhost:5000
2015.04.09 20:29:54 3: Pilight device opened
2015.04.09 20:30:06 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:30:34 3: Opening Pilight device localhost:5000
2015.04.09 20:30:34 3: Pilight device opened
2015.04.09 20:30:46 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:31:50 3: Opening Pilight device localhost:5000
2015.04.09 20:31:50 3: Pilight device opened
2015.04.09 20:32:02 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:32:03 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
2015.04.09 20:32:07 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
2015.04.09 20:32:09 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
2015.04.09 20:33:02 3: Opening Pilight device localhost:5000
2015.04.09 20:33:02 3: Pilight device opened
2015.04.09 20:33:14 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:34:14 3: Opening Pilight device localhost:5000
2015.04.09 20:34:14 3: Pilight device opened
2015.04.09 20:34:26 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:35:29 3: Opening Pilight device localhost:5000
2015.04.09 20:35:29 3: Pilight device opened
2015.04.09 20:35:41 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:36:21 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
2015.04.09 20:36:23 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
Thomas
###########
Raspi mit Fhem, nanoCUL 433 + mehrere Brennstuhl Steckdosen - HM-LAN + Thermostat, 6 fach Taster, Aussensensor - HUEBridge + 3 weiße LEDs ... mehr folgt

update71

Sorry, ist echt viel:

2015.04.09 20:36:41 3: Opening Pilight device localhost:5000
2015.04.09 20:36:41 3: Pilight device opened
2015.04.09 20:36:41 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:41 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:41 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:36:42 5: Pilight(Check): identify
2015.04.09 20:36:43 5: Pilight(Check): identify
2015.04.09 20:36:44 5: Pilight(Check): identify
2015.04.09 20:36:44 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:44 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:44 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:36:45 5: Pilight(Check): identify
2015.04.09 20:36:46 5: Pilight(Check): identify
2015.04.09 20:36:47 5: Pilight(Check): identify
2015.04.09 20:36:47 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:47 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:47 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:36:48 5: Pilight(Check): identify
2015.04.09 20:36:49 5: Pilight(Check): identify
2015.04.09 20:36:50 5: Pilight(Check): identify
2015.04.09 20:36:50 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:50 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:36:50 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:36:51 5: Pilight(Check): identify
2015.04.09 20:36:52 5: Pilight(Check): identify
2015.04.09 20:36:53 5: Pilight(Check): identify
2015.04.09 20:36:53 4: Pilight(Check): Could not connect to pilight-daemon localhost:5000 - maybe wrong api version or port
2015.04.09 20:36:53 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:37:54 3: Opening Pilight device localhost:5000
2015.04.09 20:37:54 3: Pilight device opened
2015.04.09 20:37:54 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:37:54 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:37:54 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:37:55 5: Pilight(Check): identify
2015.04.09 20:37:56 5: Pilight(Check): identify
2015.04.09 20:37:57 5: Pilight(Check): identify
2015.04.09 20:37:57 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:37:57 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:37:57 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:37:58 5: Pilight(Check): identify
2015.04.09 20:37:59 5: Pilight(Check): identify
2015.04.09 20:38:00 5: Pilight(Check): identify
2015.04.09 20:38:00 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:38:00 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:38:00 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:38:01 5: Pilight(Check): identify
2015.04.09 20:38:02 5: Pilight(Check): identify
2015.04.09 20:38:03 5: Pilight(Check): identify
2015.04.09 20:38:03 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:38:03 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:38:03 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:38:04 5: Pilight(Check): identify
2015.04.09 20:38:05 5: Pilight(Check): identify
2015.04.09 20:38:06 5: Pilight(Check): identify
2015.04.09 20:38:06 4: Pilight(Check): Could not connect to pilight-daemon localhost:5000 - maybe wrong api version or port
2015.04.09 20:38:06 1: localhost:5000 disconnected, waiting to reappear (Pilight)
2015.04.09 20:38:23 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
2015.04.09 20:38:25 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
2015.04.09 20:38:27 2: Pilight(Write): ERROR: no connection to pilight-daemon localhost:5000
2015.04.09 20:39:09 3: Opening Pilight device localhost:5000
2015.04.09 20:39:09 3: Pilight device opened
2015.04.09 20:39:09 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:09 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:09 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:39:10 5: Pilight(Check): identify
2015.04.09 20:39:11 5: Pilight(Check): identify
2015.04.09 20:39:12 5: Pilight(Check): identify
2015.04.09 20:39:12 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:12 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:12 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:39:13 5: Pilight(Check): identify
2015.04.09 20:39:14 5: Pilight(Check): identify
2015.04.09 20:39:15 5: Pilight(Check): identify
2015.04.09 20:39:15 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:15 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:15 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:39:16 5: Pilight(Check): identify
2015.04.09 20:39:17 5: Pilight(Check): identify
2015.04.09 20:39:18 5: Pilight(Check): identify
2015.04.09 20:39:18 5: Pilight(DoInit): send {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:18 4: Pilight(SimpleWrite): snd -> {"action":"identify","options":{"receiver":1},"media":"all"}
2015.04.09 20:39:18 5: SW: 7b22616374696f6e223a226964656e74696679222c226f7074696f6e73223a7b227265636569766572223a317d2c226d65646961223a22616c6c227d0a
2015.04.09 20:39:19 5: Pilight(Check): identify
2015.04.09 20:39:20 5: Pilight(Check): identify
2015.04.09 20:39:21 5: Pilight(Check): identify
2015.04.09 20:39:21 4: Pilight(Check): Could not connect to pilight-daemon localhost:5000 - maybe wrong api version or port
2015.04.09 20:39:21 1: localhost:5000 disconnected, waiting to reappear (Pilight)
Thomas
###########
Raspi mit Fhem, nanoCUL 433 + mehrere Brennstuhl Steckdosen - HM-LAN + Thermostat, 6 fach Taster, Aussensensor - HUEBridge + 3 weiße LEDs ... mehr folgt

Risiko

@update71
Es kann keine Verbindung zu pilight aufgebaut werden!!
Verwechselst du nicht webserver-port für die WebGui und den pilight Port für die Kommunikation!!??


settings": {
"port": 5000,
"webserver-port": 5001,
}


Risiko.

update71

Danke, das war es. Mir war nicht bewusst dass das 2 verschiedene Ports sind. Hätte vermutlich gereicht den Webserverport auf 5001 zu lassen und in der pilight config 5000 anzugeben. Ich war immer der Meinung dass es nur einen Port gibt.

Danke, Danke, Danke :)
Thomas
###########
Raspi mit Fhem, nanoCUL 433 + mehrere Brennstuhl Steckdosen - HM-LAN + Thermostat, 6 fach Taster, Aussensensor - HUEBridge + 3 weiße LEDs ... mehr folgt

update71

#51
Wenn du mir jetzt noch verraten kannst wie ich dort ein Symbol für on/off reinbekomme (wenn das geht) dann geb ich n Bier aus  :)

Th.

Nach Änderung auf elro_800_switch kamen die Statuslampen allein :)
Thomas
###########
Raspi mit Fhem, nanoCUL 433 + mehrere Brennstuhl Steckdosen - HM-LAN + Thermostat, 6 fach Taster, Aussensensor - HUEBridge + 3 weiße LEDs ... mehr folgt

pattex

@Risiko

mit dem Protokoll Parameter scheint etwas nicht zu stimmen. Ich habe bei mir intertechno und intertechno_old.

wenn ich nun ein neues Device anlege:
define SHUTTER pilight_switch interntechno_switch 47114711 1
dann bekomme
Unknown code SWITCH,arctech_switch,47114711,1,on, help me!
zurück.
Gehe ich dann hin und ändere das Protokoll in arctech_switch, schalte on und schalte off und ändere dann das Protokoll wieder zurück in intertechno_switch läuft es.
Leider funktioniert dieser workaround nicht bei interntechno_old Protokoll.

btw. Danke für die neue Umsetzung der Anbindung zum pilight. Sieht schon sehr gut aus.

Risiko

#53
Hallo pattex

das liegt an pilight und den unterschiedlichen Protokollnamen für ein Device. Dafür gibt es das Attribut brands.
Habe versucht das an einem Beispiel im 1. Post zu beschreiben.
Bei dir müsste also brands arctech:intertechno stehen (kaku ist auch Intertechno)

Schreibfehler? interntechno vs. intertechno
Risiko.

update71

Bei mir ist auch der Log voll mit "Help me!"  8)
Geb ich bei Brands dann das Gleiche an wie beimSwitsch (elro_800_switch) oder nur "elro"?

Th.
Thomas
###########
Raspi mit Fhem, nanoCUL 433 + mehrere Brennstuhl Steckdosen - HM-LAN + Thermostat, 6 fach Taster, Aussensensor - HUEBridge + 3 weiße LEDs ... mehr folgt

Risiko

@update71
Für elro_800 benötigt man kein brands. Hatten wir doch schon  ;)
Scheinbar empfängst du mehr, (Stichwort Nachbar, Störungen,etc) wofür du aber kein Device definiert hast.
Dafür gibt es aktuell nur die Ignore-Liste (Attribut ignore).

Risiko

pattex

@Risiko
sorry, ich habe nun mit dem brands rumprobiert und komme leider mit meinem interechno_old nicht weiter.

brands habe ich auf arctech:intertechno gesetzt.

Das Device hat als protocol intertechno_old
Schalten kann ich, aber die Rückgabe des Status wird nicht richtig gemappt.

2015.04.12 12:27:11.777 4: pilight(Write): RCV (pilight_switch) -> BUERO_CHARGERS,on
2015.04.12 12:27:11.779 4: pilight(Write): {"action":"send","code":{"protocol":["intertechno_old"],"id":2,"unit":0,"on":1}}
2015.04.12 12:27:11.781 5: pilight(SendNonBlocking): [1] {"action":"send","code":{"protocol":["intertechno_old"],"id":2,"unit":0,"on":1}}
2015.04.12 12:27:11.809 5: pilight(Send): {"action":"send","code":{"protocol":["intertechno_old"],"id":2,"unit":0,"on":1}}
2015.04.12 12:27:11.813 5: pilight(Send): RCV -> {"status":"success"}
2015.04.12 12:27:11.870 4: pilight(SendDone): message successfully send
2015.04.12 12:27:12.270 4: pilight(Parse): RCV -> {"origin":"sender","protocol":"arctech_switch_old","message":{"id":2,"unit":0,"state":"on"},"repeat":1,"uuid":"0000-00-00-63-b5e190"}
2015.04.12 12:27:12.334 5: pilight dispatch SWITCH,intertechno_switch_old,2,0,on
2015.04.12 12:27:12.335 4: pilight_switch_Parse: RCV -> SWITCH,intertechno_switch_old,2,0,on
2015.04.12 12:27:12.391 3: pilight: Unknown code SWITCH,intertechno_switch_old,2,0,on, help me!



Risiko

#57
@pattex
Sorry mein Fehler. Brands muss in diesem Fall lauten: arctech_switch:intertechno oder spezieller arctech_switch_old:intertechno_old
Alternativ könntest du statt intertechno(_old) auch kaku_switch(_old) probieren.
Dann muss brands so gesetzt werden: arctech:kaku

Risiko

pattex

@Risiko
mit intertechno / intertechno_old hatte ich kein Glück
2015.04.12 13:20:31.763 4: pilight(Write): RCV (pilight_switch) -> BUERO_CHARGERS,on
2015.04.12 13:20:31.764 4: pilight(Write): {"action":"send","code":{"protocol":["intertechno_old"],"id":2,"unit":0,"on":1}}
2015.04.12 13:20:31.765 5: pilight(SendNonBlocking): [1] {"action":"send","code":{"protocol":["intertechno_old"],"id":2,"unit":0,"on":1}}
2015.04.12 13:20:31.794 5: pilight(Send): {"action":"send","code":{"protocol":["intertechno_old"],"id":2,"unit":0,"on":1}}
2015.04.12 13:20:31.797 5: pilight(Send): RCV -> {"status":"success"}
2015.04.12 13:20:31.852 4: pilight(SendDone): message successfully send
2015.04.12 13:20:32.254 4: pilight(Parse): RCV -> {"origin":"sender","protocol":"arctech_switch_old","message":{"id":2,"unit":0,"state":"on"},"repeat":1,"uuid":"0000-00-00-63-b5e190"}
2015.04.12 13:20:32.314 3: pilight(Parse): unknown protocol -> intertechno_old


Allerdings hat es mit der Umstellung des Protokolls im Device auf kaku_switch / kaku_switch_old funktioniert. Das ist für mich soweit OK, allerdings glaube ich das da irgendwo bei dem intertechno kram der Wurm drin ist.

Risiko

@pattex
Danke fürs Testen. Bei intertechno_old war noch ein Fehler bzw. hat noch gefehlt.
Habe ich gefixt.

Risiko