Whatsapp aka. yowsup helper functions

That’s the nice part, nothing :slight_smile: I chose the following:

which has no fixed costs. Would be a bit expensive if I chose to really place a call with it or use Internet with it, but two days after activating and playing a bit with WhatsApp on an old mobile phone, I’ll remove the SIM and place it somewhere safe where it will never touch a mobile network again :see_no_evil:

Perfect, thank you alot! Mine will arrive in 2-3 days. Time to work on the repo integration!

Mobilfunkanbieter hassen diesen Trick! Let’s get this to work hehe.


Where do I get the key db path and API key?
I know that whatsapp bans mobile numbers pretty quickly, what can I do to avoid this?
And I’m currently unsure which steps the binding already does, and which I should do myself.
I can read the instructions on the top of this thread, but what does the binding do of it automatically yet?

Edit:
Just read the readme on the GitHub repo, it’s pretty well documented.
Thanks marcus!
Deleted the .jar addon and the item and will start digging into it when my SIM card arrives :slight_smile:

just to say that the binding is still working perfectly, and I’ve integrated it into my production openHAB server

Together with @Nico111 we updated the installation notes (becoming a bit more precise)

@hakan progress on the docker image?

Someone else registered successful?

2 Likes

Not yet. Yesterday, I spent some time trying to get things working with a “normal” installation, but failed to send a message as the axolotl libraries were not available. Maybe I can continue on this on Friday.

On a positive note, I could successfully register my SIM after playing WhatsApp ping-pong with my “real” account and the one for yowsup.

by the way: I forgot to post the rule example:

rule "whatsapp-in"
when 
	Item WhatsAppMessage_In changed
then
	logInfo("WhatsApp", "Received message: " + WhatsAppMessage_In.state);

	logInfo("WhatsApp", "Do echo: " + WhatsAppMessage_In.state);
	WhatsAppMessage_Out.sendCommand(WhatsAppMessage_In.state.toString());
end

I verified to register a new number (O2, ordered with the link above - thx!!) using the above step-by-step and it was successful. I used MCN=262 and MCC=3, CC=49 after 6 days WhatsApp ping pong with 4 other numbers.

I used:

    _MD5_CLASSES = "/nO5k03+jTWUwNqMcanCZg=="
    _VERSION = "2.19.9"

in env_android.py. (don’t forget to run ./setup.py install)

@Nico111 What’s your progress? Make sure to use the above MD5/Version and -E android for the registration and omit it for demos.

This is the proof that any rumors about “stopped working”, “no longer supported, because S40 was dropped by 31.12.2018” etc. are wrong. It still works!

I verified to register a new number (O2, ordered with the link above - thx!!) using the above step-by-step and it was successful. I used MCN=262 and MCC=3, CC=49 after 6 days WhatsApp ping pong with 4 other numbers.

I used:

    _MD5_CLASSES = "/nO5k03+jTWUwNqMcanCZg=="
    _VERSION = "2.19.9"

in env_android.py. (don’t forget to run ./setup.py install)

@Nico111 What’s your progress? Make sure to use the above MD5/Version and -E

after ping ponging with some contacts for another 4-5 days everything is working perfectly!

@dan12345 Is your number still working?
@Nico111 and me are getting login errors since today

oh no - me too!

Your work on this has been fantastic, but I confess I’ve been unfaithful, and have been using Telegram more and more. The platform actually invites people using it for bots, and it seems to work very well indeed…

good news: It seems that the yowsup project was reactivated and making progress. Version 3.2 was just released.

I’m currently checking if WhatsApp access is possible again. If so the next step would be to verify yowsup-cli and the binding integration.

Thanks @Nico111 for the heads up.

Everyone: Any help to verify the status is welcome

1 Like

we are back - yowsup 3.2.0 provides access to the current WhatsApp interface. The binding required a small modification on starting yowsup-cli. Please check out this build:
https://github.com/markus7017/org.openhab.binding.whatsapp/blob/2.4.1-yowsup3.2.0/target/org.openhab.binding.whatsapp-2.4.0-SNAPSHOT.jar

Installing yowsup 3.2 (Delete all yowsup versions / data on your system before installing):

Run the following command if you don’t have Python 3.6 already installed (I used Python 3.6.5)

apt-get install python3.6

Install nessesary modules required by yowsup 3.2.0

wget https://github.com/tgalal/yowsup/archive/v3.2.0.zip
unzip ../v3.2.0.zip
pip3.6 install --upgrade pip
pip3.6 install cryptography==2.5
pip3.6 install consonance==0.1.2
pip3.6 install python-axolotl>=0.1.39
pip3.6 install protobuf>=3.6.0
pip3.6 install six==1.10
pip3.6 install certifi
pip3.6 install config.manager
pip3.6 install yowsup==3.2.0

Run “yowsup-cli version” to verify that version 3.2 is installed.

Please keep in mind that new numbers require the initial message ping pong for several days, otherwise your number gets blocked.

Register your number

yowsup-cli registration --requestcode sms --config-phone <mobile number> --config-cc 49 --config-mcc <mcc> --config-mnc <mnc>
yowsup-cli registration --register <received SMS code> --config-phone <mobile number>

<mcc> - mobile country code, for Germany 262
<mnc> - mobile network code, e.g. 1 for T-Mobile
check out https://en.wikipedia.org/wiki/List_of_mobile_codes_by_country for other networks

Verify your setup:

yowsup-cli registration demos --config-phone <mobile number> -s <destination number> "Hello from openHAB"

Copy the updated binding jar to the addons folder and send a message via PaperUI->Control
Text Message->Outbound
format: <target number&Guten Tag,;:<message>

Feedback welcome.

2 Likes

Hi @markus7017, regarding the yowsup library. I’m currently working on this library. Could you please help me to configure it. I’m looking a person to help me on this matter. Please add me on skype live:nabila.ismail010795 or hit me on email nabila.ismail010795@gmail.com.

Your response is very appreciate.

Are you sure that the latest yowsup build works with WhatsApp nowadays? They disabled the old API beginning of last year. I know that there was additional work on the library, but don’t have the latest status. If you can send and receive messages with yowsup it should be easy to integrate a current build (unless they changed the concept significantly).

@markus7017
hi ,do you also working on whatsapp api now?
i have some plan,if you want to touch,pls contect me ,my email:hq.net@hotmail.com

AFAIK there is no project implementing a working WhatsApp API. The only one is tge official WhatsApp Business API, but it has costs and also relevant restrictions with regards to bidirectional communication, e.g. the user has to initiate communication, the creates kind of a consent with the services provider, but gets revoked after 24h. The are service provider on the market, bit affected with the same restrictions. This sucks, I wanted to use WA for OH alarming. As an alternative I’m using Telegram, which also has a IH integration, but I’m used to WA on a daily basis.

This was also the reason why the yowsup project went silent.

Let me know if you are aware of any other solution.