[32_yowsup.pm] Whatsapp versenden (Mit Handy- oder Festnetznummer)

Begonnen von AHA1805, 01 Oktober 2014, 21:58:55

Vorheriges Thema - Nächstes Thema

rsteinkuhl

Hallo alle miteinander,

ich habe ein FHEM-System, dass ich mit DbLog und Configdb betreibe.
Nach einigen Schwierigkeiten mit Berechtigungen und Python, habe ich das WhatsApp-System nun am laufen.
Sowohl senden als auch empfangen funktioniert tadellos.
Mein Problem ist, wie kann ich denn Werte (Temperaturwerte, Spannungswerte ...) übermitteln, mir fehlt da einfach die genaue Syntax.

So gebe ich die Anweisung ein,
set WhatsApp send 49xxxxxxxxxxx Raumtemperatur Vorratskeller: [DS18B20_B308CB010000:temperature]°C

Doch ich bekomme nur
Raumtemperatur Vorratskeller: [DS18B20_B308CB010000:temperature]°C
angezeigt.

Wie muß ich die Anweisung schreiben, damit ich
Raumtemperatur Vorratskeller: 23,65 °C
angezeigt bekomme ?

Vielen Dank im voraus für die Hilfe

Fhemeinsteiger

Hallo rsteinkuhl,

ich glaube so:
set WhatsApp send 49xxxxxxxxxxx Raumtemperatur Vorratskeller: [TEMP:state]°C


Du müsstest natürlich vorher Raumtemperatur Vorratskeller definiert haben, in etwa:

define  Vorratskeller DS18B20_B308CB010000  (oder mit GPIO4 - hängt von deiner Anbindung der Temperatursensoren ab)

dann sollte es klappen.

Fhemeinsteiger


justme1968

das [...] ist etwas das nur innerhalb von DOIF geht.

du brauchst etwas in der art:{ fhem( "set WhatsApp send 49xxxxxxxxxxx Raumtemperatur Vorratskeller: ". ReadingsVal("DS18B20_B308CB010000","temperature","") ."C" ) }

das grad zeichen macht noch probleme.

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

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

moonsorrox

jemand ein Tipp für mich wie oder wann ich nach der Installation einen erneuten Code per SMS anfordern kann.
Ich habe wohl ein falschen eingegeben..!  :-\
Wenn ich erneut probiere kommt immer dieser fehler
status: fail
retry_after: 1852
reason: too_recent
Intel-NUC i5: FHEM-Server 6.1 :: Perl v5.18.2

Homematic: HM-USB-CFG2,HM-CFG-LAN Adapter, HM-LC-BL1-FM, HM-LC-Sw1PBU-FM, HM-LC-Sw1-PI-2, HM-WDS10-TH-O, HM-CC-TC, HM-LC-SW2-FM

justme1968

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

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

moonsorrox

OK, denn ich habe eine solch grottige Telefon Qualität das ich zwei Ziffern kaum verstanden habe...
Das war ihr Fehler  :-\
Intel-NUC i5: FHEM-Server 6.1 :: Perl v5.18.2

Homematic: HM-USB-CFG2,HM-CFG-LAN Adapter, HM-LC-BL1-FM, HM-LC-Sw1PBU-FM, HM-LC-Sw1-PI-2, HM-WDS10-TH-O, HM-CC-TC, HM-LC-SW2-FM

rsteinkuhl

Hallo alle miteinander,

{ fhem( "set WhatsApp send 49xxxxxxxxxxx Raumtemperatur Vorratskeller: ". ReadingsVal("DS18B20_B308CB010000","temperature","") ."C" ) }

genau so sollte es sein, vielen Dank, jetzt kann ich weitermachen.

Gruß Rainer

otto

Hallo versuche gerade ei DOIF mit einer Remperatur zu machen hab aber "einen"  ;) Fehler drin wie muß ich es abändern das es geht ?
und ich meine nicht die Tel-Nummer  ;D
define Temp_Alarm DOIF ([Temp:temperature] >= 26.5) ( "set WhatsApp send 49xxxxxxxxx  Raumtemperatur: ". ReadingsVal("Temp","temperature","") ."C" ) DOELSEIF ([Gefriertruhe:temperature] <= 25.5)  ( "set WhatsApp send 49xxxxxxxxxx  Raumtemperatur: ". ReadingsVal("Temp","temperature","") ."C" )

