Philips Dynalite Multi Device Fan Control using Tasks

Controlling a FAN using Antumbra and Envision Touch Application.


About

When Controlling functionality in a Dynalite network, it is likely that devices may be controlled from different sources, for example an Anumbra panel with a Multi Preset Icon and also the Envision Touch Application.

To keep these devices in sync, we can use some tasks with a Start command to listen to specific dynet packets and store them in a RAM address. When using the Multi Preset Button, the presets will then stay in sync.


The first line we define the dynet area we want to monitor, as this is referenced from multiple parts of the code, it is much better to define this globally. This makes the code easily re-usable and easier to understand.

In the startup task we have two intitialisation tasks to complete. The first one stores and OFF (Present 4) into the RAM address we are using to store the current preset of the device, this is just a catchall to ensure the address is initialised to something known, as RAM could be random after a reboot. The second task requests the current preset for the FAN, this will be useful for our monitoring tasks to update correctly to the current actual preset

Task 1 and Task 2 are monitoring Tasks. The Task 1 listens to changes to the device preset, ie when someone changes it from OFF to ON. Task 2 Listens to the replies when something requests the current preset of the device, like we did in the Startup Task. Both of these tasks then store the preset into RAM address 10 for use by our Control Task

Task 3 is to control the Fan from the Multi-Preset Icon on an Antumbra panel. Whilst the icon will synchronise with the preset, pressing the button will not, and will just action what you did last on the each specific panel. Using this task as a Start Task control on this button, it uses the preset stored in the RAM address from the previous monitoring tasks to ensure when you push the button it will cycle to the next preset. In this case it cycles through HIGH-->MED-->LOW-->OFF-->HIGH

This is the configuration used on each Antumbra panel Multi-preset Antumbra

Example Envision Touch screen. This will not show the same preset as your Antumbra Panels. Envision Touch


This code can be used on as many Antumbra panels as required. If using on mutliple panels, I would recommend randomising the delay in the Startup task to minimise clashes on the network, but keep it high enough that control devices will be online before it is sent.

#const FAN_AREA 10

Startup1()
{
	LDA #0x03
	STA ~10 //Store Preset 4 for Area Fan Routine (Default OFF)
  delay(10)
  dynet(0x1c,FAN_AREA,0x00,0x63,0x00,0x00,0xff) //Request Preset for FAN
}

Task1()
{
	Name="Fan Mon - Message Listen"
  // Fade Channel/Area to Preset Area Channel 'All' - Fade Channel/Area to Preset 4 (Off) with a fade of 0.00s	In	Area, Channel 'All', Join 0xFF	
	Start(0x1c,FAN_AREA,0xff,0x6b,x,x,0xff)  // Listen to Area Fade Messages
	COPY @4,~10,1 //Copy Current Preset byte to RAM 10
}

Task2()
{
	Name="Fan Mon - Message Listen"
	// Reply with Current Preset Area Current Preset Is 4 (Off), Offset Is 0	In	Area, Channel 1, Join 0xFF	
  Start(0x1c,FAN_AREA,x,0x62,0x00,0x00,0xff)  // Listen to Area Preset Request Reply Messages
	COPY @2,~10,1 //Copy Current Preset byte to RAM 10
}

Task3()
{
	Name="Fan Control"
	// Preset 0(1)=HIGH, 1(2)=MED, 2(3)=LOW, 3(4)=OFF
	LDA ~10
	CMP #00  // Currently Preset 1(High)
	BRZ FAN12_HIGH2MED
	CMP #01  // Currently Preset 2(Medium)
	BRZ FAN12_MED2LOW
	CMP #02  // Currently Preset 3(Low)
	BRZ FAN12_LOW2OFF
	CMP #03  // Currently Preset 4(OFF)
	BRZ FAN12_OFF2HIGH
	// If no Preset Matches - just turn OFF
	FAN12_LOW2OFF:
    	DyNet(0x1C,FAN_AREA,0xFF,0x6B,0x03,0x00,0xFF)	// Area, Channel 'All', Join 0xFF - Fade Channel/Area to Preset 4 (Off) with a fade of 0.00s 
	    NULL
	FAN12_OFF2HIGH:
    	DyNet(0x1C,FAN_AREA,0xFF,0x6B,0x00,0x00,0xFF)	// Area, Channel 'All', Join 0xFF - Fade Channel/Area to Preset 1 (High) with a fade of 0.00s 
	    NULL
	FAN12_HIGH2MED:
	    DyNet(0x1C,FAN_AREA,0xFF,0x6B,0x01,0x00,0xFF)	// Area 161, Channel 'All', Join 0xFF - Fade Channel/Area to Preset 2 (Medium) with a fade of 0.00s 
	    NULL
	FAN12_MED2LOW:
	    DyNet(0x1C,FAN_AREA,0xFF,0x6B,0x02,0x00,0xFF)	// Area, Channel 'All', Join 0xFF - Fade Channel/Area to Preset 3 (Low) with a fade of 0.00s 
	    NULL
}