How to set the 'available' on this MQTT sensor

which I have in the system for ages, and now try to add the available to the sensor config:

binary sensor:

    - unique_id: boiler_bijkeuken_state_binary
      state_topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/0a48c2e8/state'
      availability:
        - topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/0a48c2e8/available'
      payload_available: true
      payload_not_available: false
      name: Boiler Bijkeuken state
      <<: *binary

or the regular sensors for states:

    - unique_id: boiler_bijkeuken_actueel
      state_topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/0a48c2e8/usage'
      availability:
        - topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/0a48c2e8/available'
      payload_available: true
      payload_not_available: false
      name: Boiler Bijkeuken actueel
      <<: *power_2500

    - unique_id: boiler_bijkeuken_totaal
      state_topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/0a48c2e8/power'
      availability:
        - topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/0a48c2e8/available'
      payload_available: 'true'
      payload_not_available: 'false'
      name: Boiler Bijkeuken totaal
      <<: *energy_plug

nvm the yaml anchors, they hold merely some value_template and class info.
I’ve tried both quoted and unquoted true/false but all remain unavailable in the HA states.

Was struggling with which available options in the docs: MQTT Sensor - Home Assistant I need, because there are a few, also with availability_topic, which I tried at first. However, since the value is true and not the default ‘online’ I have to at least make that explicit via the payloads. I did try an additional availability_template on that _topic, {{ value == 'true'}} and also {{value == true}} but all to no avail…

Please could anyone have a look, thanks!

this seems to work:

      availability_topic: '70:B3:D5:6F:31:F2/powerswitch-zwave/0a48c2e8/available'
      payload_available: 'true'
      payload_not_available: 'false'

although this is really pretty useless, because the mqtt topics never publish anything other than true…

ifs rather have the option to uses something based on state, like {{ is_number(value)}} but guess we cant fake the availability_topic to the state topic, and then use an availability_template ? it says

To determine the devices’s availability result of this template will be compared to payload_available and payload_not_available

so that brings me back to the original available topic…

experimenting with:

{% set value = states('sensor.espresso_keuken_actueel') %}
{{iif(is_number(value), min(value|round(2,none),2500),'Unavailable')}}

not sure of the ‘Unavailable’ though.

FYI, this is what I have:

      availability_topic: "tele/blinds_01/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"

I’m using an old version of Tasmota that I modified for my blinds, and the best I recall, this is what gets sent based on its MQTT Last Will and Testament.

thx, thats the format I now use to. Somehow that didnt come to me after reading the docs carefully, at least the configuration options… even the example below all of that has another format.

as for the availability, its something else than the availability we can use ion template sensors, so I am now trying to do things like

          value_template: >
            {{value|round(2) if value|is_number and value|float > 0 else none}}

but I still am not convinced this will make the sensor unavailable user circumstances, because I see None in the Dashboard, and not unavailable …