Are Rulesets selectable?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Are Rulesets selectable?

#11 Post by grovkillen » 06 Jan 2018, 23:25

Shardan wrote: 06 Jan 2018, 22:43
grovkillen wrote: 06 Jan 2018, 19:53 To me decentralizing makes the controller implementation a lot more stream line since I don't have to handle internal logic of every single unit. I like to have the controller only acting like a link between all nodes/units since they are the ones that actually do something.

But I know that this is a ongoing debate, some think large mainframes and thin clients are the way to go, some think the opposite... :ugeek:
I agree.
I see that like an organism, the human body for example. Most things are done automatically.
The eye's iris adapts automatically to brightnes, the brain gets just the information about more or less bright.
I could list a lot of such processes here.
So my sensors/actors (should) do most things based on themselves and just give info to my FHEM controller.
Only really complex sets with may rules and much logic, possibly including data from several sensors and
actions for many actors should be done by the controller.
Great analogy Shard! :D
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Are Rulesets selectable?

#12 Post by papperone » 07 Jan 2018, 13:02

Pasters wrote: 06 Jan 2018, 19:34
papperone wrote: 24 Dec 2017, 15:18 +1

I need to admin I have all this logic in my server/broker but indeed it coudl be great to be able to decentralize this to a single module!
What would be the benefit of decentralizing this to a single module, Papperone? Just curious.
Justa a stupid example: Garden Light control rules
- I have 2 different setup (winter and summer) which are selectable on the server as the ESPEasy modules are brainless (simply handlng on/off of devices)
- Each setup has different rules and presets which at the moment are handled at server level
- If I add a new device/light to my setup I need to go to the server and add it to the program
- to handle different behaviours in the same "scene" makes the logic program at server level more complex

With selectable rules-set I coudl create for each node 2 behaviours: summer and winter
- each node can have his own "logic" to handle the same "scene"
- from server level I need only to send out which ruleset to apply: e.g. "summer" or "winter" and all nodes will implement the local logic
- any new addition will be "locally programmed" via rules-set and nothing has to be changed either in the server nor in existing nodes
- each node can implement differen logic for the same "program" (again summer or winter)
- al nodes can be independent from the server broker/aggregator and even to be able to work in stand-alone

I know there always be people agrees with this and people who thinks diametrically opposite but still havign the option of "selectable rules-sets" can make ESPEasy much more flexible and all-purpouses!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Are Rulesets selectable?

#13 Post by papperone » 07 Jan 2018, 13:03

Shardan wrote: 06 Jan 2018, 22:43
grovkillen wrote: 06 Jan 2018, 19:53 To me decentralizing makes the controller implementation a lot more stream line since I don't have to handle internal logic of every single unit. I like to have the controller only acting like a link between all nodes/units since they are the ones that actually do something.

But I know that this is a ongoing debate, some think large mainframes and thin clients are the way to go, some think the opposite... :ugeek:
I agree.
I see that like an organism, the human body for example. Most things are done automatically.
The eye's iris adapts automatically to brightnes, the brain gets just the information about more or less bright.
I could list a lot of such processes here.
So my sensors/actors (should) do most things based on themselves and just give info to my FHEM controller.
Only really complex sets with many rules and much logic, possibly including data from several sensors and
actions for many actors should be done by the controller.
:D that's a perfect way to describe what I do envision as ideal setup!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Are Rulesets selectable?

#14 Post by Shardan » 07 Jan 2018, 14:02

Thanks grov and Papperone.

Two examples how to do that:
First (non ESPEasy): I'm using radiator valves from eQ3, the MAX! series. They are radio controlled from my FHEM server - but the server
just reads temperature, battery state etc. The controller sets the weekly schedule stored inside the valves and i can set another temperature
manually that stays until the next schedule time. On top i can always manually turn the button on the valve itself to vary temperaturer.
The week schedule is standalone - the valves go on with the schedule even if i switch off the controller completely.

Second: I'm workig on a pH/ temperature controller for fish tanks. Definitely it would more comfortable if i could set values from
home controller. On the other side this setup would depend fully on working server, working WiFi etc. As one usualy does not
change these values often i decided to put them into rules making the controler as "standalone" as possible. Better for the fishies ;)
The pH/T-Controller reports to the homecontrol, that's all.
(A way to store the given values from homecontrol would be nice anyways, but i'm not sure if a dummy variable is a good way as it
might get lost after a short blackout).

Regards
Shardan
Regards
Shardan

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Are Rulesets selectable?

#15 Post by toffel969 » 10 Jan 2018, 19:20

Isn't there a way to store the values in an mqtt broker, not that I'm using it, I just remember having read about it on the forum...
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: Are Rulesets selectable?

#16 Post by vader » 10 Jan 2018, 19:40

No chance to do this at the moment. You can not enable/disable a rule with a command and you can not change the complete rule text with a command. So a MQTT broker is useless. You have to expand the source code for this new function.

- rules engine must be changed
- web server must be changed
- command engine must be changed
- the rules store structure must be changed (1 new byte for enabled/disabled) per rule set

With all that done it works. :mrgreen:

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 19 guests