HTTP Device with auth Bearer Token

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
MadMAX
Posts: 8
Joined: 24 Mar 2016 17:00

HTTP Device with auth Bearer Token

Post by MadMAX »

Hello,
i am trying to create a device which get its values from Home Assistant.

So I tried to use the HTTP Device and Virtual Device (Javascript) but i just not skilled enough to get the value via the RESTful API of Home Assistant.

The URL i like to read is

Code: Select all

http://192.168.111.17:8123/api/states/sensor.temperature
but it need the Bearer token in the header of the request to access.

Code: Select all

headers: {
      'Authorization': 'Bearer <token>'
   }
Who would the URL or the code (Javascript) would look like to get access?

Thanks in advance.
Regards Max
User avatar
PoltoS
Posts: 7579
Joined: 26 Jan 2011 19:36

Re: HTTP Device with auth Bearer Token

Post by PoltoS »

You can use Code Device with http.request.

Please check this manual: https://z-wave.me/manual/z-way/JavaScri ... 0000000000
MadMAX
Posts: 8
Joined: 24 Mar 2016 17:00

Re: HTTP Device with auth Bearer Token

Post by MadMAX »

Do you mean virtual device (JS)? i dont have an applikation with the name code device!
User avatar
PoltoS
Posts: 7579
Joined: 26 Jan 2011 19:36

Re: HTTP Device with auth Bearer Token

Post by PoltoS »

Yes, Virtual Device. As I remember, it is called CodeDevice internally
flabbyburnish
Posts: 1
Joined: 07 Apr 2023 07:26

Re: HTTP Device with auth Bearer Token

Post by flabbyburnish »

Many codes used. Is there any method to differentiate?
User avatar
PoltoS
Posts: 7579
Joined: 26 Jan 2011 19:36

Re: HTTP Device with auth Bearer Token

Post by PoltoS »

Please clarify your question
Post Reply