PArns/ioBroker.netatmo

setAway API Error

Closed this issue · 8 comments

I tried to use setHome and setAway functions to set status for specific persons via Javascript. setHome works as expected, but setAway shows the following error and does not set any or all persons as away:

netatmo.0 | 2022-09-23 12:28:23.301 | info | API Warning: setPersonsAway error: Invalid string arg
netatmo.0 | 2022-09-23 12:28:03.826 | info | API Warning: setPersonsAway error: Invalid string arg

Unfortunately dubug/silly log doesn't show any more than this. Calling setHome successfully causes no log entry at all.

This is how I call the functions. Calling setAway without any arguments or with only homeId specified works and sets all persons away as expected - so there seems to be something wrong with 'personsID' in the setAway function:

sendTo('netatmo.0', "setHome", {homeId: 'xxx', personsId: ['xxx']});
sendTo('netatmo.0', "setAway", {homeId: 'xxx', personsId: ['xx']});

please tzry it with

sendTo('netatmo.0', "setAway", {homeId: 'xxx', personsId: 'xxx'});

(so a String and not an array). if this works I can adjust it ... just need that confirmation

PS: it seems that you can set home multiple users API wise but setAway is onkly working for all or one ... When I have the confirmation that it basically works as string I can adjust code to handle also multiple and the array case

please tzry it with

sendTo('netatmo.0', "setAway", {homeId: 'xxx', personsId: 'xxx'});

(so a String and not an array). if this works I can adjust it ... just need that confirmation

Thanks for the fast reply!
Yes. That works.

Ok, I will prepare a new version that will "simulate" the array way and so also allows more then one ...

Please try the GitHub version with the original call (and plesase also check setHome bevause I did adjustments to both)

Seems to be working perfectly - bot setAway and setHome. Thank you so much for your work, this feature makes my life with the Netatmo Welcome a lot easier!

cool, release will come soon

2.1.0 auf dem weg