
[driver] SMT C7400 / SMT C7401 / Ziggo Mediabox XL
UPDATE: 17/02/2019
Implemented 2 features of the new SDK version (0.53.8) and 4 new buttons of the remote (which can be found on the back)
- registerFavoriteHandlers()
This allows a device that supports favorites (only TV, DVB or TUNER) to implement a custom handler, for example for channel "42", rather than 2 buttonHandler calls for "4" and "2", a single call with "42" will be made to the favoriteHandler.
After the favorite is chosen, the favorite is sent to the Mediabox, including an ENTER key. This speeds up channel hopping considerably. - setDriverVersion(version)
Setting the version allows you to tell the Brain about changes to your devices components. If you for example add new buttons to a device, you can increase the version and this will let the Brain know to fetch the new components (NOTE: the Brain will only add new components, updating or removing old components is not supported).
This was needed for registering the favorites handler and the new color buttons support. - .addButtonGroup('Color Buttons')
Implemenents the 4 colored buttons on the back of the remote. Since no other implementation on the web for the Ziggo Horizon box has this, i am not sure if anybody IS going to use these. This means; if they screw up the interface to much i might even remove them in a future update.
UPDATE: 14/02/2019
I've restructured my code to move to the neeo-cli way of running this driver; more information and the new code can be found on GitHub. It looks like it 'works on my machine'.
Next step is trying to see if i can emulate the keyboard on the back, but i can't promise anything there. Basically i have already implemented all keys which can be found on various forums and implementing other keys is guesswork. I did find the codes for the color buttons green/red/blue/yellow on the back of the remote, so it does seem that more keys CAN be sent which no other implementation (Homey/OpenHAB/Domoticz) currently supports.
Original post:
The Dutch television provider Ziggo issues a so called 'Mediabox XL'. At the time of writing, this is either an SMT C7400 or an SMT C7401. Both devices don't have a discrete power on and power off command making them 'dumb devices' for Neeo.
Note: I have been mixed feelings with how Neeo handles dumb devices. Personally i think the current way how this is implemented means the remote is unusable for our partners and (small) kids, especially if they are non-native English like mine. I really hope Neeo will take the feedback of all beta testers and current active users into consideration and change/prioritize this.
With that said, i'll now focus in this topic on trying to make the Ziggo Mediabox XL 'smart', since that is something Neeo wants us to do, and which they have provided the Neeo SDK for. More information on the SDK and other drivers being developed, can be found here.
I've investigated online and came across some reading material which should make it possible to create my own 'driver', including discrete power handling so the device is no longer seen as a dumb device and basically solve 'my' problems for now.
Reading material used:
- Horizon Control (Java API wrapper)
- Einder (Python API wrapper)
- tv.horizon.ziggo (Homey API wrapper)
- HorizonRemote (Android API wrapper)
- horizon (OpenHAB binding)
- Ziggo HorizonBox support (Domoticz Forum)
Basically i will be combining the best of the above in creating the Neeo driver.
-
Besides a digital recorder, the Ziggo Mediabox XL is also a fully featured media player. Do you use the Ziggo Mediabox XL for television only and have a separate modem for the internet? Then you need to follow step 1 and step 2. Do you use your Ziggo Mediabox XL for both television and internet? Then you can get start at step step 2. In order for this driver to work, you would need to make sure both steps are completed.
Step 1. Connect to your home network (Dutch instructions).
Your Ziggo Mediabox XL should be connected to your home network. I would advise to connect with a network cable, but connection using WiFi follows almost the same steps outlined below. It is pretty self-explanatory.
- Press Menu on the Ziggo Mediabox XL remote.
- Select Opties.
- Select Mijn Thuisnetwerk and press OK.
- Select Instellen Thuisnetwerk and press OK.
- Select Op het modem and press OK.
- Connect the Ziggo Mediabox XL with a network cable to your modem.
- Select Netwerkkabel and press OK.
- The Ziggo Mediabox XL has to reboot now.
2. Make sure you are sharing your media library (Dutch instructions).
Now that your box is connected to your home network, you need to enable the embedded XBMC client inside the Ziggo Mediabox XL. This is an essential part for the driver, since XBMC is only running when your box is on, thus we can check to see if XBMC is reachable, meaning your box is on.
- Press Menu on the Ziggo Mediabox XL remote.
- Select Opties
- Select Mijn Thuisnetwerk and press OK.
- Select Instellen Thuisnetwerk and press OK.
- Select Ja and press OK
- Accept the Algemene voorwaarden
- The media library can be found through Mijn Media in the main menu of your Ziggo Mediabox XL.
The Ziggo Mediabox XL is now going to index your personal media, but only if it is exposed on your home network via DLNA. This may take a while depending on the amount of files. If you don't have any DLNA servers that is ok, we just need this XBMC server to 'be online'.
-
Assuming you have connected your Ziggo Mediabox XL to your home network, figure out the IP of the box and preferably use DHCP on your router to give it a static DHCP address.
Open a web-browser, type in the IP address and hit enter.
A login page should appear (if not, tripple check Mijn Thuisnetwerk settings and try again).
Login with admin/admin (yes.. very secure indeed).
Click on Basis, followed by Thuisnetwerk. You should see a page like this. You can verify here that your horizon is connected to your home network.
Then click Local Area Network where you can see your IP, the main MAC address of the Ziggo Mediabox XL and the DHCP-poolsize that the Ziggo Mediabox XL has claimed from your router (yes.. 19 IP addresses)
In my particular case, i was interested in the last IP address, 192.168.1.143, this is hosting the media server when the box is powered on. You can figure this out by looking at the MAC address of your Mediabox XL (blurred in above pics) and see which other IP has almost the same MAC address in your router reservation table. In my case, only the last 2 digits of the MAC address where different. But that will be used later.
Turn off the WiFi networks
By default, the Ziggo Mediabox XL exposes 2 WiFi networks, one on 5 GHz and one on 2.4 GHz. Since i have my own router with 4 WiFi networks already (private/guest, both on 2.4 GHz and 5 GHz) AND i don't want other people to piggy back on my bandwidth, i have chosen to disable the WiFi networks on the Ziggo Mediabox XL.
According to a different site, you should start with disabling the 5 GHz network. So first click Draadloos, followed by 5 GHz and then Radio. Change the dropdown to Uitgeschakeld and press Opslaan.
Then follow the same steps for the 2.4 GHz network, like shown below.
That should be it!
-
Repository made and initial content of this topic added to the repository: https://github.com/Webunity/ziggo-horizon
-
Another day, and a few hours in on the project...
One of the big challenges is, that the Ziggo Mediabox XL gets a dynamic IP from your router (in case you have your own separate router). Even if you configure your router to assign a static IP address, based on the MAC address of the Mediabox XL, it will not get that IP.
The first IP mentioned in the screenshots above is that of the 'main' client which is also hosting the management interface. This client reserves IPs from your router and hands out those IPs to other services inside the box, like the Mediabox XL itself. This way, the Mediabox XL never asks for an IP on your router (e.g. the IP we would need), since it already got one from the 'main' client. I've banged my head into the wall several times before i found this out.
So how do you get your Mediabox IP then?
Turn on your Ziggo Mediabox XL and press the following options on the remote:
Menu- Opties, followed by OK.
- Mijn Thuisnetwerk, followed by OK.
- Status Thuisnetwerk (LAN), followed by OK.
Isn't there an
easierother way to get a fixed IP?In the end, i've set my mediabox to a static IP (which is possible by following these Dutch instructions) to prevent the box from claiming IP in my neatly organised static IP table. It is a pain in the ass to setup, since you need to connect a network cable between your mediabox and your PC etc. etc. steps i am not going to repeat here, just Google translate the Dutch instructions.
Long story short; my horizon now has a fixed IP of 192.168.1.115 (which is the main client), i've disabled the DHCP server, decreased the DHCP-poolsize to 5, set the DHCP-lease to 86400 seconds (which is a day) and changed the DNS servers on the mediabox to Google's (8.8.8.8 and 8.8.4.4). The local addresses it claims start at 192.168.1.250 which is the IP i need. So in my case, it is 192.168.1.250 which i would need.
All is not lost, since I've come to save the day!
After I've set this up, I knew this wasn't going to work for the most of you guys, so i decided to look further. Then i saw that, when my Mediabox was on, it advertised itself in Windows Explorer so it had to do some sort of DLNA broadcast.
I am proud to announce that I have found a way to do a 'auto-mediabox-ip-detection' using the Simple Service Discovery Protocol (SSDP) which no other Ziggo Driver mentioned above currently has implemented.
It works if the mediabox is on and with the mediabox turned off, it constantly finds out the right IP. So contrary to the drivers above, my driver has zero manual configuration and works even if your media box gets a different IP on your network (I am 99% certain :-p).
I am not going to revert my static IP changes for now, since i really like the changes I've done (e.g. the 192.168.1.250 address) so now i can continue hacking! When the driver is finished, i will revert to see if my script is dummy proof.
-
First version is online! https://github.com/Webunity/ziggo-horizon
Open points / TODO:
- Auto-reconnect to box once the connection drops
- Auto-reconnect once the IP of the box changes
-
Just received my NEEO today! First thing I did was looking for Horizon driver and found this page. Awesome project! The only thing... I am not that technical. So before spending hours on diving into the SDK and so on; is there an easy way to get this driver on my NEEO? Any help would be appreciated :) I have the SMT G7401.
-
Gilles, I executed all of the steps you suggest and initially it 'found' the Mediabox at the IP address of my NAS. After I switched off DNLA on the NAS it found the actual Horizon box. I did work even with the wrong IP address but would crash on connection errors to the NAS.
I cant get it to start on boot though. I use the latest Raspbian on a Pi 2
-
Replace index.js content with below . REPLACE on line 28 with the ip of your box since here I hardcoded mine to test !
'use strict';
const Promise = require("bluebird");
const Ssdp = require('node-ssdp-lite');
const neeoapi = require('neeo-sdk');
const controller = require('./controller');//----------------------------------------------------------------------------------------------------
// Start script
//----------------------------------------------------------------------------------------------------console.log('---------------------------------------------');
console.log(' Ziggo Horizon Mediabox adapter');
console.log('---------------------------------------------');// Search for mediabox on local network
var mediabox;
console.log(' - Searching for NEEO Brain (max 15 sec.)');
neeoapi.discoverOneBrain().then((brain) => {
console.log(' - FOUND! -> ', brain.name);
clearTimeout(15000);// initiate Mediabox object
mediabox = new controller('192.168.6.186');// Set the device info, used to identify it on the Brain
const neeoDevice = neeoapi.buildDevice('Mediabox XL')
.setManufacturer('Ziggo')
.addAdditionalSearchToken('horizon')
.setType('DVB')
.addButtonGroup('POWER')
.addButtonGroup('Menu and Back')
.addButtonGroup('Controlpad')
.addButtonGroup('Channel Zapper')
.addButtonGroup('Numpad')
.addButtonGroup('Transport')
.addButtonGroup('Transport Search')
.addButtonGroup('Record')
.addButton({ name: 'GUIDE', label: 'TV Gids' })
.addButton({ name: 'ONDEMAND', label: 'On Demand' })
.addButton({ name: 'HELP', label: 'Help' })
.addButton({ name: 'INFO', label: 'Informatie' })
.addButton({ name: 'TEXT', label: 'Teletekst' })
.addButtonHander((btn) => { mediabox.onButtonPressed(btn); });console.log(' - Starting "Ziggo Mediabox XL" driver ...');
return neeoapi.startServer({
brain,
port: 6336,
name: 'mediaboxXl',
devices: [neeoDevice]
});
})
.then(() => {
console.log(' - READY! use the NEEO app to search for "Ziggo Mediabox XL".');
})
.catch((err) => {
console.error('ERROR!', err);
process.exit(1);
}); -
Hi all, I tried connecting the Horizon into my local network and this works the first couple of days but, after a while replay-tv and apps start to die on it. Has anyone else have this experience? It is the older 7400 I'm having.
I'm playing with the thought of connecting my Rpi via Wifi with the Horizon and via Lan with my local network. So it works really as a man in the middle. Has anyone tried this?
-
Jorgen Behrens and Loic please check out the new code on Github, it has almost been a complete rewrite with now support for:
- Static IP (or SSDP, you can choose)
- Better SSDP detection*
- Localisation
- Auto-reconnect (w00t!)
You might need to remove the driver and re-add it (since i changed some naming to better reflect UPC/Ziggo in the names) but that only has to be done this time, i promise :)
Check out the WIKI i have created for my driver.
I would love to see a code review or some sort from for example Niels de Klerk
Nerd info: besides the right 'user agent' header it now also downloads the XML associated with the found record, parses it and looks for the right model numbers inside that XML. I might need to tweak it for Swiss boxes, but i don't own a Swiss box, so i have to rely on you guys.
Since i don't know if you followers get a good notification, you are hereby tagged: Stephan de Klonia Christoph Engelbert AW de Kuiper Kees Loic Richard Verweij Jin Fang Chen Sisela Kevin Joosten Jim Markus Mahr Jorgen Behrens Kephas Busink Patrick
-
by the way, I just created a wiki on how to get this driver to run on boot.
-
Hi Gilles van den Hoven I can't get this to work on my Pi yet. When I start the service using 'node ./index.js' I get the following error:
module.js:544
throw err;
^
Error: Cannot find module 'debug'
at Function.Module._resolveFilename (module.js:542:15)
at Function.Module._load (module.js:472:25)
at Module.require (module.js:585:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/ziggo-horizon/index.js:4:15)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
When I run 'service ziggo-horizon status' I get
● ziggo-horizon.service - This service runs the Ziggo Horizon service
Loaded: loaded (/etc/systemd/system/ziggo-horizon.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-12-14 10:39:29 CET; 1min 37s ago
Process: 406 ExecStart=/bin/bash /opt/scripts/se-nat.sh (code=exited, status=127)
Main PID: 406 (code=exited, status=127)
Dec 14 10:39:28 raspberrypi systemd[1]: ziggo-horizon.service: Unit entered failed state.
Dec 14 10:39:28 raspberrypi systemd[1]: ziggo-horizon.service: Failed with result 'exit-code'.
Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Service hold-off time over, scheduling restart.
Dec 14 10:39:29 raspberrypi systemd[1]: Stopped This service runs the Ziggo Horizon service.
Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Start request repeated too quickly.
Dec 14 10:39:29 raspberrypi systemd[1]: Failed to start This service runs the Ziggo Horizon service.
Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Unit entered failed state.
Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Failed with result 'exit-code'.
Any ideas what I should do? During the installation of the update I;
- Removed the old /opt/ziggo-horizon directory
- Downloaded the GIT repository using wget
- Unpacked the repository using tar into /opt/ziggo-horizon
- Added 'opt' where it said '<PATH>' in the ziggo-horizon script in /init.d
- Installed Forever
- ran the other steps described in the WIKI to run the driver at boot.
- rebooted the Pi
Jorgen
-
I noticed recently that the driver restart very very often and in the logs I see
[2018-03-18T19:08:26.002Z] 2018-03-18T19:08:26.002Z ziggo-horizon:main ---------------------------------------------
0|Neeo Hor | [2018-03-18T19:08:26.003Z] 2018-03-18T19:08:26.003Z ziggo-horizon:main Ziggo Horizon Mediabox XL driver
0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main ---------------------------------------------
0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main * verifying installed Node runtime ...
0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main - OK: 8.10.0
0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main * loading modules ...
0|Neeo Hor | [2018-03-18T19:08:26.245Z] 2018-03-18T19:08:26.245Z ziggo-horizon:main - OK
0|Neeo Hor | [2018-03-18T19:08:26.247Z] 2018-03-18T19:08:26.247Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
0|Neeo Hor | [2018-03-18T19:08:26.247Z] 2018-03-18T19:08:26.247Z ziggo-horizon:controller - Found a box with IP: 192.168.6.45
0|Neeo Hor | [2018-03-18T19:08:26.247Z] 2018-03-18T19:08:26.247Z ziggo-horizon:main * Searching for NEEO Brain (max 10 sec.)
0|Neeo Hor | [2018-03-18T19:08:26.310Z] 2018-03-18T19:08:26.310Z ziggo-horizon:main - OK, found a Neeo brain with name: NEEO Salon
0|Neeo Hor | [2018-03-18T19:08:26.311Z] 2018-03-18T19:08:26.311Z ziggo-horizon:main * Announcing "Horizon Mediabox XL" driver to the Neeo brain ...
0|Neeo Hor | [2018-03-18T19:08:26.363Z] 2018-03-18T19:08:26.363Z ziggo-horizon:main - OK
0|Neeo Hor | [2018-03-18T19:08:26.363Z] 2018-03-18T19:08:26.363Z ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ...
0|Neeo Hor | Error: connect ECONNREFUSED 192.168.6.45:5900
0|Neeo Hor | at Object._errnoException (util.js:1022:11)
0|Neeo Hor | at _exceptionWithHostPort (util.js:1044:20)
0|Neeo Hor | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
0|Neeo Hor | [2018-03-18T19:08:27.515Z] 2018-03-18T19:08:27.515Z ziggo-horizon:main Error: connect ECONNREFUSED 192.168.6.45:5900
0|Neeo Hor | at Object._errnoException (util.js:1022:11)
0|Neeo Hor | at _exceptionWithHostPort (util.js:1044:20)
0|Neeo Hor | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
When the box is off it does not answer and this makes the driver crash it looks like ?
-
Hi,
your driver works so far wonderful, but I fail at the moment to get it running under init.d. Probably it will be because I did not set the paths in the script correctly, but I am under Linux or with me under Debian Stretch even more than a beginner. Would it be possible to help me with this?Below the messages if I want to start the service
root@amlogic-X96:/home/bennysb/NEEO-Treiber/NEEO-Treiber/Horizon/ziggo-horizon-master/Assets/init.d# service ziggo-horizon start Job for ziggo-horizon.service failed because the control process exited with error code. See "systemctl status ziggo-horizon.service" and "journalctl -xe" for details. root@amlogic-X96:/home/bennysb/NEEO-Treiber/NEEO-Treiber/Horizon/ziggo-horizon-master/Assets/init.d# root@amlogic-X96:/home/bennysb/NEEO-Treiber/NEEO-Treiber/Horizon/ziggo-horizon-master/Assets/init.d# service ziggo-horizon status ● ziggo-horizon.service - LSB: Ziggo Horizon Mediabox XL driver Loaded: loaded (/etc/init.d/ziggo-horizon; generated; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2018-04-14 11:08:02 CEST; 7s ago Docs: man:systemd-sysv-generator(8) Process: 5670 ExecStart=/etc/init.d/ziggo-horizon start (code=exited, status=203/EXEC) Apr 14 11:08:02 amlogic-X96 systemd[1]: Starting LSB: Ziggo Horizon Mediabox XL driver... Apr 14 11:08:02 amlogic-X96 systemd[1]: ziggo-horizon.service: Control process exited, code=exited status=203 Apr 14 11:08:02 amlogic-X96 systemd[1]: Failed to start LSB: Ziggo Horizon Mediabox XL driver. Apr 14 11:08:02 amlogic-X96 systemd[1]: ziggo-horizon.service: Unit entered failed state. Apr 14 11:08:02 amlogic-X96 systemd[1]: ziggo-horizon.service: Failed with result 'exit-code'.