Plugin : Canal+ Sat decoder UPNP control

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…

I think this plugin is very interesting. I would like to help you to develop it. But I don’t know writte lua I would like test it and tell you how it’s work in My sistem.
I don’t know install the png in this directory, how do I enter to this directory?
Thank you very mucho.

[quote=“diegocastanogonzalez, post:2, topic:184397”]I think this plugin is very interesting. I would like to help you to develop it. But I don’t know writte lua I would like test it and tell you how it’s work in My sistem.
I don’t know install the png in this directory, how do I enter to this directory?
Thank you very mucho.[/quote]

If you use the App Store method it should do all that png install for you, MiOS Apps. You may have to login to the App Store before this urn works.

What is your canalplus decoder model? Do you know it’s IP address ( first thing to do and I recommend you allocated to it a dhcp static bail on your router or Internet box so that the cube always get the same IP address always. I have not implemented discovery and you have to enter the IP address manually in the device advanced setting page)

If you do not know lua it will be hard but the code is public you should be able to study it from the code.mios.com url link I gave

One key help I need is for instance creating some nice .png icon 50x50 witch transparent background. One redish to show the state not reachable and one greenish to show the state reachable.

I can?t install any app from apps.mios, I have installed ui7, I think is for that reason.
I only can install apps from dashboard. Could you say me how can install it from develop apps.
My canalplus decoder is Thomson T11, DST800SOG.
I?m going to study the lua code.

The plug in is not yet approved publicly so that may explain why you do not see it.
if you log in into the store and go to MiOS Apps you should see it

Before going through the effort of installing, I am not sure if I can support your decoder, can you please try this first in your favorite browser:
http://:49152/stbdevice.xml
and tell me what happens ?

thx

I can see the app but I can not install it. There is a screen capture.
I wrote the line in the browser and the error was this:
C?digo de error: ERR_CONNECTION_REFUSED

[quote=“diegocastanogonzalez, post:6, topic:184397”]I can see the app but I can not install it. There is a screen capture.
I wrote the line in the browser and the error was this:
C?digo de error: ERR_CONNECTION_REFUSED[/quote]
seems strange and not related to the plugin. I have tried on mine again, deinstalled everything and installing that version from the store and it worked. have you try to install any other plugin ? or reboot your vera ?

Otherwise here are the files attached but it will require you install the icons properly in the proper folder on the vera using a remote connection to vera ( winscp for instance )

But again please try this before installing in your favorite browser
http://:49152/stbdevice.xml

[quote=“amg0, post:7, topic:184397”][quote=“diegocastanogonzalez, post:6, topic:184397”]I can see the app but I can not install it. There is a screen capture.
I wrote the line in the browser and the error was this:
C?digo de error: ERR_CONNECTION_REFUSED[/quote]
seems strange and not related to the plugin. I have tried on mine again, deinstalled everything and installing that version from the store and it worked. have you try to install any other plugin ? or reboot your vera ?

Otherwise here are the files attached but it will require you install the icons properly in the proper folder on the vera using a remote connection to vera ( winscp for instance )

But again please try this before installing in your favorite browser
http://:49152/stbdevice.xml[/quote]

The plugin is now approved and available on the public store: MiOS Apps. it should also be installed directly from the VERA user interface in the Application pages ( not sure which page as I do not have UI7 )

Version 0.27 is now displaying selected channel name and number, and offers a new UPNP action to get the current channel.

screen shot attached

Do you know if this protocol is used in other countries?
I refer to Sky italy

Do you think it could be rewrite to nc+ turbobox PVR?

@Tommi, @Dvbit : really no idea at all. I do not know these products/technology.

To all : I have released a beta version v0.29 which does auto discovery ( using uPNP standard ) and detect automatically the canalplus decoder IP address on the network ! thus removing any kind of configuration need.
( based on work & result from some other contributors like Futtzle,lolodomo and macfly92 )

v0.30 public on the store with discovery and some minor bug fix

upgrade 0.31 for UI7.0.3 with better layout

v0.33 published in test mode.
It has a dynamic UI ( hides control when the device is not registered ) and fixes a UPNP action typo preventing proper execution of the Unregister action.

i’m getting
ERR_CONNECTION_REFUSED

did you follow the instructions ?
did you do the pairing successfully ?
did you switch on / off the cube or reseted the cube’s software recently ? that requires to redo the pairing usually

Here’s the mail I got recently when I get this problem again

I am using Windows 8.1 64 bits and also had the same problem (“ERR_CONNECTION_REFUSED”) that only happened on Google Chrome. On clicking on the “Detail” on the right of the error message, the problem lies with “127.0.0.1”, in my case. So I went to the settings and opened “Manage search engines …” box in the Search section, and while scrolling down, I saw that “Google Desktop, 127.0.0.1” was made a “Default”, so I switched over to Google as the default. Hope that might be of any help.
ERR_CONNECTION_REFUSED – Solutions Encyclopedia

very good

Hello
There was an update on my Cube Wifi decoder on July 12th.
Since then, I have the impression that the plugin does not work anymore: the decoder is no longer recognized in my Vera, it no longer goes into the reachable state …
Am I the only one ?
Laurent.