Are there any plans for simple BASIC rules in Easy ESP?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Are there any plans for simple BASIC rules in Easy ESP?

#1 Post by espfrm883 » 11 Feb 2016, 01:22

It would be nice to have some simple node interactions hosted on the ESP itself. Right now, all of my commands four nodes require my MQT T broker to send commands from my controller via openhab. This creates lag and not very efficient .

Thank you for all your hard work.

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: Are there any plans for simple BASIC rules in Easy ESP?

#2 Post by tozett » 11 Feb 2016, 14:41

try under "devices" the level-control

source-code here:
https://github.com/ESP8266nu/ESPEasy/bl ... _Level.ino

if there is more than this, the developer has to tell you ... :roll:

Martinus

Re: Are there any plans for simple BASIC rules in Easy ESP?

#3 Post by Martinus » 17 Feb 2016, 17:19

espfrm883 wrote:It would be nice to have some simple node interactions hosted on the ESP itself. Right now, all of my commands four nodes require my MQT T broker to send commands from my controller via openhab. This creates lag and not very efficient.
Having mixed central and decentral control of things could turn your Home Automation control into a mess. It will also make the ESP Easy much more complicated if things have to be synchronized with other systems as well (and that will be the next request I'm afraid).

But if you have some "standalone" uses for ESP Easy, it could make sense to have some features build into ESP.

But then I need to know your definition of "simple" and "basic".

I have used a custom ESP Easy for my "RFID Tag reader test rig", looking like this:
Rules.png
Rules.png (8.57 KiB) Viewed 9774 times
That would by my definition of "simple"...

We also have the "playground action event" plugin that might be able to do some basic stuff. I've also used that for the Tag reader test, but it took 5 tasks to manage the same result.

espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Re: Are there any plans for simple BASIC rules in Easy ESP?

#4 Post by espfrm883 » 17 Feb 2016, 23:30

Do you mind sharing your custom code to add rules?

This is my idea of simple as well. I have built an ESP into an old stop light that uses an HC-SR04 (Esp_Garage_Dist_Left) to measure distance. There are two different relays that are triggered based on the distance reading.

I'm using OpenHAB and here are the associated rules.

Code: Select all

rule "Garage Left side trigger yellow"
when 
	Item Esp_Garage_Dist_Left changed
then
//	if(Esp_Garage_Pir_Left.state == ON) {
	if(Esp_Garage_Pir_Left.state == OPEN) {
		if ((Esp_Garage_Dist_Left.state > 20) && (Esp_Garage_Dist_Left.state < 300)){
			sendCommand(Esp_Garage_Relay_Ly, ON)
		}
	}
	else {
		sendCommand(Esp_Garage_Relay_Ly, OFF)
	}
end

rule "Garage Left side trigger red"
when 
	Item Esp_Garage_Dist_Left changed
then
//	if(Esp_Garage_Pir_Left.state == ON) {
	if(Esp_Garage_Pir_Left.state == OPEN) {
if ((Esp_Garage_Dist_Left.state > 20) && (Esp_Garage_Dist_Left.state < 30)){
			sendCommand(Esp_Garage_Relay_Lr, ON)
		}
	}
	else {
			sendCommand(Esp_Garage_Relay_Lr, OFF)
	}
end

Martinus

Re: Are there any plans for simple BASIC rules in Easy ESP?

#5 Post by Martinus » 18 Feb 2016, 15:52

Well my "simple" idea supports only one simple logic rule:

on <event>[compare][value] do [{]<action>[,<action>,..}]

The idea was based on the old Nodo project were we had a similar set of oneliner event/actions.

You have posted an entire script like LUA that needs a full blown scripting engine to process it. And that's were my basic development skills end :oops:

(and if I knew how to integrate a LUA engine into ESP Easy, it will likely not fit the available free RAM)

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: Are there any plans for simple BASIC rules in Easy ESP?

#6 Post by tozett » 18 Feb 2016, 16:50

Martinus wrote:Well my "simple" idea supports only one simple logic rule ...
could this logic engine go into a plugin? :)

(is this your code: http://www.esp8266.nu/forum/viewtopic.php?f=2&t=47 , or there a github? )
or are you adventourous enough to put it on the plugin-playgound? :P

i think, i would be charming to have something like IFTTT (or similar condition-logic-engine) on the ESPeasy itself. :mrgreen:
i played with this sometimes ago for my knx installation: https://sourceforge.net/p/linknx/wiki/C ... 7s_Syntax/ )

Gorgo
Normal user
Posts: 20
Joined: 14 Feb 2016, 11:40

Re: Are there any plans for simple BASIC rules in Easy ESP?

#7 Post by Gorgo » 26 Feb 2016, 13:17

Well, just to make clear I'm still on my discovering journey to find components for my system to build upon, therefore I have way more questions than answers.

I think to make a reliable home automation sytem there are cornerstones one should not bypass. As long as home automation is only turning a desktop lamp on and off the text below is redundant.

I consider basic functions with optional extras like remote contol.
First of all I believe we should (I will) not use cloud services. Home automation should work (even if any alarm system is involved) within a well secured 'intranet'. I don't think we may trust any services beyond our reach to operate flawlessly, and securely.
Zooming in to an example we may see the same aspect on a different scale, through this example below:
Kitchen light:
We have power and we have a lamp and a (momentary) switch on the wall. And we have a node with in- and outputs. Basic function is: you press the button and the node turns the light on. Extra: you can do the same via the controller and an UI on your smartphone, since the node sends the state of the output node to the contoller. Achievment: we can turn the light on even if there is no wifi, the router went crazy etc.
I'd like to have my system this way. This must be more complicated to make, but I believe it would work more solid than the other way where you are dependent on a wifi connection (and other aspects) just to turn a single light on and off. Besides, staying at a lifelike example when I'm walking into my kitchen I'd rather hit a button on the wall then start tapping my phone...

Some say ESPs are not stable enough for such tasks. I don't know yet. But if the price of the stability and the reliable workflow is that I have to use an Arduino as a node and use the ESP hooked onto as a communication device, so be it. It is not the part which would make the budget skyrocketing.

Any thoughts on this, Gentlemen?

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Are there any plans for simple BASIC rules in Easy ESP?

#8 Post by costo » 26 Feb 2016, 18:01

1 cloud services:
The owner of the cloud-server is harvesting a database with: IP , SSID end Password of all users. A potentially dangerous situation.
Just imagine the nightmare when the cloud-server gets hacked, the database leaked, or the cloud-service sold to another not trustable entity. Probably someone could do a FOTA on your device , turning your innocent IOT device into a relay, that sends certain traffic/information directly to a server under control of the hacker. I will avoid using cloud services as much as possible.

2 local AP:
Making it so that even without your device being connected to a network you can access the UI to do the normal control things.
It must be possible (not at the moment) to let the ESP act as AP and Station at the same time with the UI feature. Though most people would like to have a central home-server do all the control.

3 stability:
I find ESPEasy very stable. Here on a breadboard it works for thousands of hours without problems, these breadboard are known for their unreliable contacts !
After a reboot ESPEasy always reboots normally and connects again. Never experienced a crashed ESP that did not reboot normal.
The only requirement is a good powersupply and preferrable an extra 2.2uF capacitor over Vcc/Gnd directly on the ESP-module.

espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Re: Are there any plans for simple BASIC rules in Easy ESP?

#9 Post by espfrm883 » 28 Feb 2016, 17:53

Your point of having the ability to have a redundancy built-in for when your Wi-Fi down complements my request for simple or basic rules execution within the native ESP program. for instance the ability to turn on or off a switch with a pushbutton attached to the ESP.

As for cloud services I am a skeptic. Not due too to stability, but only to security. I don't trust the security of these cloud companies to have access to my home via the web. Therefore, my solution is to only allow access remotely via my home open VPN server. The exception is email out for SMS notifications.

My experience with the stability of ESP has been pretty good. Have a front door humidity and temperature sensor that has worked for weeks now.

Gorgo
Normal user
Posts: 20
Joined: 14 Feb 2016, 11:40

Re: Are there any plans for simple BASIC rules in Easy ESP?

#10 Post by Gorgo » 29 Feb 2016, 09:30

costo wrote:2 local AP:
Making it so that even without your device being connected to a network you can access the UI to do the normal control things.
It must be possible (not at the moment) to let the ESP act as AP and Station at the same time with the UI feature. Though most people would like to have a central home-server do all the control.
Actually I don't really want to access the node directly. I only want to keep basic functionality to be able to turn on the light manually if wifi was down for a reason.
costo wrote:3 stability:
I find ESPEasy very stable. Here on a breadboard it works for thousands of hours without problems, these breadboard are known for their unreliable contacts !
After a reboot ESPEasy always reboots normally and connects again. Never experienced a crashed ESP that did not reboot normal.
The only requirement is a good powersupply and preferrable an extra 2.2uF capacitor over Vcc/Gnd directly on the ESP-module.
I have an ESP-07 test rig running for a while, with a (opto isolated) 8-way relay board hooked onto it. Power fed by a pro lab bench supply, set to 5V, the ESP gets 3V3 through a level converter and a 470uF cap. As others reported too I experience multiple spontaneous resets a day, AND what the real problem is during reboot some relays are clicking which means GPIOs act indeed unpredictable.
Just imagine if those relays were connected to drive my workshop garage door...

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Are there any plans for simple BASIC rules in Easy ESP?

#11 Post by costo » 29 Feb 2016, 10:53

Gorgo wrote: I have an ESP-07 test rig running for a while, with a (opto isolated) 8-way relay board hooked onto it. Power fed by a pro lab bench supply, set to 5V, the ESP gets 3V3 through a level converter and a 470uF cap. As others reported too I experience multiple spontaneous resets a day, AND what the real problem is during reboot some relays are clicking which means GPIOs act indeed unpredictable.
Just imagine if those relays were connected to drive my workshop garage door...
I think you make the mistake in believing bigger is better.
A 470 uF capacitor is usually a electrolytic type, the way how electrolytic caps are fabricated makes them unusable at (very) high frequencies.
Relais have the bad reputation for generating spurious interference with many high frequency components.

I advice you strongly to solder two capacitors right on the ESP-07 module as explained here: http://www.esp8266.nu/index.php/Power
a small ceramic capacitor , about 1nF, between the reset pin and the metal case and also a tantalium capacitor of a few uF right between the Vcc pin and the metal case of the ESP-07 module, both SMD type , if not available then normal wired types, soldered on the module with the shortest wires that are practically possible. This will certainly help to minimize sponteneous resets.

Gorgo
Normal user
Posts: 20
Joined: 14 Feb 2016, 11:40

Re: Are there any plans for simple BASIC rules in Easy ESP?

#12 Post by Gorgo » 01 Mar 2016, 16:10

Thank you costo, will try this way.

Nice to see new documentation pages, they seem pretty helpful.

tim
Normal user
Posts: 52
Joined: 05 Dec 2015, 11:24

Re: Are there any plans for simple BASIC rules in Easy ESP?

#13 Post by tim » 11 Mar 2016, 17:40

Martinus wrote:Well my "simple" idea supports only one simple logic rule:

on <event>[compare][value] do [{]<action>[,<action>,..}]

The idea was based on the old Nodo project were we had a similar set of oneliner event/actions.
I think that people that came from the nodo project would like this if it work like the eventlist from the Nodo. And others too but I remember that not everyone liked the eventlist. It is not so easy for everyone. But can do some local stuff and could be handy.
But is this planned to build for the next release?

wayves
Normal user
Posts: 1
Joined: 11 Jul 2016, 17:05

Re: Are there any plans for simple BASIC rules in Easy ESP?

#14 Post by wayves » 11 Jul 2016, 18:26

Gorgo wrote:We have power and we have a lamp and a (momentary) switch on the wall. And we have a node with in- and outputs. Basic function is: you press the button and the node turns the light on. Extra: you can do the same via the controller and an UI on your smartphone, since the node sends the state of the output node to the contoller. Achievment: we can turn the light on even if there is no wifi, the router went crazy etc.
I'd like to have my system this way. This must be more complicated to make, but I believe it would work more solid than the other way where you are dependent on a wifi connection (and other aspects) just to turn a single light on and off. Besides, staying at a lifelike example when I'm walking into my kitchen I'd rather hit a button on the wall then start tapping my phone...
Try this link https://forum.pimatic.org/topic/1577/es ... a-relay/32

Post from @noxx seems to meet this criteria. I've tried it and it works but sometime a little lagged...

mvn77
Normal user
Posts: 12
Joined: 25 Jan 2017, 21:18

Re: Are there any plans for simple BASIC rules in Easy ESP?

#15 Post by mvn77 » 17 Mar 2017, 08:58

You can send commands to the UART through rules? To send an SMS via modem

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests