Control Mediabox Ziggo Next with Domoticz
Moderator: leecollings
-
- Posts: 200
- Joined: Thursday 20 December 2018 11:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Control Mediabox Ziggo Next with Domoticz
Hi,
I have a Mediabox (Ziggo Next) which I want to control with Domoticz.
On GitHub i have found a Simple webinterface for the Ziggo Next setopbox: https://github.com/basst85/NextRemoteJs
I have installed this on a raspberry pi (other than my domoticz system): 192.168.1.51:8080
It is a Java Script which uses MQTT to communicate with the Ziggo Next:
This is the script: https://pastebin.com/C9hTNU3n
I was wondering if it is possible to create Virtual Devices (Like ON/OFF, Current Status, Channel List/Select Channel, Pause) and use dzVents to send http requests....or maybe to create a sort of an interface?
Greetzzz,
Gerben
I have a Mediabox (Ziggo Next) which I want to control with Domoticz.
On GitHub i have found a Simple webinterface for the Ziggo Next setopbox: https://github.com/basst85/NextRemoteJs
I have installed this on a raspberry pi (other than my domoticz system): 192.168.1.51:8080
It is a Java Script which uses MQTT to communicate with the Ziggo Next:
This is the script: https://pastebin.com/C9hTNU3n
I was wondering if it is possible to create Virtual Devices (Like ON/OFF, Current Status, Channel List/Select Channel, Pause) and use dzVents to send http requests....or maybe to create a sort of an interface?
Greetzzz,
Gerben
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
I don't have a Next Mediabox (still on the old one) so cannot test but if the next Mediabox can be controlled via MQTT or HTTP get, post or put it should be possible.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 200
- Joined: Thursday 20 December 2018 11:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
It is a great box

