Use Rest Sensor with new Auth System

I have been using a rest sensor to access a pi zero which is outside to connect to my miflora sensors.

  - platform: rest
    resource: http://10.0.20.5:8123/api/states/sensor.bougainvillea_conductivity
    name: Bougainvillea Conductivity
    value_template: '{{ value_json.state }}'
    unit_of_measurement: "µS/cm"

Can someone help me with an example of how to access this sensor using the new auth system.

I managed to just use the legacy_api to get this up and running.

Can you pls share the new rest sensor code. I can’t find how to use the legacy_api in this case.

What version of HA are you using?

In any case you can enable legacy_api in the configuration.yaml like so

api:
  api_password: !secret api_password

my full config is located here Github

wow, you’re fast :slight_smile:
I’m using hass.io on both HA instances. I’ll checkout your config.
Thanks!

1 Like

Still no success I’m afraid.
Getting error on hass.io system that should provide the data:
Login attempt or request with invalid authentication from xxx.xxx.x.xx
On the hass.io system requesting the data I have enabled api.
On the hass.io system providing the data I have enabled api and http, both with the same password.
Template code:

  - platform: rest
    resource: http://yyyy.yyy.y.yy:8123/api/states/sensor.miflora1_moisture
    name: miflora1_soil_moisture
    value_template: '{{ value_json.state }}'
    unit_of_measurement: "%"

Can you help me?

Solved!
Adding trusted networks helped out…

I missed your previous post apologies, glad you got it sorted now you can deploy Pi zero minions all over your place :+1:

1 Like