Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnQ/Legrand ALC Lighting Driver - In Progress
Make/Model
Device Version
Connection Type

OnQ/ALC Lighting
2.02
RS232


Description:
This driver controls the OnQ ALC lighting controller. It allows for activation of switches, and relays, and state information for all of those things as well.

Quirks and Limitations:
The driver does not currently support scene buttons or I/O modules. That capability will be added upon CQC user request.
The dimmer state works differently than pressing the actual physical switch. If you press the switch "On", the light will go to its preset dim level. If you then press the "On" switch again, it will go to full bright. In the driver, however, if you write True to the dimmer State, it will only go from Off to full bright. This has been brought to the attention of the manufacturer, and it may be rectified in a future firmware release. The preset level of the dimmer is a field value, though, so you can accomplish this functionality on your own if so desired.
Currently the extended dimming rate is not settable. This issue is being worked out with OnQ.

Connection Details
See the ALC documentation for the correct method of connecting the Serial Expansion Module to your PC.

Events
This driver will send an event upon switch press and release. The event will be:
EventType....................EventData
OnSwitchPress............<SwitchName>
OnSwitchRelease........<SwitchName>
OffSwitchPress...........<SwitchName>
OffSwitchRelease........<SwitchName>

Global Scenes
The driver supports 16 global scenes. Write a number from 1 to 16 to the LearnScene field, and the current settings of all ALC switches will be memorized. Write the same number to the RestoreScene field to have all ALC lights change to the scene. The driver also supports editing global scenes via the "SetGlobalSceneLightLevel" field. Write sceneNumber,lightName,level to this field to change the level for a light. For instance write 1,MasterBedroom,62 to SetGlobalSceneLightLevel, and the next time you use RestoreScene 1, the MasterBedroom light will go to level 62. If you want a light to be not affected by a scene, sets its level to 128. You can also make mass changes by using the lightName "All" and two levels. SetGlobalSceneLightLevel 1,All,0,128 will change all lights that were previously turned off by scene 1 to lights that are not changed by scene 1 at all. For relays, 0 is off and 127 is on. There is also a report you can generate by calling QueryDrvText ID=GlobalScene Value=sceneNumber. The resulting stringList can be sent to a ListBrowser for display. Lights which are not affected by a scene (i.e. level 128) are not included in the list

Light Activity
The driver now summarizes light activity via the read only fields OnLightCount and OnLightList. The OnLightList stringlist only includes lights which are on. Most recent lights appear at the top of the list, and dimmers which are not at full intensity have their intensity after their name: MasterBedroom 74%. The driver also tracks light usage (dimmer normalized) over time. Calling QueryDrvText ID=PCT will produce a list of all lights and their overall "ON percentage" sorted by ON percentage. This is especially useful for determining which lights should be converted to high efficiency bulbs. Lights can be hidden from the list by marking them UNLISTED in the config file (useful for TowelWarmers or other non-lights that are switched via ALC).

Power Usage
The driver also calculates power usage via the read only field OnLightWatts. The total wattage used in the last 24HRs (rolling) is available in WattHRs24HRS. Also, every midnight the system records the power usage in the last 24HRs and the list of all days usage can be seen by calling QueryDrvText ID=Daily. The Power Usage code depends upon the user entering wattage for each load into the config file.

Dimming Methods
The rate of dimming can be set via the config file. There are 3 possible values:
JUMP - Changes made to the light level field will cause the light to jump to that level.
RAMP - Changes made to the light level field will cause the light to gradually move to the new level.
EXT_RAMP - Changes made to the light level field will cause the light to move to the next level at an extended rate, which will be configurable in a future release. The default ramp rate is about twice as long as standard ramp.

Config File
You may create a config file to specify the lights in use. It must adhere to these rules:
1) It must reside in the following directory (create it if it doesn't) on the machine where the driver is going to be loaded.
CQC\CQCData\MacroFileRoot\Drivers\OnQ\ALCLighting

2) The name of the file must be moniker + "_config.csv". So, if the moniker of this particular driver instance is "onq", then the file will be named "onq_config.csv". This allows you to load multiple different instances of this driver on the same PC.

3) Format in the file is as follows:

a. Each line in the file contains either a relay, or a dimmer.
b. The basic format is: "Name, Type, Branch, Module Address"
Name - Name you want this field to be shown as. Name must adhere to the normal CQC rules for field names (no special characters, no spaces, etc). See below for constraints on field names.
Type - Either RELAY or DIMMER
Branch - The ID number of the branch, from 1 to 4.
Module Address - The dip-switch address of the module.
Dimming Method (optional) - If a dimmer, enter a dimming method here, as described above. If none is entered, then the dimmer will default to "Ramp".
UNLISTED (optional) - If you don't want the load to appear in OnLightCount and OnLightList fields
Wattage (optional) - For the power usage fields to be non-zero you must enter a wattage

4) The last line in the config file MUST be "END"
Here is an example file:
LivingRoom,RELAY,3,4,240
MasterBedroom,DIMMER,1,12,200
MediaRoom,DIMMER,2,10,JUMP,480
TowelWarmer,RELAY,4,5,UNLISTED
END
If you do not specify a config file, then the driver will search the network and create field names for all devices it finds. The field names will take the form of:
Br<b>_Addr<a>_
Where b = Branch and a = Address.

Field Names and function
Field names are created automatically for a given switch name. Because of that, the names in the config file must be unique (except for default names, which are ignored). Any duplicate names will be ignored, and a message put in the log indicating the error.

Driver Fields
This section lists the fields that the driver makes available, their types, minimum and maximum values, etc... Name
Type
R/W
Description/Limits
LearnGlobalScene
Card
W
Learn global scene number <value>. Causes the current state and level of all switches to be saved. Value may be in the range from 1 to 16 only.
RestoreGlobalScene
Card
W
Restore all switches and levels to the saved settings.
<Name>Relay_State
Boolean
R/W
Get/Set the state of the relay named <Name>.
<Name>Dimmer_State
Boolean
R/W
Get/Set the state of the dimmer named <Name>
<Name>Dimmer_Level
Card
R/W
Get/Set the current dimming level of the light. Valid values are in the range of 0 (off) to 127 (full bright).
<Name>Dimmer_Method
String
R/W
Get/Set the method the dimmer uses to transition from one light level to another. Valid values are Jump, Ramp, and ExtendedRamp, and are described above.
<Name>Dimmer_PresetLevel
Card
R/W
Get/Set the level the dimmer goes to when the On switch is physically pressed. Please read the Quirks and Limitations above for more information.
ReloadConfigFile
Boolean
W
Write True to cause the config file to be reloaded. This is useful if you need to make a change to the file, without removing the driver.
ExtendedRampToLevel
String
W
Cause a dimmer to ramp to a new level, using the extended ramp rate. NOTE: This field currently does not work. See "quirks" section.


SetGlobalSceneLightLevel
String
W
Write sceneNumber,lightName,level to change the level for a light for a scene. Or Write sceneNumber,All,oldLevel,newLevel to change all lights at one level in a scene to a new level. Levels are 0-128 127 is full on (on for relays) and 128 means ignore this light for this scene.

OnLightCount
Card
R
The number of listed lights which are on.

OnLightList
StringList
R
The list of all listed lights which are on (most recent first). Dim level is include in the name for dimmers not fully on.

OnLightWatts
Card
R
Total wattage of all on lights. Dim normalized.

WattHRs24HRs
Total watt hours used in the last 24 hours (rolling).

QueryDrvText functions:
PCT
StringList
List of all lights and their dim normalized on percentages (most on first).

Daily
StringList
List of Dates and power usage for that day

GlobalScene sceneNumber
StringList
List of lights controlled by the global scene and their target dim level.


Attached Files
.cqcdrvpack   OnQALCLighting_v2_02.CQCDrvPack (Size: 29.02 KB / Downloads: 0)
Reply
Here is version 2.03, which fixes a minor bug where the driver fails if you try to take action (like turning on a light) immediately after a RestoreGlobalScene. Turns out the controller doesn't like to talk while it is sending load status updates for the loads that were affected by the scene.

Now the driver waits in RestoreGlobalScene until the controller has sent all the updates.

--Bob


Attached Files
.cqcdrvpack   OnQALCLighting_v2_03.CQCDrvPack (Size: 29.04 KB / Downloads: 0)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  RainMachine Sprinkler Irrigation Controller Driver kblagron 58 17,567 06-03-2022, 11:27 PM
Last Post: kblagron
  SmartThings API V1 driver kfly 5 503 02-22-2022, 07:55 AM
Last Post: kfly
  Tesla Driver Driver kfly 14 5,266 02-21-2022, 10:11 AM
Last Post: kfly
  Help on editing existing Driver Spot 5 431 02-03-2022, 06:50 PM
Last Post: kblagron
  New to driver development - where to start? jokermac 2 529 09-22-2021, 04:01 PM
Last Post: Spot
  Yamaha RX-V673 IP control Driver jdmevo123 22 11,057 03-27-2021, 03:02 PM
Last Post: Spot
  Updated SMS Driver gReatAutomation 0 586 01-28-2021, 12:53 PM
Last Post: gReatAutomation
  Sage Media Server driver (beta) Fonceur 698 340,947 07-26-2020, 04:59 PM
Last Post: sic0048
  Russound MCA-66 on TCP driver lapointe.sc@gmail.com 5 2,469 05-24-2020, 06:23 AM
Last Post: gReatAutomation
  Samsung SmartTV Driver George M 0 834 05-20-2020, 09:04 AM
Last Post: George M

Forum Jump:


Users browsing this thread: 1 Guest(s)