In my configuration.yaml fill I have two blocks of RESTful code that I use to access cloud based information about my PV system. The cloud seems to get overwhelmed and when additional RESTful sensors it tends to become unresponsive. Is there a way that I could selectively enable/disable the individual blocks of RESTful code so that their execution could be staggered? Maybe even set a flag to indicate when one block of code has successfully received a response back so that the next block can be executed?
#CONFIGURATION.YAML yaml file
# Loads default set of integrations. Do not remove.
default_config:
# Line to enable HA Configuration Editor
config_editor:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# RESTful INTEGRATIONS
rest:
# Studer Synoptic Data Request
- authentication: basic
method: GET
scan_interval: 10
timeout: 120
resource: https://api.studer-innotec.com/api/v1/installation/synoptic/NNNN #replace NNNN with your Studer system ID
headers:
Accept: application/json
UHASH: !secret UHASH # Points to SHA256 encoded username in secrecs.yaml file, or you can replace !secret UHASH with your hard coded SHA256 encoded username right here in the configuration.yaml file
PHASH: !secret PHASH # Points to #MD5 encoded password in secrecs.yaml file, or you can replace !secret UHASH with your hard coded #MD5 encoded password right here in the configuration.yaml file
sensor:
- name: "Studer"
unique_id: "studer"
value_template: "42"
json_attributes:
- energy
- battery
- power
# Studer Aux contact status read
- authentication: basic
method: GET
scan_interval: 30
timeout: 120
#Put you Studer cloud credentials and system ID in the line below.
resource: "https://portal.studer-innotec.com/scomwebservice.asmx/ReadUserInfo?email=<[email protected]>>&pwd=<your_studer_password>&installationNumber=<your_studer_system_ID>&device=XT1&infoId=3031"
sensor:
- name: "Studer Xtender AUX1"
unique_id: "studer_xtender_aux1"
value_template: "{{ 'unavailable' if (value_json.UserInfoResult.ErrorCode!='1') else 'opened' if (value_json.UserInfoResult.UIntValue=='0') else 'closed' }}"
json_attributes_path: "$['UserInfoResult']"
json_attributes:
- UIntValue
- FloatValue
- ErrorCode
- ErrorMessage
- ScomFormatNo
# TEMPLATE INTEGRATION
template:
#sensor to identify if daylight savings for selecting summer or winter tariff structure
- binary_sensor:
- name: "Is DST"
state: "{{ now().timetuple().tm_isdst == true }}"
#INCLUDE for tariffs sensor calculations
- sensor: !include tariffs.yaml
#INCLUDE for Studer sensors that copy data from RESTful API call attributes
- sensor: !include studer.yaml
#INCLUDE for Shelly sensor calculations
- sensor: !include shelly.yaml
#INCLUDE for Tuya sensor yaml blocks
- sensor: !include tuya.yaml