Skip to content

Expose enums with "Standby" state as switches #479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ajvpot
Copy link

@ajvpot ajvpot commented Feb 27, 2025

Some devices have a Power State enum with "On" and "Standby" values only. This enum isn't populated as a switch in home assistant because the is_boolean_enum function only accepts enums which contain "On" and "Off". This PR changes the function to also allow enums of "On" and "Standby."

This is a breaking change for people who have automations set up around the Power State being a "Select" type.

Examples of this are:

Oven Power State: Has values "On" and "Standby"
Coffee Machine Power State: Has values "On" and "Standby"

@ajvpot ajvpot marked this pull request as draft February 27, 2025 19:56
@ajvpot
Copy link
Author

ajvpot commented Feb 27, 2025

It looks like the switch logic needs to be updated as well to support this.

@ajvpot ajvpot changed the title Identify boolean enums with "Standby" state Expose enums with "Standby" state as switches Feb 27, 2025
@ajvpot ajvpot marked this pull request as ready for review February 27, 2025 20:43
@ajvpot
Copy link
Author

ajvpot commented Mar 4, 2025

This is ready for review.

Copy link
Owner

@ekutner ekutner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, "standby" is not the same as "on" or "off" but you are making an assumption that it is equivilant to "off". This begs the questions why did HC use this ENUM value and not "off" which is also a supported value. Are you sure that whenever "standby" exists there isn't also an "off" option? I'm wondering how to test this.

Check out #471 which is about something else but mentions "I keep my dryer in off mode (not standby).", which seem to suggest that both "off" and "standby" are valid option for this person's dryer.

@ZTHawk
Copy link

ZTHawk commented May 14, 2025

Just want to reply regarding Standby state. The power state select has only "On" and "Mains Off".
The "standby" state (at least for my dryer) is nothing that can be determined via any entity (I do not know one). When my dryer is ON and finished its program (or keep it just turned on), then after ~5-30 min (I do not know the exact time anymore), the display turns off and the power button is slowly blinking. This is officially declared as "standby" (power saving mode) with reduced power consumption.

@ekutner
Copy link
Owner

ekutner commented May 18, 2025

Just want to reply regarding Standby state. The power state select has only "On" and "Mains Off". The "standby" state (at least for my dryer) is nothing that can be determined via any entity (I do not know one). When my dryer is ON and finished its program (or keep it just turned on), then after ~5-30 min (I do not know the exact time anymore), the display turns off and the power button is slowly blinking. This is officially declared as "standby" (power saving mode) with reduced power consumption.

I don't know if the display turning off on the appliance is the same as being in standby mode. All I know is that "standby" is a valid power state reported by the API and it may or may not be equivalent to "off". It still needs some supporting evidence, or at least a working assumption that can be verified from logs, of how those two state relate to each other.

@ZTHawk
Copy link

ZTHawk commented May 19, 2025

While being in the "standby" mode here are all entities visible in UI (and below an extract from developer tab):

grafik

