46

My friend and I are in a university and we have been asked by the agriculture professor to create automated watering systems for plants. We want to have control over the grow lights so are there any commercial product that has an API that I can turn on/off/query power consumption through a request HTTP request, etc.

We just need to control 300w-1200w equivalent LED grow lights.

hardillb
  • 12,813
  • 1
  • 21
  • 34
Trevin Corkery
  • 563
  • 1
  • 4
  • 4

13 Answers13

17

The easiest to use is Shelly. They have relays and smart plugs and you can control them via http, like this:

http://your-shelly-ip/relay/0?turn=off

Here is the reference. If you use authentication the syntax is:

http://user:pass@[deviceIP]/relay/[channel]?[command]&[command]
anonymous2
  • 4,902
  • 3
  • 22
  • 49
ILO Romero
  • 171
  • 1
  • 3
14

A couple of options off the top of my head.

  1. Sonoff kit, can be flashed with open source firmware that allows control via MQTT/HTTP. While not sockets directly adding it into the cable is not hard. The Sonoff Pow does control and power monitoring.
  2. Belkin's WeMo sockets use SOAP messages and uPnP which is self describing (you can see my notes on working out the messages here). The Wemo Insight does control and power monitoring.

Those are mainly consumer grade kit, there is a huge amount of industrial kit using protocols like modbus that will do the same sort of thing.

hardillb
  • 12,813
  • 1
  • 21
  • 34
6

Check out Wifiplug.co.uk they provide the hardware and open API for 3 pin plug (UK, ASIA etc)

API here: Developer.wifiplug.co.uk

Free API for hobbyists - excellent suppport too.enter image description here

DeDo1
  • 61
  • 1
  • 1
4

Netio makes industrial grade smart power strip. It is a bit pricey but has ton of open interfaces(SOAP, REST, MQTT, CGI and more) and you can download the specs from their site. It even has wired ethernet port.

https://www.netio-products.com/en/device/netio-4all

4

After struggling to find smart plugs with an open API, I found a stable workaround that can work for a lot of personal projects.

I noticed that a lot of smart plugs have an IFTTT service, from which you can query the different functionalities. As you can interact with IFTTT in a lot of different ways (mail, webhook, etc.), this could allow to create quite complex apps using IFTTT as an endpoint to interact with the plug.

For example, you can setup an IFTTT webhook, which is basically a web request (GET or POST) to IFTTT which can trigger an action to turn the plug on or off. I tested this with a D-Link plug I had (DSP-W115) and it worked as expected.

Some products for which I found an IFTTT service are: D-Link, TP-Link or WeMo.

jinnlao
  • 141
  • 1
3

This website provides a list of devices compatible with Tasmota and likely ESPhome because based on ESP8266 or similar chips. After reflashing you can control them easily.

FarO
  • 303
  • 1
  • 7
2

For switching a 1200W devices you can use ESP8266 incl relay.

You can upload a generic Arduino code to control it, or even more- use Home Assistant for controlling and scheduling.

Aurora0001
  • 18,520
  • 13
  • 55
  • 169
guyd
  • 899
  • 9
  • 17
2

I was looking for something similar today and found the CloudFree smart plug which should work. That one supports 10 amps. That same site also has other consumer products they have flashed with open source firmware which will do the same thing and support up to 15 amps.

anonymous2
  • 4,902
  • 3
  • 22
  • 49
2

If you have an amazon alexa and your device is compatible to be controlled with it, you can use voicemonkey.

  1. You install the voicemonkey skill
  2. You go to the voicemonkey web and create a 'monkey' with a name, let's say "foo"
  3. You create an alexa routine that will perform your desired action, the trigger of the routine will be a "smart home" called "foo"
  4. You go to the webmonkey web and copy the URL from the 'monkey'.
  5. With that URL you'll be able to perform the alexa routine

I've been using this with the macro keys from my keyboard in order to switch off the AC and lamps when I'm going to bed and works like a charm, hope it'll help you

Kaostias
  • 121
  • 2
1

Take a look at the Kiwi Warmer Rowi: https://www.vaiotech.co.nz/products/. It is a fully customisable and programmable Smart Plug with open API (no need to connect with the cloud). And it is possible to use the Firmware SDK to write own C/C++ code as well as create own Mobile Apps using their Mobile App SDK.

user14665305
  • 111
  • 1
1

Generally speaking, in such case one would simply use a relay. A relay is exactly a "smart plug" without the smart part, basically a relay is a simple device that will flip a switch based on a command, that command can be simply to put a certain voltage to it's pin (most likely 3.3V or 5V when it comes to IOT). The command can also be via I2C, for instance with this relay you will have to use I2C to explain to the relay board which switch you want to flip.

So one would basically connect a relay to a Micro Controller Unit (MCU) with the necessary connectivity to receive the command and pass them to the relay.

I assume that you are also going to use some sensor and this kind of things.

There's two approach, either you buy each individual "smart" stuff ie sensors relays and so on which will include in each of them a MCU + one feature (for instance relays or sensor or electrovalve or whatever).

Or the most commonly use approach at least in R&D is to drive down the cost by using one or several MCU as needed (for instance ESP32 family) and using them as the base board for the sensors and relays and so on, you would use them to get data from the sensor using and switching outputs such as relays or electrovalves.

If for some reason you would be requiring more that one MCU then we would go with a "gateway" that will act as the brain of the operation. And that gateway board would control your slaves, and all your requests would go through it and the slaves will go through the gateway to get to you.

Usually this gateway board use a slightly bigger and easier to use processor for instance something running able to run Linux as IMX6, IMX8 or raspberry pi or something like that with the proper connectivity and servers one would need. You will choose this board for instance based on you criteria of connectivity, do you need ethernet? Bluetooth? Wifi? RF? GSM? Sigfox? RF? And then it's capacity to run what you will need it to run such as a REST Api, MQTT server, Socket server and so on.

YCN-
  • 473
  • 2
  • 10
0

You can make your own device for your requirement using NodeMCU and Solid State Relay. This can link with Google Assistant or Amazon Alexa too. For more information visit: https://websevice.lk OR https://sinric.com

LahiruTM
  • 121
  • 3
0

You might want to look at Rowi 2 - https://www.kiwi-warmer.co.nz/for-developers/

It's a Smart Plug with open REST API with HTTP and HTTPS. According to documentation it also has MQTT support for uploading data to AWS and other clouds that have an MQTT broker running on it.

REST API example:

ON
curl -H "Content-Type: application/json" -X POST http://192.168.0.164/setRelayStatus -d '{"data": "on"}'

OFF curl -H "Content-Type: application/json" -X POST http://192.168.0.164/setRelayStatus -d '{"data": "off”}'

Their latest version comes with external sensors for Temperature and Humidity connected via I2C.

user14665305
  • 111
  • 1