Skip to content
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

Add power signal; somewhat limited #15

Merged
merged 3 commits into from
May 29, 2024

Conversation

elffjs
Copy link
Member

@elffjs elffjs commented May 28, 2024

For Teslas, we have this field charger.power:

{
  …
  "data": {
    …
    "charger": {
      "power": 28
    }
  }
}

In kilowatts. This is only populated during charging. Looking at VSS, the best match seems to be Powertrain.TractionBattery.CurrentPower. Two weird things:

  • It's supposed to be populated all the time, with negative values when the vehicle is consuming power while driving. We don't have those drive consumption values. We can look and see if we can get it—this won't help with historical payloads.
  • It's in watts, so we must multiply the historical stuff by 1000.

Copy link

linear bot commented May 28, 2024

@elffjs
Copy link
Member Author

elffjs commented May 28, 2024

@KevinJoiner What command should I be running here? I copied the README and got

% go run github.com/DIMO-Network/model-garage/cmd/codegen -output=pkg/vss  -generators=all
2024/05/28 12:45:09 failed to generate custom file: error parsing Custom file template: open : no such file or directory
exit status 1

@elffjs
Copy link
Member Author

elffjs commented May 28, 2024

I think one does want to add -package vss there. Same error though.

@elffjs
Copy link
Member Author

elffjs commented May 28, 2024

I see, it's because all implies custom. This is if you want to execute some non-standard template?

It seems like go run github.com/DIMO-Network/model-garage/cmd/codegen -output=pkg/vss -package vss -generators=model,convert is good enough, then.

@elffjs elffjs marked this pull request as ready for review May 28, 2024 17:04
@@ -58,6 +58,8 @@ const (
FieldPowertrainTractionBatteryChargingChargeLimit = "powertrainTractionBatteryChargingChargeLimit"
// FieldPowertrainTractionBatteryChargingIsCharging True if charging is ongoing. Charging is considered to be ongoing if energy is flowing from charger to vehicle.
FieldPowertrainTractionBatteryChargingIsCharging = "powertrainTractionBatteryChargingIsCharging"
// FieldPowertrainTractionBatteryCurrentPower Current electrical energy flowing in/out of battery. Positive = Energy flowing in to battery, e.g. during charging. Negative = Energy flowing out of battery, e.g. during driving.
FieldPowertrainTractionBatteryCurrentPower = "powertrainTractionBatteryCurrentPower"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to take this opportunity to also populate powertrainTractionBatteryChargingIsCharging if we're seeing a positive value here?

Copy link
Member Author

@elffjs elffjs May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry that cross-talk between the fields will not fit into the code generation. I haven’t tried to verify this suspicion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codegen should handle multiple signals being populated from the same data point

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking lazily: we only get this for Tesla, and we're for sure populating charging for those.

Copy link
Collaborator

@KevinJoiner KevinJoiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make generate will generate the code for this repo I can update the readme with make help.

@@ -58,6 +58,8 @@ const (
FieldPowertrainTractionBatteryChargingChargeLimit = "powertrainTractionBatteryChargingChargeLimit"
// FieldPowertrainTractionBatteryChargingIsCharging True if charging is ongoing. Charging is considered to be ongoing if energy is flowing from charger to vehicle.
FieldPowertrainTractionBatteryChargingIsCharging = "powertrainTractionBatteryChargingIsCharging"
// FieldPowertrainTractionBatteryCurrentPower Current electrical energy flowing in/out of battery. Positive = Energy flowing in to battery, e.g. during charging. Negative = Energy flowing out of battery, e.g. during driving.
FieldPowertrainTractionBatteryCurrentPower = "powertrainTractionBatteryCurrentPower"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codegen should handle multiple signals being populated from the same data point

@elffjs elffjs merged commit 131d3a0 into main May 29, 2024
2 checks passed
@elffjs elffjs deleted the feature/si-2688-translate-charging-power-to-telemetry branch May 29, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants