You are describing the end-user price of a device that includes batteries, a circuit board, a WiFi transciever, a switch, and an enclosure. If the BOM and assembly costs can be brought down to $4.99, that's a miraculous feat of engineering and modern civilization's economies of scale; if it can end up on your doorstop for that price it must be subsidized.
How else could that device cost less than the gallon of industrial chemistry that you order with it?