pmazz / ps_hassio_entities

Python script to handle state and attributes of existing sensors and entities
MIT License
58 stars 10 forks source link

[BUG] Repository structure for v1.1.0 is not compliant with HACS #6

Closed kaijk closed 2 years ago

kaijk commented 2 years ago

Bug When adding this repository as a custom repository in HACS, the process fails with the message; Repository structure for v1.1.0 is not compliant (HACS version 1.24.5 - current)

To Reproduce Attempt to add the repository to HACS as a custom repository (Note, the repository is not found in the base HACS components list

Expected behavior The repository is added to hacs

YAML configuration

# NA
pmazz commented 2 years ago

I'm not sure you can install this as custom repo (because it's a python script, could be handled differently by hacs).

I tried to install it the usual way and it works (tested with hacs 1.24.5 and hassio 2022.4.5).

If you didn't find the repo in hacs, then ensure you have python scripts enabled:

kaijk commented 2 years ago

Mea culpa. I must have needed a restart or two.

Quick question, What do you recommend to keep the entities from updating on their own, and thereby only via the script? (I want to add/update a persistent attribute on my own schedule and find that it gets overwritten once a minute by HA). I'm toying with using a trigger that will never fire in the sensor definition.. Any other ideas?

On Mon, Apr 18, 2022 at 11:23 AM Paolo Mazzini @.***> wrote:

I'm not sure you can install this as custom repo (because it's a python script, could be handled differently by hacs).

I tried to install it the usual way and it works (tested with hacs 1.24.5 and hassio 2022.4.5).

If you didn't find the repo in hacs, then ensure you have python scripts enabled:

— Reply to this email directly, view it on GitHub https://github.com/pmazz/ps_hassio_entities/issues/6#issuecomment-1101631057, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL2THYVS25ZLN5HRPNTXXKLVFWSCXANCNFSM5TO2LPLA . You are receiving this because you authored the thread.Message ID: @.***>

pmazz commented 2 years ago

I would go for an automation triggered by attribute changes. When your attribute is overwritten then you change it back to your desired value. Check here: https://www.home-assistant.io/docs/automation/trigger/#triggering-on-attribute-changes

It should be something like this:

automation:
  trigger:
    - platform: state
      entity_id: sensor.mysensor
      attribute: myattribute
  action:
    - service: python_script.hass_entities
      data:
        action: set_attributes
        entity_id: sensor.mysensor
        attributes:
          - myattribute: "my value"

(I didn't test the code)