Rule: If wifi not connect set gpioX 0 - possible?
Moderators: grovkillen, Stuntteam, TD-er
Rule: If wifi not connect set gpioX 0 - possible?
Hey,
thank you very much for this forum.
i need a rule which set the status off defined gpios if the WiFi Signal is lost.
I watering my garden with a Wemos D1 mini Pro -> 4 relay module -> 24V valve. I control it with Pimatic (pimatic.org) and the MQTT protocol. But, if i lost the WiFi signal i want that the ESP close all valves in the garden (Backup if i lost the signal in the time where the garden ist watering).
Is this possible by a rule?
Thank you very much,
schmucke
thank you very much for this forum.
i need a rule which set the status off defined gpios if the WiFi Signal is lost.
I watering my garden with a Wemos D1 mini Pro -> 4 relay module -> 24V valve. I control it with Pimatic (pimatic.org) and the MQTT protocol. But, if i lost the WiFi signal i want that the ESP close all valves in the garden (Backup if i lost the signal in the time where the garden ist watering).
Is this possible by a rule?
Thank you very much,
schmucke
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Rule: If wifi not connect set gpioX 0 - possible?
I know this is not what you ask for but cant you make sure that the valves are closed after a certain time period (internally in the ESP Easy)? You can have the valves close after lets say 60 minutes if no "Off" command has been received from the server side?schmucke wrote: ↑21 Jun 2017, 09:57 Hey,
thank you very much for this forum.
i need a rule which set the status off defined gpios if the WiFi Signal is lost.
I watering my garden with a Wemos D1 mini Pro -> 4 relay module -> 24V valve. I control it with Pimatic (pimatic.org) and the MQTT protocol. But, if i lost the WiFi signal i want that the ESP close all valves in the garden (Backup if i lost the signal in the time where the garden ist watering).
Is this possible by a rule?
Thank you very much,
schmucke
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
Re: Rule: If wifi not connect set gpioX 0 - possible?
can u explain me a sample? this is what i need.
i send a on signal remote and need, for the worst case, a backup if no off signal is coming. i think, this is a better solution if my pimatic hangs.
i send a on signal remote and need, for the worst case, a backup if no off signal is coming. i think, this is a better solution if my pimatic hangs.
Re: Rule: If wifi not connect set gpioX 0 - possible?
Thanks, is this possible?majklovec wrote: ↑21 Jun 2017, 14:00 Use the rules and timer.
https://www.letscontrolit.com/wiki/inde ... ith_events
Code: Select all
on givemesomewater do
gpio,14,0 // open valve
timerSet 1,300 // 5 minute timer
endon
on Rules#Timer=1 do
gpio,14,1 // close valve
gpio,16,0 // open valve two
timerset 2,300
endon
on Rules#Timer=2 do
gpio,16,1 //close valve two
endon
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Rule: If wifi not connect set gpioX 0 - possible?
Use MQTT Import for that.
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
Re: Rule: If wifi not connect set gpioX 0 - possible?
I think, this is not this what i mean. I need a local backup. i just use a raspberry with mosquitto, but, if the system crash i want a local backup at the ESPEASY system.
If the Raspberry cannot connect to the esp to turn off the watering. I need a rule which start a timer local in this moment, where the gpio set to 1. If there come no signal (wifi loss or something), the esp must stop the watering after a specified time. i dont want that my garden is flooting by water in the worst case.
is there a rule what do the following?
Code: Select all
on gpio set to 1 do
timerSet 1,600
endon
on Rules#Timer=1 do
gpio,16,0
endon
Thank you.
schmucke
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Rule: If wifi not connect set gpioX 0 - possible?
If you send the watering command as MQTT and fetch it through MQTT Import you can start the timer from there.
I'll try to give you an example... Hold on.
I'll try to give you an example... Hold on.
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
Re: Rule: If wifi not connect set gpioX 0 - possible?
If you need this kind of local control, i think the best way is to send an event to ESP Easy from Pimatic.
The rules could then be like this:
From pimatic send this to the .../cmd topic
event,givemesomewater
The rules could then be like this:
Code: Select all
on givemesomewater do
gpio,14,0 // open valve
timerSet 1,300 // 5 minute timer
endon
on Rules#Timer=1 do
gpio,14,1 // close valve
endon
event,givemesomewater
Re: Rule: If wifi not connect set gpioX 0 - possible?
It might be possible to use the
command for this too.
Did not test this myself, as far as i have seen in some forum threads this might
give strange results as it is not fully developed.
Regards
Shardan
Code: Select all
Status <device>, <pin>
Did not test this myself, as far as i have seen in some forum threads this might
give strange results as it is not fully developed.
Regards
Shardan
Regards
Shardan
Shardan
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Rule: If wifi not connect set gpioX 0 - possible?
Rule using MQTT (importer)
More on the plugin here:
https://www.letscontrolit.com/wiki/inde ... QTT_Import
Rule using HTTP (event)
Triggering through this command.
http://<espeasyip>/control?cmd=event,startwatering
http://<espeasyip>/control?cmd=event,stopwatering
Code: Select all
on sniff#cmdMQTT=1 do
gpio,12,1
timerSet,1,600 //timer 1 set for 10 minutes
Publish %sysname%/Valve,Open
Publish %sysname%/Status,Started watering
endon
on sniff#cmdMQTT=2 do
timerSet,1,0 //timer 1 set to halt
Publish %sysname%/Valve,Close
Publish %sysname%/Status,STOP watering
endon
On Rules#Timer=1 do
gpio,12,0 //stop watering
endOn
https://www.letscontrolit.com/wiki/inde ... QTT_Import
Rule using HTTP (event)
Code: Select all
On startwatering do
gpio,12,1 //start watering
timerSet,1,600 //timer 1 set for 10 minutes
endon
On stopwatering do
timerSet,1,0 //timer 1 set to halt
endon
On Rules#Timer=1 do
gpio,12,0 //stop watering
endOn
http://<espeasyip>/control?cmd=event,startwatering
http://<espeasyip>/control?cmd=event,stopwatering
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
Re: Rule: If wifi not connect set gpioX 0 - possible?
Ok, it works! But, where can i get the state of the Device?Martinus wrote: ↑21 Jun 2017, 21:59 If you need this kind of local control, i think the best way is to send an event to ESP Easy from Pimatic.
The rules could then be like this:
From pimatic send this to the .../cmd topicCode: Select all
on givemesomewater do gpio,14,0 // open valve timerSet 1,300 // 5 minute timer endon on Rules#Timer=1 do gpio,14,1 // close valve endon
event,givemesomewater
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Rule: If wifi not connect set gpioX 0 - possible?
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 95 guests