Are there any option to call "PLUGIN_READ" function from a plugin, or i have to extend the specific plugin with a PLUGIN_WRITE to make it work?
I am trying to use a 3pin simple water sensor. (+/-/S) I've connected the analog "S" to an ESP8266 A0 pin, the "+" to ESP D8 pin, and the "-" to GND. My purpose is to powering the device with D8 pin (HIGH) in every 60-120sec, and i have to force the ADC plugin somehow to do AnalogRead only if D8=1. After the successful read, D8 goes to LOW (cut device power to reduce corrosion) and until D8=0 there are no need to do AnalogRead.
If i try to use the ADC plugin generated rule event to change D8 state, then it reads analog 0 value before D8=1. Anyone using this kind of water sensor?
Plugin_read from rules? / Water sensor problem
Moderators: grovkillen, Stuntteam, TD-er
Re: Plugin_read from rules? / Water sensor problem
If anyone interested there are a currently undocumented command in ESPEasy Mega "taskrun" it takes one parameter, then task number to run, and it works flawlessly, triggering the PLUGIN_READ from Rules at the specific task immediately. I've found it accidentally while i inspecting command.ino. Whoever code it, big thanks!
Re: Plugin_read from rules? / Water sensor problem
This sounds interesting. I'll have a play!
Re: Plugin_read from rules? / Water sensor problem
Hmm if it is undocumented, we should do something about itenesbcs wrote: ↑11 Jan 2018, 21:27If anyone interested there are a currently undocumented command in ESPEasy Mega "taskrun" it takes one parameter, then task number to run, and it works flawlessly, triggering the PLUGIN_READ from Rules at the specific task immediately. I've found it accidentally while i inspecting command.ino. Whoever code it, big thanks!
Sounds like a nice enough feature to use in other scripts also.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Plugin_read from rules? / Water sensor problem
I will try to document that this weekend. Super thanks for skimming through the code.
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Plugin_read from rules? / Water sensor problem
This is a great thing actually, you can use it to publish other devices on a given trigger. Especially with rules this is pretty nice!
Great find and thank you for letting us know about it.
On my read through the command.ino I also found TaskClear which let you delete a given task (no need to go into the settings menu anymore). And also the "rules" which let you turn on or off the rules page. Simple yet come in hand since I use HTTP in the current ESP Easy Flasher to activate rules.. no need for that anymore
These three "new" commands are now listed here: https://www.letscontrolit.com/wiki/inde ... _Reference
Great find and thank you for letting us know about it.
On my read through the command.ino I also found TaskClear which let you delete a given task (no need to go into the settings menu anymore). And also the "rules" which let you turn on or off the rules page. Simple yet come in hand since I use HTTP in the current ESP Easy Flasher to activate rules.. no need for that anymore
These three "new" commands are now listed here: https://www.letscontrolit.com/wiki/inde ... _Reference
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Who is online
Users browsing this forum: No registered users and 32 guests