Rest sensors cause strain on Hassio

Before I used the Hue.py CC by @robmarkcole, I had a lot of jsonrest and rest sensors creating sensors for all of my Hue motion sensors and templates based on these. I was very glad to have found the CC, since it made life a lot easier, and seemed to cause a lot of ease in the system. Only had the dreaded and frequent Updating hue sensor took longer than the scheduled update interval 0:00:00.100000 lines in the log.

With the Hue move to asyncio a couple of Hassio iterations ago, this CC seems to have made the Hue Hub disconnect and connect all the time, and dev’s advised to stop using CC at all, since it’s not Hassio tested and approved code, so use at own risk. see https://github.com/home-assistant/home-assistant/issues/15153 for some extra background.

Trying to comply, I’ve recreated rest sensors from before (left out the jsonrest since that too was a CC) like this:

binary_sensor:

  - platform: rest
    resource: !secret motion_sensor_5
    method: GET
    name: Corridor presence
    scan_interval: 1
    value_template: >
      {{value_json.state.presence}}
    device_class: motion

and

  - platform: rest
    resource: !secret temperature_sensor_4
    method: GET
    name: Corridor temp
    scan_interval: 1
    value_template: >
      {{value_json.state.temperature}}

  - platform: rest
    resource: !secret motion_sensor_5
    method: GET
    name: Corridor sensor config
    scan_interval: 1
    value_template: >
      {{value_json.config}}

  - platform: rest
    resource: !secret ambient_light_sensor_6
    method: GET
    name: Corridor sensor state
    scan_interval: 1
    value_template: >
      {{value_json.state}}

for each sensor.

Wanted to template the rest of the attributes out of these, but ran into the same issue from before: Rest sensors causing enormous amounts of time-out issues in the logs. Which is why I turned to the CC in the first place…

So, complying with the dev’s advice, doesnt solve anything at all…

Are rest sensors so stressful to the system ?? (other rest-sensors do error out frequently also), reason I am trying to keep them as few as possible. For importing the Hue sensors, I see no other way though so would really appreciate you help here.

The CC is a rest sensor, making a singe request to update all sensors. You’ve replaced it with a request for each sensor.
The issue here isn’t the use of rest, but some issue with the hue hub component I believe

I fear you are right, and am at a loss really. Your component is actively discouraged, simply because it is a CC, but no other way of importing the Hue Sensors is available as far as I can tell now.

The Jsonrest CC made it possible to import the full sensors in one gulp and then template the rest out of that, but trying to do so with the rest sensor simply returns the max 255 character error. Even customizing that to a text only card doesnt help.

Only other option I could see is rewriting your CC to a regular python_script, which i tried today. Unfortunately that wont allow for the imports.
Maybe you would know how to do that? The python code works perfectly, do I don’t want to live without that! ;-()( Do want to comply with the dev’s advise though…

I think you read the issue wrong. The comment the dev made was don’t make issues for CC against the HA repo.
Someone has opened a PR for an async hue sensors component, I suggest you wait for that.
Cheers

sure, i see that, but i wasn’t making issues for CC, but for Hue in Hassio. Seeking help.

Taking the CC out of the configuration definitely makes it better, really sorry to say.

As one of the discussion members said, making Hue asyncio in Hassio has made it discover other inconsistencies. Im trying to find those…

and, of course trying to integrate the Hue sensors in Hassio the correct way.