Dinushan Paranavithana Posted May 25, 2019 Share Posted May 25, 2019 I have a Boolean variable called test. I want this variable state to toggle when i press the power button from the mobile phone or touch screen. However, i can use other buttons to change the state, but for the power button the state of the variable doesn't change. What is the reason for this? Link to comment Share on other sites More sharing options...
msgreenf Posted May 25, 2019 Share Posted May 25, 2019 You are not toggling room state. You are toggling device state. You are triggering in the wrong place Sent from my Pixel 3 using Tapatalk Link to comment Share on other sites More sharing options...
Crustyloafer Posted May 26, 2019 Share Posted May 26, 2019 Are you trying to toggle a variable based on the Room itself being on/off? What is it you want to achieve? Link to comment Share on other sites More sharing options...
Dinushan Paranavithana Posted May 27, 2019 Author Share Posted May 27, 2019 @Crustyloafer The TV and projector are in the same room. I have created a IR driver for the TV. If i turn on/off the TV using the remote, I can't get a feedback from the TV to check whether it's on or off. So i'm updating another variable to assume that the TV is on/off. So if someone clicks the power button from the mobile phone, it should turn the tv on/off based on the variable state and update the variable. This is required because if i turn on the projector, the TV should turn off or if the TV is already turned off, it should ignore the TV Link to comment Share on other sites More sharing options...
c4toys Posted May 27, 2019 Share Posted May 27, 2019 18 minutes ago, Dinushan Paranavithana said: @Crustyloafer The TV and projector are in the same room. I have created a IR driver for the TV. If i turn on/off the TV using the remote, I can't get a feedback from the TV to check whether it's on or off. So i'm updating another variable to assume that the TV is on/off. So if someone clicks the power button from the mobile phone, it should turn the tv on/off based on the variable state and update the variable. This is required because if i turn on the projector, the TV should turn off or if the TV is already turned off, it should ignore the TV I personally never have used a toggle command.. I would use a variable to track last state of your 1st variable. then you know that the last variable was correct so trigger off of that! I do this to toggle camera source and main video source using a single * command on the remote Link to comment Share on other sites More sharing options...
Dinushan Paranavithana Posted May 27, 2019 Author Share Posted May 27, 2019 I have assigned custom buttons of the remote to turn on/off the tv or projector. Since the projector cannot be turned off immediately once it is turned on, i have added timers to update a variable called 'CommandIsReadyToSend'. If the variable 'CommandIsReadyToSend' is 'True', the functions assigned to the custom buttons would work. If not, the command is not sent. Link to comment Share on other sites More sharing options...
c4toys Posted May 27, 2019 Share Posted May 27, 2019 Ok, so in your boardroom-room variables-power state make a conditional IF room power is on set -variable TEST to True, IF room power is Off set -variable TEST to False Link to comment Share on other sites More sharing options...
Dinushan Paranavithana Posted May 27, 2019 Author Share Posted May 27, 2019 3 hours ago, c4toys said: Ok, so in your boardroom-room variables-power state make a conditional IF room power is on set -variable TEST to True, IF room power is Off set -variable TEST to False I want to toggle the device state. If the 'TV' is selected, we can see the menu given below. So I want the TV to turn off/on using the 'Power' button. In order to achieve this, i'm trying to toggle the variables state when ever i hit the power button. Link to comment Share on other sites More sharing options...
Crustyloafer Posted May 27, 2019 Share Posted May 27, 2019 Have you considered using the 'Theater Display Switcher' driver in the Control4 driver database, it is specifically for switching between two displays in the same room, especially between a TV and projector. You can also assign a TV lift mechanism to the TV and a motorised projector screen and projector lift so that it knows they need to go up/down as required when switching displays. See screenshot below: https://www.dropbox.com/s/7joftxvr4p250xu/Screenshot 2019-05-27 19.24.17.png?dl=0 Link to comment Share on other sites More sharing options...
Dinushan Paranavithana Posted June 6, 2019 Author Share Posted June 6, 2019 Yes I tried it @Crustyloafer. Thanks, but i wanted to try it for another purpose. I found the issue. I have deleted the power command from the tv template driver (Driver Wizard) when i created a custom driver for the TV. I have added my own command called 'power' later to assign the on/off toggle IR code value. It's good if control4 can allow us to create a GUI menu for the driver that we create, where we can add our own commands and assign them to our own buttons we design in our GUI. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.