Skip to content

Commit

Permalink
#100 🪲 BUG: Error message for "Charger is controlled by app" not showing
Browse files Browse the repository at this point in the history
- Changed the name of the state 3 to "Connected: controlled by Wallbox App"
- Did some cleanup in v2g_liberty module
- did some cleanup in dashboard
  • Loading branch information
ArdJonker committed Sep 26, 2024
1 parent 0080629 commit 86d09c1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class ModbusEVSEclient(hass.Hass):
0: 'No car connected',
1: 'Charging',
2: 'Connected: waiting for car demand',
3: 'Connected: controlled by EVSE App',
3: 'Connected: controlled by Wallbox App',
4: 'Connected: not charging (paused)',
5: 'Connected: end of schedule',
6: 'No car connected and charger locked',
Expand Down
24 changes: 12 additions & 12 deletions v2g-liberty/rootfs/root/appdaemon/apps/v2g-liberty/v2g_liberty.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def initialize(self):
"no_communication_with_fm": False
}
# Reset at init
self.turn_off("input_boolean.charger_modbus_communication_fault")
await self.turn_off("input_boolean.charger_modbus_communication_fault")

self.notification_timer_handle = None
self.no_schedule_notification_is_planned = False
Expand All @@ -117,13 +117,13 @@ async def initialize(self):
self.fm_client_app = await self.get_app("fm_client")
self.reservations_client = await self.get_app("reservations-client")

self.listen_state(self.__update_charge_mode, "input_select.charge_mode", attribute="all")
self.listen_event(self.__disconnect_charger, "DISCONNECT_CHARGER")
self.listen_event(self.__handle_phone_action, event="mobile_app_notification_action")
await self.listen_state(self.__update_charge_mode, "input_select.charge_mode", attribute="all")
await self.listen_event(self.__disconnect_charger, "DISCONNECT_CHARGER")
await self.listen_event(self.__handle_phone_action, event="mobile_app_notification_action")

self.listen_state(self.__handle_charger_state_change, "sensor.charger_charger_state", attribute="all")
self.listen_state(self.__handle_soc_change, "sensor.charger_connected_car_state_of_charge", attribute="all")
self.listen_state(self.__process_schedule, "input_text.chargeschedule", attribute="all")
await self.listen_state(self.__handle_charger_state_change, "sensor.charger_charger_state", attribute="all")
await self.listen_state(self.__handle_soc_change, "sensor.charger_connected_car_state_of_charge", attribute="all")
await self.listen_state(self.__process_schedule, "input_text.chargeschedule", attribute="all")

self.scheduling_timer_handles = []

Expand Down Expand Up @@ -161,8 +161,8 @@ async def initialize(self):

async def initialise_v2g_liberty(self, v2g_args=None):
# Show the settings in the UI
self.set_textvalue("input_text.optimisation_mode", c.OPTIMISATION_MODE)
self.set_textvalue("input_text.utility_display_name", c.UTILITY_CONTEXT_DISPLAY_NAME)
await self.set_textvalue("input_text.optimisation_mode", c.OPTIMISATION_MODE)
await self.set_textvalue("input_text.utility_display_name", c.UTILITY_CONTEXT_DISPLAY_NAME)
await self.set_next_action(v2g_args=v2g_args) # on initializing the app


Expand Down Expand Up @@ -910,11 +910,11 @@ async def __process_soc(self, reported_soc: str) -> bool:

# Cleaned_up SoC value for UI
# TODO: This is no longer needed, use input_number.charger_connected_car_state_of_charge in UI.
self.set_value("input_number.car_state_of_charge", self.connected_car_soc)
await self.set_value(entity_id="input_number.car_state_of_charge", value=self.connected_car_soc)

self.connected_car_soc_kwh = round(reported_soc * float(c.CAR_MAX_CAPACITY_IN_KWH / 100), 2)
remaining_range = int(round((self.connected_car_soc_kwh * 1000 / c.CAR_CONSUMPTION_WH_PER_KM), 0))
self.set_value("input_number.car_remaining_range", remaining_range)
await self.set_value(entity_id="input_number.car_remaining_range", value=remaining_range)
self.log(f"New SoC processed, self.connected_car_soc is now set to: {self.connected_car_soc}%.")
self.log(f"New SoC processed, self.connected_car_soc_kwh is now set to: {self.connected_car_soc_kwh}kWh.")
self.log(f"New SoC processed, car_remaining_range is now set to: {remaining_range} km.")
Expand Down Expand Up @@ -1130,7 +1130,7 @@ async def __set_chargemode_in_ui(self, setting: str):
By setting the UI switch an event will also be fired. So other code will run due to this setting.
Parameters:
setting (str): Automatic, MaxBoostNow or Stop (=Off))
setting (str): Automatic, MaxBoostNow or Stop (=Off)
Returns:
nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ views:
min: 0
max: 100
name: Car SoC
# TODO: Base these values on user settings min/max charge (in secrets).
# TODO: Base these values on user settings min/max charge settings.
segments:
- from: 0
color: var(--error-color)
Expand Down

0 comments on commit 86d09c1

Please sign in to comment.