Skip to content

Commit

Permalink
updates to v0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Pythm authored Aug 11, 2024
1 parent 73fe691 commit e621bab
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 38 deletions.
44 changes: 16 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ electricity:
power_consumption: sensor.power_home
accumulated_consumption_current_hour: sensor.accumulated_consumption_current_hour_home
max_kwh_goal: 5 # 5 is default.
max_kwh_goal: 15 # 15 is default.
buffer: 0.4 # 0.4 is default.
daytax: 0.5648 # 0 is default
nighttax: 0.4468 # 0 is default
Expand All @@ -433,7 +433,6 @@ electricity:
support_amount: 0.9 # 90%
vacation: input_boolean.vacation
outside_temperature: sensor.netatmo_out_temperature
rain_sensor: sensor.netatmo_sensor_rain
anemometer: sensor.netatmo_anemometer_wind_strength
Expand All @@ -443,8 +442,8 @@ electricity:
- mobile_app_yourotherphone
infotext: input_text.information
options:
- informEveryChange
- pause_charging
- notify_overconsumption
# IF you are charging a Tesla connected to a Easee
easee_tesla:
Expand All @@ -461,6 +460,7 @@ electricity:
finishByHour: input_number.spaceyferdig
priority: 3
charge_now: input_boolean.spacey_ladna
guest: input_boolean.easeelader_gjest_lader
# If your Tesla is connected to a "dumb" wallconnector. Example on two teslas..
tesla:
Expand Down Expand Up @@ -504,46 +504,34 @@ electricity:
pricedrop: 0.15
low_price_max_continuous_hours: 3
priceincrease: 0.65
#vacation: Will use apps default HA input boolean if not specified.
automate: input_boolean.automate_heating
indoor_sensor_temp: sensor.bod_fryseskap_air_temperature
target_indoor_temp: 20
target_indoor_input: input_number.heating_HA_sensor
window_temp: sensor.window_air_temperature
windowsensors:
- binary_sensor.your_window_door_is_open
window_offset: -3
save_temp: 12
away_temp: 13
daytime_savings:
- start: '07:30:00'
stop: '22:00:00'
presence:
- person.wife
temperatures:
- out: -4
normal: 20
save: 13
away: 14
offset: 2
- out: -3
normal: 19
save: 12
away: 14
offset: 1
- out: 2
normal: 18
save: 11
away: 13
offset: 0
- out: 7
normal: 16
save: 11
away: 13
offset: -2
- out: 11
normal: 15
save: 10
away: 12
offset: -3
- out: 14
normal: 13
save: 10
away: 12
- out: 18
normal: 12
save: 10
away: 12
offset: -5
- out: 17
offset: -6
heater_switches:
- name: hotwater
Expand Down
21 changes: 11 additions & 10 deletions apps/ElectricalManagement/electricalManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

__version__ = "0.1.5"
__version__ = "0.1.6"

import appdaemon.plugins.hass.hassapi as hass
import datetime
Expand Down Expand Up @@ -1340,7 +1340,7 @@ def initialize(self):

# Set up hot water boilers and electrical heaters
self.heatersRedusedConsumption:list = [] # Heaters currently turned off/down due to overconsumption
self.lastTimeHeaterWasReduced = datetime.datetime.now()
self.lastTimeHeaterWasReduced = datetime.datetime.now() - datetime.timedelta(minutes = 5)

heaters = self.args.get('climate', {})
for heater in heaters:
Expand Down Expand Up @@ -2077,9 +2077,10 @@ def checkElectricalUsage(self, kwargs) -> None:
for queue_id in self.queueChargingList:
for c in self.chargers:
if c.charger_id == queue_id:
ChargingState = c.getChargingState()
if (
c.getChargingState() == 'Complete'
or c.getChargingState() == 'Disconnected'
ChargingState == 'Complete'
or ChargingState == 'Disconnected'
):
try:
self.queueChargingList.remove(queue_id)
Expand All @@ -2092,7 +2093,7 @@ def checkElectricalUsage(self, kwargs) -> None:
self.log(f"{c.charger} was not in queueChargingList. Exception: {e}", level = 'DEBUG')

elif (
c.getChargingState() == 'Charging'
ChargingState == 'Charging'
and not c.isChargingAtMaxAmps()
):
if not c.Car.SoftwareUpdates():
Expand All @@ -2101,8 +2102,8 @@ def checkElectricalUsage(self, kwargs) -> None:
return

elif (
c.getChargingState() == 'Stopped'
or c.getChargingState() == 'awaiting_start'
ChargingState == 'Stopped'
or ChargingState == 'awaiting_start'
):
if not CHARGE_SCHEDULER.isChargingTime(charger_id = c.charger_id):
try:
Expand All @@ -2116,7 +2117,7 @@ def checkElectricalUsage(self, kwargs) -> None:
return

elif (
c.getChargingState() == 'Charging'
ChargingState == 'Charging'
and c.isChargingAtMaxAmps()
):
if (
Expand Down Expand Up @@ -3439,8 +3440,8 @@ def getmaxChargingAmps(self) -> int:


def isChargingAtMaxAmps(self) -> bool:
self.updateAmpereCharging()
if self.getmaxChargingAmps() <= self.ampereCharging:
self.updateAmpereCharging()
return True
return False

Expand Down Expand Up @@ -3789,7 +3790,7 @@ def __init__(self, api,
ElectricityData = json.load(json_read)
if not self.vehicle_id in ElectricityData['charger']:
ElectricityData['charger'].update(
{self.vehicle_id : {"CarLimitAmpere" : 6, "MaxkWhCharged" : 5}}
{self.vehicle_id : {"CarLimitAmpere" : 120, "MaxkWhCharged" : 5}}
)
with open(JSON_PATH, 'w') as json_write:
json.dump(ElectricityData, json_write, indent = 4)
Expand Down

0 comments on commit e621bab

Please sign in to comment.