Hello fellow smart home enthusiasts! I’ve been diving into the world of network bindings and rule triggers in my OpenHAB setup, and I wanted to share my journey and some questions I’ve encountered along the way. ![]()
For months now, I’ve been using the network binding to monitor the online status of various devices around my home. It’s been a fantastic way to keep track of which devices are connected and which might be offline. My sitemap has been a great visual aid, showing me at a glance which devices are responding to pings and which aren’t. Here’s a quick look at how I’ve set it up:
network.things
plaintext
Thing network:pingdevice:192_168_1_5 “PC Despacho” [ hostname=“192.168.1.5”]
network.items
plaintext
Switch Ping_PC_Despacho “PC Despacho” <man_1> { channel=“network:pingdevice:192_168_1_5:online” }
network.sitemap
plaintext
Text item=Ping_PC_Despacho label=“PC Despacho [MAP(es.map):%s]” valuecolor=[==ON=“green”]
The setup works beautifully for monitoring, but I’ve hit a snag when trying to create a rule that triggers based on the online status of these devices. My goal is to send an email notification whenever a device goes offline or comes back online. Here’s what I’ve tried so far:
network.rules
plaintext
rule “Despacho Ping”
when
Item Ping_PC_Despacho changed
then
if (Ping_PC_Despacho == OFF) {
sendMail(“XXXX@XXX.com”, “[OH] Ping PC Fran OFF”, “Ordenador de Fran SIN RED”)
}
if (Ping_PC_Despacho == ON) {
sendMail(“XXXX@XXX.com”, “[OH] Ping PC Fran ON”, “Ordenador de Fran conectado”)
}
end
I’ve also experimented with triggering the rule based on changes to the Thing itself:
plaintext
rule “Despacho Ping 2”
when
Thing network:pingdevice:192_168_1_5 changed
then
if (Ping_PC_Despacho == OFF) {
sendMail(“XXXX@XXXX.com”, “[OH] Ping PC Fran OFF”, “Ordenador de Fran SIN RED”)
}
if (Ping_PC_Despacho == ON) {
sendMail(“XXXX@XXXX.com”, “[OH] Ping PC Fran ON”, “Ordenador de Fran conectado”)
}
end
Unfortunately, neither of these approaches has worked as expected. I’m seeing the state changes in my events.log file, but no emails are being sent. I’m wondering if there’s something fundamental I’m missing in how these rules are structured or triggered. Any insights or suggestions from the community would be greatly appreciated! ![]()
On a lighter note, I’ve also been exploring some new lighting solutions from Govee and experimenting with integrating them into my smart home setup. It’s been a fun way to enhance the ambiance of my space while learning more about different lighting technologies. If anyone has tips or experiences to share on that front, I’d love to hear them! ![]()
Looking forward to connecting with you all and learning more about your smart home adventures! ![]()