Get the current preset_mode of Toon Thermostat

I mentioned my problem already in this topic: Toon van Eneco custom component, but because that topic is more general about Toon, I start this topic with a specific question.

I want to make some automations depending on the preset_mode of my Toon Thermostat. The thermostat runs its own program, but in some occasions I want to overrule the program. After some time I want to switch back to the regular program of Toon itself.

The thing is that I can’t get the current preset_mode (home, away, sleep, comfort).
I can get a state for the Toon program is on and if its on heat or cool mode. I also can change the preset mode. But I just cant get the current state…

I’m sure must be possible to get the current preset_mode of Toon, because its shown in the lovelace card.
Aantekening 2

I only dont have a clue how to get this in Node Red.

What you can do is making a new sensor in the configuration.yaml with the following code:

template:

  • sensor:
    • name: “Thermostat_LivingRoom_Preset_Mode”
      unique_id: thermostat_livingroom_preset_mode
      state: “{{ state_attr(‘climate.thermostat’, ‘preset_mode’)}}”
      unit_of_measurement: “state”