Page 1 of 2

Volume button

Posted: Monday 16 January 2017 10:52
by Number8
Hello,

Domoticz is not very well suited to control audio video gear. For instance in order to control the volume one needs 3 controls (see picture). In a home theater environment, one needs to add 4 more buttons (center, sub, back, surround) that makes 8 controls in domoticz, 11 as a total. The interface would become clutered with many buttons and not very user friendly.
I think (and hope) that devs would consider to design some specific controls for A/V management. The first one would be for volume and could include 2 sub controls (Vol + and Vol -) and an optional control for mute (state of the mute button, i.e. icon, would change accordingly)
Does it make sense?

Re: Volume button

Posted: Monday 16 January 2017 11:24
by michaldobrotka
And what about selector?

Re: Volume button

Posted: Monday 16 January 2017 11:41
by nizaga
i use the blindes / venetian blinds button to control volumen, you have up / down or up/down/stop.

regards,

Re: Volume button

Posted: Monday 16 January 2017 14:38
by Number8
@michaldobrotka and @nizaga: thanks for your inputs. Selector switch is certainly a workable solution, I do use the selector in a number of situations. However I think this could be improved in order to have a more compact and user friendly control.
As such, one of the states of the selector remains selected with does not mean anything in that case (no big deal I must admit).
For the mute control, I sat-up a new On/Off button with a speaker icon. However the logic should be inverted (that is when Mute is on, the button icon should be off)
A control with all volume controls in it would be more user friendly (dont pay attention to the graphic design, the sole purpose is to illustrate the idea). Values in red represent the actual value of each channel.

Re: Volume button

Posted: Monday 16 January 2017 17:53
by gizmocuz
you go a bit over the top here, domoticz is not designed for this

Re: Volume button

Posted: Monday 16 January 2017 18:06
by Egregius
Create your own page for stuff like this.
Almost impossible for Domoticz to implement all brands of receivers, mediaplayers, TVs,...

For example, my Denon control page:
Image

In the same setup I have pages for Kodi control and Kodi movie databases. I only need to browse the movie posters and click a button to turn on the TV, set the Denon receiver to the correct HDMI input and volume etc...

If you build it yourself it works EXACTLY like you want it ;)

Re: Volume button

Posted: Monday 16 January 2017 18:06
by gizmocuz
Hehe... also you go way over the top :mrgreen:

Re: Volume button

Posted: Monday 16 January 2017 18:35
by Egregius
Maybe, but then again, it does what I want it to do :D

Re: Volume button

Posted: Tuesday 17 January 2017 9:08
by Dnpwwo
It may not be designed for this but the existing controls can be used quite well:
Untitled.png
Untitled.png (60.36 KiB) Viewed 8492 times
This speaker icon is mute/unmute and the slider shows/sets the volume far quicker than pushing + or - again and again.... :lol:

Re: Volume button

Posted: Tuesday 17 January 2017 22:01
by Number8
Hehe as gizmocuz said I'm not the only one to be other the top :D
For volume I have a selector with preset values and another selector with - and + so I can adjust
I'd love to design a specific page but I'm not fluent in JavaScript (by far).
Are there any example of such HTML page with custom design controls and the necessary JavaScript glue?
Thanks

Re: Volume button

Posted: Tuesday 17 January 2017 22:05
by Number8
Slider for volume is a nice idea however if I recall well the slider has 100 steps, whereas for main volume the scale goes from -96 to 10 and for some others from -12 to 12. So the slider value would not represent the actual value

Re: Volume button

Posted: Wednesday 18 January 2017 9:44
by Dnpwwo
Correct, you need to do a conversion somewhere between dB and the slider range, normally in a Lua event or an external script

Re: Volume button

Posted: Friday 20 January 2017 13:52
by Number8
Dnpwwo wrote:Correct, you need to do a conversion somewhere between dB and the slider range, normally in a Lua event or an external script
For sure. But then the real 116 steps for main volume (-96 to +10) will be compressed and the -12 to + 12 for other volumes will have far too many steps. This is why so far I haven't used to slider. It would be great to be able to set the min and max value of the slider for each control instance in order to cope with what each equipment is capable of

Re: Volume button

Posted: Sunday 19 February 2017 21:35
by dwmw2
The slider for volume would be fine... but how do I update it when amp volume is changed through other means?

I created a virtual dimmer switch, and I can happily turn it on/off and slide it left and right. Connecting that up to actually control the amp via a lua script should be simple enough.

It's also simple to set up something which automatically monitors the amp itself (it's an Onkyo, so I just connect to a TCP socket and listen for updates). I get a line of data from the amp whenever the volume is changed.

If I use the 'Set Volume' switch command, won't that trigger my scripts to *tell* the amp to set the volume that it had just told me? Triggering another notification from the amp... and another command ... and another notification.

The 'udevice' command doesn't seem to work on the virtual dimmer switch... what am I missing?

Do I have to write actual hardware support for this, to be able to update the observed "dimmer" level without actually triggering a command to the amp? I know this works properly for ZWave light switches...

Re: Volume button

Posted: Sunday 19 February 2017 21:56
by Dnpwwo
@dwmw2,

I would have a look at this viewtopic.php?f=65&t=15681#p120392 and think about making one for your Onkyo (seems like you have some technical knowledge). The Python framework was added to solve exactly these problems.

(Need to be running the beta version though and have Python 3 libraries on your server)

Re: Volume button

Posted: Monday 20 February 2017 17:20
by dwmw2
Thanks. I'm slightly reluctant to resort to python as the machine I'm running this on is fairly underpowered — the VDSL router which sits in the cupboard under the stairs (where it needs to be to see all the Evohome devices) on a UPS anyway. But that example did help me resolve some problems with the sensor types for the C++ plugin I've started to put together: https://github.com/dwmw2/domoticz/commits/onkyo

I might be more inclined to do it with scripting if we could use MicroPython. Or even lua... can't we do device plugins with lua instead?

Re: Volume button

Posted: Tuesday 21 February 2017 14:51
by dwmw2
FWIW I've also resolved my original problem — I need to do the outbound updates with a script configured as the switch action, not triggered by the update. That way it *does* only get invoked for explicit actions from the Domoticz side, not for incoming "informational" updates from the amp itself.

Of course, that only works right now for on/off and selector switches; there seems to be no way to pass the *level* into the script when it's a dimmer. I've submitted a patch which expands {level} when triggering the switch script: https://github.com/domoticz/domoticz/pull/1250

Re: Volume button

Posted: Tuesday 11 July 2017 21:37
by Amsterdam020
I use as Nizaga suggets the Switch Type "Blinds" to control Kodi. Works great !
Volume button.png
Volume button.png (57.35 KiB) Viewed 7238 times
URLs are the following...
http://192.168.1.66:8080/jsonrpc?reques ... t"},"id":1}
http://192.168.1.66:8080/jsonrpc?reques ... t"},"id":1}
(change IP adres and id to your own values)

The volume is in or decreased with 5 units.

Re: Volume button

Posted: Tuesday 11 July 2017 22:23
by nizaga
If you run the latest beta, you can use LUA to capture the stop event and program your action. In the current stable is not implemented but in the latest beta is working fine. I use the on action/off action via URL and the stop via LUA


Enviado desde mi iPhone utilizando Tapatalk Pro

Re: Volume button

Posted: Sunday 18 February 2018 9:07
by Amsterdam020
Hi pascalbianca,

I have two Raspberry Pi's
- one with domoticz
- the other with kodi

This button is on the raspberry pi with domoticz and changes the volume on the pi with kodi.
Could be in your case that you need another number then '1'.

Not sure if this is the answer of the question.