Jump to content

Query State of Scenes / Value of Variables?


waffles

Recommended Posts

Posted

Is there a way to query the state of a scene, specifically for Insteon devices?

 

A simple on/off or yes/no would work for me.

 

Here is a simple scenario:

I have 3 ApplianceLincs that belong to Scene "all on".

If the state for all 3 devices is ON, the state for this scene will be YES.

If the state for one or more is not ON, the state for this scene will be NO.

 

 

The same rules would apply for dimmers. There, ON for each device would be defined by their respective target levels (0-100%).

 

Along those lines, is it possible to query the value of VARIABLES (Integers or States)?

Posted

What are you actually trying to do? Your questions are very generic and vague so it's difficult to give answers. Variables can be used in conditions of programs...is that what you mean by Query? You can't use the status of a scene as a whole, but you can check each device individually...or you could use programs to detect the scene being turned on and off to set a variable.

Posted
Is there a way to query the state of a scene, specifically for Insteon devices?

 

No

 

Here is a simple scenario:

I have 3 ApplianceLincs that belong to Scene "all on".

If the state for all 3 devices is ON, the state for this scene will be YES.

If the state for one or more is not ON, the state for this scene will be NO.

 

I believe you will need a program for this.

 

if status device 1 is on
and status of device 2 is on
and status of device 3 is on
then
else

 

You could then use the state of the program (true or false) as indication of scene status. If you prefer, you could create a variable and set it to some value based on "then" or "else" path execution.

Posted
What are you actually trying to do? Your questions are very generic and vague so it's difficult to give answers. Variables can be used in conditions of programs...is that what you mean by Query? You can't use the status of a scene as a whole, but you can check each device individually...or you could use programs to detect the scene being turned on and off to set a variable.

 

Sorry, I did not want to make it too complicated/detailed.

 

I have a universal remote control system with 2-way/feedback (iRule). I use the REST interface commands to communicate with the ISY by sending commands and receiving states of devices. The next step – and this is the content of my questions here – is to get the ISY to broadcast the states of scenes or values of variables.

 

Hope this is clearer now.

Posted
Is there a way to query the state of a scene, specifically for Insteon devices?

 

No

 

....

 

Is to possible to have this feature added?

 

.....

 

I believe you will need a program for this.

 

if status device 1 is on
and status of device 2 is on
and status of device 3 is on
then
else

 

You could then use the state of the program (true or false) as indication of scene status. If you prefer, you could create a variable and set it to some value based on "then" or "else" path execution.

 

 

This is what I thought of as a workaround if the value for variables could be queried but not the state of scenes. I already wrote a little test program where I set a variable to '1', if all criteria are met, otherwise the variable is set to '0'.

The downside of this approach is that in case of changes to a scene this program would have to be updated accordingly.

Posted
The next step – and this is the content of my questions here – is to get the ISY to broadcast the states of scenes or values of variables.

 

Unfortunately, I am not familiar with the REST interface. What I can say with a certain confidence, however, is that if your choice of status is between "scenes" and "variables", you will have to choose variables. There is no such thing as scene status from an ISY, or perhaps insteon, viewpoint.

 

The downside of this approach is that in case of changes to a scene this program would have to be updated accordingly.

Yes, it would.

 

Is to possible to have this feature added?

I assume that it is, but you would have to convince universal devices to do so. I also suspect that this is more complicated than many give credit. How does one define when a scene is on? Any given scene can have multiple "on" levels, based on each controller. Regardless, I think there is a "product feature request" place to put such requests if you are inclined to do so..

 

I continue to look for that ultimate remote and find myself focused on iRule/android/ipenabledirblaster as a potential solution. While I don't want to hijack your topic, I am definitely interested in your thoughts on this.

Posted
…

I assume that it is, but you would have to convince universal devices to do so. I also suspect that this is more complicated than many give credit. How does one define when a scene is on? Any given scene can have multiple "on" levels, based on each controller.

