The current X10 lights control doesn’t allow for changing the brightness of the lights.
There are a number of ways to look at this problem; Is Home Assistant the only control for the lights, or are there external non HA switches interacting with the system. If it’s the former the state engine can calculate all the correct dim levels that X10 requires. If its the latter than you can give it your best effort, and perhaps reset all lights sometime during the day to full brightness and just live with a little irregularity.
There are however extended X10 commands that allow you to set discrete brightness level and turn the light on at the same time rather than setting relative brightness levels as with standard X10 heyu commands.
heyu on A1; heyu dim 6
heyu obdim A1 6
You can use:
heyu xpreset A1 31
The xpreset range is 0-63. 0 being off, 63 being on. If you send a 63 it results in the light being immediately put on at full bright instead of the usual soft start.
All my lights are connected to X10 LD11’s that support the extended X10 codes so my proposal is to edit https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/light/x10.py to extend the schema to allow for an extended flag to be set to true for each light. If this flag is set, on commands with brightness attributes commands would instead use heyu xpreset rather than heyu on/ignore the brightness attribute as it currently works.
Would this method be acceptable? Should I create an issue and put together a PR?
It would also be possible, to use standard X10 dim/brighten commands as long as the first proviso I mentioned is correct or ignored… that HA controls all the lights and you don’t mind them being a bit off if local control messes them up.