I would like to monitor the FW version of my enphase gateway, but don’t have a sensor or other entity providing this info. I also did not find an appropriate action.
The firmware version is only collected when the integration is loaded or reloaded. So it’s pretty static. When the Envoy firmware is updated there’s going to be an outage. But that may not lead to an integration reload in all cases. Some logic tries to detect such situations, but that needs some further fine-tuning.
They have some one-line examples in the thread as well, but that’s not my stronghold.
{%- set envoy = '123456789012' %}
{%- set devices = states | map(attribute='entity_id') | map('device_id') | unique | reject('eq',None) | list %}
{%- set ns = namespace(integrations = []) %}
{%- for device in devices %}
{%- set ids = device_attr(device, 'identifiers') | list | first | default %}
{%- if ids and ids | length == 2 %}
{%- set integration, something_unique = ids %}
{%- if integration == 'enphase_envoy' and something_unique == envoy and not device_attr(device, 'via_device_id') %}
{%- set ns.integrations = ns.integrations + [ device_attr(device, 'sw_version') ] %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- set envoy_fw = ns.integrations | first | default %}
{{envoy_fw}}