Yes, this can get a bit fuzzy, in particular if you have several dimmer devices with target levels less than 100 and greater than 0%...and even more complicated if you have a mix of different target levels in a scene. To come up with a percentage value, as available for a dimmer, but for a scene, do you calculate an average across all device levels? If so, what does it tell you? Or this one: should a scene be considered 100%, if a target level is only 70% and that level is currently met. That is why I said, I prefer to keep it simple – like you showed in your program: each device of a scene has a target state. If all devices are at their target state, this equates to a TRUE, otherwise it is FALSE – no grey area.

 

 

…

 

Regardless, I think there is a "product feature request" place to put such requests if you are inclined to do so..

Will do. EDIT: how do I do this? Is there a sub forum to post in or form to submit?? Maybe one the moderators (Michel?) could point me in the right direction - thanks!

 

…

I continue to look for that ultimate remote and find myself focused on iRule/android/ipenabledirblaster as a potential solution. While I don't want to hijack your topic, I am definitely interested in your thoughts on this.

I upgraded from a several thousand $ URC setup a few years ago to iRule. I have been very happy with iRule’s capabilities and performance (and at much lower cost). I use a couple of iPads, a Touch and an Android smart phone as ‘front ends’. Control of my home theater is handled mainly by the ISY for the Insteon ‘stuff’, a Digi Portserver for the IP to RS232 connections and a GlobalCache itach for the IR devices. More and more devices are also directly controllable through IP.

iRule is a very powerful and customizable solution. AFAIK, iRule offers a free demo version> Why do not you check it out.

Posted
Why do not you check it out.

 

I intend to try it out, someday. I must confess that I fear that I will like it, and compulsively spend the next months-worth of evenings and weekends learning a new hobby. Given one with my lack of experience with HTML and REST and stuff like that, I expect a steep learning curve.

 

You seem to confirm my perception that iRule is king if one is looking for customization and flexibility.

 

I have too many hobbies already.

Posted
I have a universal remote control system with 2-way/feedback (iRule). I use the REST interface commands to communicate with the ISY by sending commands and receiving states of devices. The next step – and this is the content of my questions here – is to get the ISY to broadcast the states of scenes or values of variables.

 

Aw...iRule...I love it. =) You can both query and set variable values via the REST interface. Here is a thread with the details.

 

As for scenes, you can't see the status, but you can see the status of various individual devices via the REST interface. Or you can have programs set variables... Let's say you had two scenes for a set of lights. The controller for "Scene One" is "KPL Button A" and the controllers for "Scene Two" are "Switch 1" and "Switch 2". You could use these programs:

-- Set a variable to indicate "Scene One" status
If
  (
     Control "KPL Button A" is switched On
     Or Control "KPL Button A" is switched Fast On
  )
  AND Control "KPL Button A" is not switched Off
  AND Control "KPL Button A" is not switched Fast Off
  AND Control "Switch 1" is not switched On
  AND Control "Switch 1" is not switched Off
  AND Control "Switch 1" is not switched Fast On
  AND Control "Switch 1" is not switched Fast Off
  AND Control "Switch 2" is not switched On
  AND Control "Switch 2" is not switched Off
  AND Control "Switch 2" is not switched Fast On
  AND Control "Switch 2" is not switched Fast Off
Then
  $Scene_One_Status = 1
Else
  $Scene_One_Status = 0

 

-- Set a variable to indicate "Scene Two" status
If
  (
     Control "Switch 1" is switched On
     Or Control "Switch 1" is switched Fast On
     Or Control "Switch 2" is switched On
     Or Control "Switch 2" is switched Fast On
  )
  AND Control "KPL Button A" is not switched On
  AND Control "KPL Button A" is not switched Fast On
  AND Control "KPL Button A" is not switched Off
  AND Control "KPL Button A" is not switched Fast Off
Then
  $Scene_Two_Status = 1
Else
  $Scene_Two_Status = 0

 

