How to "sendMessage" to different people/devices?

I´m just wondering if it´s possible to send messages via “sendMessage” within a rule to different people.
E.g. “Alert is ON” to all mobiles, but “washing mashine is ready” just to the mobile of my wife.

Thx!

I’m not familiar with “sendMessage.” What protocol are you wanting to use to send the notifications?

The most obvious solution is to simply do a separate “send” to each user you want to receive the notification.

I personally use Prowl which has pretty basic functionality. My wife and I would each have to sign up for an account. If the notification should go to both of us, I would push a message to both of our API keys. If it’s something that she doesn’t care about, only push to mine.

Email would be done similarly.

Looking at Pushover’s API, it seems like it may be even more flexible/powerful. It appears you can push to a user, a certain device, or a group.

You can take it a step further if you want to and send certain notifications to a person only if they are at home (or away). It doesn’t do me any good to get a notification that the laundry is done if I am not at home

Do you want an answer for a specific action/binding or in general?

If you are using openHab Cloud and the ios/android app you can send notifications that way. Within myopenhab.org you can setup multiple users and send messages to individual users based on your rule.

sendNotification("email_1@you.com", "your text here")
sendNotification("email_2@you.com", "your text here")

When you setup the app on the phone, use the 2 different user accounts

1 Like

Currently I´m using the “sendNotification” within my rules which works fine, but I was not sure whether I have to create different user accounts on “myopenhab.org” for each user separately.

@PointandClick: very good idea with sending notifications if people are at home, but I didn´t find a real working “geofencing” solution yet

You will have to create separate users.

Do i have to create a second account on myopenhab with another email-adress but same secret-key from my installation, like i used for my main-account?

Na, you can add several users via “users”. That can be reached via your login name.

Please allow me to comment on this one, even it’s a bit old.

My experiance with sendNotification is, that even I add different users on myopenhab.org, it’s not possible to sent individual messages.

Just to be clear, I’m doing like this.

I have created the myopnhab.org account based on aaa@mydomain.dk. Per default this user then appear in the users section. Then I have added two more users, bbb@mydomain.dk and ccc@mydomain.dk.

These users are logged in on different iOS devices.

I have created these two test rules:

rule "Test message 1"
when
	Item TestSwitch1 changed from OFF to ON
then
	// do something
   sendNotification("aaa@mydomain.dk", "Test message 1")	
end

rule "Test message 2"
when
	Item TestSwitch2 changed from OFF to ON
then
	// do something
   sendNotification("bbb@mydomain.dk", "Test message 2")	
end

No matter what test switch I’m activating, all 3 devices receive the messages. That’s not what I have expected, but anyway the fact.

Does anyone experience different behavior?

BR O

Hello Ole,

yes in my case it is working fine.
But I’m not using myopenhab.org. I created my own cloud, but the same system behind. Can’t see a problem here.

For single user Notifications I use:
sendNotification(“aaa@mydomain.dk”,“greetings to denmark”)

For notifications to all the users I use
sendBroadcastNotification(“greetings to denmark”)

How many devices can you see in your aaa@mydomain.dk account?

Hi Felix,

Your explanation of how it works is how I had expected it, however that’s not my experience.

I checked “devices”, and only my iPhone which is using the “main / aaa@mydomain.dk” cloud login was listed. Not the other devices, which I had imagined?

I pressed the trashcan to delete the device, and it disappeared. Then I made yet another login ddd@mydomain.dk, to use that on my own iPhone instead of using the “Main” login.

The new login connects well I suppose, based on functional access to all my sitemaps via the remote URL (Wi-Fi is disabled).

I checked “devices” again, but it is not registered on the list, it’s still complete empty. Should I expect some kind of delay before devices shows up?

Just to be sure, the extra logins beside the main one, does they have to be real? They are not, I expect it has nothing to do with e-mail communication. But I can of course add them at my domain host if they need so.

Thanks.

A short follow up on this one.

After some trial and error, the following is my experience.

To send individual messages, it is necessary that every device is registered under OpenHAB cloud “my devices”

To register a device, it is necessary to first login the device with the OpenHAB cloud “main” login, meaning the login used for OpenHAB cloud sign up / registering, referred to as aaa@mydomain.dk in my earlier post.

But if this “main” account remain logged in, push messages appears on all devices. To avoid that, I have added different users from the OpenHAB “users” interface, for every device, and logged them into each device.

So, the tricky part for me to understand was, that before every device can receive individual messages by using each own user login, it must be logged in with the main login first.

Best regards Ole.