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

Feature: Advanced UI #65

Merged
merged 8 commits into from
Apr 3, 2024
Merged

Feature: Advanced UI #65

merged 8 commits into from
Apr 3, 2024

Conversation

lydiazcheng
Copy link
Contributor

@lydiazcheng lydiazcheng commented Mar 29, 2024

This PR implements

  1. all use cases in Advance UI including,
  • Set Display Message
  • Get Display Message
  • Clear a Display Message
  • Show EV Driver Running / Final Total Cost During / After Charging Show EV Driver-specific Tariff Information
  • Update Tariff Information During Transaction
  • Configure Fallback Tariff Information & Total Cost Message (Covered by Set Variable, no need to implement)
  1. a Tariff workaround which supports calculate total cost

Local tests

Use wscat to test display messages related as well as show specific tariff use cases. Use EVerest for other use cases.

Set Display Message

  1. send a invalid request body contains invalid value in field “language“ from postman
{
  "message": {
    "id": 0,
    "priority": "AlwaysFront",
    "endDateTime": "2024-04-01T00:00:00.000Z",
    "message": {
        "format": "ASCII",
        "language": "sth??",
        "content": "This is a test message."
    }
  }
}
  1. returns not success and the error message
{
    "success": false,
    "payload": "Language shall be specified as RFC-5646 tags, example: US English is: en-US."
}
  1. send a valid set display message req without start date time
  2. the start date time is auto generated in the request and charger receive it
    image
  3. send a response from the charger. Then if the status is accepted, citrine sends a get all display messages request to the charger.
    image

Get Display Message

  1. send a request from postman and received by the charger
    image
  2. send NotifyDisplayMessagesRequest from charger
    [2, "e328fcbf-aa7d-4057-9117-e180b184a210", "NotifyDisplayMessages", {"requestId": 1, "messageInfo":[{"id":1,"priority":"AlwaysFront","endDateTime":"2024-04-01T00:00:00.000Z","startDateTime":"2024-03-28T19:08:08.519Z","message":{"format":"ASCII","content":"This is a test message."},"display":{"name":"MonitoringCtrlr"}},{"id":2,"priority":"NormalCycle","startDateTime":"2024-03-28T19:08:08.519Z","endDateTime":"2024-04-01T00:00:00.000Z","message":{"format":"ASCII","content":"This is a test message."},"display":{"name":"MonitoringCtrlr"}}]}]
  3. charger receive the response
    image
  4. the messages are stored in db
    image

Clear a Display Message

  1. send a clear request from postman and charger receive it
    image
  2. send a accepted response from the charger
    image
  3. citrine marks all active = true messages on this charger to false in db and send a get all messages req
    image
    image

Show EV Driver Running Total Cost During Charging

Send CostUpdatedRequest every minute

  1. CostUpdatedRequest is sent every 60 seconds
    image
    image
    image
  2. cost not send in the TransactionEventResponse when use costUpdateInterval.
    image

Alternative scenario: update cost when receiving TransactionEventRequest (eventType=Updated)

after receiving the transaction event, citrine calculates by all meter values of this transaction and return the total cost in response. image

Show EV Driver Final Total Cost After Charging

After stop the transaction (EVDisconnected), returns the final cost.
image

Show EV Driver-specific Tariff Information

charger send a authorize request and then citrine set the tariff info in the response if the id token is accepted. (To simplify the test, I change the code in the handler temporarily to force id token status always to be accepted.)
image

Update Tariff Information During Transaction

after receiving TransactionEventRequest (eventType = Updated) , citrine should check if there is updated tariff and send it back to charger. Since we don’t have such a case, I currently just print a log here.
image

Create/Find/Delete Tariff

  1. create new tariffs using the data endpoint and store in db
    image
    image
  2. get tariffs using unit(KWH)
    image
  3. get tariff using station id (cp001)
    image
  4. get tariff by id (3)
    image
  5. delete a tariff by id (3)
    image

Signed-off-by: Zihe Cheng <lydiazcheng@users.noreply.github.com>
Signed-off-by: Zihe Cheng <lydiazcheng@users.noreply.github.com>
@lydiazcheng lydiazcheng self-assigned this Mar 29, 2024
Signed-off-by: Zihe Cheng <lydiazcheng@users.noreply.github.com>
Copy link
Collaborator

@thanaParis thanaParis left a comment

Choose a reason for hiding this comment

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

Good start! There are some changes I'd like; see review comments.

01_Data/src/layers/sequelize/model/Tariff/Tariffs.ts Outdated Show resolved Hide resolved
01_Data/src/layers/sequelize/repository/DeviceModel.ts Outdated Show resolved Hide resolved
01_Data/src/layers/sequelize/repository/MessageInfo.ts Outdated Show resolved Hide resolved
02_Util/src/util/timer.ts Outdated Show resolved Hide resolved
02_Util/src/util/transaction.ts Outdated Show resolved Hide resolved
03_Modules/Configuration/src/module/module.ts Show resolved Hide resolved
Signed-off-by: Zihe Cheng <lydiazcheng@users.noreply.github.com>
@lydiazcheng
Copy link
Contributor Author

Good start! There are some changes I'd like; see review comments.

Thanks a lot Thana! The feedback is very helpful! I updated the code. Pls let me know if there are any further comments.

@lydiazcheng
Copy link
Contributor Author

Local test on partial use cases:

Update cost interval

Screenshot 2024-04-03 at 9 58 04 AM Screenshot 2024-04-03 at 9 59 34 AM Screenshot 2024-04-03 at 10 01 01 AM

Show specific tariff

Screenshot 2024-04-03 at 10 04 16 AM

Signed-off-by: lydiazcheng <lydiazcheng@users.noreply.github.com>
Signed-off-by: Zihe Cheng <lydiazcheng@users.noreply.github.com>
Copy link
Collaborator

@thanaParis thanaParis left a comment

Choose a reason for hiding this comment

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

Looks good!

@thanaParis thanaParis merged commit 7d9f458 into rc-1.1.0 Apr 3, 2024
1 check passed
@ChrisWeissmann ChrisWeissmann deleted the feature/advanced-ui branch June 5, 2024 13:25
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.

2 participants