Add automation to Rest Temperature Value

I integrated a sensor the follwoing way:

  - platform: rest
    resource: http://xxx
    name: Test API
    value_template: '{{ value_json.temperatur }}'
    device_class: temperature
    unit_of_measurement: '°C'

Now i want to add an automation whenever the temperature get above or under let’s say 35 °C.

When it comes to selecting the trigger in the automation I can select the following values:

platform: state
entity_id: sensor.test_api

which doesn’t seem to work for what I am looking for.

When I try to add above or under manually I get the following error:

Message malformed: extra keys not allowed @ data['above']

Do I have to do anything else in the sensorsettings before I can build this automation?

I also get the notification that this entity doens’t have a unique Id as stated here:

But there doesn’t seem to be a way to add an id within rest. Can this be the problem?

Use a numeric state trigger instead of a state trigget.

No, the unique id is just to be able to edit the entity fron the UI.

1 Like

… Pretty dumb of me I guess :roll_eyes:
Thank you for your answer, I got it to work now!

1 Like

You want:

  platform: numeric_state
  entity_id: sensor.test_api
  above: 35

1 Like

thank you again