"Simple" PWM output

How do I configure a PWM output so that I can control it with MQTT?

It’s not a light; I want to control it by publishing a simple float value.

Combine ESP32 LEDC Output — ESPHome (or whatever pwm output you are using) and the new text component Text Component — ESPHome

I’d rather have some numeric component. Ideally with min/max. That way, HA could show a slider to set the value with.

Yes I can add custom code to HA – but when you have umpteen such devices that doesn’t scale as well as we’d all like.

I could probably broadcast a fake config entry that tells HA about a “light” with “brightness control” … which is somewhat suboptimal when the thing in question is e.g. a variable-speed pump, not a light.

Well tie it to a numeric then.