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


  • 0

Question

Posted

Hello everybody

I would like to create a text file per day on a NAS in which I write events with a timestamp in plain text.
Has anyone built something like this with LUA?
I imagine that a quick app creates the file and then closes it.
Another call of the QA opens the file, attaches something and closes it again.
The next day the process starts with a new file.
No time-consuming MySQL or other databases.
So actually not a complex matter but new territory for me and an example would be very helpful.
greeting
Frank

3 answers to this question

Recommended Posts

  • 0
Posted
2 hours ago, FBerges said:

Hello everybody

I would like to create a text file per day on a NAS in which I write events with a timestamp in plain text.
Has anyone built something like this with LUA?
I imagine that a quick app creates the file and then closes it.
Another call of the QA opens the file, attaches something and closes it again.
The next day the process starts with a new file.
No time-consuming MySQL or other databases.
So actually not a complex matter but new territory for me and an example would be very helpful.
greeting
Frank

 

I did this with Node-RED. My Home Center 2 does an HTTP call with the data to a http in node in Node-RED and the file node writes a status line to a CSV.

If you want to implement it native LUA you have to add a webserver package to your NAS (if that is possible, Synology can) and get the "data" with a simple PHP script. As I know the LUA code for Fibaro does not "understand" a direct SMB or FTP call. But I could be wrong for HC3.

  • 0
Posted
Joep is telling the truth.
Install on synology web package with php. Then upload the php script.
Send data from HC3 using POST net.HTTPClient method to "form" php script.
So much theory, maybe it will help.
  • 0
  • Inquirer
  • Posted

    @martin_n, @Joep12345

     

     

    That all sounds interesting, but a little too difficult.
    I have an older Qnap and thought it would be a little easier.
    Log on to the Qnap as a user via LUA.
    Then create the file and close it again.
    Then open if necessary, add some "text" and close again.
    It's a bit more complicated than I imagine.
    In so many ways as you describe it, my knowledge is certainly not enough.
    This is a pity.
    Maybe someone else has an easier way than the one you described.
    The HC3 is still quite new and the knowledge in the community is somewhat "limited".
    My wish is surely greater than my knowledge.
    Thanks for your information.


    Greetings to the neighbors
    Frank

    Join the conversation

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

    Guest
    Answer this question...

    ×   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...