Netdata: sensor missing after HA reboot if netdata node is unavailable

Steps to reproduce:

  1. The Netdata node (PC with netdata client installed) must be available.
  2. Specify a couple of sensors for Netdata in configuration.yaml:
  - platform: netdata
    host: !secret vmdebian_ip
    port: '19999'
    name: vmDebian
    resources:
      cpu_softirq:
        data_group: cpu.cpu0
        element: softirq
        icon: mdi:cpu-32-bit
      cpu_user:
        data_group: cpu.cpu0
        element: user
        icon: mdi:cpu-32-bit
  1. Restart HA.
  2. Enjoy added Netdata sensors in Lovelace.
  3. Turn off the Netdata node (that PC).
  4. Watch in HA how Netdata sensors are “unavailable”.

Now the not funny part:
7. Restart HA.
8. Note that all Netdata sensors have disappeared - the Lovelace cards show errors.

OK, I understand that Netdata sensors are not created in HA in case “Netdata node cannot be found”.
What is the best practice in that case?

What I can do is:

  1. Create template sensors like:
  - platform: template
    sensors:
      vmdebian_ram_used_persistent:
        value_template: "{% if not is_state('sensor.vmdebian_ram_used','unavailable') -%}
                         {{ states('sensor.vmdebian_ram_used') }}
                         {%- else -%}
                         {{ states('sensor.vmdebian_ram_used_persistent') }}
                         {%- endif %}"
  1. Use in Lovelace these “persistent” sensors - they will be always present.

But may be there is a better solution?

Update:
Also, there may be a problem with “unit_of_measurement”.
For netdata sensors the unit is determined by the Netdata addon and MAY BE dynamically changing (I think so). So you only can speculate which units to specify for the manually made “persistent” sensors.