How to visualize impulse switch in WebFront?

Hello,

How can I visualize an impulse switch in WebFront? Let me try to explain. My garage door uses a remote control with a single button, where the same button is used for open and close.
My Eltako FSR61-230V impulse switch triggers the garage door. In WebFront I see two variables, OFF/ON. Only the ON variable triggers an action.
ON → Garage door opens
OFF–> No action (But I have to trigger OFF in WebFront, otherwise I can’t trigger ON again)
ON again → Garage door stops
OFF–> No action (But I have to trigger OFF in WebFront, otherwise I can’t trigger ON again)
ON again → Garage door closes

This isn’t very user friendly, has someone made a workaround for this? Thanks!

Try the search term „Taster“.

1 „Gefällt mir“

Thanks,

While this script looks simple enough, and executing the script works as expected, I’m not sure how to implement it. I thought I would just use the script as a custom action, but that creates an infinite loop. I’m having trouble finding the fault in my logic.

Dennis,

to prevent the loop, you schould request the action only once if you are push the button at the webfront.
Like that:

<?php
If ($_IPS['SENDER'] == 'WebFront')
{
	RequestAction($_IPS['VARIABLE'],true);
	IPS_Sleep(500);
	RequestAction($_IPS['VARIABLE'],false);
}

Hi @Attain ,

I edited the script as suggested, and it removes the loop. But it doesn’t seem to execute any action at all. (I’ve configured the script as custom action)

Sorry , i don’t considered, that the default action no more exist.
Now you must use the instance functions.
I’m not sure if the following command is correct because i don’t have this Eltako device
Can you try this:

<?php
If ($_IPS['SENDER'] == 'WebFront')
{
	ENO_SwitchMode(IPS_GetParent($_IPS['VARIABLE']), true);
	IPS_Sleep(500);
	ENO_SwitchMode(IPS_GetParent($_IPS['VARIABLE']), false);
	
}
1 „Gefällt mir“

Yes! That works!

Is there some IPS script/command reference for dummies or something like that? I think I would learn a lot from a simple „How to“.
Now I only need to get rid of the „Off“ button in WebFront. :slight_smile:

This is not possible with an boolean variable like this status variable. But can achieve with an integer variable.

Create a new integer variable below the instance.
Make a new integer variable profile like this and select it for your new variable.
grafik
You can select an icon and label the button as you like.

Use as action script for the variable this:

<?php
If ($_IPS['SENDER'] == 'WebFront')
{
	ENO_SwitchMode(IPS_GetParent($_IPS['VARIABLE']), true);
	SetValue($_IPS['VARIABLE']),1);
	IPS_Sleep(500);
	ENO_SwitchMode(IPS_GetParent($_IPS['VARIABLE']), false);
	SetValue($_IPS['VARIABLE'], 0);
}

The original status variable you can now make invisible to hide it from the webfront.

HTH

Thanks for assisting me again. The script generates an error, I’m not sure why. :thinking:

Parse error: syntax error, unexpected ',' on line 5
Line 5: IPS_SetValue($_IPS['VARIABLE']), 1);

First closing bracket is to much :wink:

1 „Gefällt mir“

That’s what I thought too, but then I receive the following error:
image
I think „IPS_SetValue“ does not exist.

Correct, without IPS_ ;-), sorry, I haven’t seen it.

1 „Gefällt mir“

Thanks @ralf ,

I guessed that „IPS_SetValue“ should have been „SetValue“, and that change corrected the error:

<?php
If ($_IPS['SENDER'] == 'WebFront')
{
	ENO_SwitchMode(IPS_GetParent($_IPS['VARIABLE']), true);
	SetValue($_IPS['VARIABLE'], 1);
	IPS_Sleep(500);
	ENO_SwitchMode(IPS_GetParent($_IPS['VARIABLE']), false);
	SetValue($_IPS['VARIABLE'], 0);
}
?>

What I don’t get is how IPS knows which variable to set? The instance has now 2 variables, one boolean variable and one integer variable.

did the trick, it includes the ID of the Variable you press within WebFront.

Details in Systemvariablen — IP-Symcon :: Automatisierungssoftware

1 „Gefällt mir“

Everyone, thank you for your help!

Dennis,

sorry for my mistakes, fortunately you already got help. Thanks Ralf.

SetValue set it for the integer variable, because it is the trigger for this script.
The other (boolen) is still set automatically by the device instance as an result of the SwitchMode command.

1 „Gefällt mir“