# How to store device(Sonoff,s) status in database using node-red?

**URL:** <https://discourse.nodered.org/t/how-to-store-device-sonoff-s-status-in-database-using-node-red/4765>\
**Category:** General\
**Created:** [11 November 2018 09:13 UTC](https://discourse.nodered.org/t/how-to-store-device-sonoff-s-status-in-database-using-node-red/4765 "2018-11-11T09:13:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [11 November 2018 12:21 UTC](https://discourse.nodered.org/t/how-to-store-device-sonoff-s-status-in-database-using-node-red/4765/5 "2018-11-11T12:21:55Z")

</div>

I install mosquitto on my pi and then use OpenHab in the Sonoff 'Controlers' Protocol.  
If you look at the thread [Coffee pot timer](https://discourse.nodered.org/t/coffee-pot-timer/4743) you will see how I set the controler on a SonOff S20 switch. That and the flow should get you pointed in the right direction.

---

_[View the full topic](https://discourse.nodered.org/t/how-to-store-device-sonoff-s-status-in-database-using-node-red/4765)._
