Actions Files - thica/ORCA-Remote GitHub Wiki

There are several files, where actions are defined:

Table of Contents

actions.xml

The actions.xml is the main file, which defines, which action files should be loaded. It is a standard system file, so you should not change it.

<?xml version="1.0" encoding="UTF-8"?>
<!-- It is NOT wise to change this document, change the custom include files instead!! -->
<ORCA>
<!--Actions to be started, when a page is displayed. If 'page name' is 'appstart',
the actions will be executed before the first page is displayed -->

<pagestartactions xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="$var(ACTIONPATH)/standardpagestartactions.xml" parse="xml" condition="$var(ORCASTANDARDPAGESTARTACTIONSINCLUDED)!=1"/>
<xi:include href="$var(DEFINITIONPATH)/actions/custompagestartactions.xml" parse="xml" />
</pagestartactions>

<!-- Actions which can be assigned to buttons -->
<actions xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="$var(ACTIONPATH)/standardactions.xml" parse="xml" condition="$var(ORCASTANDARDACTIONSINCLUDED)!=1"/>
<xi:include href="$var(DEFINITIONPATH)/actions/customactions.xml" parse="xml" />
</actions>
</ORCA>

You see, that four files are loaded to define your action structure:

  • standardpagestartactions.xml: These are system wide actions, which will be executed at systemstart or when pages are displayed or stopped: This file is located in the [orca_root]\actions path. You should not modify this file, it will be replaced by the next update.
  • custompagestartactions.xml: These are your custom / definion actions, which will be executed at systemstart or when pages are displayed or stopped: This file is located in the [orca_root]\definitions\[definition]\actions path. You can modify this file as you like.
  • standardactions.xml: These are system wide actions, which you can call by your buttons. This file is located in the [orca_root]\actions path. You should not modify this file, it will be replaced by the next update.
  • customactions.xml: These are your custom / definition actions, which you can call by your buttons. This file is located in the [orca_root]\definitions\[definition]\actions path. You can modify this file as you like.

Internal action files

Most of the internal startup actions are triggered by actions files as well. Those should never be changed.

  • actionsearly.xml: This triggers all major startup actions
  • actionsfallback: This triggers the downloading of the core ORCA files at first application start

Pagestartactions

Page start actions are actions, that will be loaded at systemstart, after the defition has been load, or before a specific page is displayed. While the standardpagestartactions are currently empty, is the custompagestartactions a very important file. As nothing is fixed in ORCA, you need to tell ORCA, which is the first page to display. This can be done by settinge the DEFINITIONSTARTPAGE var to the name of the page you would like to start with. A "showpage" command will be added to the end of the definitionstart by ORCA. And you might need to initalize your custom variables here.

A typical custompagestartactions.xml file might look like this:

<?xml version="1.0" encoding="UTF-8"?>
<includes>
<pagestartaction name="appstart">
<action name="" string="setvar" varname="POWERSTATUS_$dvar(definition_alias_firetv)" varvalue="OFF" />

<action name="Check if we have a first app start" string="if $var(STARTCOUNT)==1"/>
<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_INTERFACE_MAIN"        varvalue="android_adb" />
<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_CONFIGNAME_MAIN"       varvalue="DEVICE_$dvar(definition_alias_firetv)" />
<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_INTERFACE_POWERON"     varvalue="android_adb" />
<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_CONFIGNAME_POWERON"    varvalue="DEVICE_$dvar(definition_alias_firetv)" />
<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_INTERFACE_VOLUME"      varvalue="android_adb" />
<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_CONFIGNAME_VOLUME"     varvalue="DEVICE_$dvar(definition_alias_firetv)" />
<action name="" string="endif" />
</pagestartaction>

<pagestartaction name="definitionstart">
<action name="" string="setvar" varname="DEFINITIONSTARTPAGE" varvalue="Page_Device_$dvar(definition_alias_firetv)" />
<action name="Remove the tv channels settings from the imported setting"    string="removedefinitionsetting" definitionname="$dvar(definition_alias_tvfavorites_template)"/>
<action name="Remove the Layout Control settings from the imported setting" string="removedefinitionsetting" definitionname="$dvar(definition_alias_firetv)_mediaplayer_template" settingname="$lvar(mediaplayertemplate_10064) ($dvar(definition_alias_mediaplayer_template))"/>
<action name="Remove the Color Bar settings from the imported setting"      string="removedefinitionsetting" definitionname="$dvar(definition_alias_firetv)_mediaplayer_template" settingname="$lvar(mediaplayertemplate_10006) ($dvar(definition_alias_mediaplayer_template))"/>
</pagestartaction>

