Closed ronajon closed 9 months ago
Thanks for the report. Actually, this issue is most likely solved by #190 and available in the pre-release v1.9.0-dev2.
I have a few more changes I want to make before publishing the next release, but hopefully within a few days.
Hi, `` I have a similar issue. It seems my switch is not being saved after I have set it up.
I'm trying to set up the integration with a polestar and Etrel Inch charger. Using automations I can set the switch "ev_smart_charging_ev_connected" properly. If I activate smart charging, the intervals are being calculated and displayed on the graph, so that's working also.
I configured a switch to control the charger:
switch:
- platform: template
switches:
car_charger_control_switch:
friendly_name: "Car Charger Control Switch"
turn_on:
service: modbus.write_register
data:
address: 10 # Connector 1 - Cancel current setpoint , max value
slave: 255
value: 1 # Value ignored, triggered by write
hub: etrel_inch
turn_off:
service: modbus.write_register
data:
address: 2 # Connector 1 - Pause charging
slave: 255
value: 0 # Value ignored, triggered by write
hub: etrel_inch
using this switch I can manually stop and start the charging.
Still the integration does not start or stop the charging when it should. What seems odd to me, is that the switch is not being displayed in the configuration after I set it up. Could it be it's not properly being saved?
@ThomasMidgley, what you describe sounds like the issue that #190 should fix. You can try the pre-release, or wait a day or two until I will release v1.9.0.
Fixed in release v1.9.0.
@jonasbkarlsson, thanks for the help. I've tested with v1.9.0 and I'm still getting "Charger control switch entity not found" I've deleted the whole integration and downloaded it again, just be sure.
Hi! Sorry, now I see the problem. This is different from #190.
The integration currently only supports native switch entities. It does not support template switches.
The way to make it work is to use two automations, such as https://github.com/jonasbkarlsson/ev_smart_charging#example-of-automation-to-start-charging and https://github.com/jonasbkarlsson/ev_smart_charging#example-of-automation-to-stop-charging. And to replace the action
with service call to switch.turn_on
and switch.turn_off
.
Something like the following for the automation that turns on charging.
action:
- service: switch.turn_on
data: {}
target:
entity_id: switch.car_charger_control_switch
@jonasbkarlsson, sorry to keep spamming this closed issue. In the beginning I've started with automations, but I can't seem to set it up properly. Hence I tried using a virtual switch.
setting the switch switch.ev_smart_charging_ev_connected works as it should. But I can't seem to trigger the charging.
A penny for your thoughs....
# Doorgeven aan EV Smart Charging dat auto verbonden is
- alias: EV Smart Charging - car connection status
description: ""
mode: single
trigger:
- platform: state
entity_id:
- sensor.Etrel_connection_status
condition: []
action:
- if:
- condition: state
entity_id: sensor.Etrel_connection_status
state: "4" # Charging
then:
- service: switch.turn_on
data: {}
target:
entity_id: switch.ev_smart_charging_ev_connected
else:
- if:
- condition: state
entity_id: sensor.Etrel_connection_status
state: "1" # socket available
then:
- service: switch.turn_off
data: {}
target:
entity_id: switch.ev_smart_charging_ev_connected
# AUG 2023: AAN/AF schakelen laadpaal
- alias: EV Smart Charging - Start
description: ""
mode: single
trigger:
- platform: state
entity_id:
- sensor.ev_smart_charging_charging
from: "off"
to: "on"
condition: []
action:
- service: modbus.write_register
data:
address: 10 # Connector 1 - Cancel current setpoint, revert back to maximum
slave: 255
value: 1 # Value ignored, triggered by write
hub: etrel_inch
- alias: EV Smart Charging - Stop
description: ""
mode: single
trigger:
- platform: state
entity_id:
- sensor.ev_smart_charging_charging
from: "on"
to: "off"
condition: []
action:
- service: modbus.write_register
data:
address: 2 # Connector 1 - Pause charging
slave: 255
value: 0 # Value ignored, triggered by write
hub: etrel_inch
I would first disable the automation EV Smart Charging - car connection status
, and then do the Verifying the configuration.
If that doesn't work, then I would suspect that there are some issues with the modbus parts.
Regarding the automation EV Smart Charging - car connection status
, is it so that state: "1" # socket available
means that the cable is disconnected? Which is the case when switch.ev_smart_charging_ev_connected
should be turned off.
Or do you also get state "1" when the cable is connected, but there is no charging active?
Hi @jonasbkarlsson,
I believe I found my issue. There seems to be a different how to write a hex value between lovelance and the automations. Hex values are used in the Modbus command.
I'm now able to do the verification of the configuration. I can control the charging with the press buttons. Will try to charge automatically this night.
Thanks for the help and keep up your nice work!
Version of the custom_component
Version 1.8.0
Configuration
Tesla custom integration 3.16.1
Describe the bug
on restart of homeassistant, the EV Smart Charging integration is unable to find the Charger Control Switch , the EV Charging panel is then disabled The switch is the Tesla charger switch, named _switch.mario_kartcharger
When reloading the integration (after initial startup) the switch is found and the EV Charging panel is active again
Debug log