Can't set volume in Spotify nodes

I can't set the volume for the spotify account. I can play, pause step to next with no problem.

Here is the API doc about the setVolume. But what have i done since it dont work????


Debug message is:
image

Can someone please help me.🙏🙏🙏

Are you sure it's volume_percent and not volumePercent
Not using the api myself.

Thanks for your suggestion but i have tryed that with no luck

You need to include the volume as a parameter using msg.params, rather than as msg.volume_percent.

Your example is missing the following line:

msg.params = [<number_between_0_100>]

This is something that is mentioned at the very bottom of the node documentation: node-red-contrib-spotify (node) - Node-RED

Below is an example selecting between two volume levels, hope this helps!

[
    {
        "id": "337e51c93a930c86",
        "type": "inject",
        "z": "8d12682940e41210",
        "name": "10%",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "10",
        "payloadType": "num",
        "x": 530,
        "y": 1160,
        "wires": [
            [
                "6b6aa1b8ba94cda1"
            ]
        ]
    },
    {
        "id": "c73e8ddb331bf51b",
        "type": "spotify",
        "z": "8d12682940e41210",
        "name": "Set Volume",
        "auth": "",
        "api": "setVolume",
        "x": 850,
        "y": 1160,
        "wires": [
            []
        ]
    },
    {
        "id": "7138d12c657e61b5",
        "type": "inject",
        "z": "8d12682940e41210",
        "name": "25%",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "25",
        "payloadType": "num",
        "x": 530,
        "y": 1200,
        "wires": [
            [
                "6b6aa1b8ba94cda1"
            ]
        ]
    },
    {
        "id": "6b6aa1b8ba94cda1",
        "type": "change",
        "z": "8d12682940e41210",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "params",
                "pt": "msg",
                "to": "[payload]",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 680,
        "y": 1160,
        "wires": [
            [
                "c73e8ddb331bf51b"
            ]
        ]
    }
]

Thank you so much for your help. But i still cant get it to work.
here is my flow. Shouldn´t that be working with a slider in sted?
I get this error

[
    {
        "id": "478a3775.62ec48",
        "type": "debug",
        "z": "bd80cf37.f9982",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 1510,
        "y": 780,
        "wires": []
    },
    {
        "id": "1c383f46fd92694e",
        "type": "ui_slider",
        "z": "bd80cf37.f9982",
        "name": "",
        "label": "lydstyrke",
        "tooltip": "",
        "group": "4c99ccf8.ce4ef4",
        "order": 3,
        "width": "6",
        "height": "1",
        "passthru": true,
        "outs": "end",
        "topic": "topic",
        "topicType": "msg",
        "min": 0,
        "max": "100",
        "step": 1,
        "x": 980,
        "y": 720,
        "wires": [
            [
                "6b6aa1b8ba94cda1",
                "f77aafc13c4a0751"
            ]
        ]
    },
    {
        "id": "4064ce121cbfb984",
        "type": "spotify",
        "z": "bd80cf37.f9982",
        "name": "volume",
        "auth": "300cc24fc07817a7",
        "api": "setVolume",
        "x": 1360,
        "y": 780,
        "wires": [
            [
                "478a3775.62ec48"
            ]
        ]
    },
    {
        "id": "337e51c93a930c86",
        "type": "inject",
        "z": "bd80cf37.f9982",
        "name": "10%",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "10",
        "payloadType": "num",
        "x": 990,
        "y": 800,
        "wires": [
            [
                "6b6aa1b8ba94cda1"
            ]
        ]
    },
    {
        "id": "7138d12c657e61b5",
        "type": "inject",
        "z": "bd80cf37.f9982",
        "name": "25%",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "25",
        "payloadType": "num",
        "x": 990,
        "y": 840,
        "wires": [
            [
                "6b6aa1b8ba94cda1"
            ]
        ]
    },
    {
        "id": "6b6aa1b8ba94cda1",
        "type": "change",
        "z": "bd80cf37.f9982",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "params",
                "pt": "msg",
                "to": "[payload]",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1180,
        "y": 780,
        "wires": [
            [
                "4064ce121cbfb984"
            ]
        ]
    },
    {
        "id": "4c99ccf8.ce4ef4",
        "type": "ui_group",
        "name": "Spotify",
        "tab": "365b37e6.3e87d8",
        "order": 5,
        "disp": true,
        "width": "6",
        "collapse": true
    },
    {
        "id": "300cc24fc07817a7",
        "type": "spotify-auth",
        "name": "Spotify OAuth2",
        "scope": "streaming\nuser-follow-modify\nuser-read-currently-playing\nuser-modify-playback-state"
    },
    {
        "id": "365b37e6.3e87d8",
        "type": "ui_tab",
        "name": "Funhall Lys",
        "icon": "dashboard",
        "order": 3,
        "disabled": false,
        "hidden": false
    }
]

Hi, it could be that your device doesn't support it, or perhaps there is some other issue at play. Looking around online, there seem to be comments that iOS exhibits this behaviour, see here

In my own testing, I also received this error when trying to change the volume of the android app. This may be because the volume is not controllable from an app level, and is instead deferred to the OS.

I have tested the original flow I provided with a google nest hub, and it works as expected. This appears to be a spotify issue, rather than a node-red issue.

SUUUUPER. Now it works if I play spotify from a computer.
I was playing on a old Apple Ipad before. Can the age of the Ipad be the reason you think.

I imagine it is due to some quirk with mobile apps, both on android and iOS. Playback controls like play/pause should work, as well as next/prev. It just appears to be volume that is impacted.

Why this is not implemented, I don't know. Even the spotify desktop app cannot change the volume of a mobile device using spotify connect:
image

I will try to install it on a pi instead of a Ipad.
Maybe you can help me with a nother thing.
I am trying to make a simpel dashboard where people can choose a number and place it next in line.
Actually a simple dashboad player. I have start, stop, next and volume. But i like to choose som numbers from som play lists.
Can you help me please??????

That may be best to open another thread to discuss, and leave this thread with the answers to the issues you experienced to assist others with the same issue.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.