[APP][Pro] Simple (Sys) LOG - Use this app for Simple (Sys) Logging

Eric, please take a look at the test version :wink:

Goodmorning Arie,

It’s not working on my side….
Already tried restarting the app and rebooting homey…

Well, good to know: i guess you dont have better logic library installed?
I’ll check on it next week, because having bll not installed shoud not make it timeout, you should see the old interface with a message.

Edit:
It might look like i did recieve you crash report, but then i really need to know: do you have bll installed?

At first, I didn’t have BLL installed…
When I got the time-out I installed it and rebooted again.
But no difference…
Still a time-out when opening the log.

Eric

Edit: as a test I rolled back to the regular version, cleared the log, and went back to the test-version.
Now it works.
So I guess loading the existing log takes too much time and gets timed out…

Hp2019?

How large was your log?

Because yeah it could be, however, i don’t do the migration on start, at least, the app startup doesn’t wait for the migration, that is done in the background.

But yeah, still sounds like a solveable issue, so ill spend time on it.

I like the new interface !
Some things I see/miss….

The button to switch between portrait and landscape disappears in landscape mode.
The button still works but the icon is not there.


I also miss the option (or can’t find it) to clear the complete log…

Eric

You’re right, i don’t have that (yet) in the new interface, only a flowcard.
Would you mind creating feature requests for missing features? Than i will not forget them when i work on it this week :wink:

I am on HP 2023.
The log wasn’t that big I think…
I don’t log a lot yet and I started with simple log when I migrated to HP2023 last week, because Papertrails wasn’t ready for HP 2023.

I will !

Edit: sorry Arie, in all the years I have used homey now, I have never issued an “official” feature request…
Soooo, where do I do this? :face_with_peeking_eye:

Well, there is still a known memory issue on the hp2023, causing “random” errors. Those appear more when reading files, so, this specific error i will only get into once the hp2023 issue is resolved.

Because you crashreport says (sort of):
Create file. (Done, no error)
Write to file.
Error, file not found…

Well, I will use it for a while and let it create a new log. Just to see if a bigger log creates a new issue…

Well, like i said: apps crash randomly, so i am not very fast in solving hp2023 issues that seem random :wink:
There are good reasons most developers have not yet migrated :wink:
But athom is working hard getting us there :slight_smile:

I am not experiencing very big issues since I migrated. The only ‘problem’ for me is that all my Aqara door/window sensors are not working on Pro2023. But thanks to your Homesh app I have been able to have a functional house again, by leaving all these sensors on HP2019.
When this issue will be solved, I am going to think of an other usecase for my Pro2019 with Homesh…

1 Like

Thanks, Arie,
I still got the same error :hugs:

Script used:

const version = '1.0.2';

const flowNames = ['Test1','Test2','Test3']; // Use this line to run a few select flows by name.
//const flowNames = null; // Use this line to run all flows

//const appId = 'homey:app:nl.nielsdeklerk.log'; // Will delete all cards and removed the lines for all Simple Log cards!
const appId = 'homey:app:nu.dijker.papertrails'; // Will delete all cards and removed the lines for all Papertrails cards!

//const reallyExecute = false; //set this to false for a test run (in HS), true to really run (in the Playground)
const reallyExecute = true; //set this to false for a test run (in HS), true to really run (in the Playground)

