Data and time formats

bjehnbergbjehnberg Member Posts: 23

Hallo world.

I am loooking for a way, if possible, to use Conrad Connect as a automated gateway, in order to export data values from my Weatherhub sensors to the UK Met Office observation network WOW
https://wow.metoffice.gov.uk/
WOW offers an api which looks like this: http://wow.metoffice.gov.uk/automaticreading
But the date and time parameters in a call must be encoded like this
ex. dateutc=2011-02-02+10%3A32%3A55 for for the 2nd of Feb, 2011 at 10:32:55.
and this in not the format Conrad Connect uses for this type of data. If one takes a look at for example the Is_between_hours time function the components in date and time (year, month, day, hour, minute, second) appears as individual parameters, but they are not accessible as far as I understand it. If there was, they could fairly eas concatenated to the desired format. Any solution for this problem? Perhaps such a thing is beyond the scope of Cnrad Connect?

Comments

  • ChristianChristian Administrator, Moderator Posts: 1,696 admin

    Hi @bjehnberg, it's fairly easy to write all sensor readings to a Google spreadsheet. Perhaps a workaround could be build upon this?

  • bjehnbergbjehnberg Member Posts: 23
    edited August 9

    Hi Christian, an thank you for quick response. As you may understand, in this case I want to use Conrad Connect as an automation engine, and that can be done in principle but the lack of data manipulation possibilities in the maker actuator makes this hard to perform. Yes, it's fairly easy to capture the data values in a Google spreadsheet and I have already tried that. In a spreadsheet I also have access to a large number of data manipulation facilities, i.e. I can format the data capured from the spreadsheet actuator in almost any way I want to. But in order to automate the process chain completely to (in this case) the WOW frontend api I need yet another automation engine that can trigger on the event "new row inserted in Google spreadsheet" (and issue and api call) , and I don´t know where to find such a creature.

  • ChristianChristian Administrator, Moderator Posts: 1,696 admin

    Hi @bjehnberg, okay, understood. I'm afraid, this won't be possible at the time being (from a business point of view).

  • bjehnbergbjehnberg Member Posts: 23

    Hi, Christian. Of course I understand that. What I am looking for is clearly beyond the scope of Conrad Connect. But I found out a solution, namely the automation engine Zapier, and this service can trigger on the event "new row inserted in Google Spreadsheet", pick up the appropriate column values and issue a webhook api call to MetOffice's WOW. It's not a very elegant solution, and if anybody have a better idea, I would be very grateful to hear about it.
    The number of service calls for a free Zapier account is limited to 1000 a month, so thus the observations have to limited to once per hour.

  • ChristianChristian Administrator, Moderator Posts: 1,696 admin

    Hi @bjehnberg, interesting! Would there be a chance to extract the desired data from a Telegram message?

  • bjehnbergbjehnberg Member Posts: 23

    If we are talking specifically about the Zapier service, the answer is no. There is yet no integration from Telegram to Zapier:
    https://zapier.com/apps/telegram/integrations

  • bjehnbergbjehnberg Member Posts: 23

    I might add that I was wrong in my post on august 11th about the Zapier integration service. The number of service calls for a free Zapier account is limited to 100 a month, otherwise you have to pay an monthly fee of around 20 EUR (for 1000 calls a month), which is far too expensive for an amateur. The main advantage with a service like Zapier is that you don't have to code anything, you just specify your workflow and your data. So now I'm looking for an alternative with a better price plan.

  • ChristianChristian Administrator, Moderator Posts: 1,696 admin

    Hi @bjehnberg, thanks for the update. Couldn't that be done with a simple app script for Google Sheets? I could well imagine that this would be possible.

  • bjehnbergbjehnberg Member Posts: 23

    Hi again, Christian. I suppose so, the call to the MetOffice api is a simple http POST request. An installable Google script trigger would detect the event "new row inserted" (by the Google spreadsheet actuator in the Conrad Connect project collecting data from the Weatherhub sensors) and when this trigger is fired an api http request, with the payload fetched from the actual spreadsheet columns in the newly inserted row, could be issued. There is just one small problem: I know absolutely nothing about how to write javascript code or how to contain an app script within a spreadsheet!

  • ChristianChristian Administrator, Moderator Posts: 1,696 admin

    Hi @bjehnberg, well, let's find an expert then!

  • bjehnbergbjehnberg Member Posts: 23
    edited September 5

    Well, hehe, that expert has to be me then. Once upon a time I was a programmer, but that was long before the existence of all those modern scripting languages. But there are a lot of tutorials out there so, as a long term goal I will try to get rid of all these expensive integrations services (except ConradConnect. of course). A script, as you lined out, should not contain that many lines of code. After all, it's only a number of column values that should be picked upp from the last spreadsheet row and shipped away with a http request. All necessary mechanisms for this are in place in the Google Drive environment, it's only a mattor of how to master them. So please wish me good luck with this.

  • bjehnbergbjehnberg Member Posts: 23

    Hello again, I have decided to give up on ConradConnect. I have a simple scenario, collect weather data from the Weatherhub/Mobile Alerts sensor cloud on an regularly basis, record them in a Google Sheets spreadsheet and then finally deliver them to the UK MetOffice WOW database, but ConradConnect is not suited for this purpose (and probably not designed for it either). In the beginning my main problem was the latter but Christan hinted my (see above - thanks once again, Christian) about the possibility with Google app scripts. And that was much easier than I first thought, it took me just a couple of hours to write such a script. The next step was to write a script that collected weather data from the sensor cloud with by means of a direct call to the Mobile Alerts rest api:
    http://www.mobile-alerts.eu/index.php/en/
    And that was almost as easy as the former case, with the powerful build-in functions in the app script environment. So now I am able, with an app scripts time-driven trigger (also called a clock trigger), to control and tailor the data flow from the sensor readings exactly as I want.

  • ChristianChristian Administrator, Moderator Posts: 1,696 admin

    Hi @bjhenberg, thanks, you are always welcome! Don't forget that CC offers the possibility to let you send status messages via Telegram, Pushover, SMS, etc.

Sign In or Register to comment.