-
Notifications
You must be signed in to change notification settings - Fork 72
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
EnergySiteInfo: add tarrif v2 and remove tou settings #175
base: master
Are you sure you want to change the base?
Conversation
…ger populated * `tou_settings` is no longer present at energy sites. * `tariff_content_v2` encodes details of time of use details for powerwall sites. Closes jonasman#174
@@ -23,8 +23,8 @@ open class EnergySiteInfo: Codable { | |||
open var offGridVehicleChargingReservePercent: Double? | |||
|
|||
open var userSettings: UserSettings | |||
open var touSettings: TOUSettings? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
touSettings
arent there anymore?
what about for WallConnector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I was on a code sabbatical. I'm back at my Swift efforts now. I do not have a wall connector so maybe my JSON is not the same as yours? Can you give me a sample JSON for an energy site with a wall connector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my json with 1 wall connector gen 3.
Looking at the lib, a lot of fields are missing.
Anyway tou_settings
can be removed even tho this is a tou_capable
{
"response": {
"id": "AAAA",
"site_name": "Oeiras",
"site_number": "STE20231001-XXXXX",
"installation_date": "2023-10-01T22:15:08Z",
"user_settings": {
"go_off_grid_test_banner_enabled": null,
"storm_mode_enabled": null,
"powerwall_onboarding_settings_set": null,
"powerwall_tesla_electric_interested_in": null,
"vpp_tour_enabled": null,
"sync_grid_alert_enabled": false,
"breaker_alert_enabled": false,
"off_grid_vehicle_charging_enabled": null
},
"components": {
"solar": false,
"battery": false,
"grid": false,
"backup": false,
"gateway": "gateway_type_none",
"load_meter": false,
"tou_capable": false,
"storm_mode_capable": false,
"flex_energy_request_capable": false,
"car_charging_data_supported": false,
"off_grid_vehicle_charging_reserve_supported": false,
"vehicle_charging_performance_view_enabled": false,
"vehicle_charging_solar_offset_view_enabled": false,
"battery_solar_offset_view_enabled": false,
"energy_service_self_scheduling_enabled": true,
"wall_connectors": [
{
"device_id": "XXXX",
"din": "1529455-02-E--PGT23103001005",
"part_number": "1529455-02-E",
"part_type": 15,
"part_name": "Gen 3 Wall Connector",
"is_active": true
}
],
"nbt_supported": true
},
"installation_time_zone": "Europe/Lisbon",
"tariff_content_v2": {
"code": "(edited)",
"name": "0,215",
"utility": "Luzboa",
"daily_charges": [
{
"name": "Charge"
}
],
"demand_charges": {
"ALL": {
"rates": {
"ALL": 0
}
},
"Summer": {},
"Winter": {}
},
"energy_charges": {
"ALL": {
"rates": {
"ALL": 0
}
},
"Summer": {
"rates": {
"OFF_PEAK": 0.21
}
},
"Winter": {}
},
"seasons": {
"Summer": {
"fromDay": 1,
"toDay": 31,
"fromMonth": 1,
"toMonth": 12,
"tou_periods": {
"OFF_PEAK": {
"periods": [
{
"toDayOfWeek": 6
}
]
}
}
},
"Winter": {}
},
"sell_tariff": {
"name": "0,215",
"utility": "Luzboa",
"daily_charges": [
{
"name": "Charge"
}
],
"demand_charges": {
"ALL": {
"rates": {
"ALL": 0
}
},
"Summer": {},
"Winter": {}
},
"energy_charges": {
"ALL": {
"rates": {
"ALL": 0
}
},
"Summer": {
"rates": {
"OFF_PEAK": 0.21
}
},
"Winter": {}
},
"seasons": {
"Summer": {
"fromDay": 1,
"toDay": 31,
"fromMonth": 1,
"toMonth": 12,
"tou_periods": {
"OFF_PEAK": {
"periods": [
{
"toDayOfWeek": 6
}
]
}
}
},
"Winter": {}
}
},
"version": 1
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made a commit with the missing fields
Energy Site Info was missing tariff content. This change adds codable classes for the new
tariff_content_v2
payload.tou_settings
is no longer present in energy site info payloads.tariff_content_v2
encodes details of time of use details for powerwall sites.Closes #174
I tested this manually against my credentials.