Smart Switches
evcc supports smart sockets and controllable switches. These switches work similarly to EV chargers, but without the power control. Here, evcc only controls the on/off state of the socket. If there is enough surplus or cheap energy available, the socket is switched automatically. Additionally, manual control via "Off" and "Fast" is possible.
Modes
Depending on the application, there are two modes of operation.
These are set implicitly via the standbypower
parameter on the device.
Charging mode (default)
This mode is suitable for the use of sockets that control battery-powered vehicles (e-motorcycles, e-bikes, tool batteries, ...).
The measured charging power at the switch is considered as charging power.
If this power falls below a threshold (default: standbypower: 15
), evcc considers the device as charged.
This mode is active if the configured value for standbypower
is not negative.
Here is an example of a Tasmota socket that is operated in charging mode. The connected charger has a standby consumption of a maximum of 50 W.
chargers:
- name: e_bike_outlet
type: template
template: tasmota
host: 192.0.2.1
standbypower: 50
This means that in this mode the state of the charger is determined by the measured power:
- Charging: (power >
standbypower
) - Charged: (power ≤
standbypower
)
This mode assumes that the switch also has an integrated energy meter. It is currently not possible to achieve this behavior with an additional energy meter at the charger.
Static mode
This mode is suitable for general consumers such as heat pumps, air conditioners, heaters, etc.
This mode is activated by a negative value for standbypower
.
Here is an example of a Shelly switch that controls a heat pump with 5 kW power.
chargers:
- name: my_sg_ready
type: template
template: shelly
host: 192.0.2.2
standbypower: -5000
The state of the charger is directly dependent on the switch state of the socket:
- Charging: switch on
- Charged: switch off
evcc assumes a constant power that is set by the standbypower
parameter.
In the example above the switch controls a 5 kW heat pump.
If you want to see the real power consumption it is recommended to add a separate energy meter to the charging point.
Special behavior
No automatic sessions
In evcc the period from plugging in a vehicle to disconnecting is considered a charging session. This concept does not work with switches, as these cannot detect a connected/disconnected state. Therefore, evcc logs the consumption at switches as a long charging process that runs from the start to the end of evcc. There is currently no purely time-based evaluation. There are plans to implement this in the future.
However, there is already a way to manually create a charging sessions. When switching the charging point to Off at a switch, the current charging session is stopped. You can manually start a charging session by switching on and off via the UI. You could automate this via API (e.g. every night).
Integrated device
By default, charging points offer the possibility of vehicle assignment.
In many switch scenarios this is not desired.
It makes little sense to connect the Tesla to the SG-Ready contact of a heat pump.
By setting the features
-flag integrateddevice
you disable the manual vehicle assignment in the UI.
Additionally, the automatic vehicle detection is disabled for this charging point.
Heating
If you use the switch to control a heat pump, you should set the features
-Flag heating
.
This changes the display in the UI.
Now the status uses the word "heating" instead of "charging".
Additionally, the soc
of the charger (if available) is no longer displayed in % but as a temperature in °C.
Switchable sockets
AVM FritzDECT
chargers:
- name: my_smartswitch
type: template
template: fritzdect
uri: https://fritz.box # URI, HTTP(S) address (optional)
user: # Username, e.g. email address, user id, etc.
password: # Password, Use single quotes in case of leading zeros
ain: 307788992233 # Actor Identification Number (AIN), Printed on the type label on the back of the device. Embed it in double quotes in case of leading zeroes.
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Home Assistant Switch
chargers:
- name: my_smartswitch
type: template
template: homeassistant-switch
baseurl: http://homeassistant.local:8123 # Base URL of the Home Assistant instance
token: # Long-Lived Access Token, from Home Assistant profile
switchentity: switch.smartsocket # Entity ID of the switch device
powerentity: sensor.smartsocket_power # Entity ID for power measurement, optional
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Homematic IP
chargers:
- name: my_smartswitch
type: template
template: homematic
host: 192.0.2.2 # IP address or hostname
port: 2010 # XML-RPC server port number, optional
device: 0001EE89AAD848 # Device address/Serial number, Homematic device id like shown in the CCU web user interface.
user: # Username, e.g. email address, user id, etc. (optional)
password: # Password, Use single quotes in case of leading zeros (optional)
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
HomeWizard
chargers:
- name: my_smartswitch
type: template
template: homewizard
host: 192.0.2.2 # IP address or hostname
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
myStrom Switch
chargers:
- name: my_smartswitch
type: template
template: mystrom
host: 192.0.2.2 # IP address or hostname
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Shelly
1
chargers:
- name: my_smartswitch
type: template
template: shelly
host: 192.0.2.2 # IP address or hostname
user: # Username, e.g. email address, user id, etc. (optional)
password: # Password, Use single quotes in case of leading zeros (optional)
channel: 0 # Channel, optional
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Plug S
chargers:
- name: my_smartswitch
type: template
template: shelly
host: 192.0.2.2 # IP address or hostname
user: # Username, e.g. email address, user id, etc. (optional)
password: # Password, Use single quotes in case of leading zeros (optional)
channel: 0 # Channel, optional
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Plus 1
chargers:
- name: my_smartswitch
type: template
template: shelly
host: 192.0.2.2 # IP address or hostname
user: # Username, e.g. email address, user id, etc. (optional)
password: # Password, Use single quotes in case of leading zeros (optional)
channel: 0 # Channel, optional
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Pro 1
chargers:
- name: my_smartswitch
type: template
template: shelly
host: 192.0.2.2 # IP address or hostname
user: # Username, e.g. email address, user id, etc. (optional)
password: # Password, Use single quotes in case of leading zeros (optional)
channel: 0 # Channel, optional
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Tasmota single phase
chargers:
- name: my_smartswitch
type: template
template: tasmota
host: 192.0.2.2 # IP address or hostname
user: # Username, admin is default (optional)
password: # Password, Use single quotes in case of leading zeros (optional)
channel: 1 # Relaychannel number, Relaychannel number (1-8)
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
TP-Link
H-Series Smart Plug
chargers:
- name: my_smartswitch
type: template
template: tplink
host: 192.0.2.2 # IP address or hostname
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)
Tapo P-Series Smart Plug
chargers:
- name: my_smartswitch
type: template
template: tapo
host: 192.0.2.2 # IP address or hostname
user: # Username, e.g. email address, user id, etc.
password: # Password, Use single quotes in case of leading zeros
standbypower: 15 # Standby power (W), Power values above this value will be considered as charging power (optional)