[31_PLAYBULB.pm] Modul für MiPow PLAYBULB Candle Bluetooth Lampen

Begonnen von CoolTux, 15 November 2016, 20:22:00

Vorheriges Thema - Nächstes Thema

Byte09

Hey Cooltux,

ich will ( wirklich nur mal vorsichtig ) anfragen, ob du schonmal dazu gekommen bist , dir das sanzuschauen ?

ansonten würde ich ggf. versuchen mir das selber hinzubiegen , hab mal reingeschaut - scheint ja zumindest kein Hexenwerk zu sein , wenn wohl auch ein Geduldsspiel ohne entsprechende Informationen.

Gruss Byte09

CoolTux

Alles gut. Bin froh das Du fragst. Ist wieder ein bisschen unter gegangen.
Angeschaut hatte ich es mir mal kurz. Ich werde Dir morgen mal die handle raus suchen die Du für mich abrufen musst.

Danke noch mal fürs an schupsen.



Grüße
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net


CoolTux

Zitat
handle = 0x001a, char properties = 0x08, char value handle = 0x001b, uuid = 0000fff2-0000-1000-8000-00805f9b34fb
handle = 0x001c, char properties = 0x06, char value handle = 0x001d, uuid = 0000fff3-0000-1000-8000-00805f9b34fb
handle = 0x001e, char properties = 0x02, char value handle = 0x001f, uuid = 0000fff1-0000-1000-8000-00805f9b34fb
handle = 0x0022, char properties = 0x0a, char value handle = 0x0023, uuid = 0000fff7-0000-1000-8000-00805f9b34fb
handle = 0x0024, char properties = 0x02, char value handle = 0x0025, uuid = 0000fff8-0000-1000-8000-00805f9b34fb
handle = 0x0026, char properties = 0x06, char value handle = 0x0027, uuid = 0000fffb-0000-1000-8000-00805f9b34fb
handle = 0x0028, char properties = 0x06, char value handle = 0x0029, uuid = 0000fffc-0000-1000-8000-00805f9b34fb
handle = 0x002a, char properties = 0x0a, char value handle = 0x002b, uuid = 0000fffd-0000-1000-8000-00805f9b34fb
handle = 0x002c, char properties = 0x0a, char value handle = 0x002d, uuid = 0000fffe-0000-1000-8000-00805f9b34fb
handle = 0x002e, char properties = 0x0a, char value handle = 0x002f, uuid = 0000ffff-0000-1000-8000-00805f9b34fb
handle = 0x0030, char properties = 0x0a, char value handle = 0x0031, uuid = 0000fff5-0000-1000-8000-00805f9b34fb


Bitte einmal die handles abrufen und Ergebnis zu jedem handle hinzu schreiben

gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x1b
gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x2b
gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x1f
gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x23
gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x25
gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x27
gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x29
gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x31




Grüße
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Byte09

Hi Cooltux,

anbei die Daten :


root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x1b
Characteristic value/descriptor read failed: Attribute can't be read

root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x2b
Characteristic value/descriptor read failed: Attribute can't be read

root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x1f
Characteristic value/descriptor: 00 00 00 00 04

root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x23
Characteristic value/descriptor: 30 30 30 30

root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x25
Characteristic value/descriptor: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x27
Characteristic value/descriptor: 00 cf 00 ff ff 00 04 00

root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x29
Characteristic value/descriptor: 00 cf 00 ff

root@raspberrypi:~# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x31
Characteristic value/descriptor read failed: Attribute can't be read


gruss Byte09

CoolTux

Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Byte09

Zitat von: CoolTux am 19 Dezember 2017, 21:57:51
Bitte einmal die Version von hier laden
https://github.com/LeonGaultier/fhem-PLAYBULB/archive/master.zip

Bitte als Model BTL301W wählen.

Super, Lampe ist ansprechbar und schaltet einwandfrei. Ich danke Dir.

Gruss Byte09

CoolTux

Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

KNUT345

#368
Hallo Zusammen,
habe Pi3 mit Strech lite mit integriertem Bluetooth neu aufgesetzt,
fhem läuft perfekt,
leider bekomm ich meine BTL300 weder mit v5 noch mit v6 aktiviert,
ich bekomme permanent state: unreachable
Per bluetoothctl oder gatttool wird die Candle angezeigt.

Kann mir jemand einen Tipp geben?

Grüße Knut

CoolTux

Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

KNUT345

Hallo CoolTux,
ein bei Klick auf Status-Icon
verbose 5 am Modul liefert
Zitat
2017.12.28 17:05:27 4: (Sub PLAYBULB - MyCandle1) - Call BlockingRun
2017.12.28 17:05:28 4: (Sub PLAYBULB_Run - MyCandle1) - Running nonBlocking
2017.12.28 17:05:37 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 29818
verbose 5 bei global liefert
Zitat
2017.12.28 17:15:32 4: WEB_192.168.123.49_53601 POST /fhem?cmd.MyCandle1=set%20MyCandle1%20on&room=Test&XHR=1&fwcsrf=csrf_106413131784627&fw_id=11032; BUFLEN:0
2017.12.28 17:15:32 5: Cmd: >set MyCandle1 on<
2017.12.28 17:15:32 4: BlockingCall (PLAYBULB_BlockingRun): created child (952), uses telnetPort to connect back
2017.12.28 17:15:32 4: (Sub PLAYBULB - MyCandle1) - Call BlockingRun
2017.12.28 17:15:32 5: Starting notify loop for MyCandle1, 1 event(s), first is on
2017.12.28 17:15:32 5: statistics Statistik_Counts: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: statistics Statistik_EinAus: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: statistics Statistik_Energie: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: statistics Statistik_EnergieHaus: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: statistics Statistik_Pct: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: statistics Statistik_Rollo: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: statistics Statistik_Temperatur: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: statistics Statistik_Zeit: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 4: dewpoint_notify: cmd_type=dewpoint devname=MyCandle1 dewname=TaupunktToAllDeviceReadings, dev=MyCandle1, dev_regex=.* temp_name=temperature hum_name=humidity
2017.12.28 17:15:32 5: dewpoint_notify: s='on'
2017.12.28 17:15:32 5: dewpoint timeout=1
2017.12.28 17:15:32 5: statistics stat_Balkon: Notify.266 Notification of 'MyCandle1' received. Device not monitored.
2017.12.28 17:15:32 5: rg_Batteriestatus: not on any display, ignoring notify
2017.12.28 17:15:32 5: rg_Hilfe: not on any display, ignoring notify
2017.12.28 17:15:32 5: rg_Statistik_EnergieHaus: not on any display, ignoring notify
2017.12.28 17:15:32 5: rg_Statistik_EnergieHausAktuell: not on any display, ignoring notify
2017.12.28 17:15:32 5: End notify loop for MyCandle1
2017.12.28 17:15:32 4: WEB: /fhem?cmd.MyCandle1=set%20MyCandle1%20on&room=Test&XHR=1&fwcsrf=csrf_106413131784627&fw_id=11032 / RL:20 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2017.12.28 17:15:32 4: Connection accepted from telnetPort_127.0.0.1_34742
2017.12.28 17:15:32 5: Cmd: >{BlockingRegisterTelnet($cl,7948)}<
2017.12.28 17:15:32 4: (Sub PLAYBULB_Run - MyCandle1) - Running nonBlocking
2017.12.28 17:15:36 4: WEB_192.168.123.49_53601 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2017-12-28.log; BUFLEN:0

Hilft das weiter?

Grüße Knut

KNUT345

Hallo CoolTux,
nachdem ich den vorangegangenen Thread nochmals durchgesucht habe, bin ich auf ähnliche Problembeschreibungen gestoßen.
Zitat
pi@RasPi3:~ $ ps ax | grep -v grep | grep "gatttool"
8509 ?        S      0:00 gatttool -b D8:A2:4B:15:AC:E6 --char-write -a 0x14 -n 061700fb00000000
pi@RasPi3:~ $
Dieser Prozess ist ein nicht abgeschlossener FHEM Prozess (denke ich)
Zitat
pi@RasPi3:~ $ sudo killall gatttool
pi@RasPi3:~ $ gatttool -b D8:A2:4B:15:AC:E6 --char-read -a 0x16
Characteristic value/descriptor: 06 17 00 fb ff
Danach läßt sich die Candle mit model... verbinden.
Ein Status Request liefert im Log File
Zitat
2017.12.28 20:23:37 4: (Sub PLAYBULB - MyCandle1) - Call BlockingRun
2017.12.28 20:23:37 4: (Sub PLAYBULB_Run - MyCandle1) - Running nonBlocking
2017.12.28 20:23:38 1: PERL WARNING: substr outside of string at ./FHEM/31_PLAYBULB.pm line 477.
2017.12.28 20:23:38 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/31_PLAYBULB.pm line 477.
2017.12.28 20:23:38 4: (Sub PLAYBULB_Run StatusRequest - MyCandle1) - Rückgabe an Auswertungsprogramm beginnt
2017.12.28 20:23:38 4: (Sub PLAYBULB_Done - MyCandle1) - Abschluss!
2017.12.28 20:24:38 4: (Sub PLAYBULB - MyCandle1) - Call BlockingRun
2017.12.28 20:24:39 4: (Sub PLAYBULB_Run - MyCandle1) - Running nonBlocking
connect error: Function not implemented (38)
connect: Cannot allocate memory (12)
2017.12.28 20:24:39 4: (Sub PLAYBULB_Run - MyCandle1) - Rückgabe an Auswertungsprogramm beginnt
Das devStateIcon wechselt auf ON.
Ein Klick auf eine der Farben, oder sonstige Aktion liefert: unreachable und:
Zitat
pi@RasPi3:~ $ ps ax | grep -v grep | grep "gatttool"
9042 ?        S      0:00 gatttool -b D8:A2:4B:15:AC:E6 --char-write -a 0x16 -n 06FF0000
pi@RasPi3:~ $

