home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.61k stars 30.77k forks source link

DOODS state not handled as numerical although being a count #92506

Closed diamant-x closed 9 months ago

diamant-x commented 1 year ago

The problem

Hi, this is a spin-off from https://community.home-assistant.io/t/new-custom-compontent-image-processing-object-detection-doods/131000/573?u=diamant-x which I see should rather be handled by the core source code. Further details included in the link.

The issue is that all DOODS entities state value is return self._total_matches (source: https://github.com/home-assistant/core/blob/9b74cb950796ad7ca7d19cd04fb8953a92cf812a/homeassistant/components/doods/image_processing.py#LL232C9-L232C35) , which means is an 1) always numerical and 2) actual measurement and as such qualifies as a Sensor state which could/should leverage Long-term statistics with small number of changes aligning it to https://developers.home-assistant.io/docs/core/entity/sensor/

However, currently the DOODs entity inherits from ImageProcessingEntity which is NOT a sensorEntity and as such is currently represented in a non-numerical way in HomeAssistant.

image

What version of Home Assistant Core has the issue?

core-2023.4.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

DOODS - Dedicated Open Object Detection Service

Link to integration documentation on our website

https://www.home-assistant.io/integrations/doods/

Diagnostics information

No response

Example YAML snippet

image_processing:
  - platform: doods
    scan_interval: 3600
    url: "http://192.168.10.100:8765"
    detector: tensorflow
    file_out:
      - "/media/objectrecognition/{{ camera_entity.split('.')[1] }}_trafficdetection.jpg"
    confidence: 35
    labels:
      - car
      - truck
      - bus
      - motorcycle
    source:
      - entity_id: camera.a2

Anything in the logs that might be useful for us?

No response

Additional information

Should be possible to reproduce with any DOODS setup. The generated entity will show itself (and its history) not as a numerical sensor but instead as a 'string', which then makes it impossible to draw a line chart, analyze its changes, setup automations based on numerical thresholds or efficiently store historical information.

home-assistant[bot] commented 1 year ago

doods documentation doods source

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

diamant-x commented 1 year ago

Still an issue. Same happens with the seven segments OCR integration because both inherit the same parent class.

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

diamant-x commented 1 year ago

Still an issue. Doods entities store numbers as strings.

issue-triage-workflows[bot] commented 9 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.