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

Use a CSV (or JSON or HTML) value to trigger a scene


Question

Posted

I created an app in Google Sheets which fills a table with photovoltaic real time parameters.
Based on a certain logic, I have a cell switching to "1" or to "0". I need to use this value to turn on and off a water heater.

Please login or register to see this image.

/monthly_2024_08/image.png.62e9cf94c0ce0f27835c92e385dae4db.png" />


You can download the value of the cell using the URL:

 

  • CSV

    Please login or register to see this link.

  • JSON

    Please login or register to see this link.

 

How can I trigger a scene controlling the water heater smart plug?

I need to check the value every 10 minutes and run the "ON" or the "OFF" scene.

 

I could then extend it to other devices...

 

Thank you

11 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    I am adding another option.
    You can read the value ON/OFF (1/0) from the URL:

    Please login or register to see this link.

    • 0
    Posted

    Create a LUA scene which triggers every 10 minutes and on the action side check for the response on the url you posted. And then call your ON/OFF scene directly from this LUA scene. Or you implement the logic for ON/OFF directly into this scene depending on the response so you don't need multiple scenes.

    • 0
  • Inquirer
  • Posted

    Hi! Thanks for the reply.
    I tried to create a LUA to check the URL but looks like it doesn't work or there is some mistake in my coding.

    What do you think?

     

     

    Please login or register to see this code.

     

     

    Or even:

     

    Please login or register to see this code.

    • 0
    Posted

    I think you got yourself down a rabbit hole with your Google route. It ain't that easy.

     

    If you really want to do it that way, first read the manual: 

    Please login or register to see this link.

     on how to to execute HTTP/HTTPS queries. First make a simple example code to get familiar to it and later try to get to the Google json file. If you can get a response, you still have to get the values from the json file, etc. 

    • 0
  • Inquirer
  • Posted

    Thanks for the link SmartHomeEddy! Very useful.
    Regarding the json... isn't easier to use this alternative which I included later in my comment?

     

     

    Cytat

     

    You can read the value ON/OFF (1/0) from the URL:

    Please login or register to see this link.

     

     
    • 0
    Posted
    8 minutes ago, Patryk Kopaczewski said:

    Regarding the json... isn't easier to use this alternative which I included later in my comment?

     

    Ah, I couldn't see the json, link wouldn't work. But just the value is better. 

     

    • 0
  • Inquirer
  • Posted (edited)

    Hello I have read the docs thank you.
    I made a quick app but I can't get the value from the URL (which is not json but simply a value)

     

     

    Please login or register to see this code.

     
    print(data) is Nil 🙁
     
    Thank you...
     
    end
    Edited by Patryk Kopaczewski
    • 0
    Posted

    Give the quickapp some time to get the response. 

     

    If you replace the print(data) --debug then it will work. 

     

     

    Please login or register to see this code.

     

    • 0
    Posted

    (And add an error part in the quickapp, to catch the errors)

    • 0
  • Inquirer
  • Posted

    Oh wow it works!!! Thank you so much. I was struggling with this since so long time! Many thanks!

    • Like 1

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