Discussion on local control by ESP Easy

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Martinus

Discussion on local control by ESP Easy

#1 Post by Martinus » 26 Oct 2015, 17:54

I'm currently working on a really simple plugin that can control an output pin based on the value of some other task. Could be temperature, light or whatever the ESP can measure. So you could have the ESP turn up the heater, turn on the fan, open the water hose, close a window or do other things like that, to keep things within preset levels. Or just a LED or buzzer warning you about some situation you should act upon...

It currently looks like this:
LevelControl.png
LevelControl.png (10.03 KiB) Viewed 18186 times
But could there be real use for this and should we automate stuff this way? Within our team we had earlier discussions about the ESP not being a controller and that things should not start to control stuff by themselves without your home controller being aware... Do you want only centralized control or not...??

Good thing: The ESP can still send the state update to your Home Automation controller, so at least it knows that some ESP did something...

Possible bad thing: Don't know where this will end. Maybe in a too complex ESP or in some Home Automation mess...

Backbone
Normal user
Posts: 106
Joined: 06 Oct 2015, 22:12

Re: Discussion on local control by ESP Easy

#2 Post by Backbone » 26 Oct 2015, 18:35

Me like, me like.... :-)
Complex? Life is complex... electronics and software we can control. :-)

I have a situation where this would work fine.
I have a pump for the floor heating that now is running 24/7.
To save cost I only need it to run when the general thermostat starts to heat up the rest of the system and the floor heating.
Both pumps can not be connected to start simultaniously.
So I measure the outgoing temp of the CV heater with a DS18S20 and when it is above 25 degrees it should activate a wireless 433 Mhz remote socket by http command or a relay on the pin.
When the temp goes below 23 degrees it should turn off the wireless remote 433 socket by http command or relay on the pin.
Also an adjustable delay of switching ON or OFF would be an extra bonus in some occasions.
This saves me writing a script in DMZ for the same function for a really simple daily basic function.

You got my vote, but who am I? :-)

Paco

Ger
Normal user
Posts: 71
Joined: 05 Sep 2015, 18:09

Re: Discussion on local control by ESP Easy

#3 Post by Ger » 26 Oct 2015, 19:17

Very nice idea :D
I had an idea, would it be an option to make output plugins.
With output plugins it would be possible to make plugins for 433 MHz control or WS2812 led string etc.

BerndJ
Normal user
Posts: 86
Joined: 28 Sep 2015, 06:57

Re: Discussion on local control by ESP Easy

#4 Post by BerndJ » 26 Oct 2015, 20:42

Hi,

very good idea, thats the right way.

At first i would like to control the windows shutter.
separate switch at each window (cables existing), MCP23017 input to esp and these software to toggle 2 outputs, also on 23017 for action.
info to centralized Homecontrol and the WAF is OK. We should include a routine from HC to ESP asking for status.

best wishes

Bernd

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Discussion on local control by ESP Easy

#5 Post by BertB » 26 Oct 2015, 21:03

I was thinking about the same sort of thing as Paco.

So, a yes from me too.

hooijschuur
New user
Posts: 3
Joined: 27 Sep 2015, 09:01

Re: Discussion on local control by ESP Easy

#6 Post by hooijschuur » 28 Oct 2015, 14:51

This would be a nice addition to ESPeasy.

i hope it would also be possible to do time based events in combination with a pir sensor or a switch.
for instance if a pir sensor detects a person the temperature goes high for hour en then low and lower after 24 hours.

also synchronized time would then be nice.

Oyvindes
New user
Posts: 5
Joined: 28 Oct 2015, 09:15

Re: Discussion on local control by ESP Easy

#7 Post by Oyvindes » 28 Oct 2015, 15:29

I like the idea, but i hope you see the degree of variables this will demand from ESPeasy? This will escalate the project from a mere addon to self sufficient controller. I truly like the project and i hope that you will allocate resources to develop a controller-like environment last, and hopefully focus on getting ESPeasy's sensors and such up to a higher number first.

Not being a partypooper...

rmtucker
Normal user
Posts: 57
Joined: 04 Oct 2015, 17:14

Re: Discussion on local control by ESP Easy

#8 Post by rmtucker » 28 Oct 2015, 16:00

I think what worries me about the above are the constraints on the memory space available etc.
Even the 4mb esp12e versions only allow 1mb for everything and the remaining 3mb is for spiffs.
Some discussion on where the project is headed would be a good thing as it works perfectly for most applications but i feel it is catering for too many variations of controller now.
At the moment it seems to work a little bit with them all instead of a lot better with one or two?

Just Sayin :D :D

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: Discussion on local control by ESP Easy

#9 Post by NietGiftig » 28 Oct 2015, 20:34

I think that there are many sophisticated apps who can deal with the automation part.
I like the hardware part from ESPEasy and the possibility to interact with the automation apps (Domoticz/Openhab/Node-Red/...)
so I would say keep it to hardware interaction.. and a good MQTT implementation in ESP Easy so it is possible to send and receive commando's to all kind of hardware, uniform, regardless of witch Home automation App you are using.
Reporting the status is good for possible Home automation troubles, but I think it is not necessary to have the "slaves" rule the automation.

Perhaps a different branch of ESP Easy where the unit can be used stand alone, but that is also possible with an Arduino Pro Mini, and there is already lots of software for.

Just my view :|

hooijschuur
New user
Posts: 3
Joined: 27 Sep 2015, 09:01

Re: Discussion on local control by ESP Easy

#10 Post by hooijschuur » 29 Oct 2015, 16:25

Thank you for the response.
i like an esp easy which can do some automation on its own.
This makes the function like a thermostat much more reliable.
if the wifi network is down or the rpi. the heating stays on till there is some human interaction.

chrille
Normal user
Posts: 88
Joined: 26 Aug 2015, 15:11
Location: Horsens, Denmark

Re: Discussion on local control by ESP Easy

#11 Post by chrille » 29 Oct 2015, 21:02

NietGiftig wrote:I think that there are many sophisticated apps who can deal with the automation part.
I like the hardware part from ESPEasy and the possibility to interact with the automation apps (Domoticz/Openhab/Node-Red/...)
so I would say keep it to hardware interaction.. and a good MQTT implementation in ESP Easy so it is possible to send and receive commando's to all kind of hardware, uniform, regardless of witch Home automation App you are using.|
+1

Focus on sensors/devices and MQTT

Leave all the logic to external applications

- Jan
Jan Chrillesen, Denmark

ronnyvs
New user
Posts: 6
Joined: 18 Oct 2015, 22:53

Re: Discussion on local control by ESP Easy

#12 Post by ronnyvs » 29 Oct 2015, 22:22

Very nice!!!

This is the thing for what I'm searching for... now I'm doing this with openhab and the rules, but need several devices...
can't wait to have the first download ready on the github...

again...
VERY NICE JOB :D :D :D

Martinus

Re: Discussion on local control by ESP Easy

#13 Post by Martinus » 31 Oct 2015, 10:22

Thank you all for joining this discussion! It seems we have an almost equal mix of + and - on this subject.

In the mean while, i have done some experimenting with the level control plugin, but instability of the ESP leads to new challenges if you start using it as an output device. I've seen this particular ESP module rebooting for some unknown reason a day ago and during the reboot, the output goes into an undesired state. Still in testlab, so it's only the LED on GPIO-16, but what if you have some real device connected here?

So far, all output stuff has never left my testlab, so it does not matter at all if it's actually unstable. Some sensors have gone into production, but the occasional ESP reboot does not matter if you're measuring temperature and humidity. Domoticz does not even notice this.

Some things to consider if you're planning to use the ESP as an actuator device:

- Servo motors keep their positional state if the ESP reboots, but they do loose "torque" because the PWM signal is lost.

- The MCP23017 output pins keep their state after ESP reboot. So this would be ok.

- The GPIO pins do NOT keep their state. So undesired effects during reboot. PWM state is lost anyway after reboot.

So I'm a bit worried about developing stuff that will lead to a lot of complaints that we can not solve easily. The support of direct GPIO control was build because it was an easy coding job, not because we thought it would be a rock solid solution.


Just a side note:

My house is still populated with many Nodo Controllers based on Arduino Mega/Pro mini/Nano. Their uptime can be measured in years (!!). Some of them even have a battery backed power supply, like the "Burglar alarm Nodo". These units have all been recently extended with an ESP module so they can have basic communication with Domoticz over Wifi (using ESP Easy firmware as a Wifi bridge)

Because of ESP instability, i have no short term plans to migrate Nodo controllers to ESP if it's an output device or if it needs rock solid uptime

