CANAL PLUS Sat Decoder plugin
To control the CanalSat ( tested on HD Wifi but also Cube probably ) decoder via the UPNP ip interface.
Screen shots in the document and installation instruction : [url=http://code.mios.com/svn_public/mios_ipx800/trunk/Cplus/cplus.pdf]http://code.mios.com/svn_public/mios_ipx800/trunk/Cplus/cplus.pdf[/url]
Version 0.34
Features
[ul][li]UI5 / UI7 compatible[/li]
[li]autodiscovery of the canalplus device ip address[/li]
[li]Support the Pairing process. first request pairing from the settings tab, then look at your decoder to see the 4 digit code displayed, then enter the code here and click Register.[/li]
[li]reachability of the canalplus device is reported and reachable/not reachable are events useable in scenes/notifications[/li]
[li]dynamic ( but ugly ) icons for the device based on its reachability[/li]
[li]Optionally controls the on/off state via a scene. you enter a scene number which triggers a ON OFF on the canalplus device using the IR transmitter of your choice. ( like IRTrans, GlobalCach? or any other ). Since the remote IR is a toggle command, this plugin takes into account the ON OFF status detected by the UPNP interface and can appropriately set a deterministic ON or OFF status[/li]
[li]Auto refresh ever 120s or Manual refresh button on the UI dashboard usable in scenes[/li]
[li]Several UPNP actions to send command to the canalplus device. these UPNP actions are not exposed in the plugin user interface by callable by LUA code[/li]
[li]UI dashboard
[list]
[li]Current selected channel name, number & locator[/li]
[li]button to force a data refresh[/li]
[li]buttons to do a deterministic ON / OFF ( if a PowerScene is declared )[/li]
[/list]
[/li]
[li]SETTINGS js tab
[list]
[li]ip address : but this needs to be manually edited in the advanced properties[/li]
[li]Pairing button: Press then enter the 4 digit code displayed on the canalplus device, then press the Register button[/li]
[li]optional scene number to toggle the ON OFF state via an IR transmitter[/li]
[li]Ability to send a sequence of keys[/li]
[li]Ability the remote keys[/li]
[li]Ability to select the channel by its name[/li]
[/list]
[/li][/ul]
Variables
Service : urn:upnp-org:serviceId:cplus1
[ul][li]IP, MAC, Manufacturor, Model: filled in once uPNP detection worked once. IP address should be discovered automatically but the user can also force it in the device ip variable[/li]
[li]Debug: 0/1 , 1 for debug mode[/li]
[li]Version: version of the plugin[/li]
[li]Present: 1 if the C+ device card is reachable, 0 otherwise[/li]
[li]IconCode: 100 when the device is reachable, 0 otherwise. controls the icon display on UI5 dashboard[/li]
[li]UUID: the uPNP uuid reported by the C+ device[/li]
[li]Pairing: the last pairing code used[/li]
[li]Volume: the last Volume status ( 0 to 100 ) reported by the C+ device[/li]
[li]PowerScene: Optional, when filled in , it is the Vera scene number which triggers a IR transmitter command to toggle the ON OFF status of the C+ device[/li]
[li]Channels: Internal channel list with this format: listid#name,number,locator|name,number,locator etc…[/li]
[li]CurrentChannel: name, #n, loc where name is the current channel name, n is the channel number and loc is the channel upnp locator[/li][/ul]
Notifications
[ul][li]“Connection State” : When the device becomes reachable or not reachable, in no repeat mode[/li][/ul]
uPNP Actions
[ul][li]action “Refresh” : for forcing a refresh of data from the C+ to Vera.[/li]
[li]action “GetPresent” : for reporting if the C+ device is reachable or not[/li]
[li]action “SetDebug” : Set or unset DEBUG mode[/li]
[li]action “SetPower” : Set the state ON or OFF of the C+ device[/li]
[li]action “RequestPairing” : Forces a pairing request to the C+ device. ONLY if the device is not already registered, otherwise it will be a No-Op[/li]
[li]action “RegisterSmartphone” : Forces a pairing using a 4 digit code given by the C+ device[/li]
[li]action “UnregisterSmartphone” : Forces a unregistration of the device ( not yet exposed in the UI ). after this a new pairing process is required[/li]
[li]action “GetVolume” : Gets the Volume level on the C+ device ( 0 to 100 )[/li]
[li]action “SendKey(keystream)” : Sends a remote stream of keynames ( csv separated ) to the C+ device ( to change channel for instance )[/li]
[li]action “SetChannel (newLocator)” : Set a channel by its locator[/li]
[li]action “GetChannel” : Returns current selected channel: “name, #n, loc”[/li][/ul]
Key Names
SendKey accepts a csv list of names for the remote keys. the list of name is herebelow ( between quotes ). So for instance to send 99 you would you pass “9,9” to the SendKey(“9,9”) UPNP action. There is a delay of 100ms between keys being sent to the decodeur.
local mapCmdToCode = {
["Ok"]=57345,
["Retour"]=57346,
["VOL+"]=57347,
["VOL-"]=57348,
["Mute"]=57349,
["P+"]=57350,
["P-"]=57351,
["Guide"]=57355,
["Sortie"]=57357,
["Haut"]=57600,
["Bas"]=57601,
["Gauche"]=57602,
["Droite"]=57603,
["0"]=58112,
["1"]=58113,
["2"]=58114,
["3"]=58115,
["4"]=58116,
["5"]=58117,
["6"]=58118,
["7"]=58119,
["8"]=58120,
["9"]=58121,
-- ["k58366"]=58366,
-- ["k58367"]=58367,
["Play"]=58368,
["Pause"]=58369,
["Stop"]=58370,
["Rec"]=58371,
["Forward"]=58372,
-- ["k58373"]=58373,
["Rewind"]=58374,
-- ["k58375"]=58375,
-- ["k58376"]=58376,
["Menu"]=61184,
["Info"]=61185
}
Install
[ul][li]from the store : public versions : [url=http://apps.mios.com/plugin.php?id=7466]MiOS Apps
[li]from the store : beta versions: [url=http://apps.mios.com/test-plugin.php?id=7466&show=versions]MiOS Apps
[li]Source files on [url=http://code.mios.com/trac/mios_ipx800/browser/trunk/Cplus]http://code.mios.com/trac/mios_ipx800/browser/trunk/Cplus[/url][/li]
[list]
[li]you need to install the ICON ( .png ) file manually into the folder /www/cmh/skins/default/icons of your vera[/li]
[li]All other files can be installed by uploading Luup files from your Vera page in Apps / Develop / Luup files[/li]
[/list][/ul]
Final thx to all authors of plugins from which I stole some snipset of code here and there, especially how to make a uPNP call from @lolodomo in his DNLA plugin.
I ll welcome feedbacks & volunteers to improve the functionality of this plugin.
Enjoy…