Page 1 of 1

Storing a file with a json string - as variables for use in Rules

Posted: 02 Sep 2019, 18:53
by JR01
Hi, still struggling with my complex requirements for a Sprinkler system. See my release 1.0 https://github.com/IoTPlay/sprinklersys ... components.

I am trying to make the ESP8266 not only a dumb slave to a Controller (Node-RED & MQTT), but to be given a mandate, and to run it, independent if the Controller is available or not (release 2 in progress).

Question: Is their anywhere in the ESP_Easy stack, or roadmap, a solution where I can send a flat file, with MQTT perhaps, for storage on the ESP, in json format, which can then be read by the ESP rules engine, where the json variables can be used in formulas? For instance, the array below says which legs must be used on which days, for how long it should be on, and how long it should rest for the borehole to fill up again....

just asking.......

Code: Select all

{"legday":
  [
    [1,1,1,1,1,0,1,"L1A",15,40],
    [0,0,0,0,0,1,0,"L1B",15,40],
    [1,1,1,1,1,0,1,"L2A",15,40],
    [0,0,0,0,0,0,0,"L2B",15,40],
    [0,0,0,0,0,0,0,"L3A",15,40],
    [1,1,1,1,1,1,1,"L3B",15,40],
    [0,0,0,0,0,0,0,"L4A",15,40],
    [1,1,1,1,1,1,1,"L4B",15,40]
  ]
}

Re: Storing a file with a json string - as variables for use in Rules

Posted: 02 Sep 2019, 19:34
by TD-er
Well you can trigger events/rules based on days and time of day.
And you can upload the rule from somewhere.
So all you need is something to convert this JSON into rules and upload it to ESPeasy node.