So whenever the controllers for a scene are switched On, the scene's status is set to On (the one). Whenever they are switched Off or the controllers for the other scene are used, it is set to Off (the zero). You could then use the variables set by these programs for your irule feedback.

Posted
Why do not you check it out.

 

I intend to try it out, someday. I must confess that I fear that I will like it, and compulsively spend the next months-worth of evenings and weekends learning a new hobby. Given one with my lack of experience with HTML and REST and stuff like that, I expect a steep learning curve.

 

You seem to confirm my perception that iRule is king if one is looking for customization and flexibility.

 

I have too many hobbies already.

 

I can also confirm iRule's goodness, but it does have a time-sucking steep learning curve, and I can also agree with your "too many hobbies already". =p My iRule lags behind because we use our JP1 remotes more than anything to control everything...my wife is not big on iphone/ipad control despite us both having iphones and an ipad in the house. /shrug

Posted
........ You can both query and set variable values via the REST interface. Here is a thread with the details.

Thanks for the link. Looks like this is exactly what I was looking for (for my fall back solution anyway).

 

As for scenes, you can't see the status, but you can see the status of various individual devices via the REST interface. Or you can have programs set variables... Let's say you had two scenes for a set of lights. The controller for "Scene One" is "KPL Button A" and the controllers for "Scene Two" are "Switch 1" and "Switch 2". You could use these programs:

-- Set a variable to indicate "Scene One" status
If
  (
     Control "KPL Button A" is switched On
     Or Control "KPL Button A" is switched Fast On
  )
  AND Control "KPL Button A" is not switched Off
  AND Control "KPL Button A" is not switched Fast Off
  AND Control "Switch 1" is not switched On
  AND Control "Switch 1" is not switched Off
  AND Control "Switch 1" is not switched Fast On
  AND Control "Switch 1" is not switched Fast Off
  AND Control "Switch 2" is not switched On
  AND Control "Switch 2" is not switched Off
  AND Control "Switch 2" is not switched Fast On
  AND Control "Switch 2" is not switched Fast Off
Then
  $Scene_One_Status = 1
Else
  $Scene_One_Status = 0

 

-- Set a variable to indicate "Scene Two" status
If
  (
     Control "Switch 1" is switched On
     Or Control "Switch 1" is switched Fast On
     Or Control "Switch 2" is switched On
     Or Control "Switch 2" is switched Fast On
  )
  AND Control "KPL Button A" is not switched On
  AND Control "KPL Button A" is not switched Fast On
  AND Control "KPL Button A" is not switched Off
  AND Control "KPL Button A" is not switched Fast Off
Then
  $Scene_Two_Status = 1
Else
  $Scene_Two_Status = 0

 

So whenever the controllers for a scene are switched On, the scene's status is set to On (the one). Whenever they are switched Off or the controllers for the other scene are used, it is set to Off (the zero). You could then use the variables set by these programs for your irule feedback.

 

I see you are querying the controllers, rather than the loads, which oberkc and I were looking at. Is there an advantage to do this way over the other?

Posted
I see you are querying the controllers, rather than the loads, which oberkc and I were looking at. Is there an advantage to do this way over the other?

I personally prefer Control over Status since I think about these programs in an event-based way. However, I was mostly doing it because you mentioned scenes. Since the scenes may have many responders and at different levels, it's hard to say what "scene" is on. Using programs like I showed on the controllers, you can tell what scene is really on. If you just query the status of a light, is it "On" because Scene A is turned on or because Scene B is turned on?

Posted
I see you are querying the controllers, rather than the loads, which oberkc and I were looking at. Is there an advantage to do this way over the other?

I personally prefer Control over Status since I think about these programs in an event-based way. However, I was mostly doing it because you mentioned scenes. Since the scenes may have many responders and at different levels, it's hard to say what "scene" is on. Using programs like I showed on the controllers, you can tell what scene is really on. If you just query the status of a light, is it "On" because Scene A is turned on or because Scene B is turned on?

 

Got it - thanks much!

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37.1k
    • Total Posts
      372k
×
×
  • Create New...