need something that will send an email when a switch is flipped.

Hi Everyone,
I am trying to make something that will send me an email when power is cut or restored. I can use a no/nc relay to trigger an event, so i need something that can register the relay switch changing in both directions to to send me an email that the power state has changed.
Background, i have a heat pump heating system. The power company has an RF switch that they can turn the heat pump on and off with if they need to load shed. I want to get an alert on my phone when the power is cut and when it is returned, so i can heat my house with an alternate source if i need to.
Thanks for any and all help. I am new to Arduino, and am looking to see the feasibility of this.

Why not just use a second thermostat set at a lower setting , switching your alternative heat source - then if the heat pump doesn’t work the alternative system
Will switch in automatically .

i would except that alternate is a wood stove that I need to light :wink:
This house is new to me so I am not sure how long they cycle it off or how fast the house cools down yet, but I'd like to know when how often, what times, etc so I can figure it out, and know how long the house can go without the heat pump before it gets below 50 if no one is home.

You be better off logging the internal and external temperatures in that case as well as when the pump goes off . Knowing that rate of cooling is in this case roughly proportional to temperature difference ( but wind but wind speed and direction have an effect) you should be able to roughly model and predict how long it will take for the house to cool for given outside conditions .
Just knowing when the heating is off won’t give the full position.

Google for stuff on heat loss.

There are SMS shields for the UNO , that plus the supplied library examples should get you started in respect of your original request

A WeMOS D1 Mini can link to your WiFi router and send you notifications via email. Power it via a "phone charger."

Actually, an ESP-01 and its adapter plugged straight into the "charger" is ridiculously compact. :grinning:

That way the moment you lose power the ESP loses power, and can not send out the e-mail (or even record when it happened) telling when the power was lost. It can only tell you when power is restored.

wvmarle:
That way the moment you lose power the ESP loses power, and can not send out the e-mail (or even record when it happened) telling when the power was lost. It can only tell you when power is restored.

I recommend you read the second paragraph of the OP with some care to determine what it actually is that is wanted.