Kyvis Labs API Client Module

Kyvis Labs is excited to announce the public release of out API client module. This is an Ignition module that provides an easy way to interface with REST APIs without having to write scripts in Ignition. The module allows you to specify the interaction with an API through a configuration YAML. The YAML configuration is designed to be portable for easy sharing. All sensitive information related to the API is stored and protected in Ignition's internal database as encrypted variables. The module will perform the REST calls, parse the response, and execute actions to store data to Ignition tags, invoke other APIs, or handle the response with a Python script.

The API Client Module provides support for:

  • All HTTP methods (GET, POST, PUT, DELETE, HEAD, PATCH)
  • HTTPS with the ability to disable certificate verification (if needed)
  • Execute manually, on a timer, through a cron schedule, or triggered from an Ignition tag
  • Multiple authentication types (Bearer, Basic Auth, Session Auth, OAuth2)
  • JSON and JSON path support
  • Write results to tags provided by the module in a realtime tag provider called API
  • Webhooks or callbacks to push data to Ignition without having to poll for data. Requires Ignition to be accessible by the service invoking the webhook.

The API is configured using YAML. We have a repository started with the configurations we use, and invite other members to submit their configurations as well!

The module is available at https://github.com/Kyvis-Labs/ignition-api-client-module and the API yaml configurations are available at GitHub - Kyvis-Labs/API-YAML

We are excited what the community can do with this module.

13 Likes

Impressive.

I was trying out your module and I am having some diffculties. I directly put in the YAML config and retrieved my city id from
image
And entered my key.
I see the API tag provider and can see the weather api I created, but I don't see any data coming from it. I saw a note in the git hub documentation that said something about exposing Ignition to the internet but I'm pretty sure that is not required for this API config. Am I missing something Basic. I also looked at trying to configure my local google device project to this but I had an auth problem related to the redirect URl being different than what I set up.

Can you provide more details?

I don't know what to tell you but here is what I see.


and here are the tags I see.
image
I was expecting to see more tags based on what I saw in the YAML config.
It seems that there is a problem with the functions running. I don't know how I can debug this. I can get the data easily otherwise by using the system.net functions I used for the Google project I was working.

What version of Ignition are you using?
What do you see in the variables page for that API instance?

8.1.23

Are you seeing any errors in the logs? I copied the raw YAML from the github repo, filled in the variables and it worked right away. Maybe try copying the yaml in again?

No I looked in the logs. I also copied the raw YAML from github repo and saw the same thing. It also had the same problem. Do you think a gateway setting might be off?

It seems the function hasn’t executed. The YAML on GitHub has a schedule setting for each function and it runs every 5 minutes. Do you see that in your YAML? Also, are you using the latest version of the API client module?

I copied YAML directly from GitHub and I indeed do see the function in it.

What OS are you using? I have only personally tested the module on Linux.

I'm using windows 11.

Hi @WChester,

I'm get it working on windows 10 and ubuntu
I don't think the os version is the issue

Are you sure to use this configuration as example ? API-YAML/config.yaml at main · Kyvis-Labs/API-YAML · GitHub

If i compare the version in the readme and the version of the above link there is a missing parameter under schedule in both currentWeather and forecast.


This could be the cause

Regards

That's interesting I do see the difference. :confused: It's strange I did copy and paste directly from there. That's a funny thing to not copy over. I copied again from that spot and sure enough it seems to be working now.

I forgot the example on the README file, I kept checking for that exact issue in the API-YAML, as it was a last minute change. Thanks @Arnaud_Declerck .

The documentation has been updated.

1 Like

Well that proves that we are not robots @Kyle_Chase.

Big thanks to made such free module that are really helpful

I have setup a project for google devices and had gotten as far as to access my thermostats and have not really started on the cameras but I think using the API module would be a good way to proceed, but am wondering about a couple things.

  • Oauth2 the redirect URL is not the one I have specified. Where is this generated and how do I change it as the one in the image below in my project setup it is rejected as not a valid url.
    image
    image

  • Does this take into account the 7 day limit on the refresh token. Every seven days I need to get another Authorization code and the refresh and access token. (If I'm doing something wrong here that is causing this I'd appreciate any insight.) I had seen something that suggested I needed to publish my project but have not seen how to do that.

  • Lastly the documentation says I need to make this project accesible to the internet to use the webhooks. I have never had any cause to use them and I think that the webdev module is part of that but the web dev module is not really intuitive to me.

Thank-you for developing this module. I am connect to both smarthings and ring using your yaml files for both. I can see the tags created for both. Is there a way to display my ring cameras live images from the ring tags?

You can change the redirect URL by specifying the public HTTP address in Ignition. Log in to the Ignition Configuration section and select Networking > Web Server from the menu. There you can specify the address:

image

That is what we use directly for the redirect URL.