How to create a new Page on Volumio 2

Hi,

Earlier this year I build a Pi DAC running on Volumio 1.55 with an ener314-ir and its lirc library.
This version was easy to custom and allowed me to add new pages such as taking the control of my amp.

Today I installed the latest version of Volumio + updated all other libraries I usually used.
Lirc works perfectly I can control the amp via ssh but the new structure of volumio 2 is very different from the previous.

My question is how can I create a new page and add a link into the main menu without playing with the add-on features?
This page will be like a form with different button and when you click on one of them it will execute a shell command exec($value) or shell_exec($value)

For example:

[code]

<?php include("inc/marantz_control.php"); ?> Power On [/code]

marantz_control.php file

<?php
if(isset($_POST['lirc_command'])){
$input=$_POST['lirc_command'];

        switch ($input){
                case "poweron":
                exec('sudo SEND_ONCE Marantz KEY_POWER');
                break;

                case "poweroff":
                shell_exec('irsend SEND_ONCE Marantz KEY_SPLEEP');
                break;

                case "airplay":
                shell_exec('irsend SEND_ONCE Marantz BTN_MISC');
                break;

        }
echo $input."test";
}
?>

Could I add a simple page within the folder /volumio/http/www/app/themes/volumio/assets/static-pages and a script into /volumio/http/www/app/themes/volumio/scripts

But I might have to follow the MCV framework from AngularJS to add a new page.

What I think I have to do:
New controller
New page
update the volume menu

[]Where to find the file mainmenu.json?
[
]Where should I add the page and the controller?

Where to start?

Thanks!
lirc-ir.txt.zip (1.1 KB)

No idea where I should start?
May I edit the menu without breaking the all things? (image attached).

Where is the Controller of the menu I could edit to add a new entry?
Where can I storage new JS controller?
Where to storage my new template?

My previous script what based on PHP
Can recycling my script?

Thanks :slight_smile:
Lirc_interface_Volumio_v2.png

The best way is to create a plugin, and a page UI to manage it. Please have a look at : https://volumio.github.io/docs/Plugin_System/Plugin_System_Overview.html

Thank you balbuze.

I definitely need to spend some time to get it done as a plug-in :slight_smile:

Yes and it would be so easy to reuse, for you or other user ( with some adaptation) :wink:

Let us know if you need help!

I won’t hesitate if I need help michelangelo! I’m not the best in coding but I have some skills in web dev.
Let’s see how far I can go with Angularjs as it’s new for me but not the MVC concept.

Don’t worry, no need to code with angular. We made a plugin system which should work for you!

volumio.github.io/docs/Plugin_S … rview.html

I’m reading the pages :smiley:

A simple way to do this is to simply make use of lirc_web (github.com/alexbain/lirc_web). Change default portnumber 3000 in config and you’re running!