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

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
JR01
Normal user
Posts: 237
Joined: 14 Feb 2016, 21:04
Location: South Africa
Contact:

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

#1 Post by JR01 » 02 Sep 2019, 18:53

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]
  ]
}
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay . Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

TD-er
Core team member
Posts: 1603
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

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

#2 Post by TD-er » 02 Sep 2019, 19:34

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests