again i got a question and need a little bit of your help.
i am trying to create a rule, that sends time-based a push notification (states of a few items) to my iphone. the openhab-app is installed on the iphone and the openhab cloudservice is activated.
what are the next steps now? do i just need to create a rule now (which commands?) oder do i have to install/configure some more addons (which do i need?)
now i got this rule and so far it is working fine, but i want the notification to be sent when the value rises above 50. how can i express it in the rule?
rule "Luftfeuchtigkeit"
when
Item tado_wohnzimmer_Humidity changed or
Item tado_badezimmer_Humidity changed or
Item tado_schlafzimmer_Humidity changed
then
sendNotification("xxx@yyy.de",
"Die Luftfeuchtigkeit ist zu hoch - Fenster öffnen und Lüften!"
)
end
also it would be great to know, how i can get the message in two lines…
i am not sure but i think then i would get a notification for every change thats above 50, but i want to get just one notification, when the value of one of the items rises above 50. the next notification should be sent when the value falls under 50 and then rises again…
i thought there maybe could be a way to create the rule like this:
send notificatition, when the value changes from <50 to >50
You might want to try \n as stated and not /n as you have in your code…
I‘ve not tried it but a newline is definitely indicated by a backslash + n…
Maybe this helps.
By the way: can you provide a screenshot of the actual notification?
I am searching for something good-looking and ad-free and configurable (maybe with icon for warnings) for iOS…
sorry for my late reply, but i had to do a completely new installation of my homeserver and also my openhab, what took a while.
It seems like in this time some changes were made, because now i get the output i was especting. Nevertheless you where right with your hint to use \n - but now you get a full empty line using \n.
actually my code looks like this an i get the following ios notification:
rule "Spritpreise"
when
Item Test_Notification changed or
Item TankstelleHoyerDodenhof_E10 changed or
Item TankstelleTeamLilienthal_E10 changed or
Item TankstelleHoyerOttersberg_E10 changed
then
if (Rule_Spritpreise.state == ON) {
sendNotification("abc@exy.com",
"Aktuelle E10-Preise:
Hoyer Dodenhof " +TankstelleHoyerDodenhof_E10.state+ "€
Hoyer Ottersberg " +TankstelleHoyerOttersberg_E10.state+ "€
TEAM Lilienthal " +TankstelleTeamLilienthal_E10.state+ "€"
)
}
Brilliant thanks! If anyone is still struggling I also had to remove a previous device from myopenhab, reinstall the app on my iphone and then it worked as per instructions above.