Author Topic: Can events dim a light only if the light is currently on  (Read 3720 times)

donpaul

  • Guru
  • ****
  • Posts: 300
    • View Profile
Can events dim a light only if the light is currently on
« on: March 17, 2010, 07:39:03 pm »
I need to create an event that sets a light level to 20, only if the light is currently at a level over 20. Is something like that possible? Some sort of IF statement?

mythtified

  • Guru
  • ****
  • Posts: 176
    • View Profile
Re: Can events dim a light only if the light is currently on
« Reply #1 on: March 17, 2010, 10:38:00 pm »
I asked a similar question once and was told I needed to dig into the database to see what could be used to monitor a device's state.

I believe there is a way to do that by setting up an advanced event but I don't have the experience necessary to get what I would need from the database.  Hopefully there is someone else out there that has the answer.

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: Can events dim a light only if the light is currently on
« Reply #2 on: March 18, 2010, 07:45:38 am »
I don't think its possible to use device states as a criteria in the current code. It shouldn't be to hard to add though.

best regards,
sambuca

davegravy

  • Addicted
  • *
  • Posts: 551
    • View Profile
Re: Can events dim a light only if the light is currently on
« Reply #3 on: March 18, 2010, 03:15:01 pm »
As I understand it, as an event parameter, you can send relative values (i.e -20 would reduce the lighting level by 20 from whatever it currently is). This would only have an effect if the light was currently on. It's not a perfect solution.

It would be great if certain events could use "states" based partly on light status. For example, I started playing a movie late last night and I already had the lights off. When the movie finished, the lights automatically came up as usual, but I would have preferred if they'd stayed off (my preference indicated by the initial condition).

In other words, turn up the lights post-media only if they were on when the media started.

I'm guessing it's not feasible given the current code, but if it were possible it would make the system quite powerful.

donpaul

  • Guru
  • ****
  • Posts: 300
    • View Profile
Re: Can events dim a light only if the light is currently on
« Reply #4 on: March 18, 2010, 06:11:03 pm »
It would be great if certain events could use "states" based partly on light status. For example, I started playing a movie late last night and I already had the lights off. When the movie finished, the lights automatically came up as usual, but I would have preferred if they'd stayed off (my preference indicated by the initial condition).

In other words, turn up the lights post-media only if they were on when the media started.

I'm guessing it's not feasible given the current code, but if it were possible it would make the system quite powerful.

Pretty much what I was faced with. If we could use IF/THEN type statements in events and scenarios, it would be very powerful and open up tons of possibilities. It is definitely an important feature and one I would donate for (the other is netflix online). I so wish I could code!

apagg

  • Veteran
  • ***
  • Posts: 60
    • View Profile
Re: Can events dim a light only if the light is currently on
« Reply #5 on: March 19, 2010, 10:12:32 am »
Quote
Pretty much what I was faced with. If we could use IF/THEN type statements in events and scenarios, it would be very powerful and open up tons of possibilities. It is definitely an important feature and one I would donate for (the other is netflix online). I so wish I could code!

have ha look here http://wiki.linuxmce.org/index.php/User:Apagg for an example on using IF/THEN. A list of parameters can be found here http://wiki.linuxmce.org/index.php/Event_criteria.

I am not sure if this actual answers your question but it should be a start.

If you want features that is not implemented at the moment it is smart to open a feature_patch request in trac http://svn.linuxmce.org/trac.cgi/newticket.

Andreas