thomasmauerer / hassio-addons

My collection of addons for Home Assistant
MIT License
468 stars 54 forks source link

Feature Request: Unique ID for sensor.samba_backup #102

Closed BillyFKidney closed 2 years ago

BillyFKidney commented 2 years ago

The Samba Backup does not have a unique ID, preventing the settings from being modified within the UI.

image

During installation if a unique ID is created additional configuration settings will become available, such as area:

image
thomasmauerer commented 2 years ago

I don't think it is possible to add a unique id here. The sensor is different from others since there is no integration for it. The add-on simply posts the values via the Home Assistant API, which is - by the way - the reason why the sensor gets lost as soon as Home Assistant is restarted.

BillyFKidney commented 2 years ago

I don't think it is possible to add a unique id here. The sensor is different from others since there is no integration for it. The add-on simply posts the values via the Home Assistant API, which is - by the way - the reason why the sensor gets lost as soon as Home Assistant is restarted.

Gotcha, I tried to setup a Sensor Template but that didn't go well. :(

I did follow your instructions on an automation to ensure the sensor is available. Thanks for that!

alias: Startup - Restore Samba Backup Sensor
description: >-
  There is a known limitation that the sensor will be unavailable if you restart
  Home Assistant. This is caused by the way Home Assistant handles sensors which
  are not backed up by an entity, but instead come from an add-on or AppDaemon.
trigger:
  - platform: homeassistant
    event: start
  - platform: state
    entity_id:
      - sensor.samba_backup
    attribute: state
    to: unavailable
condition: []
action:
  - service: hassio.addon_stdin
    data:
      addon: 15d21743_samba_backup
      input: restore-sensor
mode: single
thomasmauerer commented 2 years ago

I tried to setup a Sensor Template but that didn't go well

What are you trying to achieve with the template?

BillyFKidney commented 2 years ago

I tried to setup a Sensor Template but that didn't go well

What are you trying to achieve with the template?

I like being able to assign areas to all the entities, makes it a lot easier to sort / filter.

thomasmauerer commented 2 years ago

Ok I understand. Areas are a UI-only feature and cannot be defined in yaml (at least to my knowledge), so unfortunately this won't be possible with the Samba Backup sensor.

thomasmauerer commented 2 years ago

I'm closing this issue since adding unique ids is not possible for add-ons. We would need an integration on Home Assistant side for this to work, which is out of the scope of this addon.