Inverter offline > avoid rest sensor to execute

Hi

Is there a way to avoid such spam logs when my inverter is offline? after sunset the inverter goes offline but my rest sensor still tries to retrieve data.
I tried to add an availability with a binairy sensor, but it seems like the rest sensor still triggers every minute and ignores that part.

any suggestions?

2026-05-17 01:55:45.377 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.2.12/ failed with Cannot connect to host 192.168.2.12:80 ssl:default [Connect call failed ('192.168.2.12', 80)]
2026-05-17 01:56:45.344 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: http://192.168.2.12/ failed with Cannot connect to host 192.168.2.12:80 ssl:default [Connect call failed ('192.168.2.12', 80)]

My sensor

sensor:
- platform: rest
  scan_interval: 60
  resource: !secret solax_local_ip
  payload: !secret solax_local_realtime_payload
  method: POST
  headers: 
    X-Forwarded-For: 5.8.8.8
  name: "solax_rest_local"
  unique_id: solax_rest_local
  json_attributes:
    - SN
    - ver
    - type
    - Data
    - Information
  value_template: >-
    {% if state_attr('sensor.solax_rest_local', 'SN') is defined %}
      Active
    {% else %}
      Unavailable
    {% endif %}
  availability: >-
    {{ is_state('binary_sensor.inverter_ip', 'on') }}
  timeout: 5

I might try to add a sunset component to availability?
In general, stop the behavior so the log is correct and not spammed.
You can filter out specific log entries from recorder, but that comes with the risk of missing real problems