'dict object' has no attribute rule

I have this error triggered every 30s:

2024-05-26 18:47:05.799 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘dict object’ has no attribute ‘rule’ when rendering ‘{{ value_json.rule.enabled }}’

Does anybody know where to search the cause?

The first places I would check would be MQTT and REST sensor configurations.

thank you, it was a REST sensor. Wouldn’t it be great to state the sensor name that causes an error?

Hi, I have a similar error that comes also from a rest sensor. How did you solve this problem?

A device that I integrated over a rest API was not connected (wifi).

Because there is not information in the error message which source causes the error, you need to go trough your configuration.yaml file and check the rest API integrations.

I solved it by connecting this device again.