Gruß Otto
Fhem 1 wire Adapter mit FT232RL&DS2480B Raspberry PI HMLAN HM485LAN HM-LC-Sw4-PCB   HMW-IO-12-SW7-DR Funkhandsender
FRITZ!Powerline 546E

Bambi

Nabend Kollegen,
vielen Dank für eure harte Arbeit ;D

Ich war mal so frei und habe einen Wiki-Artikel angefangen: http://www.fhemwiki.de/wiki/Yowsup

Gutes N8tle noch
Bambi

moonsorrox

ich habe mal folgende Fragen
1. zu dieser Zeile
Zitatin zeile 148 muss der pfad für den aufruf und das config file angepasst werden. eventuell mit sudo und HOME setzen.
das wird noch konfigurierbar gemacht.
bei mir steht darin folgendes:
open(STDIN, "<&$fn") or die "can't redirect STDIN $!";
was muss ich hier ändern..?

2. in einer der letzten Beiträge habe ich das jetzt mal angepaßt auf mein Beispiel
{ fhem( "set WhatsApp send 4917xxxxxxxxxx Aussentemperatur Norden: ". ReadingsVal("Aussensensor_Norden","temperature","") ."C" ) }
das funktioniert nicht hier bekomme ich immer ein "not connected"

Was hingegen funktioniert sind die folgenden Beispiele:
{system("/usr/bin/python2.7 /opt/yowsup-master/yowsup-cli demos -s 491xxxxxxxxx \"Garage ist jetzt zu\" -c /opt/fhem/yowsup.cfg 2\> /tmp/test.txt")}

hier wird mir auch die Datei test.txt beschrieben und ich bekomme eine WhatsApp Meldung

{system("/usr/bin/python2.7 /opt/yowsup-master/yowsup-cli demos -s 491xxxxxxxxx \"Garage ist jetzt zu\" -c /opt/fhem/yowsup.cfg")}
das funktioniert auch und ich bekomme eine Meldung

Also die Funktion WhatsApp sollte gegeben sein, nur eben mein define WhatsApp zeigt immer "Disconnected"
Was muss ich jetzt noch einstellen, einschl. der obigen Zeile..?

Weiterhin muss ich mehrmals auf "reconnect" drücken damit ich überhaupt mal ein "Connected" bekomme

Intel-NUC i5: FHEM-Server 6.1 :: Perl v5.18.2

Homematic: HM-USB-CFG2,HM-CFG-LAN Adapter, HM-LC-BL1-FM, HM-LC-Sw1PBU-FM, HM-LC-Sw1-PI-2, HM-WDS10-TH-O, HM-CC-TC, HM-LC-SW2-FM

justme1968

1. ist nicht mehr relevant. dafür gibt es jetzt das cmd attribut

2. du kannst das modul und das yowsup nicht gleichzeitig verwenden. sobald du von hand mit der gleichen id etwas tust meldet whatsapp jeden anderen client ab.

wenn das modul diconnected ist bitte mit verbose 5 loggen und auch stdout und stderr zeigen.

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

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

Cybers

Zitat von: Cybers am 15 Juni 2015, 14:23:13
Hallo,

seit ein paar Tagen kann ich plötzlich keine Nachrichten mehr empfangen und senden. Aus Putty klappt der Versand ohne Probleme.
Hier mal mein Fhem-Log mit Verbose 4 beim Versand:
2015.06.15 14:06:20 4: HTTP FHEMWEB:47.67.42.133:55563 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2015-06.log
2015.06.15 14:06:20 4: Connection closed for FHEMWEB:47.67.42.133:55560: EOF
2015.06.15 14:06:17 4: dummy set fp_time 14:06
2015.06.15 14:06:16 4: HTTP FHEMWEB:47.67.42.133:55560 GET /fhem/FileLog_logWrapper?XHR=1&inform=type=status;filter=;since=1434369920;fmt=JSON&timestamp=1434370000162
2015.06.15 14:06:16 4: Connection closed for FHEMWEB:47.67.42.133:55568: EOF
2015.06.15 14:06:08 4: HTTP FHEMWEB:47.67.42.133:55568 GET /fhem?XHR=1&inform=type=status;filter=WhatsApp;since=1434369966;fmt=JSON&timestamp=1434369991298
2015.06.15 14:06:08 4: Connection accepted from FHEMWEB:47.67.42.133:55568
/
2015.06.15 14:06:08 4: 2206:FHEMWEB:47.67.42.133:55563: /fhem?cmd={AttrVal(%22WhatsApp%22,%22room%22,%22%22)}&XHR=1 / RL:27 / text/plain; charset=UTF-8 / Content-Encoding: gzip
2015.06.15 14:06:08 4: HTTP FHEMWEB:47.67.42.133:55563 GET /fhem?cmd={AttrVal(%22WhatsApp%22,%22room%22,%22%22)}&XHR=1
/
2015.06.15 14:06:08 4: 2206:FHEMWEB:47.67.42.133:55560: /fhem?cmd={ReadingsVal(%22WhatsApp%22,%22disconnect%22,%22%22)}&XHR=1 / RL:21 / text/plain; charset=UTF-8 / Content-Encoding: gzip
2015.06.15 14:06:08 4: HTTP FHEMWEB:47.67.42.133:55560 GET /fhem?cmd={ReadingsVal(%22WhatsApp%22,%22disconnect%22,%22%22)}&XHR=1
2015.06.15 14:06:07 4: dummy set fp_time 14:06
/
2015.06.15 14:06:07 4: 2206:FHEMWEB:47.67.42.133:55560: /fhem?detail=WhatsApp / RL:2763 / text/html; charset=UTF-8 / Content-Encoding: gzip
2015.06.15 14:06:07 4: HTTP FHEMWEB:47.67.42.133:55560 GET /fhem?detail=WhatsApp
[offline]:
Error: Not connected
2015.06.15 14:06:07 4: WhatsApp: parse:
2015.06.15 14:06:07 3: WhatsApp: sending /message send 491713165626 'Test'
2015.06.15 14:06:07 4: HTTP FHEMWEB:47.67.42.133:55560 GET /fhem&detail=WhatsApp&dev.setWhatsApp=WhatsApp&cmd.setWhatsApp=set&arg.setWhatsApp=send&val.setWhatsApp=491713131331+Test
2015.06.15 14:06:06 4: Connection closed for FHEMWEB:47.67.42.133:55559: EOF


Wenn ich ein "set WhatsApp reconnect" habe ich folgendes im Log:
2015.06.15 14:17:47 4: HTTP FHEMWEB:47.67.42.133:55755 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2015-06.log
2015.06.15 14:17:47 4: Connection accepted from FHEMWEB:47.67.42.133:55755
2015.06.15 14:17:45 4: Connection closed for FHEMWEB:47.67.42.133:55753: EOF
2015.06.15 14:17:44 4: HTTP FHEMWEB:47.67.42.133:55753 GET /fhem/FileLog_logWrapper?XHR=1&inform=type=status;filter=;since=1434369979;fmt=JSON&timestamp=1434370686755
2015.06.15 14:17:42 4: Connection closed for FHEMWEB:47.67.42.133:55745: EOF
2015.06.15 14:17:41 4: Connection closed for FHEMWEB:47.67.42.133:55752: EOF

[offline]:
general: Disconnected: Connection Closed
2015.06.15 14:17:40 4: WhatsApp: parse:

[connected]:
2015.06.15 14:17:40 4: WhatsApp: parse: general: Disconnected: Connection Closed
2015.06.15 14:17:37 4: dummy set fp_time 14:17
2015.06.15 14:17:37 3: sendWhatsApp: echo client startet
2015.06.15 14:17:37 4: Connection accepted from telnet:127.0.0.1:60611
[connected]:[connected]:
2015.06.15 14:17:35 4: WhatsApp: parse:
2015.06.15 14:17:35 4: WhatsApp: parse: Auth: Logged in!
2015.06.15 14:17:35 4: HTTP FHEMWEB:47.67.42.133:55745 GET /fhem?XHR=1&inform=type=status;filter=WhatsApp;since=1434370653;fmt=JSON&timestamp=1434370678699
2015.06.15 14:17:35 4: Connection accepted from FHEMWEB:47.67.42.133:55752
/
2015.06.15 14:17:35 4: 2206:FHEMWEB:47.67.42.133:55753: /fhem?cmd={AttrVal(%22WhatsApp%22,%22room%22,%22%22)}&XHR=1 / RL:27 / text/plain; charset=UTF-8 / Content-Encoding: gzip
2015.06.15 14:17:35 4: HTTP FHEMWEB:47.67.42.133:55753 GET /fhem?cmd={AttrVal(%22WhatsApp%22,%22room%22,%22%22)}&XHR=1
2015.06.15 14:17:35 4: Connection accepted from FHEMWEB:47.67.42.133:55753
/
2015.06.15 14:17:35 4: 2206:FHEMWEB:47.67.42.133:55745: /fhem?cmd={ReadingsVal(%22WhatsApp%22,%22disconnect%22,%22%22)}&XHR=1 / RL:21 / text/plain; charset=UTF-8 / Content-Encoding: gzip
2015.06.15 14:17:35 4: HTTP FHEMWEB:47.67.42.133:55745 GET /fhem?cmd={ReadingsVal(%22WhatsApp%22,%22disconnect%22,%22%22)}&XHR=1
2015.06.15 14:17:34 3: WhatsApp: sending /presence available
2015.06.15 14:17:34 3: WhatsApp: sending /L
2015.06.15 14:17:34 4: WhatsApp: parse: [offline]:


