Requête API a une eedomus avec Lua sur une fibaro HC2

12 Comments

Pour envoyer une requête API a une eedomus avec Lua sur une fibaro HC2 il faut crée un scene (les HTTPS ne sont pas accepter dans les virtual device)

Pour envoyer par exemple:

https://api.eedomus.com/set?api_user=xxxxx&api_secret=xxxxexE&action=periph.value&periph_id=494468&value=1

1= alarm activer 0 = desactiver

Il faut ecrire dans la scene

local http = net.HTTPClient()
http:request(« https://api.eedomus.com/set?api_user=F2tgxxxx_secret=6RNN6o4DJu3xqexE&action=periph.value&periph_id=494468&value=1 », {
   options = {
      method = ‘PUT’,
      headers = {},
      timeout = 10000
      },
  success = function(response)
              if response.status == 200 or response.status == 201 then
                result = json.decode(response.data)
                if result.body.error_msg then
                    fibaro:debug(‘Erreur: ‘..result.body.error_msg)
                end
              else
                  fibaro:debug(‘Commande a échoué’)
              end
            end,
  error =   function(err)
              fibaro:debug(‘[ERREUR] ‘ .. err)
            end
})

Lua est diferent dans les scene ou les VD et c est tres mal documente

J’ai beaucoup cherche

Leave a Comment

  1. Hey very interesting blog!

  2. Répondre

    Do you mind if I quote a few of your articles as long as I provide credit and sources back to your webpage?
    My blog site is in the exact same niche as yours and my users would really benefit from some of the information you present here.
    Please let me know if this okay with you. Thanks!

      • stevenin
      • 3 novembre 2020
      Répondre

      yes, no problem

  3. Répondre

    If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela

  4. Répondre

    This is my first time visit at here and i am actually impressed to
    read everthing at one place.

  5. Thanks for your marvelous posting! I actually
    enjoyed reading it, you might be a great author. I will be sure to bookmark your
    blog and definitely will come back at some point.

    I want to encourage you to definitely continue your great job, have a nice morning!

  6. Répondre

    Hey excellent blog! Does running a blog similar to this take a lot of work?
    I have virtually no expertise in coding but I was hoping to start my own blog
    in the near future. Anyway, should you have any recommendations or tips
    for new blog owners please share. I know this is
    off subject however I simply needed to ask. Thank you!

  7. Répondre

    I am actually grateful to the holder of this web site who has
    shared this fantastic paragraph at at this place.

  8. Thanks for finally writing about > Requête API a
    une eedomus avec Lua sur une fibaro HC2 – stevenin < Liked it!

    • Kyle
    • 6 septembre 2020
    Répondre

    It’s impressive that you are getting ideas from this post as well
    as from our discussion made at this time.

  9. Répondre

    I loved as much as you will receive carried out right here.
    The sketch is attractive, your authored subject
    matter stylish. nonetheless, you command get bought an shakiness over that you wish be delivering
    the following. unwell unquestionably come further formerly again since
    exactly the same nearly a lot often inside case you shield this increase.

  10. Répondre

    Good information. Lucky me I ran across your blog by accident (stumbleupon).
    I’ve book-marked it for later!