<style> </style>
binary_sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_option_remainingprogramtimeisestimated unavailable restored: true device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Estimated remaining programme time supported_features: 0
Siemens Trockner - Estimated remaining programme time
binary_sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_setting_childlock unavailable restored: true device_class: home_connect_alt__settings icon: mdi:tune friendly_name: Siemens Trockner - Childproof lock supported_features: 0
Siemens Trockner - Childproof lock
binary_sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_status_doorstate off device_class: door friendly_name: Siemens Trockner - Door State
Siemens Trockner - Door State
binary_sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_status_localcontrolactive off icon: mdi:gauge-full friendly_name: Siemens Trockner - Local Control Active
Siemens Trockner - Local Control Active
binary_sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_status_remotecontrolactive on icon: mdi:gauge-full friendly_name: Siemens Trockner - Remote Control Active
Siemens Trockner - Remote Control Active
binary_sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_status_remotecontrolstartallowed off icon: mdi:gauge-full friendly_name: Siemens Trockner - Remote Control Start Allowed
Siemens Trockner - Remote Control Start Allowed
binary_sensor.siemens_wt47xe40_68a40e4c2828_connected on device_class: connectivity friendly_name: Siemens Trockner - Connected
Siemens Trockner - Connected
binary_sensor.siemens_wt47xe40_68a40e4c2828_laundrycare_dryer_option_gentle off device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Gentle
Siemens Trockner - Gentle
button.siemens_wt47xe40_68a40e4c2828_start_pause unavailable icon: mdi:play friendly_name: Siemens Trockner - Start
Siemens Trockner - Start
button.siemens_wt47xe40_68a40e4c2828_stop unavailable icon: mdi:stop friendly_name: Siemens Trockner - Stop
Siemens Trockner - Stop
select.siemens_wt47xe40_68a40e4c2828_bsh_common_setting_powerstate unavailable restored: true options: BSH.Common.EnumType.PowerState.MainsOff, BSH.Common.EnumType.PowerState.On device_class: home_connect_alt__settings icon: mdi:tune friendly_name: Siemens Trockner - Power status supported_features: 0
Siemens Trockner - Power status
select.siemens_wt47xe40_68a40e4c2828_laundrycare_dryer_option_dryingtarget unavailable restored: true options: LaundryCare.Dryer.EnumType.DryingTarget.IronDry, LaundryCare.Dryer.EnumType.DryingTarget.CupboardDry, LaundryCare.Dryer.EnumType.DryingTarget.CupboardDryPlus device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Drying target supported_features: 0
Siemens Trockner - Drying target
select.siemens_wt47xe40_68a40e4c2828_programs LaundryCare.Dryer.Program.Mix options: LaundryCare.Dryer.Program.Mix device_class: home_connect_alt__programs icon: mdi:tumble-dryer friendly_name: Siemens Trockner - Programs
Siemens Trockner - Programs
sensor.siemens_wt47xe40_68a40e4c2828_active_program unknown device_class: home_connect_alt__programs icon: mdi:tumble-dryer friendly_name: Siemens Trockner - Active Program
Siemens Trockner - Active Program
sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_option_duration unavailable restored: true device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Adjust the duration supported_features: 0 unit_of_measurement: seconds
Siemens Trockner - Adjust the duration
sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_option_estimatedtotalprogramtime unavailable restored: true device_class: home_connect_alt__timespan icon: mdi:office-building-cog friendly_name: Siemens Trockner - Estimated total programme duration supported_features: 0
Siemens Trockner - Estimated total programme duration
sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_option_finishinrelative unavailable restored: true device_class: home_connect_alt__timespan icon: mdi:office-building-cog friendly_name: Siemens Trockner - Finish time supported_features: 0
Siemens Trockner - Finish time
sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_option_programprogress unavailable device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Program Progress
Siemens Trockner - Program Progress
sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_option_remainingprogramtime unavailable device_class: timestamp icon: mdi:office-building-cog friendly_name: Siemens Trockner - Remaining Program Time
Siemens Trockner - Remaining Program Time
sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_setting_powerstate unavailable restored: true device_class: home_connect_alt__settings icon: mdi:tune friendly_name: Siemens Trockner - Power status supported_features: 0
Siemens Trockner - Power status
sensor.siemens_wt47xe40_68a40e4c2828_bsh_common_status_operationstate BSH.Common.EnumType.OperationState.Finished device_class: home_connect_alt__status icon: mdi:gauge-full friendly_name: Siemens Trockner - Operation state
Siemens Trockner - Operation state
sensor.siemens_wt47xe40_68a40e4c2828_laundrycare_common_option_processphase unavailable restored: true device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Process Phase supported_features: 0
Siemens Trockner - Process Phase
sensor.siemens_wt47xe40_68a40e4c2828_laundrycare_common_option_refertoprogram 0 device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Refer To Program
Siemens Trockner - Refer To Program
sensor.siemens_wt47xe40_68a40e4c2828_laundrycare_dryer_option_connecteddry_originalprogramtime unavailable restored: true device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Original Program Time supported_features: 0 unit_of_measurement: seconds
Siemens Trockner - Original Program Time
sensor.siemens_wt47xe40_68a40e4c2828_laundrycare_dryer_option_dryingtarget LaundryCare.Dryer.EnumType.DryingTarget.CupboardDry device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Drying Target
Siemens Trockner - Drying Target
sensor.siemens_wt47xe40_68a40e4c2828_laundrycare_dryer_option_dryingtargetadjustment LaundryCare.Dryer.EnumType.DryingTargetAdjustment.Off device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Drying Target Adjustment
Siemens Trockner - Drying Target Adjustment
sensor.siemens_wt47xe40_68a40e4c2828_laundrycare_dryer_option_wrinkleguard LaundryCare.Dryer.EnumType.WrinkleGuard.Off device_class: home_connect_alt__options icon: mdi:office-building-cog friendly_name: Siemens Trockner - Wrinkle Guard
Siemens Trockner - Wrinkle Guard
sensor.siemens_wt47xe40_68a40e4c2828_selected_program LaundryCare.Dryer.Program.Mix device_class: home_connect_alt__programs icon: mdi:tumble-dryer friendly_name: Siemens Trockner - Selected Program
Siemens Trockner - Selected Program
switch.siemens_wt47xe40_68a40e4c2828_bsh_common_setting_childlock unavailable restored: true device_class: home_connect_alt__settings icon: mdi:tune friendly_name: Siemens Trockner - Childproof lock supported_features: 0
Siemens Trockner - Childproof lock

@ekutner
Copy link
Owner

ekutner commented May 20, 2025

So it seems that at least some entities are still available when the appliance is in standby mode.

@ZTHawk
Copy link

ZTHawk commented May 23, 2025

I noticed today that:

  1. Dryer has following states (for select powerstate):
    a) MainsOff
    b) On
  2. Oven has following states (for select powerstate):
    a) Standby
    b) On

@ekutner
Copy link
Owner

ekutner commented Jun 23, 2025

This is consistent with making the change because there is no case where all three options are available for the same appliance. The question is if there is no such case at all and the proposed change can be safely applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants