Skip to content

Conversation

@DanielGlaas
Copy link

Based on #23509.

climate and input_boolean entities are now supported in addition to switch entities for the homeassistant-switch charger template. This allows controlling devices like heaters, thermostats and smart plugs as chargers.

@andig andig added devices Specific device support enhancement New feature or request labels Dec 8, 2025
@DanielGlaas
Copy link
Author

Dropdown selection in UI then e.g. works as follows:

Bildschirmfoto vom 2025-12-08 18-33-31

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The charger parameter is still a single string, but the updated example now lists three entity IDs separated by commas; this is likely to confuse users and should be adjusted either to show just one valid example or to clarify that only a single entity ID is accepted.
  • In GetBoolState, you map heat, cool, and heat_cool to true, but other valid climate states like auto, fan_only, dry, or aux_heat are not handled explicitly; consider whether any of these should also be treated as true for climate entities and document or encode that mapping consistently.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `charger` parameter is still a single string, but the updated example now lists three entity IDs separated by commas; this is likely to confuse users and should be adjusted either to show just one valid example or to clarify that only a single entity ID is accepted.
- In `GetBoolState`, you map `heat`, `cool`, and `heat_cool` to `true`, but other valid climate states like `auto`, `fan_only`, `dry`, or `aux_heat` are not handled explicitly; consider whether any of these should also be treated as `true` for climate entities and document or encode that mapping consistently.

## Individual Comments

### Comment 1
<location> `templates/definition/charger/homeassistant-switch.yaml:33` </location>
<code_context>
   - name: switch
</code_context>

<issue_to_address>
**suggestion:** The `switch` param wording and example may be misleading now that non-switch domains are allowed.

The parameter is still called `switch` and described as "Entity ID of the switch device", but the service and example now cover `climate` and `input_boolean`, which can be confusing.

Consider either broadening the description (e.g. "Entity ID of the controllable device") or adjusting the example/docs to clearly state that multiple domains are supported while the parameter value remains a single entity ID.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

climate and input_boolean entities are now supported in
addition to switch entities for the homeassistant-switch
charger template. This allows controlling devices like
heaters, thermostats and smart plugs as chargers.
@DanielGlaas DanielGlaas force-pushed the HA_climate_entity_ha_switch branch from a616f76 to 2e5207a Compare December 8, 2025 20:34
@andig andig marked this pull request as draft December 12, 2025 12:21
@andig
Copy link
Member

andig commented Dec 12, 2025

I'm not happy with polluting the switch with auto and other values. That said, sgready or sgready-boost may be the better fit here. As last resort, you can always manually configure an integration using the http plugin. I'd also be open to add a homeassistant plugin that might allow more finer-grained control over response values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants