<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Volume control]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/9864/mmm-volume">MMM-Volume</a></p>
<p dir="auto">@Sean</p>
<p dir="auto">Hello, just got the volume part to work but when I tested it I got a strange behavior.</p>
<p dir="auto">first my code:</p>
<p dir="auto">This is the content of my recipe file in MMM-AssistantMK 2<br />
(<a href="https://github.com/eouia/MMM-AssistantMk2/" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/eouia/MMM-AssistantMk2/</a>)</p>
<pre><code>var recipe = {
    transcriptionHook: {
        "volume_down": {
            pattern: "Baisse le volume", 
            command: "volume_down"
        },
        "volume_up": {
            pattern: "Monte le volume",
            command: "volume_up"
        },
        "volume_set": {
            pattern: "Volume ([0-9]{1,2}[0]?|100) %",
            command: "volume_set"
        },

    },
    command: {
        "volume_down": {
            notificationExec: {
                notification: "VOLUME_DOWN",
            }
        },
        "volume_up": {
            notificationExec: {
                notification: "VOLUME_UP",
            }
        },
        "volume_set": {
            notificationExec: {
                notification: "VOLUME_SET",
                payload: (params, key) =&gt; {
                    return params[1];
                }
            }
        },
    },
}
exports.recipe = recipe
</code></pre>
<p dir="auto">When I call to Up/down volume it work fine (with a 10 updownscale) It break when I call VOLUME_SET to set it to a specific level (let say 30)  and then if I call VOLUME_UP it goes straight to 100 but If I call VOLUME_DOWN first it will work perfectly and go to 20.</p>
<p dir="auto">I missed something?</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.magicmirror.builders/topic/11112/volume-control</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 06:50:28 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/11112.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Sep 2019 01:16:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Volume control on Wed, 18 Sep 2019 01:19:10 GMT]]></title><description><![CDATA[<p dir="auto">Last time I bug you with that I promise.:smiling_face_with_halo:</p>
<p dir="auto">I fixed it that way</p>
<pre><code>      case this.config.notifications.VOLUME_DOWN:
        var vol = parseInt(this.currentVolume) - curUpDownScale
        if (vol &lt; 0) vol = 0
        this.sendSocketNotification(this.config.notifications.VOLUME_SET, vol)
        break
      case this.config.notifications.VOLUME_UP:
        var vol = parseInt(this.currentVolume) + curUpDownScale
        if (vol &gt; 100) vol = 100
        this.sendSocketNotification(this.config.notifications.VOLUME_SET, vol)
        break
</code></pre>
<p dir="auto">By adding the <em><strong>parseInt</strong></em> to make sure that it’s an integer.</p>
<p dir="auto">All working fine now!!</p>
<p dir="auto">Thank again, really like your module!</p>
]]></description><link>https://forum.magicmirror.builders/post/61434</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/61434</guid><dc:creator><![CDATA[smassy]]></dc:creator><pubDate>Wed, 18 Sep 2019 01:19:10 GMT</pubDate></item><item><title><![CDATA[Reply to Volume control on Tue, 17 Sep 2019 08:45:31 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your report.<br />
Value of volume is number(integer, from 0 to 100), so when you use <code>VOLUME_UP</code> or <code>VOLUME_DOWN</code>, this module will add/subtract updownScale to/from currentVolume. But it will work when those values are number.  if you’ve set string(text) as the value, (like “50” and “10”) It will append one string to other string like “5010”.<br />
So, use the volume value as number(integer), not string(with quotation mark).<br />
Someday, I’ll modify source to convert string to number, maybe on next update.</p>
]]></description><link>https://forum.magicmirror.builders/post/61400</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/61400</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 17 Sep 2019 08:45:31 GMT</pubDate></item><item><title><![CDATA[Reply to Volume control on Tue, 17 Sep 2019 04:04:13 GMT]]></title><description><![CDATA[<p dir="auto">@Sean</p>
<p dir="auto">Just to let you know.</p>
<p dir="auto">the ‘-M’ did not fixed the volume problem. I found out ,using the console, that the variable, for an unknown reason, when I  use ‘VOLUME_SET’ followed by ‘VOLUME_UP’ it append the current volume number and the updownscale instead of doing the addition.</p>
<p dir="auto"><strong>using volume_set 50 and updownscale 10</strong></p>
<p dir="auto">Console:</p>
<pre><code>Block
      curUpDownScale: 10
      vol: "5010"
</code></pre>
<p dir="auto">But when I use ‘VOLUME_SET’ followed by ‘VOLUME_DOWN’ it work with no issue. Also in that order I can use ‘VOLUME_UP’ after…</p>
<p dir="auto">I also realized that the vol number is not between double quote</p>
<pre><code>Block
      curUpDownScale: 10
      vol: 40
</code></pre>
<p dir="auto">Still looking to find where it breaks</p>
]]></description><link>https://forum.magicmirror.builders/post/61398</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/61398</guid><dc:creator><![CDATA[smassy]]></dc:creator><pubDate>Tue, 17 Sep 2019 04:04:13 GMT</pubDate></item></channel></rss>