Rules - i have problem.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
kpisiek
New user
Posts: 1
Joined: 26 Mar 2019, 23:03
Location: Europe

Rules - i have problem.

#1 Post by kpisiek » 27 Mar 2019, 20:08

I have a problem with rules. For the device that I have is a strip with 3 sockets but 1 button.

Let's assume the version: I enable socket 1 through the app, the remaining 2.3 are disabled.

When I press the button on the slat. Slot 1 will turn off, the rest will turn on.

I would like to create a rule that will send to IDX and allow all three to be included in the button.

And that when you attach the slat, it also sent home information about the attached socket.

Actual rule:

Code: Select all

On System#Boot do 
 gpio,3,0
endon
On WIFI#Connected do
SendToHTTP 10.10.10.254,8080,/json.htm?type=command&param=switchlight&idx=18&switchcmd=Off ### correct?
SendToHTTP 10.10.10.254,8080,/json.htm?type=command&param=switchlight&idx=19&switchcmd=Off ### correct?
SendToHTTP 10.10.10.254,8080,/json.htm?type=command&param=switchlight&idx=20&switchcmd=Off ### correct?
endon

on Button1#state do
  if [Relay1#state]=0 or [Relay2#state]=0 or [Relay3#state]=0
    gpio,5,1
    gpio,4,1
    gpio,13,1
  else
    gpio,5,0
    gpio,4,0
    gpio,13,0
  endif
endon

on Relay1#state do
  if [Relay1#state]=0
    gpio,1,1
  else
    gpio,1,0
  endif
endon
on Relay2#state do
  if [Relay3#state]=0
    gpio,1,1
  else
    gpio,1,0
  endif
endon
on Relay3#state do
  if [Relay3#state]=0
    gpio,1,1
  else
    gpio,1,0
  endif
endon
GPIO-1 is LED
GPIO 5,4,13 Relay
Electrican in coal mine.

dampa
Normal user
Posts: 87
Joined: 19 Jul 2018, 01:48

Re: Rules - i have problem.

#2 Post by dampa » 31 Mar 2019, 19:47

take a look at this thread viewtopic.php?f=4&t=6586 it may help you debug and give you insight to your problem

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests