- changed title to Homeyscript single timer
Homeyscript single timer
Hello,
I had a homeycript working with Chronograph. It is used for flow which is controlling my pool and it was working before winter. Now when I tried to run the script it ends with an error “cannot read properties of undefined (reading 'id')”. I am able to use app.apiGet('/stopwatches')
to get all data, but when I am trying to get specific ID error occurs.
So far I have: checked that the ID is correct, I have tried to create new stopwatch and get its value thru Homecript, googled for the error, restarted Homeyscript as well as Homey device.
Homeyscript:
let app = await
Homey.apps.getApp({id:'nl.fellownet.chronograph'});
//app.apiGet('/stopwatches'); //gets all timers
//GET /stopwatches/:id - retrieve a single timer,
let Filtrace = await app.apiGet('/stopwatches/446148364_stopwatch_solinatortime');
console.log(Filtrace.duration/1000/60);
Correct ID
{
id: '446148364_stopwatch_solinatortime',
name: 'Solinator TIME',
data: { type: 'Stopwatch' },
duration: 26322015,
targetDuration: null,
running: true
},
Kind regards,
Jakub
Comments (5)
-
reporter -
reporter - marked as minor
-
reporter - marked as trivial
My mistake, I found that there is now a flow card available to put the stopwatch value into variable. Sorry for this, I was not aware of this new functionality.
-
repo owner Okay, i still found the bug. This is because of migrating to SDK3. I had a bug in it.
Resolved in 2.1.1 -
repo owner - changed status to resolved
- Log in to comment