HTTP Request button

Hi all,

I have some motorised blinds in my house which use an app that I have access to the http get requests. I am trying to get this to work in HADashboard but am having trouble getting it to do exactly what I want.

At the moment I’ve got it working on HASS using the cover template component and having it call a service which I have set up using the Rest Command and it works great. I’ve attached a screenshot of the services which when called work perfect.

If I try and just simply use the cover widget in HADashboard it currently only allows me to open and close the blinds. There is no stop or favourite position. I am also not worried about visually seeing the status of the blinds on HADashboard.

What I would like to do is create separate buttons in which I can assign each http request to such as up, down, stop and favourite. Is there a way I can do this by simply calling a service from HASS which currently works great? Or even a way I can setup a widget which calls the http request directly?

Your help is much appreciated.

i think the easiest way is to create a script in HA for al services and then use the script widget to activate the scrips.

Thanks for your reply @ReneTode from the reading ive been doing that was what I was thinking also however I haven’t had much luck getting it to work.

Do you think you could help me out in providing a simple script that would do what I’m after?

i would love to.
but i havent written a script in HA myself.

i would probably write an app that sends the http requests and use input_booleans to activate the app.
something like:

init:
  listen_state(callback,"input_boolean.stop_cover")

def calback(...):
  if new=="on":
    send http
    self.turn_off("input_boolean.stop_cover")

with args you could make the boolean and the rquest variable and so you could reuse the app to use any boolean to send any http request.
the input_booleans would always be off that wayand you would have a pushbutton in the dashboard.

Thanks for the tip. That’s all a bit over my head but I see where you are getting at. I’ll see what I can put together, cheers.

1 Like

Just a heads up for everyone that I finally got it working. My issue was at the bottom of the configuration.yaml file was a line to look for scripts in the scripts.yaml file. As soon as I put my script in there which called the service in the image above it all appeared as follows and with only the activate button

I then called it out using the script widget in HADashboard which looks a little something like this


So happy with the outcome.

2 Likes