bencevans / node-sonos

🔈 Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
700 stars 146 forks source link

configureSleepTimer() not working #506

Closed printerboi closed 3 years ago

printerboi commented 3 years ago

Calling sonos.configureSleepTimer("PT30M") should set the sleep Timer of the called device to 30 minutes.

I always get the following upnp error:

Error: upnp: statusCode 500 & upnpErrorCode <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>402</errorCode></UPnPError></detail></s:Fault></s:Body></s:Envelope>

I'm not sure if I got the time format right.

const { Sonos } = require('sonos')

const device = new Sonos('xxx.xxx.xxx.x');

device.configureSleepTimer("PT30M").then(success => {
    console.log("timer set");
}).catch(err => {
    console.log(err);
})

Versions (and Environment)

Node version: v14.15.1 node-sonos version: 7.5.4 OS: Manjaro Arch Linux

hklages commented 3 years ago

try 00:30:00 instead of PT30M

printerboi commented 3 years ago

Hey, thanks for the response. This fixed the issue. I totally messed up with the time String.