Skip to content
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

Command-line switch not accepted as charger control switch #326

Open
nilrog opened this issue Sep 3, 2024 · 3 comments
Open

Command-line switch not accepted as charger control switch #326

nilrog opened this issue Sep 3, 2024 · 3 comments

Comments

@nilrog
Copy link

nilrog commented Sep 3, 2024

Version of the custom_component

Version 2.0.1

Configuration

Home assistant v2024.7.4 running in docker with this integration downloaded using HACS

Describe the bug

When trying to configure the integration it does not accept the switch entity that I have that controls the EV charger. I get the error "Brytare för laddningsstyrning hittas inte.". Yet the switch entity exists and can be used as switch everywhere else in HA. I have been using it for many years from automations et.al.
If I substitute the switch entity in the configuration with one for a zigbee switch it is accepted.

The switch is a command-line switch that is configured like this:

command_line:
  - switch:
      name: the_name
      command_on: "..."
      command_off: "..."
      command_state: "..."
      value_template: '...'

Debug log

There are no debug logs from this integration that shows that anything goes wrong when I try to fill in the config parameters.


2024-09-03 12:20:26.659 DEBUG (MainThread) [custom_components.ev_smart_charging.config_flow] EVChargingControlConfigFlow.__init__
2024-09-03 12:20:26.659 DEBUG (MainThread) [custom_components.ev_smart_charging.config_flow] EVChargingControlConfigFlow.async_step_user
2024-09-03 12:21:05.879 DEBUG (MainThread) [custom_components.ev_smart_charging.config_flow] EVChargingControlConfigFlow.async_step_user


@jopocop
Copy link

jopocop commented Oct 23, 2024

Neither does normal custom switch. I don't have start/stop control in the charger, and the car (vw id3) doesn't have a switch to start/stop charging, but separate button entities. So I created a switch that turn_on --> service: button.press (start) and turn_off --> service: button,press (stop).

However, the integration doesn't allow this. "Charger control switch entity is not a switch."

@janneho
Copy link
Contributor

janneho commented Oct 23, 2024

Use automation for start/stop charging.
Like this

@jopocop
Copy link

jopocop commented Oct 26, 2024

Perfection. Thanks.

Just noting that it seems to me that the integration's own manual start/stop buttons don't seem to work. I do have similar buttons in the VW integration itself. They are actually bit weird, they exist and they work, but they are not visible in the VW integration screen, only in the developer tools - where the description looks identical to the ones created by the VW integration.

Problem with these VW buttons is that they are obviously not connected to the EV smart charging integration, so stopping manually charging will not be relayed to the charging_charging -sensor. Therefore, I created instead a script that presses both start buttons or both stop buttons. One starts/stops the charging and the other just notifies the EV Smart Charging integration. And script triggered when switch.ev_smart_charging_smart_charging_activated switch changes state.

Still in testing phase. Testing is slow as the battery is mostly full.

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

No branches or pull requests

3 participants