Type /help for available commands
==================
2015.06.15 14:17:34 4: WhatsApp: parse: Yowsup Cli client
2015.06.15 14:17:34 4: Connection closed for FHEMWEB:47.67.42.133:55750: EOF
/
2015.06.15 14:17:34 4: 2206:FHEMWEB:47.67.42.133:55745: /fhem?detail=WhatsApp / RL:2808 / text/html; charset=UTF-8 / Content-Encoding: gzip
2015.06.15 14:17:34 4: HTTP FHEMWEB:47.67.42.133:55745 GET /fhem?detail=WhatsApp
2015.06.15 14:17:34 2: WhatsApp: starting yoswup-cli: /opt/yowsup-master/yowsup-cli demos -c /opt/yowsup-master/config.example --yowsup
2015.06.15 14:17:34 3: WhatsApp: Disconnected
2015.06.15 14:17:34 3: WhatsApp: sending /disconnect
2015.06.15 14:17:34 4: HTTP FHEMWEB:47.67.42.133:55745 GET /fhem&detail=WhatsApp&dev.setWhatsApp=WhatsApp&cmd.setWhatsApp=set&arg.setWhatsApp=reconnect&val.setWhatsApp=
2015.06.15 14:17:34 4: Connection closed for FHEMWEB:47.67.42.133:55747: EOF
/
2015.06.15 14:17:33 4: 2206:FHEMWEB:47.67.42.133:55745: /fhem?cmd={ReadingsVal(%22WhatsApp%22,%22reconnect%22,%22%22)}&XHR=1 / RL:21 / text/plain; charset=UTF-8 / Content-Encoding: gzip
2015.06.15 14:17:33 4: HTTP FHEMWEB:47.67.42.133:55745 GET /fhem?cmd={ReadingsVal(%22WhatsApp%22,%22reconnect%22,%22%22)}&XHR=1



list WhatsApp ergibt folgendes:
NR         627
   NTFY_ORDER 50-WhatsApp
   PARTIAL
   PID        2327
   STATE      offline
   TIME       vor 4 Minuten
   TYPE       yowsup
   Readings:
     vor 4 Minuten   state           offline
Attributes:
   cmd        /opt/yowsup-master/yowsup-cli demos -c /opt/yowsup-master/config.example --yowsup
   group      WhatsApp
   NR         627
   NTFY_ORDER 50-WhatsApp
   PARTIAL
   PID        2327
   STATE      offline
   TIME       2015-06-15 14:17:40
   TYPE       yowsup
   Readings:
     2015-06-15 14:17:40   state           offline
Attributes:
   cmd        /opt/yowsup-master/yowsup-cli demos -c /opt/yowsup-master/config.example --yowsup
   group      WhatsApp
   room       Status


Das Yowsup-Modul ist das aktuellste.
Was kann das sein?

Gruß, Sascha

Ich habe dieses Problem immer noch nicht lösen können. Weiß vielleicht jemand weiter?

Gruß, Sascha
FHEM 6.2 auf Raspberry PI 4 / Smartvisu
Eltako Serie 14: FAM14, FGW14-USB, FSB14, FSR14-4x, FSR14-2x, FDG14, FTS14-EM in Kombination mit Jung F50 24V Tastern
1-Wire Temperatursensoren
aus alter Zeit:
Gott sei Dank nur noch 3 Homematic Jalousie- & Schaltaktoren! Wer sich mit Funk auskennt, legt Kabel

moonsorrox

Zitat von: justme1968 am 17 Juni 2015, 00:44:16
wenn das modul diconnected ist bitte mit verbose 5 loggen und auch stdout und stderr zeigen.

das ist erst mal das log, mit verbose 5, dass andere (stdout und stderr) kenne ich gar nicht muss ich mal suchen:

2015.06.17 10:24:33 3: WhatsApp: read: end of file reached while sysread
2015.06.17 10:24:33 3: WhatsApp: Disconnected
2015.06.17 10:24:33 3: WhatsApp: sending /disconnect
2015.06.17 10:24:33 1: exec failed!!!
2015.06.17 10:24:33 1: PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli": No such file or directory at ./FHEM/32_yowsup.pm line 164.
2015.06.17 10:24:33 2: WhatsApp: starting yoswup-cli: /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup
2015.06.17 10:24:33 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4293.
2015.06.17 10:24:29 1: PERL WARNING: Use of uninitialized value in hash element at fhem.pl line 1382.
2015.06.17 10:24:23 3: WhatsApp: read: end of file reached while sysread
2015.06.17 10:24:23 3: WhatsApp: Disconnected
2015.06.17 10:24:23 3: WhatsApp: sending /disconnect
2015.06.17 10:24:23 1: exec failed!!!
2015.06.17 10:24:23 1: PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli": No such file or directory at ./FHEM/32_yowsup.pm line 164.
2015.06.17 10:24:23 2: WhatsApp: starting yoswup-cli: /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup
2015.06.17 10:24:23 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4293.
2015.06.17 10:24:16 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4293.
2015.06.17 10:24:13 3: WhatsApp: read: end of file reached while sysread
2015.06.17 10:24:13 3: WhatsApp: Disconnected
2015.06.17 10:24:13 3: WhatsApp: sending /disconnect
2015.06.17 10:24:13 1: exec failed!!!
2015.06.17 10:24:13 1: PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli": No such file or directory at ./FHEM/32_yowsup.pm line 164.
2015.06.17 10:24:13 2: WhatsApp: starting yoswup-cli: /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup
2015.06.17 10:24:13 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4293.
2015.06.17 10:24:11 1: Error: Aussensensor_Terrasse has no TYPE
2015.06.17 10:24:03 3: WhatsApp: read: end of file reached while sysread
2015.06.17 10:24:03 3: WhatsApp: Disconnected
2015.06.17 10:24:03 3: WhatsApp: sending /disconnect
2015.06.17 10:24:03 1: exec failed!!!
2015.06.17 10:24:03 1: PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli": No such file or directory at ./FHEM/32_yowsup.pm line 164.
2015.06.17 10:24:03 2: WhatsApp: starting yoswup-cli: /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup
2015.06.17 10:24:03 1: PERL WARNING: Use of uninitialized value in string eq at fhem.pl line 4293.
Intel-NUC i5: FHEM-Server 6.1 :: Perl v5.18.2

Homematic: HM-USB-CFG2,HM-CFG-LAN Adapter, HM-LC-BL1-FM, HM-LC-Sw1PBU-FM, HM-LC-Sw1-PI-2, HM-WDS10-TH-O, HM-CC-TC, HM-LC-SW2-FM

JoWiemann

Hallo,

einen Hinweis hast Du schon im Log: PERL WARNING: Can't exec "/opt/local/bin/yowsup-cli": No such file or Directory

Irgendwie scheint Dein Pfad zum yowsup nicht mehr zu stimmen, oder Du hast das Attribut cmd falsch gesetzt.

Grüße Jörg
Jörg Wiemann

Slave: RPi B+ mit 512 MB, COC (868 MHz), CUL V3 (433.92MHz SlowRF); FHEMduino, Aktuelles FHEM

Master: CubieTruck; Debian; Aktuelles FHEM

VB90

Ich habe mit der Version vom 01.06. auch Probleme mit senden, empfangen.
Lange Liste Fehler im Log.
Hatte aber noch keine Zeit, die Ursache zu erforschen. Nutze deswegen die Vorversion ohne Probleme beim Versand.
Den Empfang habe ich noch nicht eingerichtet.

vb
Man muss das Rad nicht neu erfinden, nur wissen wie es gedreht wird.