teslamate icon indicating copy to clipboard operation
teslamate copied to clipboard

Entering the cost per KWh value higher than 100 (three digits) is not possible

Open olivercho opened this issue 4 years ago • 5 comments

Describe the bug Hi, recently the Superchargers in Korea started to charge and I wanted to set the cost per kWh of my charge sessions as currently defined (313 KRW/kWh). But as I tried to enter '313' into a charge session it didn't make any change and the value was not remembered. After a few tries, I noticed that only less than 100 was allowed to enter and higher number than that was not available. I guess the internal cost field in the database is set to use lower than 3 digits values, perhaps based on US prices. Please change the setting to allow higher numbers, so that users can set the charge costs as same as defined in their currency values. (for me 313 KRW/kWh)

Expected behavior

Allowed to enter the cost per kWh value as defined in KRW (three digits, 313 KRW/kWh)

How to reproduce it (as minimally and precisely as possible):

Steps to reproduce the behavior:

  1. Go to 'Charges'.
  2. Click on one of session locations to create/edit geo-fence.
  3. From the geo-fences page, choose the Cost type as "Per kWh".
  4. Enter higher number than 100.
  5. See error. It won't be saved.
  6. Enter lower number than 100.
  7. Now it will be saved properly.

Relevant entries from the logs

paste logs here

Screenshots

Data

Environment

  • TeslaMate version: 1.20.1
  • Type of installation: Docker
  • OS TeslaMate is installed on:
  • User OS & Browser: MacOS High Sierra / Chrome
  • Others:

olivercho avatar Nov 01 '20 13:11 olivercho

Same issue here, Is it the issue due to the type of the DB column?

Beomi avatar Nov 12 '20 16:11 Beomi

But as I inspected this issue via Chrome, it even doesn't send any HTTP request which is over 100.

Beomi avatar Nov 12 '20 16:11 Beomi

@adriankumpf , I was able to adjust the DB column settings by following an article from a local Tesla community, and after that entering larger number worked fine. (Though the initial cost automatically filled for each charge session was based on USD and so I needed to change the value as KRW.) Below was the way I used which uses the docker-compose.yml. Hopefully this is helpful to resolve this issue.

docker-compose exec database psql teslamate teslamate ALTER TABLE charging_processes ALTER COLUMN cost TYPE numeric(8,2); ALTER TABLE geofences ALTER COLUMN cost_per_unit TYPE numeric(7,4); exit

olivercho avatar Dec 06 '20 11:12 olivercho

@olivercho It works perfectly. Thanks!

Beomi avatar Dec 07 '20 06:12 Beomi

@olivercho Thanks. It works perfectly.

dongbum avatar Apr 05 '22 04:04 dongbum