Using Infinity plugin to send API commands

  • Please note that because I’m a new poster I can’t have links in my post and it is auto-formatting anything with http in it as a link. so I modified all the ‘http’ to ‘htt’

  • What Grafana version and what operating system are you using?

    • running latest docker image (grafana/grafana:latest) on Debian 6.12 on an x86_64
  • What are you trying to achieve?

    • I need to send an API command to a remote relay module via a canvas button on a dashboard tile. The URL for the relay is like htt://x.x.x.x/relay_cgi.cgi?type=0&relay=0&on=0&time=0&pwd=0.
  • How are you trying to achieve it?

    • I installed the Infinity plugin via the docker UI. I set the base URL to ‘htt://x.x.x.x
    • Then in the button configuration, the API method = GET and the endpoint is set to ‘/api/datasources/proxy/2/relay_cgi.cgi?type=0&relay=0&on=0&time=0&pwd=0’
  • What happened?

    • clicking the ‘test API’ or button results in an error. Browser console says it is error 405 Method Not Allowed.
    • Testing the URL in my own browser as htt://grafana:3000/api/datasources/proxy/2/relay_cgi.cgi?type=0&relay=0&on=0&time=0&pwd=0 DOES work at both controlling the relay and showing the correct/valid response.
  • What did you expect to happen?

    • I expected the relay to act on the command and return a result string.
  • Can you copy/paste the configuration(s) that you are having problems with?

    • I think there are several parts to this. possibly even at the docker level
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

    • Grafana log message is: grafana | logger=context userId=1 orgId=1 uname=admin t=2025-12-20T17:21:52.480329402Z level=info msg=“Request Completed” method=GET path=/api/datasources/proxy/2/relay_cgi.cgi status=405 remote_addr=x.x.x.x time_ms=2 duration=2.229732ms size=100 referer=“htt://grafana:3000/d/hb-relay-panel/hb-relay-control-and-status?editPanel=3&from=now-15m&orgId=1&refresh=5s&timezone=browser&to=now” status_source=server
  • Did you follow any online instructions? If so, what is the URL?

    • I’ve been at it for over 5 hours through all kinds of instructions, including AI.

Can you ping x.x.x.x from inside grafana container

Yes, I can ping both the IP and name from within the container. I can issue the query directly to the relay as well as to the grafana proxy. Just can’t do it from within a grafana tile.

can you successfully call that same endpoint from cmd line using curl or postman?

And how is it that this can work?

http://grafana:3000/api/datasources/proxy/2/relay_cgi.cgi?type=0&relay=0&on=0&time=0&pwd=0

which command line, the docker host, my client PC, or within the grafana container?

I can’t explain how it works, it was offered by AI to be the correct path to get to the infinity proxy and it works from my client PC browser.

additionally, I have another command for the relay which only reads the status (no query parameters) which works great but isn’t using the canvas button. So maybe the issue is with canvas and not infinity?

1 Like

Hi,

I had exactly the same issue all of which pointed to an issue within the Canvass button as you note.

However, as my switch URLwas exposed people were able to get the canvass switch to work remotely but regardless I still cannot get it to work. Everything else works bar the Canvass test url? like you have noted.

Very weird but 100% true! Eventually they dropped the issue but now I see it has cropped up again?

1 Like

it seems related to this.

so it could be that Canvas is not configured with that capability. I would log a bug.

As an option you could use Business Text to do similar things.

Thanks for the replies and suggestions. in the end I gave up on using Infinity and setup a node-red service to handle it.

Can you try Actions authentication with the Infinity data source | Grafana Labs ?