//The script below is unaltered 
async function run() {
  const lineHolders = ['outputError', 'outputSuccess', 'outputTrue', 'outputFalse'];
  const flowGroups = ['triggers', 'conditions', 'actions'];

  let APIv3 = Number.parseInt((await Homey.system.getInfo()).homeyVersion.split('.')) >= 10;

  let afs = await Homey.flow.getAdvancedFlows();
  afs = _.toArray(afs);

  //return afs;
  if (flowNames) afs = _.filter(afs, x => flowNames.indexOf(x.name) > -1);
  afs = _.filter(afs, af=> _.find(af.cards, c=>c.ownerUri==appId));

  for(let i = 0;i<afs.length;i++) {
    const af = afs[i];
    const cardsToDelete = _.pickBy(af.cards, c=>c.ownerUri==appId);
    af.cards = _.pickBy(af.cards, c=>c.ownerUri!==appId);

    for(const key in af.cards) {
      //console.log(key);
      const card = af.cards[key];
      let lines;
      for(let j = 0;j<lineHolders.length;j++) {
        if(card[lineHolders[j]] && card[lineHolders[j]].length>0 && Object.keys(lines = _.pickBy(cardsToDelete, (c,k)=> card[lineHolders[j]].indexOf(k)>-1)).length ) {
          _.each(lines,(c,k)=> card[lineHolders[j]].splice(card[lineHolders[j]].indexOf(k),1));
          if(card[lineHolders[j]].length==0) delete card[lineHolders[j]];
        }
      }
    }
  }


  let flows = await Homey.flow.getFlows();
  flows = _.toArray(flows);

  //return afs;
  if (flowNames) flows = _.filter(flows, x => flowNames.indexOf(x.name) > -1);
  flows = _.filter(flows, af=> _.find(af.triggers, c=>c.uri==appId) || _.find(af.conditions, c=>c.uri==appId) || _.find(af.actions, c=>c.uri==appId));

  for(let i = 0;i<flows.length;i++) {
    const flow = flows[i];
    for(let j = 0;j<flowGroups.length;j++) {
        if(flow[flowGroups[j]] && flow[flowGroups[j]].length>0) {
          flow[flowGroups[j]] = _.filter(flow[flowGroups[j]], c=>c.uri!=appId);

          // _.each(lines,(c,k)=> card[flowGroups[j]].splice(card[flowGroups[j]].indexOf(k),1));
          // if(card[flowGroups[j]].length==0) delete card[lineHolders[j]];
        }
      }
  }

  if(reallyExecute) _.each(afs, async af=>{
   try  {
     await Homey.flow.updateAdvancedFlow({id:af.id, advancedflow:{cards:af.cards}});
   } catch(err) {
     console.log(err);
   }
  });

  if(reallyExecute) _.each(flows, async flow=>{
   try  {
     await Homey.flow.updateFlow({id:flow.id, flow});
   } catch(err) {
     console.log(err);
   }
  });
  return {afs, flows};
}


run().then(x=>{ if(this!=null) this.log(x)});


  • Console

Screenshot from 2023-03-19 15-43-44

I don’t get why the console.log(err) on line 76 reports “Parameter broken is read-only.” for every standard flow. Tried 20 different flownames, so it is not an error in my flows I guess?

Thanks, i now know the issue and howto solve it…
I’ll work on it (but not today) :wink:

1 Like

Cool, yes no hurries of course :wink:

I managed to get the script to remove flowcards to work. Great, thx, @Arie_J_Godschalk

But can not get the script to add flowcards to work unfortunately.
Using v1.0.1 and set “let flowNames;” or let flowNames =null”.
Creating a flow with name “AddLogCards (Test)” while not changing the script doesn’t work as well… ;(

What could I be doing wrong?

Other question:
When migrating from HP19 to HP23; should I run the “remove script” on my old HP19 first to remove Papertrails cards - then make a backup and migrate? Or can I migratie first and then remove the (by then broken) Papertrails cards after?

Yeah, there is still a bug in the script, and i haven’t found time to fix it yet, sorry m8.

That would not really matter, either way would be fine.
I personally am trying to clean up the old homey as much as possible before (someday executing the final/definite) migration.

1 Like

Dear Arie,

Many thanks for the great app! I found it some weeks ago and realized that this was missing your years in my setup :+1:

2 small things, maybe it is easy to fix/implement (i don’t know what is wrong but I’m not allowed to post a issue/suggestion on the bitbucket website.:

  1. When saving a layout, it is saving all values. Also the ‘how many lines on a page value’. I would like to have it at 100. When saving, the default is shown as 100 but it is loading just 50. I have to change it back to 50 and again to 100 to see 100 lines. - it is also showing 50-51 lines but when changing the view (for example 250 entrys a page) it is suddenly 250 of 250. Maybe that the ‘total counter’ is not working?

  2. I have some log entries that are also showing in the homey timeline. The ‘catagories’ field is also shown between ‘’. Is it possible to hide the ‘catagories’ field in the timeline? They use a lot of space in the timeline.

Many many thanks for this great app!!!

Hey @Ranney, can you create a ticket for it?
You do not need a bitbucket account, altho people seem to have issues without it.
If you also cannot create a ticket, lrt me know please.

@Peter_Kawa, are you able to still create tickets peter?

About the Total, you are right, that doesn’t work, and thats actually on purpose. Or atleast, the file-system-database i created, which uses very low resources, very fast, and dossn’t let the flowcards wait to finish, so, it’s fast, because i created a bucket-dumping system.
This has a lott of advantages and only one downside: the total count is unknown.

A total count would require either reading all files all the time, which is a big nogo, or constantly resaving certain files.
However, i do have an idea which i can try.

The other point one i’ll fix.

Point 2, how would you like it? One general setting to either enable or disable categories in the timeline?