rules to create a stop for a command

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

rules to create a stop for a command

#1 Post by megamarco83 » 19 Oct 2018, 15:05

Hi i need to create two event inside rules:
1)"blind_1_BLOCK"
and
2) "blind_1_UNBLOCK"

this two event are called by domoticz unsing commands:

Code: Select all

http://192.168.0.154/control?cmd=event,blind_1_BLOCK

Code: Select all

http://192.168.0.154/control?cmd=event,blind_1_UNBLOCK  
inside the event "blind_1_BLOCK" i need to prevent that some that use wall switch can activate the corrensponding relay; and when domoticz send "blind_1_UNBLOCK" now i want that if some one press the wall switch the corresponding relay now shold work

is it possible?

this is my configuration:
Image1.jpg
Image1.jpg (62.11 KiB) Viewed 1739 times
Image2.jpg
Image2.jpg (66.33 KiB) Viewed 1739 times
Image3.jpg
Image3.jpg (40.91 KiB) Viewed 1739 times
Image4.jpg
Image4.jpg (23.9 KiB) Viewed 1739 times
Image5.jpg
Image5.jpg (84.8 KiB) Viewed 1739 times
Image6.jpg
Image6.jpg (64.39 KiB) Viewed 1739 times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: rules to create a stop for a command

#2 Post by grovkillen » 19 Oct 2018, 17:51

I would use a dummy value that is set to zero during activation of the scenario, once the scenario is complete you set the dummy value to one.

If someone press the wall button when the scenario is rolling you have a check of the dummy value and if the value is zero your code will not proceed.
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 :idea: :idea: :idea:

megamarco83
Normal user
Posts: 230
Joined: 13 Apr 2017, 23:09

Re: rules to create a stop for a command

#3 Post by megamarco83 » 20 Oct 2018, 20:03

grovkillen wrote: 19 Oct 2018, 17:51 I would use a dummy value that is set to zero during activation of the scenario, once the scenario is complete you set the dummy value to one.

If someone press the wall button when the scenario is rolling you have a check of the dummy value and if the value is zero your code will not proceed.
ok got it, thanks
just another help on write rules :-)
now mine rules is:

Code: Select all

on event_UP_SHORT_blind_test do
 if [relayp#R_UP]>0
  output,relayp,0,0
 else
  output,relayp,1,0
  output,relayp,0,1
 timerset,1,2 // to trigger relay UP direction for 2seconds
SendToHTTP 192.168.0.105,8085,/json.htm?type=command&param=updateuservariable&vname=blindControl&vtype=2&vvalue={"n":"blind_test","d":"UP","s":"2"}
  endif 
endon
now i have added a dummy device:
Immagine.jpg
Immagine.jpg (35.09 KiB) Viewed 1698 times
now i want to use the wall switch only if the dummy device "blind1_lock" is = to 0 if "blind1_lock" = 1 i do not want to allow wall switch is correct this rule modify?

Code: Select all

on event_UP_SHORT_blind_test do
 if [relayp#R_UP]>0 and [blind_lock#blind1_lock]=0
  output,relayp,0,0
 else
  output,relayp,1,0
  output,relayp,0,1
 timerset,1,2 // to trigger relay UP direction for 2seconds
SendToHTTP 192.168.0.105,8085,/json.htm?type=command&param=updateuservariable&vname=blindControl&vtype=2&vvalue={"n":"blind_test","d":"UP","s":"2"}
  endif 
endon

Post Reply

Who is online

Users browsing this forum: No registered users and 133 guests