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

Unable to display power using three-phase electricity #4206

Open
1 task done
oven1231231234 opened this issue Sep 17, 2024 · 7 comments
Open
1 task done

Unable to display power using three-phase electricity #4206

oven1231231234 opened this issue Sep 17, 2024 · 7 comments
Labels
area:dashboard Related to a Grafana dashboard area:tesla api Related to the Tesla API undetermined Not sure if this is considered a real bug waiting for feedback

Comments

@oven1231231234
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Unable to display power using three-phase electricity tesla models 2014 P85

Expected Behavior

No response

Steps To Reproduce

No response

Relevant log output

teslamate-1  | 2024-09-16 21:25:57.823 [info] GET /
teslamate-1  | 2024-09-16 21:25:57.830 [info] Sent 200 in 6ms
teslamate-1  | 2024-09-16 21:26:25.391 [info] GET /settings
teslamate-1  | 2024-09-16 21:26:25.402 [info] Sent 200 in 10ms
teslamate-1  | 2024-09-16 21:31:17.481 car_id=1 [info] Fetching vehicle state ...
teslamate-1  | 2024-09-16 21:31:17.684 car_id=1 [info] Start / :asleep
teslamate-1  | 2024-09-16 21:31:17.690 car_id=1 [info] Disconnecting ...
teslamate-1  | 2024-09-16 21:40:59.736 car_id=1 [info] Start / :online
teslamate-1  | 2024-09-16 21:40:59.746 car_id=1 [info] Connecting ...
teslamate-1  | 2024-09-16 21:44:03.409 car_id=1 [info] Suspending logging
teslamate-1  | 2024-09-16 21:53:14.281 car_id=1 [info] Fetching vehicle state ...
teslamate-1  | 2024-09-16 21:55:07.322 car_id=1 [info] Fetching vehicle state ...
teslamate-1  | 2024-09-16 21:55:07.400 car_id=1 [info] Start / :asleep
teslamate-1  | 2024-09-16 21:55:07.408 car_id=1 [info] Disconnecting ...
teslamate-1  | 2024-09-16 22:03:49.092 car_id=1 [info] Start / :online
teslamate-1  | 2024-09-16 22:03:49.105 car_id=1 [info] Connecting ...
teslamate-1  | 2024-09-16 22:03:49.923 [info] GET https://nominatim.dhuar.com/reverse -> 200 (814.300 ms)
teslamate-1  | 2024-09-16 22:03:49.939 car_id=1 [info] Charging / SOC: 72% / Home
teslamate-1  | 2024-09-16 22:03:49.939 car_id=1 [info] Disconnecting ...
teslamate-1  | 2024-09-16 22:12:11.399 [info] GET /
teslamate-1  | 2024-09-16 22:12:11.406 [info] Sent 200 in 7ms
teslamate-1  | 2024-09-16 22:47:49.993 [info] GET /
teslamate-1  | 2024-09-16 22:47:50.006 [info] Sent 200 in 10ms
teslamate-1  | 2024-09-16 22:47:56.158 [info] GET /settings
teslamate-1  | 2024-09-16 22:47:56.166 [info] Sent 200 in 7ms
teslamate-1  | 2024-09-16 23:33:08.559 car_id=1 [info] Charging / Complete / 13.52 kWh – 89 min
teslamate-1  | 2024-09-16 23:33:08.561 car_id=1 [info] Start / :online
teslamate-1  | 2024-09-16 23:33:08.570 car_id=1 [info] Connecting ...
teslamate-1  | 2024-09-16 23:36:12.621 car_id=1 [info] Suspending logging

Screenshots

561726593227_ pic
571726593550_ pic

Additional data

charges.csv

Type of installation

Docker

Version

1.30.1

@JakobLichterfeld JakobLichterfeld added undetermined Not sure if this is considered a real bug area:dashboard Related to a Grafana dashboard area:tesla api Related to the Tesla API labels Sep 18, 2024
@JakobLichterfeld
Copy link
Collaborator

Thanks for reporting. Can you elaborate a bit more?
Your screenshots show, that a charge starts, begins with zero power and then increased to 11 kW. As soon as charge is finished it drops to zero same as voltage. This seems expected behavior.

@oven1231231234
Copy link
Author

ok.
I will take a screenshot and label it during the next charging process.
Thanks

@oven1231231234
Copy link
Author

811728920139_ pic
Page1 The power value is not displayed, but the charging capacity is displayed。This page shows the real-time charging status

831728921585_ pic
Page2 The number of charging phases is not displayed. Power is not displayed either。This page is the charging record

@matthew0129
Copy link

I know you have to change CurrentChargeView.json
line 1742

original:
"rawSql": "SELECT $__timeGroupAlias(date,$__interval), avg(case when charger_phases >= 1 then (case when charger_phases = 2 then 3 when charger_phases = 1 then 1 else 0 end) * charger_actual_current * charger_voltage / 1000.0 else charger_power end) as "Power" FROM charges WHERE charging_process_id = $charging_processes AND $__timeFilter(date) GROUP BY 1 ORDER BY 1 ",

change to:
"rawSql": "(case when charger_phases >= 1 then (case when charger_phases = 3 then sqrt(3) * charger_actual_current * charger_voltage / 1000.0 when charger_phases = 2 then 3 * charger_actual_current * charger_voltage / 1000.0 when charger_phases = 1 then 1 * charger_actual_current * charger_voltage / 1000.0 else 0 end) else charger_power end) as "Power" FROM charges WHERE charging_process_id = $charging_processes AND $__timeFilter(date) GROUP BY 1 ORDER BY 1
",

But I can apply it. It did work. But I don't know how to save it. I cannot change from the Garafana UI.

@JakobLichterfeld
Copy link
Collaborator

@swiffer May I ask you to take a look into the proposed change?

@swiffer
Copy link
Contributor

swiffer commented Dec 8, 2024

@matthew0129 - CurrentChargeView.json is no dashboard available in TeslaMate, it's part of of TeslaMate Custom Grafana Dashboards.

Anyhow (same query used in charge-details.json): The solution proposed by @matthew0129 is adding a new case for charger_phases = 3, the issue reported by @oven1231231234 is occuring when charger_phases remain 0 for the whole drive. in that case charger_power is used directly, so it should always return the average.

@oven1231231234 - can you share the raw data (charges) of your charging_process?

query currently used (reformatted to make it easier to read):

SELECT
    $__timeGroupAlias(date,$__interval),
    avg(
        case
            when charger_phases >= 1 then (
                case
                    when charger_phases = 2 then 3
                    when charger_phases = 1 then 1
                    else 0
                end
            ) * charger_actual_current * charger_voltage / 1000.0
            else charger_power
        end
    ) as "Power" 
FROM charges
WHERE charging_process_id = $charging_process_id
GROUP BY 1 ORDER BY 1 

oh and both -> update to the latest version, totally worth it ;) also addresses making changes via Grafana UI ;)

@oven1231231234
Copy link
Author

oven1231231234 commented Dec 13, 2024

query currently used (reformatted to make it easier to read):

How can I query raw data?@swiffer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dashboard Related to a Grafana dashboard area:tesla api Related to the Tesla API undetermined Not sure if this is considered a real bug waiting for feedback
Projects
None yet
Development

No branches or pull requests

4 participants