loopj / home-assistant-vantage

Home Assistant integration for Vantage InFusion home automation controllers.
MIT License
9 stars 4 forks source link

Lights always power on at 100% but should power on at most recent load level #98

Open ddetton opened 11 months ago

ddetton commented 11 months ago

System Health details

System Information

version core-2023.10.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.5
os_name Linux
os_version 6.1.45
arch x86_64
timezone America/Los_Angeles
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.33.0 Stage | running Available Repositories | 1382 Downloaded Repositories | 1
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | June 10, 2024 at 5:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true remote_server | us-east-1-9.ui.nabu.casa certificate_status | ready can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 10.5 -- | -- update_channel | stable supervisor_version | supervisor-2023.10.1 agent_version | 1.5.1 docker_version | 23.0.6 disk_total | 30.8 GB disk_used | 8.0 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Studio Code Server (5.13.0), Home Assistant Google Drive Backup (0.111.1), Advanced SSH & Web Terminal (15.1.0), Node-RED (14.4.0), Samba share (10.0.2), Mosquitto broker (6.2.1), WeatherFlow to MQTT (3.1.6)
Dashboards dashboards | 2 -- | -- resources | 0 views | 1 mode | storage
Recorder oldest_recorder_run | October 25, 2023 at 8:54 PM -- | -- current_recorder_run | October 26, 2023 at 3:31 PM estimated_db_size | 252.95 MiB database_engine | sqlite database_version | 3.41.2

Checklist

Describe the issue

Not sure if this is standard Home Assistant behavior or not but it is my view that when a dimmable light is powered on using the on/off power switch, it should power on at it's most recent load level. When this is done with a Philips Hue light, it is powered on at it's most recent load level. When lighting control is programmed in Vantage, the programmer usually specifies the load level. For interior loads, very seldom is it 100%. It just seems more user friendly to power it on at it's most recent level.

Reproduction steps

  1. Go to the HA Dashboard UI and press the power toggle on a a dimmable load from Vantage.
  2. ...

Debug logs

I did not have the logger component active when I tested this.

Diagnostics dump

No response

loopj commented 11 months ago

Hey @ddetton thanks for the feedback!

This is something I considered when initially writing the integration, and it looks like it is about 50/50 on if lighting integrations default to 100% or default to the last known state - there seems to be no convention or recommendation from HA.

One quirk of defaulting to the last known state, is that I couldn't find any exposed Vantage command interface for "turn on to last level". You must always specify a load level, eg LOAD 118 100.0.

One way around this would be to always track the last known level in memory in Home Assistant, but this would mean when restarting Home Assistant (eg. for an upgrade) we would lose these cached levels. Given the complexity of tracking/storing the cached levels, I opted to have "turn on" commands default to 100%.

I'm open to alternative approaches here, as I may have missed something!

ddetton commented 4 months ago

Hey @loopj , continue to default to 100% but provide a configurable global power on level in the integration. Out of the box the parameter is 100% but it can be changed to another level that would apply to all loads. An additional bonus feature could be to have separate power on level parameters for daytime and nighttime.

This is one of my most heavily used integrations because it works so well. I just discovered the power of vantage task and button events. I have a mix of Vantage and Hue controlled lights. I just programmed an HA automation that is triggered by a Vantage keypad button press to turn off all of the Hue lights in an area. The button already turned off all Vantage lights. Now I don't have to use Siri to turn off all of the Hue lights. Excellent work and thank you for this integration!

filmackay commented 4 months ago

Is it possible to consult the entity history that is built-in to HA (I believe it's 7 days?), in order to quickly ascertain the previous load level. Otherwise you need to create a new entity for every load that contains the "previous" :(