Grüße Knut

jonah

Zitat von: CoolTux am 03 November 2017, 06:14:49
also da sollte definitiv irgendwas kommen. Du kannst aber gerne mal

gatttool -b AC:E6:4B:07:B5:E8 --char-write-req -a 0x14 -n 0000FF0000001F00


versuchen.
Einmal wenn die Lampe aus ist, also nicht am schalter aus sondern so aus. Sprich anschalten dann macht sie ja den Farbverlauf, dann auspusten. Ja da ist ein loch beim schalter auf den pusten dann geht sie aus.
Dann den befehl abschicken.

Wenn da auch nichts passiert. Lampe an pusten und noch mal den Befehl los schicken.

Hej. Danke für die Anregungen. Wegen Prüfungskram etc. war ich dann wieder mal länger raus. Jetzt habe ich gerade wieder etwas Zeit, nachdem ich Tradfri auch wieder zum Laufen bekommen habe. Bin also sehr motiviert. :-)

Wie schon geschrieben passiert hiermit nichts:
gatttool -b AC:E6:4B:07:B5:E8 --char-write -a 0x14 -n 0000FF0000001F00

Mit der Befehls-Variation (req) funktioniert ebenfalls nichts, es gibt aber in der Konsole immerhin eine Rückmeldung, egal, ob vorher ausgepustet oder leuchtend:
pi@fhem:~ $ gatttool -b AC:E6:4B:07:B5:E8 --char-write -a 0x14 -n 0000FF0000001F00
^C
pi@fhem:~ $ gatttool -b AC:E6:4B:07:B5:E8 --char-write-req -a 0x14 -n 0000FF0000001F00
Characteristic Write Request failed: Attribute can't be written
pi@fhem:~ $ gatttool -b AC:E6:4B:07:B5:E8 --char-write-req -a 0x14 -n 0000FF0000001F00
Characteristic Write Request failed: Attribute can't be written
pi@fhem:~ $


Es läuft also weiterhin nicht so, wie es sollte. Hast du eine Idee? Danke für die tolle Unterstützung, weiterhin!

Byte09

Hi Cooltux,

ich habe leider das Problem , das ich doch recht häfig die meldung "unreachable" erhalte. insbesondere dann , wenn ich mehrere lampen nacheinander schalte, in abhängigkeit von anderen Lampen ( z.B farbe meiner Hues ) . Da ich das Problem nicht wirklich eingrenzen kann reagiere ich darauf durch durch erneutes senden des Befehls, wenn der ursprüngliche Befehl nicht durchgegangen ist . Meistens klappt es beim zweiten Versuch , einige Sekunden später.  ( reagieren tue ich hier auf state:unreachable - in meinem Fall mit einem Absent Device , könnte aber auch ein Notify  etc. sein ) . Leider habe ich , bzw das reagierende Modul , keine möglichkeit mehr, "herauszufinden" , was denn nun eigentlich der nicht ausgeführte Befehl war ( oder habe ich hier was übersehen ?! )

ich habe mir jetzt so beholfen , dass in deinem Modul entsprechende Readings gesetzt werden , schon bevor der Befehl ausgeführt wird, darauf kann ich dann im Fall eines "unreachable" zugreifen.

für mich habe ich folgendde Zeilen eingefügt:
253 readingsSingleUpdate($hash,'last_cmd',$action,1);
254 readingsSingleUpdate($hash,'last_cmd_arg',$arg,1);


ggf. könntest du das ja so oder ähnlich in die off. Version übernehmen, wäre recht hilfreich - wenn es unsinn ist , vergiss es einfach  ;)

gruss Byte09

CoolTux

Muss ich mir mal in Ruhe anschauen. Die Idee macht schon Sinn und ich wollte das Modul eh als nächstes auf NotifyFn umbauen.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net