Dashboard Designer

Evening All,

Today I stubbled into a new chapter in IPS - „dashboard“ designer ! I Created a button with the IPSYMID value „24173“, The value is the object ID to a moeller dimmer. then I wrote a simple script like this thinking that I can use the $IPS_COMPONENT.

<?
if( $IPS_SENDER == "Designer" ) {
MXC_SwitchMode($IPS_COMPONENT /*[First floor\Kitchen\Kitchen]*/, !GetValueBoolean ( 15572 /*[First floor\Kitchen\Kitchen\Status]*/ ));
}
?>

But this didnt work :frowning: How can I set a object id to a button and then pass this to the script ?

Thanks in advanced

You can. But you need to change your seconds part of the statement to use the $IPS_COMPONENT id for the „toggle“ variable.

It should be like this: (haven’t tested - but should do the job)

!GetValue(IPS_GetStatusVariableID($IPS_COMPONENT, „StatusVariable“))

paresy

PS: Add an „echo $IPS_COMPONENT“ to see if the forwarding of the variable works.

paresy, thank you for your prompt answere „like always“ - I didn’t get your example to work - Tried to find some documentation on „IPS_GetStatusVariableID“ but I think there are some problem in IPS online documentation. Under the chapter „IPS_GetStatusVariableID“ I see you describe the function „IPS_Execute“.

Following example

 did not work 

```php
<?
if( $IPS_SENDER == "Designer" ) {
MXC_SwitchMode($IPS_COMPONENT,!GetValue (IPS_GetStatusVariableID ($IPS_COMPONENT, "Status")));
}
?>

Following example

 worked using GetVariableIDByName instead of IPS_GetStatusVariableID and convert string to integer.


```php
<?
if( $IPS_SENDER == "Designer" ) {
MXC_SwitchMode((integer)$IPS_COMPONENT, !GetValue(IPS_GetVariableIDByName("Status", (integer)$IPS_COMPONENT)));
}
?>

Thanks in advanced

I accidentally switched the parameters


<?
if($IPS_SENDER == "Designer") {
    MXC_SwitchMode((integer)$IPS_COMPONENT, !GetValue(IPS_GetStatusVariableID((integer)$IPS_COMPONENT, "StatusVariable")));
}
?>

Thank you for the code example, worked like charm. Can I ask you what’s the different between IPS_GetStatusVariableID and IPS_GetVariableIDByName it looks like they do the same magic job.:slight_smile:

IPS_GetStatusVariableID works on an internal name, which is unique and won’t change

IPS_GetVariableIDByName works on the object name you can see and modify in the logical tree view. Therefore it may change and break your script while the first option will always work.

paresy