X10 Heyu - Brightness control

Hi guys,

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.

Instead of:

heyu on A1; heyu dim 6
or
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.

Cheers,

So is my direction OK? Would a PR be acceptable?

Did you ever get a response to this? I have a few X10 lights and although I can turn them on and off successfully, the ‘slider’ control that launches when you click the light component does nothing except ‘dim’ the icon on the screen! In fact, if you use the ‘heyu monitor’ to see what is happening, every time you adjust the slider - to whatever value - the only command that monitored via heyu is [sndc addr unit 1: hu C1 (Bedroom) sndc func On : hu C]. It would be nice if the slider adjusted the brightness of the ‘real’ lamp and not just the icon…

I think we need to make this happen, now that X10 is firmly back selling product. I think a formal request needs to be made. My whole system is X10, I’ve been doing this for quite awhile. Anything I can do to help, but sorry I’m not a python programmer.

I think that stedaniels has the right idea. Perhaps a model number attribute for each x10 device in the congfig…yaml could direct between which dimming scheme to use and include the current one for switches?