Hi everyone,
I have a custom made board that pilots my heaters and gets current values from my appartment’s electrical panel.
It answers simple http requests with a small json string sent back.
I have been able to integrate it in HA with rest resources and template sensors like this:
rest:
- resource: http://192.168.1.101/json/currents
scan_interval: 21
sensor:
- name: "courants domotix"
json_attributes_path: "$"
device_class: power
- resource: http://192.168.1.101/json/counters
scan_interval: 30
sensor:
- name: "counters domotix"
json_attributes_path: "$"
device_class: power
- resource: "http://192.168.1.101/json/pilote/"
scan_interval: 31
sensor:
- name: "ordres pilotes domotix"
json_attributes_path: "$"
- resource: "http://192.168.1.101/json/relais/"
scan_interval: 33
sensor:
- name: "ordres relais domotix"
json_attributes_path: "$"
template:
- sensor:
- name: "Conso 0"
unique_id: 'conso_0'
device_class: power
state: >
{% set courants_domotix_list = states('sensor.courants_domotix')|from_json %}
{{ courants_domotix_list[0] }}
etc…
It works mostly, but I have a scheduling problem which undermines the reliability of it: the board is not able to process several requests at a time, so whenever 2 resources are refreshed at the same time, it fails.
There are 4 requests I want to refresh, so inevitably some end up at the same time (I have put odd periods to reduce stats, but it does not really solve it)
I’m looking for a way to force requests to be sent one at a time.
I have found out that I could create triggers at separate times, but I don’t know how to refresh the rest resource based on a trigger. It doesn’t seem possible.
Is there another way I could access the http answers that I could trig with a trigger ? or any other way to force the refresh of the resource without conflicts ?
If anyone has ideas or pointers…
Thanks