Hi,
This is my first message but I’ve been reading the community for a long time ago and I would like to say that I’m learning a lot and I appreciate all the help that the members of the community provide:)
If I’m writing now is because I created a rules file with notifications of Telegram (all are running perfect) but I would like to know if there is a possibility to deactivate or activate them when I want. I await your response and thank you very much for everything. By the way, as I said before, it’s the first time I write and if I haven’t done it well, please say it to get it right next time.
-
Platform information:
- Hardware: Raspberry PI 3B
- OS: openHABian v1.4.1
- Java Runtime Environment: openjdk version “1.8.0_152”
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8 .0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, m ixed mode, Evaluation)
openHAB version: openHAB 2
-
Issue of the topic: Switch for turning on/off Telegram notifications
-
Please post configurations (if applicable):
- Items configuration related to the issue
// Activación-desactivación avisos apertura móvil
Switch Notificaciones_telegram “Estado[%s]” (Home, Escenas) - Sitemap configuration related to the issue
Group item=Escenas {
Frame label=“Notificaciones Telegram”
Switch item=Notificaciones_telegram
} - Rules code related to the issue
/* Mensaje de texto */
rule “Puerta almacén - Apertura”
when
Item PuertaAlmacN_isOpen changed
then
if(PuertaAlmacN_isOpen.state == OPEN)
{
logInfo(“notifications”, “Sending notification via Telegram.”)
sendTelegram(“Juanma”,
“Juanma, ¡la puerta del almacén se ha ABIERTO!”)
}
if(PuertaAlmacN_isOpen.state == CLOSED)
{
logInfo(“notifications”, “Sending notification via Telegram.”)
sendTelegram(“Juanma”,
“Juanma, ¡la puerta del almacén se ha CERRADO!”)
}
end - Services configuration related to the issue
- Items configuration related to the issue
-
If logs where generated please post these here using code fences: