Show remaining sprinkler irrigation time in a text sensor

Hello,
I’m trying to show the remaining irrigation time in a text sensor with this yaml

text_sensor:
  - platform: template
    name: "Irrigation Time Remaining"
    id: irrigation_time_remaining
    lambda: |-
      if (id(my_sprinkler).time_remaining_active_valve().has_value()) {
        return "Time remaining: " + id(my_sprinkler).time_remaining_active_valve().value + " seconds";
      } else {
        return "No active valve";
      }

but i get this error:

/config/esphome/sprinkler.yaml: In lambda function:
/config/esphome/sprinkler.yaml:43:35: error: invalid operands of types 'const char [17]' and '<unresolved overloaded function type>' to binary 'operator+'
   43 |         return "Time remaining: " + id(my_sprinkler).time_remaining_active_valve().value + " seconds";
      |                ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                |                                                            |
      |                const char [17]                                              <unresolved overloaded function type>
/config/esphome/sprinkler.yaml:45:16: error: could not convert '"No active valve"' from 'const char [16]' to 'esphome::optional<std::__cxx11::basic_string<char> >'
   45 |         return "No active valve";
      |                ^~~~~~~~~~~~~~~~~
      |                |
      |                const char [16]
*** [/data/sprinkler/.pioenvs/sprinkler/src/main.cpp.o] Error 1

What I’m doing wrong?

looks like it doesn’t like you’ve concatenated the string and you have an issue with mismatched types. This integration comes with a time remaining sensor already and the .time_remaining_active_valve() already returns the string “Time Remaining” if that somehow wasn’t obvious in the name…