<pagestartaction name="Page_Device_$dvar(definition_alias_firetv)">
<action name="" string="call PageStart Page_Device_$dvar(definition_alias_firetv)" />
</pagestartaction>
</includes>

Some explanation to this:

<pagestartaction name='appstart'>
<pagestartaction name='definitionstart'>

This defines, where to execute the pagestartactions.

  • "appstart": The actions will be executed right at start of the application.
  • "definitionstart'": The actions will be executed after the definition is loaded. THIS IS PLACE, WHERE YOU HAVE TO DEFINE, WHICH IS THE FIRST PAGE TO SHOW.
  • "xxxxx": If you provide a proper page name, the actions will be executed before the page is displayed.
You can add pagestopactions as well, which then will be executed, before a page is removed from the screen

appstart actions

Some more words to the example above, to the appstart actions:

<action name="" string="setvar" varname="POWERSTATUS_$dvar(definition_alias_mediaplayer_template)" varvalue="OFF" />
<action name="" string="modifyvar" varname="inputstring"  operator="load" parameter1="" parameter2="$dvar(definition_alias_mediaplayer_template)"/>

These initally sets the power status of your devices, or the status of your actions. This is helpful, if you have devices, which have the same command to toggle the power status. You might also prevent to execute some actions twice, when you re-enter your activities page.

<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_INTERFACE_MAIN"        varvalue="android_adb" />
<action name="" string="getsaveorcasetting" configtype="$var(DEFINITIONNAME)" varname="$dvar(definition_alias_firetv)_CONFIGNAME_MAIN"       varvalue="DEVICE_$dvar(definition_devicename_firetv)" />

This lines initializes the interfaces to use to a default value. The user can change this using the settings pages

definitionstart actions

The definition start actions will be executed, after the definiton has been loaded. You need to set the DEFINITIONSTARTPAGE variable, which define the first page to shaw

<action name="" string="setvar" varname="DEFINITIONSTARTPAGE" varvalue="Page_Main" />

Here you see, that the first page to start is a page named "Page_Main"

Actions

Actions are either standard actions or custom actions. Standard actions are a set of generic actions, which are stored in the standardactions.xml file, which you can find in the [orca_root]\actions path. You should never change this file. A (short) example could look like this:

<?xml version="1.0" encoding="UTF-8"?>
<includes>
<action name="StopApp" string="stopapp" />
<action name="Show Page" string="showpage" />
<action name="Set Focus" string="setfocus" />
<action name="NoAction" string="noaction" />
<action name="Update Page Clocks" string="updatewidget {pageclocks}" />
<action name="Send Power Toggle" string="sendcommand power_toggle" />
<action name="Send Power On" string="sendcommand power_on" />
<action name="Send Power Off" string="sendcommand power_off" />
<action name="Send OK" string="sendcommand ok" />
</includes>

Custom actions are stored in the the customactions.xml file, which you can find in the [orca_root]\definitions\[definition]\actions path. Here you define all your your actions, which are specific to your definition or are missing in the standardactions file. Such a file could look like this:

?xml version="1.0" encoding="UTF-8"?>
<includes  xmlns:xi="http://www.w3.org/2001/XInclude">
<action name="Send Start Kodi $dvar(definition_alias_enigma2)">
<action name="" string="setvar" varname="startapp" varvalue="kodi" />
<action name="" string="sendcommand startapp" interface="$var($dvar(definition_alias_enigma2)_INTERFACE_ROOT)" configname="$var($dvar(definition_devicename_enigma2)_CONFIGNAME_ROOT)" />
</action>
<action name="FKT SwitchOn $dvar(definition_alias_enigma2)">
<!-- Original wakeup will be valled first by default, so we just add the second stuff-->
<action name="Call Web PowerOn (even if fails)" string="sendcommand power_on"  interface="$var($dvar(definition_alias_enigma2)_INTERFACE_MAIN)" configname="$var($dvar(definition_devicename_enigma2)_CONFIGNAME_MAIN)" condition="$var(POWERSTATUS_$dvar(definition_devicename_enigma2))==OFF"   />
</action>
<action name="FKT SwitchOn $dvar(definition_alias_enigma2) Force">
<!-- Original wakeup will be valled first by default, so we just add the second stuff-->
<action name="Call Web PowerOn (even if fails)" string="sendcommand power_on"  interface="$var($dvar(definition_alias_enigma2)_INTERFACE_MAIN)"  configname="$var($dvar(definition_devicename_enigma2)_CONFIGNAME_MAIN)"/>
</action>
</includes>
⚠️ **GitHub.com Fallback** ⚠️