Skip to content
ggodart edited this page Jan 6, 2021 · 2 revisions

Scene

See original

SYNOPSIS

States:

  'on'       - all scene members are set to their scene on values and with
               optional ramp rate.  The mh items' state is also set to mirror
               the scene's control
  'off'      - all scene members are set off
  'brighten' - all scene members' state is incremented
  'dim'      - all scene members' state is decremented
  'resume'   - resume is a special state that allows a resumption
               of the original states of the scene's member lights.

Ramp rate table:

Ramp rates must currently expressed in percentage form. The table below maps percentage to ramp duration.

  100% -  0.1s       65% -  26s       29% - 150s
   97% -  0.2s       61% -  28s       26% - 180s
   94% -  0.3s       58% -  30s       23% - 210s
   90% -  0.5s       55% -  32s       19% - 240s
   87% -  2.0s       52% -  34s       16% - 270s
   84% -  4.5s       48% -  38s       13% - 300s
   81% -  6.5s       45% -  43s       10% - 360s
   77% -  8.5s       42% -  47s        6% - 420s
   74% - 19.0s       39% -  60s        3% - 480s
   71% - 21.5s       35% -  90s        0% - 540s
   68% - 23.5s       32% - 120s

Special Considerations:

If using in conjunction with lights managed by Light_Items, various properties of the Light_Itemsuch as"on_state"and"delay_off"may need to be stored, separately managed and restored. Use ofscene->tie_eventandscene->tie_filter `can be used within user code to gain access to scene and scene member states.

If control over a scene item will be "mapped" via user code (vice directly controlled by a X10SL-compatible controller), then consider mapping the "off" part of the control to the resume method to avoid making all lights turn off. For example,

  if ($some_button->state_now eq ON) {
     $my_scene->set(ON);
  } elsif ($some_button->state_now eq OFF) {
     $my_scene->set('resume');
  }

Items.mht

Defined in items.mht as

  # declare the scene item
  SCENE, family_room_movie, All_Lights|Scenes

  # add members to the scene
  SCENE_MEMBER, x10_family_light, family_room_movie, 70%, 78%

The first percentage is the "on-level" and extends from 0% to 100%; it is set to 100% if omitted. For non-dimmable items, it must be 0%, off, 100% or on.

The second percentage is the ramp-rate (see table below); it is optional and can be unique. It must be omitted if the device doest not support fade/ramp rates

DESCRIPTION

Generic Scene base class

INHERITS

Generic_Item

INI PARAMETERS

METHODS

Method Description
add($x10sl_light, $on_level, $ramp_rate) Adds a scene member
Note that this does NOT automatically enrol the scene at the device level. $on_level and ramp_rate must both be expressed in percentage. See ramp rate table abovefor ramp rate mapping. $ramp_rate is optional.
TO-DO: ensure that new member doesn't already exist
remove_member($x10sl_light) Removes a member at the device level. Consider only using this method sparingly and possibly via Voice_Command.
Unenrolls member(s) from scene Deletes (object) member if passed in; otherwise, deletes all members
remove_all_members() Removes all members defined for a scene at the device level. Consider only using this method sparingly and possibly via Voice_Command.
Convenience method as invoking a null argument remove_member isn't obvious
resume Allows a restore of members' original state values; no restore occurs if the scene has not been set on prior to a resume

AUTHOR

Jason Sharpee [email protected]

Based on X10_SCENE.pm from: Gregg Liming [email protected]

SEE ALSO

Clone this wiki locally