Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


HC3 QuickApps coding - tips and tricks


jgab

Recommended Posts

Jan I am ashamed it's not working. If I resume point by point:

Install homebrew>>>>get overview commands to use

Install luarocks    >>>>get overview commands to use

brew install luarocks>>>warning already installed and up to date

which lua>>>>>>/usr/local/bin/lua

ln -s /opt/homebrew/bin/lua ~/Documents/LUA>>>>file exists

Privacy and full acces >>lua checked

luarocks install luajson>>>luajson 1.3.4-1 is now installed in /usr/local (license: MIT/X11)

brew install openssl>>>>Warning: openssl@3 3.0.5 is already installed and up-to-date.

 

Please login or register to see this code.

 

 

 

 

Link to comment
Share on other sites

  • Topic Author
  • When you installed openssl with brew it said something about the directory it installed openssl@3

    In my case it was  

    Please login or register to see this code.

    which is then used as the path when installing luasec  (minus the /include and /lib part)

    Please login or register to see this code.

    Your brew may install the openssl libraries in another path. (I have a company Mac that is partly locked down so stuff are not always installed in the most obvious places)

    If you have forgot the openssl message, you can uninstall and install openssl again.

    >brew uninstall openssl

    >brew install openssl

    Link to comment
    Share on other sites

    Please login or register to see this code.

    I did  clean and after that an >brew install openssl>>result in:

    Please login or register to see this code.

    I am lost complete now?

    Please advice

     

    Link to comment
    Share on other sites

  • Topic Author
  • Please login or register to see this code.

    and after that

    Please login or register to see this code.

    Edited by jgab
    Link to comment
    Share on other sites

    Jan, finished? It give an error but also 

    Please login or register to see this code.

    Will wait for your adapted iOSLocator to see the effect.

    Thank you very much for your time and effort

    Link to comment
    Share on other sites

  • Topic Author
  • You are almost there ?

    You should set macUser to "sjaakkoppejan" instead of "MacBook Pro van Sjaak".

    I deduce that from your previous post with the log

    Please login or register to see this code.

    and also make sure that you run FindMy and that it shows some users or devices...

    ...and then when pushFmipcore don't crash it will list devices and their IDs. Add the IDs you want to track to the list items in the script.

    Edited by jgab
    Link to comment
    Share on other sites

    user modified

    FindMy is enabled

    pushFmipcore only report

    tracking 2 devices no id's are showing

    Ok small problem SSD 1TB almost full I add 80Gb data!!

    Apple support wiped complete clean and now I have done all again.

    If in terminal execute lua pushFmipcore.lua should that show ID's or does it show in testLoc?

    Thanks for your time and effort

     

    Edited by Sjakie
    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, Sjakie said:

    user modified

    FindMy is enabled

    pushFmipcore only report

    tracking 2 devices no id's are showing

    Ok small problem SSD 1TB almost full I add 80Gb data!!

    Apple support wiped complete clean and now I have done all again.

    If in terminal execute lua pushFmipcore.lua should that show ID's or does it show in testLoc?

    Thanks for your time and effort

     

    Yes, when the scripts starts it logs all devices it can find in the terminal window incl their IDs.

    Then you edit the lua table in the script named 'items' to the IDs of the devices you want to track. The one that are there now is my devices - and you can't look them up :-)

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    Please login or register to see this code.

    This I have in my file but it shows only 3 devices tracking. I double checked computername is as you proposed on Mac

    Link to comment
    Share on other sites

  • Topic Author
  • 19 minutes ago, Sjakie said:

    Please login or register to see this code.

    This I have in my file but it shows only 3 devices tracking. I double checked computername is as you proposed on Mac

    If the username is wrong you should get an error when it tries to open the fmipcore/Items.data file. If you don't, then it works - or do you still get errors?

    But how did you get the IDs that you have put in the items table? From the log?

    @Sjakie your right - it was a problem in my script.

    Add an all=true variable at the beginning of the script, like this

     

    Sorry, got carried away - that's not the problem.

    But you can still add a variable 

    Please login or register to see this code.

    in the beginning of the script. It may log some more (not location enabled) devices. Those devices I usually ignore.

    Edited by jgab
    Link to comment
    Share on other sites

    Please login or register to see this code.

    The items numbers are from HC3

    Still no devices

    Edited by Sjakie
    add data2
    Link to comment
    Share on other sites

  • Topic Author
  • Ok, you still get error. It says "Operation not permitted" when trying to open the file.

    That means that you have not managed to get the lua interpreter "Full disk access" - like in the first steps.

    You may have managed to install another lua while you did your trials. 

    In the terminal, move to the directory where you have the script and do

    >which lua

    and use that path for the ln - s operations etc. incl. giving Full disk access to it as described in the first posts in this thread.

     

    You also said something about Apple wiping your laptop? Then the lua program also lost it's full disk access rights and you need to redo it.

    Edited by jgab
    Link to comment
    Share on other sites

    Jan, there was a LUA with full permission, deleted add new one>>>you are the best!

    Please login or register to see this code.

    hehehe after a hard day of Mac stuff its showing!! Thanks

    Please login or register to see this code.

    {} to addin QA testLoc or in a separate QA?

     

    Link to comment
    Share on other sites

  • Topic Author
  • So the test QA I posted previously

    Please login or register to see this code.

    The 'data' argument will be a list of changed locations (even if it's only one).

    The QA in this example just loops over the list and logs the name, lat and long. But there is also an address field and (if applicable) battery status/level.

    Link to comment
    Share on other sites

    Jan, okay will See what will happens if we go away and come back later on today.

    Is there a easy way to start the script when Mac is starting?

    Thanks again

    Link to comment
    Share on other sites

    Jan, I started the lua pushFmipcore.lua at 13:33>>the message for all 3 devices location=true

    I left home with my iPhone just before 14:00 and cam back around 17:30

    in the editor I only see since 13:34:

    no changed items/devices is that I have 3 devices and that did't change?

     

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, Sjakie said:

    Jan, I started the lua pushFmipcore.lua at 13:33>>the message for all 3 devices location=true

    I left home with my iPhone just before 14:00 and cam back around 17:30

    in the editor I only see since 13:34:

    no changed items/devices is that I have 3 devices and that did't change?

     

    and your laptop was running with the FindMy application open?

    Link to comment
    Share on other sites

    Yep as just now I left and came back after being 30 km away

    No changed items/devices

    Link to comment
    Share on other sites

  • Topic Author
  • 11 hours ago, Sjakie said:

    Yep as just now I left and came back after being 30 km away

    No changed items/devices

    Well, I did some tests.

    When the FindMy app is in the foreground it updates very often.

    FindMy app in the background updates less often, like the iPhone, ~each minute.

    FindMy app when in power save (screen saver) - unsure if it's updates...

    FindMy app when the Mac is sleeping doesn't update.

     

    Did you laptop go to sleep or power save?

     

    It may turn out that this method is not something that one can rely on, but more as a complement.

     

    To run the script startup we probably need to add it as a cron job to the Mac. Haven't tested it.

    Please login or register to see this link.

     

    Edited by jgab
    Link to comment
    Share on other sites

    Jan,

    FindMy should be in the foreground, I don't see option run in back ground, all option are on in iPhone and Macbook.

    Screensaver is on 20 min will set it off, yesterday I left my computer and house on the same time in both cases.

    I noticed that if I switch off Macbook I have option to steer Terminal it comes up after restart

     

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...