Homeyscript single timer

Issue #27 resolved
Jakub Vícha created an issue

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)

  1. Jakub Vícha reporter

    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.

  2. arie 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

  3. Log in to comment