How would you approach this?
This is the HTML page which sends the commands to the java script "index.js":
Code: Select all
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Next remote</title>
</head>
<body>
<h1>Next remote</h1>
<br/>
<br/>
<p id="stbStatus"></p>
<p id="stbCurrentChannel"></p>
<button id="Power" onCLick="powerKey()">Power</button>
<button id="Escape" onCLick="escapeKey()">Back/Escape</button>
<button id="Pause" onCLick="pauseKey()">Pause</button>
<br/>
<br/>
<b>Click on channelbutton to switch to channel</b>
<br/>
<div id="stationsList" />
<script>
// Get channels
fetch('/api/stations')
.then(function(response) {
return response.json();
})
.then(function(stations) {
for (let s = 0; s < 15; s++) {
let stationBtn = document.createElement('button');
stationBtn.setAttribute('style', 'width: 100px; height: 100px; padding: 5px; background: url(' + stations[s].images[3].url + ') no-repeat; background-size: 100%;');
stationBtn.id = stations[s].serviceId;
document.getElementById('stationsList').appendChild(stationBtn);
}
document.addEventListener('click', function(e) {
if(e.srcElement.nodeName == 'BUTTON' && e.srcElement.id.includes("_")){
setChannel(e.srcElement.id);
}
});
});
function setChannel(channel){
// Switch channel
fetch('/api', {
method: 'POST',
headers: {'Content-Type': 'application/json; charset=utf-8'},
body: JSON.stringify({
action: 'pushChannel',
channel: channel
}),
json: true
});
};
function powerKey(){
// Power on/off
fetch('/api', {
method: 'POST',
headers: {'Content-Type': 'application/json; charset=utf-8'},
body: JSON.stringify({
action: 'powerKey'
}),
json: true
});
};
function escapeKey(){
// Escape key
fetch('/api', {
method: 'POST',
headers: {'Content-Type': 'application/json; charset=utf-8'},
body: JSON.stringify({
action: 'escapeKey'
}),
json: true
});
};
function pauseKey(){
// Pause key
fetch('/api', {
method: 'POST',
headers: {'Content-Type': 'application/json; charset=utf-8'},
body: JSON.stringify({
action: 'pauseKey'
}),
json: true
});
};
function getStatus(){
fetch('/api/status')
.then(function(response) {
return response.json();
})
.then(function(status) {
if(status.setopboxState){
document.getElementById("stbStatus").innerHTML = 'Setopbox status: ' + status.setopboxState;
if(status.currentChannel){
document.getElementById("stbCurrentChannel").innerHTML = 'Current channel: ' + status.currentChannel;
}
}
});
};
setInterval(function(){ getStatus(); }, 1000);
</script>
</body>
</html>
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
I would only start with this when I have the box myself or if someone could give me the exact MQTT and/or HTTP commands needed to get the info from the box and send the commands to the box.
On this forum you can find some example scripts which show you how to send HTPP (with openURL) and MQTT commands (using os.execute(mosquitto))
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 200
- Joined: Thursday 20 December 2018 11:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
I think the MQTT commands/functions can be found in this js script: https://pastebin.com/C9hTNU3nwaaren wrote: ↑Sunday 01 November 2020 12:02I would only start with this when I have the box myself or if someone could give me the exact MQTT and/or HTTP commands needed to get the info from the box and send the commands to the box.
On this forum you can find some example scripts which show you how to send HTPP (with openURL) and MQTT commands (using os.execute(mosquitto))
E.g. this function would toggle the ON/OFF:
Code: Select all
function powerKey() {
console.log('Power on/off');
mqttClient.publish(mqttUsername + '/' + setopboxId, '{"id":"' + makeId(8) + '","type":"CPE.KeyEvent","source":"' + varClientId + '","status":{"w3cKey":"Power","eventType":"keyDownUp"}}')
};
- FireWizard
- Posts: 1886
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
Hello @gschmidt,
1. Please do not X-post.
See your post, almost a year ago: viewtopic.php?t=28352
2. Did you already try the link is that post: https://pypi.org/project/ziggonext/#history?
As I can see, it is under active development.
3. An approach could be that you install Mosquitto on the same device and look what the published topics are with a client, such as MQTT Explorer.
See: https://raspberrypi.tilburgs.com/mosquitto-mqtt/
and: http://mqtt-explorer.com/
From there you can easy find the published topics.
The next step is to decide, whether you want to use @waaren 's proposal to use dZvents or to use a tool like Node Red and to push the desired messages to Domoticz.
Regards
1. Please do not X-post.
See your post, almost a year ago: viewtopic.php?t=28352
2. Did you already try the link is that post: https://pypi.org/project/ziggonext/#history?
As I can see, it is under active development.
3. An approach could be that you install Mosquitto on the same device and look what the published topics are with a client, such as MQTT Explorer.
See: https://raspberrypi.tilburgs.com/mosquitto-mqtt/
and: http://mqtt-explorer.com/
From there you can easy find the published topics.
The next step is to decide, whether you want to use @waaren 's proposal to use dZvents or to use a tool like Node Red and to push the desired messages to Domoticz.
Regards
-
- Posts: 200
- Joined: Thursday 20 December 2018 11:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
Hi @FireWizard,FireWizard wrote: ↑Sunday 01 November 2020 14:49 Hello @gschmidt,
1. Please do not X-post.
See your post, almost a year ago: viewtopic.php?t=28352
2. Did you already try the link is that post: https://pypi.org/project/ziggonext/#history?
As I can see, it is under active development.
3. An approach could be that you install Mosquitto on the same device and look what the published topics are with a client, such as MQTT Explorer.
See: https://raspberrypi.tilburgs.com/mosquitto-mqtt/
and: http://mqtt-explorer.com/
From there you can easy find the published topics.
The next step is to decide, whether you want to use @waaren 's proposal to use dZvents or to use a tool like Node Red and to push the desired messages to Domoticz.
Regards
1. I guess you mean with X-post same question? Sorry for that, I wasn’t aware that a solution using a plug-in or creating it with scripts were the same.
2. I thought that was a plug-in for Home Assistant?
3. I have node-red installed on the same device...I have some flows who work this way, only for pushing audio messages to my Google home speakers. But I try to avoid using 2 programs for a method. My programming skills are still in learning phase, so that is why I ask for some help and advice.
- FireWizard
- Posts: 1886
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
Hello @gschmidt
You wrote:
However some Python script, intended for HA, might also be useful and applicable for Domoticz.
I see many script, prove of concepts and also a Homebridge plugin for Node Red. These seems to use all the MQTT protiocol.
Did you already try to use MQTT-explorer and try to connect to the box?
If you are able to communicate with the box, like all other clients, it should be possible to communicate with Domoticz.
Whether you want to use Node Red or a dzVents script, it is up to you.
Regards
You wrote:
As I do not own a Ziggo Next box. I'm not able to verify. So it could be that this script is only for Hone Assistant,I thought that was a plug-in for Home Assistant?
However some Python script, intended for HA, might also be useful and applicable for Domoticz.
I see many script, prove of concepts and also a Homebridge plugin for Node Red. These seems to use all the MQTT protiocol.
Did you already try to use MQTT-explorer and try to connect to the box?
If you are able to communicate with the box, like all other clients, it should be possible to communicate with Domoticz.
Whether you want to use Node Red or a dzVents script, it is up to you.
Regards
-
- Posts: 2
- Joined: Sunday 12 January 2020 20:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
Hi there,
I am the developer of the python package and the home assistant plugin. My code is open source and available on:
https://github.com/Sholofly/ziggonext-python
https://github.com/Sholofly/ziggonext
You can use the python package in Domoticz! Please note that i am not a python developer so there is room voor improvements (error handling i.e.).
Feel free to contact me for questions or add some functionality if you like..
greets,
Rudolf
I am the developer of the python package and the home assistant plugin. My code is open source and available on:
https://github.com/Sholofly/ziggonext-python
https://github.com/Sholofly/ziggonext
You can use the python package in Domoticz! Please note that i am not a python developer so there is room voor improvements (error handling i.e.).
Feel free to contact me for questions or add some functionality if you like..
greets,
Rudolf
- jjnh
- Posts: 33
- Joined: Sunday 09 December 2018 14:06
- Target OS: Linux
- Domoticz version: 2023.1
- Location: Netherlands
- Contact:
Re: Control Mediabox Ziggo Next with Domoticz
Hi,
Did anyone make any headway with integrating this plugin into Domoticz?
Did anyone make any headway with integrating this plugin into Domoticz?
Odroid N2+ 4GB, with an RfxTrx433E, Zigbee with Slaesh's CC2652RB, Z-Wave, BroadLink IR using RM mini 3 and P1 connected.
Who is online
Users browsing this forum: Google [Bot] and 1 guest