Monitor state of switch

Hey guys I have a problem. I need a device to send command to raspberry pi.

Let me explain:

I have a switch that I have setup years ago, I need to measure the state of the switch. If the switch is on I want a sensor to measure it is on or off. I mean if the switch is turned on, it must have electric pass through (obviously), now I need something to connect to the end of the switch to fire a command to the pi if electric current is presence (using wifi, zwave, zigbee anything)

Any help is appreciated!

Maybe this is something for you.

There are plug-in appliance modules that let you control a device (on/off) remotely via WiFi, zwave, or zigbee. Your application doesnā€™t appear to need the ability to control the device but some of these modules also monitor the amount of power consumed. There are examples, here on this forum, of people using power consumption as a means of determining if the device is actually operating. For example, a TV may be in standby mode and drawing very little current. However, when it is truly ON it is consuming more power and the module will report an increase in power consumption.


EDIT
Most of these ā€˜power monitoringā€™ devices are based on a magnetic current sensor. Hereā€™s a homebrew version (the magnetic current sensor is plainly visible) but the appliance module I described offers the convenience of a neat, ready-built solution.

1 Like

Can you show me the sample arduino code or any github link to that? Please show me how you done that! Thanks!

You can use any firmware that can be flashed to a ESPxx.



https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html

and so onā€¦

EDIT: When itā€™s connected to your WLan you can use the Wake on LAN Switch to monitor only if the ESP8266 has power or not.

Hereā€™s an example of what I mentioned earlier. The Sonoff Pow r2 Switch:
https://www.itead.cc/smart-home/sonoff-pow-r2.html

You can replace its firmware with Tasmota and itā€™ll report (via WiFi) its energy, voltage, power, and current (and more) as MQTT topics.

1 Like