Hi, I have configured some REST sensors in Home Assistant / one main REST sensor that spawns multiple sensors since it returns a lot of data.
- resource: someWebAdress
method: POST
headers:
Content-Type: application/x-www-form-urlencoded
token: "{{ states('input_text.token') }}"
scan_interval: 94670856
sensor:
- name: "Noah 2000 SOC"
unique_id: 63146954-1e07-4bcc-8105-5a68429b8b76
value_template: '{{ value_json.data.noah[0].battery1Soc }}'
state_class: measurement
device_class: battery
unit_of_measurement: '%'
- name: "Noah 2000 Temperatur"
unique_id: 84b43ba1-d669-487b-99a3-9a6c05852f4f
value_template: '{{ value_json.data.noah[0].battery1Temp }}'
state_class: measurement
device_class: temperature
unit_of_measurement: '°C'
- name: "Noah 2000 Aktueller Modus"
unique_id: 50abd32c-2704-4110-a8e1-8dcfffdf2c34
value_template: '{{ value_json.data.noah[0].totalBatteryPackChargingStatus }}'
state_class: measurement
- name: "Noah 2000 Lade/Entlade Power"
unique_id: 087bcf2f-da20-4c9f-bc07-7f1a98d1fea1
value_template: '{{ value_json.data.noah[0].totalBatteryPackChargingPower }}'
state_class: measurement
device_class: power
unit_of_measurement: 'W'
- name: "Noah 2000 Maximale Ladung"
unique_id: a8842e72-170d-4366-bdb6-7d1d2d6c4a3d
value_template: '{{ value_json.data.noah[0].chargeSocLimit }}'
state_class: measurement
device_class: battery
unit_of_measurement: '%'
- name: "Noah 2000 Minimale Ladung"
unique_id: 8ad4e6cb-0e24-4045-b98e-56913791b0ef
value_template: '{{ value_json.data.noah[0].dischargeSocLimit }}'
state_class: measurement
device_class: battery
unit_of_measurement: '%'
- name: "Noah 2000 Heutige Solarproduktion"
unique_id: 13a5b478-7d56-4bbb-b7b7-8dbfc6a22fdb
value_template: '{{ value_json.data.noah[0].eacToday }}'
state_class: total_increasing
device_class: energy
unit_of_measurement: 'kWh'
- name: "Noah 2000 Gesamte Solarproduktion"
unique_id: 08ba298f-b2bd-4d30-87ab-a3c9ba999256
value_template: '{{ value_json.data.noah[0].eacTotal }}'
state_class: total
device_class: energy
unit_of_measurement: 'kWh'
- name: "Noah 2000 Output Power"
unique_id: 4fbdb2f5-f103-468e-a524-b996bd5f9434
value_template: '{{ value_json.data.noah[0].pac }}'
state_class: measurement
device_class: power
unit_of_measurement: 'W'
- name: "Noah 2000 Solar Power"
unique_id: 808f4de3-d3f7-4468-87d4-3eebc705d3d9
value_template: '{{ value_json.data.noah[0].ppv }}'
state_class: measurement
device_class: power
unit_of_measurement: 'W'
- name: "Noah 2000 PV1 Voltage"
unique_id: "46f8a6cd-2b32-49cb-9b8b-26ec17769e05"
value_template: '{{ value_json.data.noah[0].pv1Voltage }}'
state_class: measurement
device_class: voltage
unit_of_measurement: 'V'
- name: " Noah 2000 PV1 Current"
unique_id: "24d96cd5-8b25-4319-a708-ea709cabd4ed"
value_template: '{{value_json.data.noah[0].pv1Current}}'
state_class: measurement
device_class: current
unit_of_measurement: 'A'
- name: "Noah 2000 PV2 Voltage"
unique_id: "8470439c-75c2-4246-9fc2-f467fef84dee"
value_template: '{{value_json.data.noah[0].pv2Voltage}}'
state_class: measurement
device_class: voltage
unit_of_measurement: 'V'
- name: "Noah 2000 PV2 Current"
unique_id: "28ff3102-6e63-40e1-a984-e2d93e9d4845"
value_template: '{{value_json.data.noah[0].pv2Current}}'
state_class: measurement
device_class: current
unit_of_measurement: 'A'
- name: "Noah 2000 Zyklen"
unique_id: "7c5ecfb3-32a0-4280-a26a-1b8db5b8b7eb"
value_template: '{{value_json.data.noah[0].batteryCycles}}'
- name: "Noah 2000 Status"
unique_id: "3a733600-bd53-4c16-8a96-76a243f7d96e"
value_template: '{{value_json.data.noah[0].status}}'
- name: "Noah 2000 Heating Status"
unique_id: "2fdd5a4e-024e-47c2-9cf8-461f293d8e79"
value_template: '{{value_json.data.noah[0].heatingStatus}}'
- name: "Growatt API Letzte Update Time"
unique_id: "6a5ee3ca-efbb-4b17-8332-bfc4cc816884"
value_template: '{{value_json.data.noah[0].timeStr}}'
- name: "Growatt API Response"
unique_id: "6ea62411-f94d-48ba-934d-bab5d04a7ed2"
value_template: "OK"
json_attributes:
- data
binary_sensor:
- name: "Noah 2000 Heating"
unique_id: dbe3bf7a-f452-42a7-95cc-354b3b7c9053
value_template: '{{ value_json.data.noah[0].status |float == 5}}'
device_class: heat
This main sensor should be polled every 7 seconds, so I created an automation that triggers every 7 seconds. This automation updates the API key (input_text.token
) every 7 seconds and then executes the Home Assistant Core “Update Entity” service for the entity Noah 2000 Solar Power. This updates the REST endpoint for this entity and refreshes all the other sensors relying on the same endpoint.
However, the issue is that Home Assistant only sends a request to the server behind the API endpoint every 10 seconds, no matter how often I run the “Update Entity” service (e.g., once per second for Noah 2000 Solar Power). Home Assistant still sends the REST request to the server only every 10 seconds.
I discovered this limitation by capturing the network traffic from the machine running Home Assistant and observing that only one request is sent every 10 seconds.
Could this be a limitation (which, from my perspective, doesn’t make much sense since you can set the scan_interval
for REST sensors to as low as 1 second, and that works—though I can’t use it due to the dynamic headers I need)? Or is this a bug?