finity69x2 / nws_alerts

An updated version of the nws_alerts custom integration for Home Assistant
84 stars 29 forks source link

Package nws_alerts setup failed. Component variable Integration 'variable' not found. #63

Closed DMEbner closed 9 months ago

DMEbner commented 1 year ago

I am getting this error message when checking the configuration for the nws alerts package. Anyone else having this issue and can maybe help?

Cheers!

finity69x2 commented 1 year ago

the custom integration "hass-variables" was changed with some big breaking changes just recently and they completely eliminated the "variable" domain.

If I was to guess at what the problem is I would look there.

I probably won't be updating my hass-variables custom integration version past the point where the breaking changes were made so everything that I use it for keeps working. I use it in many places beside this package and the changes weren't very welcome for me.

regularguy01 commented 1 year ago

It is related to this most likely. https://github.com/finity69x2/nws_alerts/issues/60#issue-1647719799

finity69x2 commented 1 year ago

Sorry, I've been pretty busy lately and haven't had a chance to even think about this issue yet.

but yes, I guess I should update the package to use the non-variable domain options.

I've always liked the variable integration for it's ability to have custom attributes that you could set via a service call. the new so-called variables (but not really now since it's just a new custom sensor) can still do that too so it's not a total loss.

I just need to find the time to decide which direction to go and then re-code the package to that standard.

jwagner0789 commented 5 months ago

You can add a template sensor to bypass the variable integration.

- sensor:
    - name: "nws_alerts_event_ids"
      unique_id: "nws_alerts_event_ids"
      state: >
        {{ (state_attr('sensor.nws_alerts', 'event_id')).split('-')[0] }}
      attributes:
        history_1: "{{ states('sensor.nws_alerts_event_ids') }}"
        history_2: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_1') }}"
        history_3: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_2') }}"
        history_4: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_3') }}"
        history_5: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_4') }}"
        history_6: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_5') }}"
        history_7: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_6') }}"
        history_8: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_7') }}"
        history_9: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_8') }}"
        history_10: "{{ state_attr('sensor.nws_alerts_event_ids', 'history_9') }}"