How do i stop this from looping forever?

Moderator: leecollings

Post Reply
Stefano1232
Posts: 6
Joined: Thursday 16 May 2019 5:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How do i stop this from looping forever?

Post by Stefano1232 »

Hi, I have a script which should turn the light on, when the wall remote button is pressed. I had to do this weird work around as you can see to get it to to work. Ok so when I do one if statement at a time (Only have the turn light on command) It works, but putting both the if and else if statement to turn the light on and off with the same button, causing the light to forever try to turn off and on at the same time.

How do I fix this?

Image
image hosting
knielen
Posts: 46
Joined: Sunday 10 September 2017 9:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How do i stop this from looping forever?

Post by knielen »

I'm not sure, but maybe it works if you set the WallSwitch1 to Off in your actions.
Stefano1232
Posts: 6
Joined: Thursday 16 May 2019 5:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How do i stop this from looping forever?

Post by Stefano1232 »

knielen wrote: Friday 17 May 2019 16:39 I'm not sure, but maybe it works if you set the WallSwitch1 to Off in your actions.
I tried this, but it stops the action of the light. For example: I press button when light is on, it starts to turn light off (Light starts to dim) then stops (Light is still on) then press again, and it starts to go back to the brighter dim settings, then stops.

Is there a way to check if light has reached the desired state before turning the button off?
User avatar
kuifje
Posts: 36
Joined: Wednesday 25 October 2017 16:38
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Heemskerk
Contact:

Re: How do i stop this from looping forever?

Post by kuifje »

IT turns on and of because you are using the same triggers at the same time.
When you push the remote button does iT stay on or is this a 1 time only?
Kuifje
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest