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: 7624
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: 7624
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: 7624
Joined: 26 Jan 2011 19:36

Re: HTTP Device with auth Bearer Token

Post by PoltoS »

Please clarify your question
cashewsslate
Posts: 2
Joined: 28 Dec 2022 10:02

Re: HTTP Device with auth Bearer Token

Post by cashewsslate »

What happens happy wheelsif you use the token of all?
Last edited by cashewsslate on 23 Jul 2024 05:32, edited 1 time in total.
User avatar
PoltoS
Posts: 7624
Joined: 26 Jan 2011 19:36

Re: HTTP Device with auth Bearer Token

Post by PoltoS »

Do you mean not at all? You will get no data. If you add an anonymous user or enable the Z-Wave/Zigbee API with no authentication, you can connect without the token. But this is not recommended for production unless you know what you are doing
Post Reply