asm7100
Normal user
Posts: 96
Joined: 13 Sep 2015, 21:45
Location: Denmark

Re: Discussion on local control by ESP Easy

#14 Post by asm7100 » 31 Oct 2015, 10:28

I Have a test set-up to, and mine also frees up some time :-(
5xESP-01 - 3xESP-12 - 2xESP-12E 3xRPIb+ - 1xBPIm1 - 3xACTi DOME - 7xACTi Indoor cam. Lot off cisco equ.

hamster
Normal user
Posts: 62
Joined: 27 Sep 2015, 21:01
Location: UK

Re: Discussion on local control by ESP Easy

#15 Post by hamster » 06 Nov 2015, 00:44

If an option could be included where a gpio output reacts to a gpio input it would be greatly appreciated.
I'm trying to build a wifi light switch which I can control remotely yet still be able to operate locally.

ronnyvs
New user
Posts: 6
Joined: 18 Oct 2015, 22:53

Re: Discussion on local control by ESP Easy

#16 Post by ronnyvs » 06 Nov 2015, 15:08

hello,

i noticed that asm7100 have a test version...
Is it possible to download this test version somewhere?
normally every single one is using the same software on a different way. If more people test it, maybe someone finds out out some problems and/or some solutions...

regards of a fan of this project :D

BerndJ
Normal user
Posts: 86
Joined: 28 Sep 2015, 06:57

Re: Discussion on local control by ESP Easy

#17 Post by BerndJ » 06 Nov 2015, 17:52

Hi,

a third brach on github could be fine. ;)

fluppie
Normal user
Posts: 89
Joined: 09 Oct 2015, 13:23

Re: Discussion on local control by ESP Easy

#18 Post by fluppie » 09 Nov 2015, 09:52

Inspiration for local control/wifi thermostat: https://github.com/mharizanov/ESP8266_Relay_Board

hamster
Normal user
Posts: 62
Joined: 27 Sep 2015, 21:01
Location: UK

Re: Discussion on local control by ESP Easy

#19 Post by hamster » 25 Dec 2015, 22:12

Really great having the local control. However, I was wondering if it is possible to change the setpoint value from domoticz? Many thanks in advance.

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

Re: Discussion on local control by ESP Easy

#20 Post by Gorgo » 24 Feb 2016, 18:09

Re: hamster

As I've hardly made a few steps on this track with EspEasy (still waiting for my Pi to arrive) I don't even see clearly wether an ESP with EspEasy firmware set to OpenHab MQTT Protocol for example capable to send response of its GPIO states to the controller or not (is it? -because I didn't really find Documentation about the architecture and the protocols -surely my bad),

-but what I'd like to do is for example to have a light to be controlled via the controller AND via a (non latching) regular pushbutton on the wall. Should I expect that the GPIO input triggered by the button will report an ON request from the controller and then the controller will turn the light on through an other GPIO of the very same ESP, or is it possible to control the light within the ESP and send a response to the controller that the state is changed?

Any ideas appreciated, Gentlemen.

hackaday
New user
Posts: 2
Joined: 17 May 2016, 22:41

Re: Discussion on local control by ESP Easy

#21 Post by hackaday » 17 May 2016, 22:50

Gorgo wrote:Re: hamster

As I've hardly made a few steps on this track with EspEasy (still waiting for my Pi to arrive) I don't even see clearly wether an ESP with EspEasy firmware set to OpenHab MQTT Protocol for example capable to send response of its GPIO states to the controller or not (is it? -because I didn't really find Documentation about the architecture and the protocols -surely my bad),

-but what I'd like to do is for example to have a light to be controlled via the controller AND via a (non latching) regular pushbutton on the wall. Should I expect that the GPIO input triggered by the button will report an ON request from the controller and then the controller will turn the light on through an other GPIO of the very same ESP, or is it possible to control the light within the ESP and send a response to the controller that the state is changed?

Any ideas appreciated, Gentlemen.
This is exactly what I'm trying to do. I have some Eco Plugs http://www.homedepot.com/p/Grounded-Ind ... /206177754 that I have loaded with EspEasy. I can control them locally via the built in button, or via MQTT, but I'm unable to keep the states synced. If there was a way to query the state of a gpio pin, it would be rather simple to publish updates on state change in a rule. If there is a way to do this, I sure haven't been able to figure out the syntax.

It seems kind of silly for the command from a push button to go from the device, to the controller, then back to the device. If the controller is down, it's better that the device still function manually given how simple it would be to implement.

dduley
Normal user
Posts: 93
Joined: 06 Feb 2016, 17:56

Re: Discussion on local control by ESP Easy

#22 Post by dduley » 17 May 2016, 23:10

Hi Hackaday,

Look here: http://www.esp8266.nu/forum/viewtopic.php?f=4&t=1431

This is actually quite easy to do using a switch task.

Regards

Dave

hackaday
New user
Posts: 2
Joined: 17 May 2016, 22:41

Re: Discussion on local control by ESP Easy

#23 Post by hackaday » 18 May 2016, 14:44

Hello dduley,

My brain was a bit fried, so it took me a bit to understand your post, but it eventually clicked. That looks like just what I was after. From the little testing I did, it seems to work as intended and keeps the state in sync whether the outlet is activated via the push button, or MQTT. Now just to get it talking with Openhab.

Thanks a million

robob
New user
Posts: 8
Joined: 26 Jun 2016, 21:18

Re: Discussion on local control by ESP Easy

#24 Post by robob » 03 Jul 2016, 19:01

Hi All...

quite an old post, but I would like to know if the feature to control output pins from within ESPEasy is going to come in the near future. I would really need it to contol my blinds as I need the switch on the wall and in domoticz.

Yes I know how to setup the stuff using virtual switch, but to be able to set a specific angle of the blinds, I need to switch on/off the wall-switch quickly. Around on/off in 0,2 seconds. This is something not working if I first send the signal to the domoticz server and back to esp. It simply reacts too slow.

By the way. I would need to control output pins of MCP23017 as I have only 2 pins on my esp's (ESP8266-01).

Thank you,
Roman

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

Re: Discussion on local control by ESP Easy

#25 Post by tozett » 04 Jul 2016, 05:30

http://<ESP IP address>/control?cmd=mcpgpio,<pin>,0

see: http://www.esp8266.nu/index.php/MCP23017

or local with rules:

Code: Select all

on Rules#Timer=1 do
  gpio,2,0 // close valve
endon
see: http://www.esp8266.nu/index.php/Tutorial_Rules

jram
New user
Posts: 5
Joined: 01 Jul 2016, 19:03

Re: Discussion on local control by ESP Easy

#26 Post by jram » 04 Jul 2016, 09:20

I've just discovered this topic and it is of great interest to me since 'smart' autonomous devices are, for me, the way ahead.

I prefer to have the system set up so that the device can be as independent as makes sense. For example, imagine a freezer controller where the ESP controller monitors the temperature and runs the (variable speed) motor at the most efficient speed for the environmental conditions. Of course the controller will report operating information back (via Mqtt) for time to time, but in the event of a network failure, will be quite happy to continue to operate autonomously.

I am just beginning to investigate the 'hooks' that might be in ESPeasy to allow me to engineer this solution so any details on is project would be very useful - please :)

robob
New user
Posts: 8
Joined: 26 Jun 2016, 21:18

Re: Discussion on local control by ESP Easy

#27 Post by robob » 05 Jul 2016, 19:45

tozett wrote:ww.esp8266.nu/index.php/Tutorial_Rules
Hi Tozett,

seems to be the solution. Do you know where to get the compiled higher verions for ESPEasy?
I never checked out and compiled...

Roman

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

Re: Discussion on local control by ESP Easy

#28 Post by tozett » 05 Jul 2016, 21:38

a compiled version must match your ram settings,
and the devs provide a a compiled version only for their next "super-stable" build.
meanwhile you could compile one yourself. its easy. lots of infos here in the forum,
and a description on the wiki: http://www.esp8266.nu/index.php/Tutoria ... are_Upload

Martinus

Re: Discussion on local control by ESP Easy

#29 Post by Martinus » 06 Jul 2016, 16:59

robob wrote:Do you know where to get the compiled higher verions for ESPEasy?
Roman
As of today, new binaries for R108 are available on our website:http://www.esp8266.nu/index.php/Main_Page#Stable

robob
New user
Posts: 8
Joined: 26 Jun 2016, 21:18

Re: Discussion on local control by ESP Easy

#30 Post by robob » 06 Jul 2016, 22:28

Thank You guys.

Works!

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests