Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Add examples to set values in tasks via HTTP/MQTT #4857

Open
TD-er opened this issue Oct 26, 2023 · 1 comment
Open

[Docs] Add examples to set values in tasks via HTTP/MQTT #4857

TD-er opened this issue Oct 26, 2023 · 1 comment

Comments

@TD-er
Copy link
Member

TD-er commented Oct 26, 2023

For example:
How to set a value in a "Level" task, as asked on the forum

But there have been a few more plugins which support "config" like command syntax.
So maybe we should add some Example pages which can be included in several plugin pages to whom it applies.

@popaserge
Copy link

Example as requested to set values in tasks via HTTP/MQTT :

There is a general syntax for http commands that I tried to use : https://espeasy.readthedocs.io/en/latest/Reference/Command.html

For 3 years I use a Sonoff_4CH_Pro_R2 on which is installed ESP_Easy_mega_20210503_normal_ESP8285_1M.

Last summer I used the P001_Switch.ino plugin ( https://espeasy.readthedocs.io/en/latest/Plugin/P001.html) and 2 of the relays to manage 2 solenoid valves.
image

One of the solenoid valve is activated every evening at 21h to water my little vegetable garden during 10 mn.
This is made by following rules.

on System#Boot do
Let,4,600 // %v4% Temps de cycle arrosage 10 mn
endon
on Clock#Time=All,: do //will run every minute
if %syshour% = 21 and %sysmin% = 0
LongPulse,15,1,%v4% //Déclenchement relais 4 arrosage à 21h
endon

But this also works by http request on my smartphone to test it during 1 mn.
http//:192.168.xxx.yyy/control?cmd=Longpulse,15,1,60

The other valve is used to fill my swimming pool when necessary. This is done on my smartphone by an other http request:
http//:192.168.xxx.yyy/control?cmd=Longpulse,4,1,600

To send the http request I use the smartphone application Http Shortcuts (for Android)

I think that the same should be possible with the commands of the P021_Level.ino (https://espeasy.readthedocs.io/en/latest/Plugin/P021.html) or other similar plugins having specific commands to set a level or a value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants