Device loses communication with MiCasaVerde

I am fairly new to the home automation world and brand new to the world of Vera. I have a Vera2 system with a Train thermostat. This is my only device as I wanted to get this working before purchasing other devices.

I have this working fairly well but I am wondering if there is a way to have the Vera system send a notification if the device stops responding. I had a situation last night where the breaker tripped that controls the thermostat and because it had no power I did not get any notifications from the device. It would be nice if the Vera2 would send me an email or text saying it cannot communicate with the device anymore so that I know it is down.

Thanks for any help.

Take a look to this

http://forum.mios.com/index.php?topic=5130.0

WOW! seems like a lot for what I would considered pretty simple functionality. I guess I have some learning to do on where this code is written and stored.

I was hoping there was a GUI for making this setting change but I figure I was going to have to get into this code eventually.

In the next firmware that will be released hopefully pretty soon, there is code added that if a device has not communicated with vera for over 72 hours, it will log it. I believe this can be used to send a notification.

  • Garrett

Here’s one way to do what you are looking for that works (at least on my system). For event notification I took the send email code from guessed and put it in its own function, stored the function in the Startup Lua tab (found under the MIOS Developer icon in the toolbox). Be sure to change first 5 variables to match your e-mail account information (usually provided by your ISP).

[code]function send_email (email_to, email_subject, email_message)
– change these to match the information from your email provider
local SMTP_SERVER = “mail.youremail.com
local SMTP_AUTH_USER = “your_userid”
local SMTP_AUTH_PW = “your_password”
local SMTP_PORT = “25”
local USER_SENDING = “your_email_address”

local smtp = require(“socket.smtp”)
local rcpt = {email_to}
local mesgt = {
headers = {
to = email_to,
from = USER_SENDING,
subject = email_subject
},
body = email_message
}
local r, e = smtp.send{
from = USER_SENDING,
rcpt = rcpt,
source = smtp.message(mesgt),
server = SMTP_SERVER,
port = SMTP_PORT,
user = SMTP_AUTH_USER,
password = SMTP_AUTH_PW
}
end[/code]

Next I created a scene that runs on a timer that polls the device every day (pick what ever timing is appropriate for your situation). The code needed (stored in the Luup tab of that scene) to poll is as follows.

local lul_comm = luup.variable_get("urn:micasaverde-com:serviceId:HaDevice1","CommFailure", 22) if ( lul_comm == "1" ) then send_email( "your_email_address_here", "email subject goes here", "email message goes here") end

Change the 22 to the device id of your thermostat, and put your email address, subject and message in the send_email function call.

Hello Guard,

For me it seem doesn’t work correctly, when the device is not reachable, it return always 0.
Do you have some idea ? It is necessary to poll the node before do the request ?