Rest api - best practices

I am trying to import 80 sensors from a single device using the resp api but seeing HA log errors if I have any more than 5 sensors configured. I am wondering whether there is a better way of getting many values from the same device. I think my current config is making 80 single requests to get the data where I woud expect a single request to return all 80 sensor values would be more efficient and hopefully no log errors. Any ideas or direction anyone can offer?

The log errors are:
2022-03-26 01:08:41 ERROR (MainThread) [] Error fetching data: failed with All connection attempts failed

I have each sensor configured in confguration.yaml I have shown the config for 2 of the sensors and the remaining ones are configured in the same manner.

  - platform: rest    
    name: AARC Tank pH
    value_template: "{{ value_json.status.probes.probe[1].value }}"
    unit_of_measurement: "dkh"
    force_update: true    
  - platform: rest    
    name: AARC Tank ORP
    value_template: "{{ value_json.status.probes.probe[2].value }}"
    unit_of_measurement: "mV"
    force_update: true

The device with the 80 sensors shows the following (I have limited it to the two sensors) when doing a status.xml request.

<status software="5.06_8C21" hardware="1.0">
<date>03/26/2022 00:12:37</date>
<failed>03/13/2022 18:41:53</failed>

It looks like you’re using the RESTful sensor integration. Try the RESTFUL platform integration instead. You can make one call and extract many fields/values.

1 Like