SONOFF and IFTTT ZERO EXPORT to GRID

I need code for IFTTT (if its possible) to work with SONOFF modules: POW R2, ifan2, 4CHR2 and PRO and S26:

Read POW current/power then power up specific channels.

Must include enable/disable code run switch: read sonoff button state:

IF OFF disable code and power off all the channels controlled in the code INCLUDING POW SOLAR1

IF ON run code and power up POW SOLAR1:

Wait 140 or more seconds after power up the POW SOLAR1 then

Read POW power of 6 modules in the WIFI/LAN:

POW 1 = 120w

POW 2 = 60w

POW 3 = 10w

POW 4 = 0W

POW 5 = 120W

POW SOLAR1 = 780W

CALCULATE

GRIDEnergyConsumption= SUM (POW 1 TO 5) - POW SOLAR1 = positive, zero or negative (in this case = -310watts)

If positive or zero the solar is at max power off all switches off except POW SOLAR1

if negative then power on/off channels so that the GRIDEnergyConsumption = 0 or less positive possible

Power SONOFF channels constants defined:

4CH PRO 1:

channel 1 = 100w (one 100w calibrated lamp connected to this channel)

channel 2 = 40 w (one 40w calibrated lamp connected to this channel)

channel 3 = 80 w

channel 4 = 200 w

4CH PRO 2:

channel 1 = 110w

channel 2 = 90 w

channel 3 = 150 w

channel 4 = 300 w

if its possible

Fancontroller = 0 to 500w (i think can be linear consumption controlled)

so the code must power on 310 watts near or equivalent channels

for example

enable channel 1,2,3,4 = 100 + 40 + 80 + 200 = 420watts

420-310=110 watts exceded

enable just channels 110w + 200w = 310 watts solved

or

if the fan can be linear controlled = set speed to needed watts x 100% / 500 watts

Taidot: ActionScript, Web API

Tietoa työnantajasta:
( 0 arvostelua ) Portugal

Projektin tunnus: #18166294