CliffS / ikea-tradfri

A library to access the IKEA Trådfri lighting system without needing to call a separate binary
GNU Lesser General Public License v3.0
12 stars 6 forks source link

Scenes not working #32

Open olofsson opened 3 years ago

olofsson commented 3 years ago

I have tried to use scenes in 5.1.0 with node 16 There is no function setScene. the folowing code: tradfri.setScene('Alla av').then((id) => {console.log(id)}).catch((error) => {console.log("Error: ", error)}); generate this error: TypeError: tradfri.setScene is not a function

tradfri.scenes is an empty array even if there is 4 defined scenes according to ikea home smart app.

trying to set a scene with tradfri.scene = "Alla av" results in the following error: Error: Can't find scene Alla av at Group.setScene (/home/olofsson/Sync/src/tellstick_node-new/node_modules/ikea-tradfri/lib/Group.js:192:17) at Tradfri.set (/home/olofsson/Sync/src/tellstick_node-new/node_modules/ikea-tradfri/lib/Tradfri.js:206:55) at /home/olofsson/Sync/src/tellstick_node-new/testIkea.js:49:23

olofsson commented 3 years ago

Half the problem is solved. It was my misstake. I used the swedish 'Alla av' for the scene were all ligths was switched off. But the internal name was ALLOFF. The rest of thw defined scenes kept there swedish name. But still there is no function setScene on the toplevel.

olofsson commented 3 years ago

If I use this code the function setScene is available. var superGroup = tradfri.group('SuperGroup'); superGroup.setScene('ALLOFF').then((id) => {console.log(id)}).catch((error) => {console.log("Error: ", error)});

The scene is set and id is the id off the scene.