Moonrise

Ansicht von 7 Antwort-Themen
  • Autor
    Beiträge
    • #219011
      j.deenen
      Teilnehmer

      Hi,

      I need to make a trigger on the moonrise time, build in is an option for sunrise. I want to build the same for moonrise. Is it possible to make a script that can get information from an api? Or is it possible to get the information somewhere else?

      The api is for the moonrise time for every day.

      Thanks!

    • #226560
      bkruse
      Teilnehmer

      Hi,
      there are a lot of ways Programmer can interface with other things. The question is, what kind of API are you talking about?
      Once you have the values available in a script, it is possible to let it trigger anything on moonrise.

      A selection of options I think could be helpful in this case:
      – read from a file
      – read from a HTTP request
      – react to a HTTP request that was issued to the Programmers internal webserver
      – receive UDP/TCP messages

      hope that helps,
      Björn

    • #226561
      j.deenen
      Teilnehmer

      Hi Björn,

      I’m trying to understand the HTTP request in ecue. I want to send this request. (http://api.timezonedb.com/v2/list-time-zone?key=7AXP5CU04225&format=xml&country=NL).

      If I send this with a simple request maker I get this response:


      OKNLNetherlandsEurope/Amsterdam36001487582828

      I can’t find the information how to create this in ecue. I hope you have the solution for me.

      ,Jelle

    • #226562
      bkruse
      Teilnehmer

      Hi,

      sorry for late answer.
      In Programmer > Device Manager add a Protocols > HTTP Client
      You’d use the base url api.timezonedb.com in your case.

      Then use a macro like attached to send the HTTP request.

      For receiving and parsing the HTTP Response from that website, you can use a separate macro that uses RegisterEvent() to wait for the response. You will receive a handle to a bob and can use BobGetString() to retrieve the full message.
      Note: string in escript can only hold 255 chars at most :-/

      In advanced system Manual there is also an example of HTTP Request/Response, see chapter “HTTP Client” page 105.

      Hope that helps,
      Björn

    • #226563
      j.deenen
      Teilnehmer

      Hi,

      Is it possible you can resend this? I didn’t see any attachments.

      Thanks,

      Jelle

    • #226564
      bkruse
      Teilnehmer

      Sorry, probably I forgot to attach.

      rn

    • #226565
      j.deenen
      Teilnehmer

      Hi,

      Thanks for the macro, it’s working. Online I can check the hits send to the api. The api is changend, I have one that contains the moonrise time. For receiving the data I got some problems. I only want to use a little bit of the data, the moonrise time for every day.

      How can I receive the information from the api and filter the moonrise time. I need to start the macro every day at 12:00pm, if the system time is the same as the moonrise time the macro need to trigger a cuelist.

      I understand a very little of the scripting in Ecue. But I can’t make one for this. I hope you can help me out one more time.

      Thanks,

      Jelle

      ps.

      The new api:

      http://api.aerisapi.com/sunmoon/amsterdam,nl?client_id=olj98hXH2wUa46Eaoh3UR&client_secret=9WufpmtS2SGa7BmlJKDYnzHHwn8pQMwmTvpjxBmq

    • #226566
      bkruse
      Teilnehmer

      Hi,

      I’m sorry to say, but this exceeds the amount of time what I/we can provide here.
      To fiddle this out exactly, test it, include some fault tolerant steps, etc.would be quite some hours.
      Of course we (or some of our partners) can make an offer for a special request like this.

      For just the basic step, you are not too far away. But without programming experience it could be difficult.

      – send the http request
      – receive the http response
      – look in the received bob object for the information you need and save the moonrise time hour/minute
      – another skript that is run every minute, it checks if current time matches moonrise time – if yes it starts desired action

      Kind regards,
      Björn

Ansicht von 7 Antwort-Themen
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.