Get data from sensor after every 2 seconds

Tags: #<Tag:0x00007f739a96b080>

Hello I am new to Home Assistant .Currently i’m using rest sensors to hit external API and get sensor data from it. Just for testing i’m using ngrok url. I get hit to API after every 30 seconds even though i have set timeout to 10 seconds or even 45 seconds. I don’t know actually where is the issue. Here is my code written inside configuration.yaml .

  - platform: rest
    name: sensor1
    resource: ""
    payload: '{"profile":"status_text"}'
    timeout: 10
    force_update: true
      User-Agent: Home Assistant
      Content-Type: application/json
    value_template: '{{ value_json.message }}' 

That is not what timeout is for, scan_interval on the other hand is what you are looking for.

It’s not mentioned as a setting but it’s part of sensors.
Use CTRL+F and you will find an example.

1 Like

Thanks alot. :slight_smile: