Transmitting sensor data via http does not work!

Good day! Tell me how you can get this from the remote ha sensor to the local HA? It used to be via the api and rest, but now it doesn ’ t work! Ho w ca n I redo everythin g o n webhook?

The REST API is still there and working. Can you show what doesn’t work?
When did it work last time (which version of HA) and when did it stop working?

When requested started giving 401 errors!

Check the REST API docs here.

You need a token to make requests to the rest api. The option you are using has been deprecated a long time ago as far as I know.

From which HA version did you update and which version are you using now?

Version was 0.89 updated to 106.6. Thank you for the direction I will understand!

Phuu that’s a huge jump in versions and a lot happened in the mean time.

I can only recommend updating HA on a more frequent basis. If you wait so long there are a lot of breaking changes that you need to deal with and depending on your setup, it may be even better to start from scratch. Just my two cents.

Thank you very much! And you could tell me what other way to get data from a remote HA without API and MQTT?

Hmm, don’t know any other ways than API and MQTT out of my head. Why do you not want to use API anymore?

To be honest I can 't figure it out myself! Since the last time I did it on a hint and all I did was register it in the configuration.time in YAML on http: api_password:QWERTY and the other severe the sensors platform: Leisure

name: green_house
force_update: true
value_template: ‘{{ value_json.state }}’ and everything worked!

Read the link I provided, you just need to create a token (explained in the link as well) and add this token to the header of the api request. The sensor etc. stays the same.

Can I give you an example? And the fact that I’m really confused!

Yes you can.

How did you make the call to the REST API in the past?да.online_custom?api_password=QWERTY
url request or HA sensor.yaml

Did you already create a token on the remote HA instance?

Try like this:

  - platform: rest
    name: green_homes
    method: GET
      Authorization: 'Bearer xtokenx'
      content-type: 'application/json'

And replace xtokenx with your token

In the http configuration: Api_password replaced with Api: as written in the manual! I created a token in my profile but there are no results yet!
Returns an error in logs on the requested HA

Source: components/rest/ 
Integration: rest ([documentation](, [issues]( 
First occurred: 20:39:59 (1 occurrences) 
Last logged: 20:39:59

Error fetching data: failed with HTTPConnectionPool(host='', port=8123): Max retries exceeded with url: /api/states/sensor.online_custom_1 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5f97f3d050>: Failed to establish a new connection: [Errno 111] Connection refused'))

You get a connection refused error, something wrong with your token. So on the HA instance with IP you created a token, then on the machine you have the code you entered my code with your token? Can you show your config with the token redacted?

- platform: rest
  name: green_homes
  method: GET
    Authorization: 'Bearer REMOVED'
    content-type: 'application/json'

I said redact the token :grimacing:

Did you create this token on the machine with ip Do you geg any errors in the logs?

I apologize if I seem stupid to you English is not my native language!You’re right I haven 't completely edited it! Now changed but the token does not work as it should in the sensor it is written 401: Unauthorized

Yes the token was created on a machine with the address

# Configure a default setup of Home Assistant (frontend, api, etc)


# Uncomment this if you are using SSL/TLS, running in Docker container, etc.

# http:

# base_url:


# Text to speech


- platform: google_translate

group: !include groups.yaml

automation: !include automations.yaml

script: !include scripts.yaml

scene: !include scenes.yaml

sensor: !include_dir_merge_list sensors/

Are you able to access Home Assistant of the machine with the ip from this machine through the browser? Does it work with curl?