Linking a physical toggle (light) switch to URL-broadcast status indicator

Hi folks – So many brilliant minds on here that I know someone will tell me how to do this…

I am building a home-raised, organic (chicken) egg distribution stand. There will be a weatherproof, refrigerated box there that will occasionally be loaded with containers of eggs that we produce on our property.

I want to link a physically-manipulated switch at the stand to a virtual ‘indicator’ that I can use in Smartthings as well as in a app that I am going to build. The app might rely on the status as broadcast via a URL, for instance.

The “user” is the individual who walks up to the egg stand. When he/she removes the last carton of eggs, he/she will either throw the toggle switch, indicating that the egg refrigerator is empty. The empty status will alert us to take more eggs out to the fridge. Also, community folks can use the app to see whether there are eggs for purchase or not.

Any thoughts on how to rig up a physical toggle switch to generate the indicator status I need?


Quick idea. Spring load the base of the container/fridge, put a contact sensor on the inside and a magnet on the spring loaded base. Last eggs out lets the base rise enough so the magnet can meet the contact switch indicating empty.

PS, Use WebC0RE to make a simple piston for notification, no app required.


I feel like I’m missing whatever it is that makes this complicated.

Any smartthings – controlled switch, including a battery operated switch, can trigger any other smart things controlled activity – – or act as the “if” in an IFTTT applet, Where the that could be to send a Gmail, send a Web hook through the IFTTT channel, or a lot of other things. Or, of course, as was mentioned you could use webcore in a similar way to IFTTT.

Even just the ecolink battery operated toggle would work.

Is the issue that the eggstand is too far away from the house for regular communications? Because otherwise I don’t understand what is unusual about this.

If you have actiontiles, you could even set up a dashboard with just that one switch which would be called “refill needed“ or something like that.

So what am I missing?

And of course there’s always the quirky egg minder. It was designed for home refrigerators. The problem is it’s never been 100% reliable, and although there was once an integration with smartthings, it no longer works. But it does have an IFTTT channel. And even bought from third-party sellers it only cost about $15. It’s a Wi-Fi device, so the range is excellent.

Thanks, Daven – I thought about spring loading, but the weight of the fridge will be substantial, and the difference in weight of a carton of eggs will be relatively small. Thus I could see the sensitivity of the sensor having to be quite precise. That said, it would be a great idea - no manual manipulation of a toggle switch required!

Thank you. I though the switch part should not be too complicated – I will look at your link. But the idea of porting the status outside of Smartthings, via a URL, for instance, that I could use on a dedicated app, is the part I was vexed by.

The egg stand is within Z-wave/Zigbee range, so that’s not a problem.

And I’ve got Actiontiles, but I’ve yet to really dive deeply into it. I want my neighbors to be able to click the app to see when eggs are there, or not, and/or get push notifications if they want them. Maybe Actiontiles is the solution.

Just a quick comment, but the main problem I see here is not technical, as @JDRoberts says, the tech part is very easy to solve. Your biggest problem is people. :slight_smile:

If you’re relying on your customers to remember to flip a switch you’re going to end up w/a fair number of false “in-stock” status events (no eggs left but forget to flip switch) and likely a smaller number of false customer “out-of-stock” status events (eggs left, but flipped switch saying out), and staff forgetting and forgets to flip the switch back after restocking.

Either way, once you “promise” your customers that you have stock by giving them an online tool that depends on people (not to mention SmartThings reliability), they (and you) are going to get fooled sometimes. :slight_smile: Of course, that may be better than your current situation, where you can’t communicate at all, but customers tend to get mad when they are told one thing and find another.

So you can solve the “How do I provide a switch for people to hit?” issue easily, but you may find it harder to solve the “How do I get people to hit the switch?” issue. Just ask me how often my family remembers to turn off a light when leaving a room…

Good luck w/this.


I agree with you, Dana - this is a concern. Maybe I should reconsider Daven’s idea of using a weight sensor. Or figure out how Amazon Go is monitoring items being taken out of their new stores. LOL. Going to consider all these ideas!


If you could find a camera that can survive long-term inside the box, and it’s signal could get out of the box (or you can run ethernet to it), you could have a live egg cam. :smiley: If you found a usable POE camera you could get power and network to it in one cable. No notifications, tho, you’d have to check it to see status.

Heck, I’d watch that channel!

I’VE GOT IT! (Not really, but this is fun.)

Approach: Find out how many times the door of your refrigerator has to be opened before you sell the X number of cartons in it. Then count door open events to track stock. E.g., 1.3 open events per carton sold. 20 open events = 20/1.3=~15 cartons sold. If box holds 30 cartons, 40 door open events and it’s empty.

To make this work:

  1. Put a contact sensor on the door.
  2. Data gathering phase: Monitor number of door openings it takes to sell a known quantity of eggs in the box. The number will vary, but if you always restock at the same number of eggs in the box it will be pretty easy to get to a pretty concrete door open to cartons sold ratio. You don’t need to track events real time, just need time stamps of when eggs were refilled, and how many were required to refill the box.
  3. After you have some data crunched, set a reasonably “safe” margin to test. E.g., If your door openings to cartons sold average is 1.3, then set your warning level 1 open/carton, and set an alarm for employees to check when it hits enough openings to sell the amount of eggs stocked. (If you always fill the refrigerator w/the same number egg cartons the math/management of this is easier.)
  4. Assuming your door open to cartons sold ratio isn’t moving all over the place, you’ll be able to confirm a safe value with a little testing. (You may need to have two ratios - normal price and sale price. And sorry, Easter is going to be impossible. :slight_smile: )
  5. Set your in/out of stock notifications using that value, and set an alarm to refill the box when hit the number of door open events to put you close to empty. Use the same info to let customers know when you have eggs.


Amazon Go uses cameras. Lots and lots of cameras. Plus scales on the shelves.

The ceiling of the store has multiple cameras and store shelves have weight sensors, to detect which item(s) a customer took

What’s your budget for this part of the project?

Right. Not that much. It’s a humble egg stand.

1 Like

Then I would consider some kind of pressure mat/scale implementation. Rather than a switch. You probably won’t be able to get it down to the last individual egg, but you should be able to get it down to about a 8 ounce variance.

Ideally, you would rig it so that the pressure Mat is under the refrigerator but the network device is off to the side.

Take a look at the following and see if it gives you any ideas:

Again, the tricky thing will be to get the calibration just right. But it means only one device (so the cost is lower) and reporting would happen automatically so you don’t have to worry about customers forgetting.

Once you get the notification from the pressure Mat, then you can use web core to turn on a virtual switch or send a webhook or whatever

Thank you. Great idea. I actually used a pressure mat for another Smart
Switch, but I didn’t think about using a pressure mat for this. Great idea!

1 Like

Just ordered the pressure map. What is a webhook, by the way?

Sorry - Just Googled Webhook; got it!

1 Like