MG Motor Mg5 Electric Car Integration

Someone on the MG forums suggested changing the picture to monochrome with a picture editor, which I had a little trouble doing to get a dark enough grey from the original orange but they posted one they created, so I flipped that to portrait and have this so far:

I think portrait mode gives a bit more room to place info icons on the phone screen. I might add a couple of extra things, e.g. the range estimate, odometer.

I also found this site:
https://www.the-blueprints.com/vectordrawings/show/28488/mg_4_ev/

Like you I need to learn how to use icons for things like battery status, whether charger plugged in/charging, if aircon control can go on the image.

1 Like

Added a couple of extras. Easy to overwhelm the image.

The range estimate number is anomalous, that will correct itself.

1 Like

I took inspiration and created a modified version of displaying entities in an image.

4 Likes

Fwiw:
When I added the token with dashes instead of underscores it worked straight away:

- ABRP_USER_TOKEN=LSJE53458PT054876=gs750ap6-587a-1504-xs58-12345s87f584

Iā€™m trying to run the mqtt gateway via docker. My MQTT container is in the same stack.

Everything can connect to the mqtt container such as zigbee2mqtt and other docker containers but I canā€™t get this gateway to connect even if I run under host mode.

Iā€™m mqtt is anonymous. Logs just suggest connection refused.

The car (MG4) refuses to charge after the EVSE (Wallbox Pulsar Plus) has been on ā€˜Pauseā€™ for a while.

I run an automation on the EVSE to start charging when the Solar inverter (SMA) voltage rises too high. This to prevent the solar system from shutting down. With my Polestar connected this works great, during a two week vacation it prevented dozens of solar system shutdowns.

However with the MG4 it does not (always) work. When the EVSE has been on ā€˜Pauseā€™ for a wile, then when the automation kicks in and wants to car to charge, the car does not accept a charge, the EVSE status goes into ā€˜Waiting for car demandā€™.

What is causing this behavior, what could a work around be?

Behavior:

  • MG4 connected at 11:50
  • paused from 11:50 to 12:10
  • charging from 12:10 to 12:18 (based on solar inverter voltage)
  • paused from 12:18 to 16:03, at 16:03 charge initiated, but not starting
  • waiting for demand from 16:03 on, charging not accepted by the car

PS
This behavior also makes that the scheduled charge automation does not always work.

The only way to start charging again that I could find is to physically disconnect the car and reconnect it again (hard to do from 1000 miles away). Also forcing a refresh does not re-enable charging.

Iā€™m not sure but this issue seems unrelated to the MG integration.

I would agree. Not the MG integration, not the EVSE integration, not the HA automation. It seems to be the reaction of the car to the EVSE switching on and off (more precisely in and out of ā€˜pausedā€™).

I canā€™t figure out what causes this. Sometimes it works fine a whole day, sometimes it fails after the the first switch. Just wondering if anybody else has seen this work or fail and if there is a fix.

Iā€™m clearly just guessing here, but have you checked in your car settings so there is no scheduled charge set?

Hi all, itā€™s an amazing feature that Iā€™d like to use for my MG5!
I have some questions:

  • is it possible to use it to retrieve history of charge sessions and how much power was taken?
  • is it only linked to saic api or does it need OBD plug?
  • is it possible to use it for change charge settings: schedule, targetā€¦?
    Thank you very much for your work!

There is a power sensor and a sensor for plugged-in.
You should be able to feed the power sensor to a utility meter when ever the plugged-in sensor is ā€˜onā€™

ODB plug is not required

Yes.
There are settings for Target SOC, current adjustment for 6/8/16 and Max amps, a toggle to start and stop charging, start and stop times, and a selection for charge till target SOC or till stop time.

@wattmatters are you able to share the yaml for the latest versions of your dashboards?

I find it difficult to separate out the yaml from all my other dashboard code. Iā€™m no coder so unfamiliar with whatever useful editing tools there are that might help with this.

This is the dashboard intended for our phones, with the overhead car image. It is placed inside of a 1 card panel (not masonry or side panel view).

Hopefully enough in there to help with the larger dashboard I have for the computer screen, as extracting that from everything else I have on my dashboard is too much.

title: Home
views:
  - icon: mdi:car
    title: MG
    path: e
    type: panel
    badges: []
    cards:
      - type: vertical-stack
        cards:
          - type: picture-elements
            image: local/community/MG4-top-grey1.jpeg
            elements:
              - type: state-badge
                entity: sensor.lsjwhXXXXXX_soc
                style:
                  top: 10%
                  left: 44%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: sensor.lsjwhXXXXXX_range
                style:
                  top: 10%
                  left: 56%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-icon
                entity: binary_sensor.lsjwhXXXXXX_battery_charging
                style:
                  top: 9.5%
                  left: 50%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: lock.lsjwhXXXXXX_doors_lock
                style:
                  top: 60%
                  left: 50%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: lock.lsjwhXXXXXX_boot_lock
                style:
                  top: 85%
                  left: 50%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: climate.lsjwhXXXXXX_vehicle_climate
                style:
                  top: 45%
                  left: 56%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: sensor.lsjwhXXXXXX_interior_temperature
                style:
                  top: 45%
                  left: 44%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: sensor.lsjwhXXXXXX_tyres_front_left_pressure
                style:
                  top: 30%
                  left: 21%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: sensor.lsjwhXXXXXX_tyres_front_right_pressure
                style:
                  top: 30%
                  left: 78.5%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: sensor.lsjwhXXXXXX_tyres_rear_left_pressure
                style:
                  top: 71%
                  left: 21%
                  '--ha-label-badge-title-font-size': 0em
              - type: state-badge
                entity: sensor.lsjwhXXXXXX_tyres_rear_right_pressure
                style:
                  top: 71%
                  left: 79%
                  '--ha-label-badge-title-font-size': 0em
          - type: horizontal-stack
            cards:
              - type: gauge
                entity: sensor.lsjwhXXXXXX_soc
                name: SOC
                needle: true
                segments:
                  - from: 0
                    color: '#FF0000'
                  - from: 1.47
                    color: '#FF0F00'
                  - from: 2.94
                    color: '#FF1E00'
                  - from: 4.41
                    color: '#FF2D00'
                  - from: 5.88
                    color: '#FF3C00'
                  - from: 7.35
                    color: '#FF4B00'
                  - from: 8.82
                    color: '#FF5A00'
                  - from: 10.29
                    color: '#FF6900'
                  - from: 11.76
                    color: '#FF7800'
                  - from: 13.24
                    color: '#FF8700'
                  - from: 14.71
                    color: '#FF9600'
                  - from: 16.18
                    color: '#FFA500'
                  - from: 17.65
                    color: '#FFB400'
                  - from: 19.12
                    color: '#FFC300'
                  - from: 20.59
                    color: '#FFD200'
                  - from: 22.06
                    color: '#FFE100'
                  - from: 23.53
                    color: '#FFF000'
                  - from: 25
                    color: '#FFFF00'
                  - from: 26.57
                    color: '#F7FD00'
                  - from: 28.14
                    color: '#F0FC00'
                  - from: 29.71
                    color: '#E9FA00'
                  - from: 31.29
                    color: '#E1F900'
                  - from: 32.86
                    color: '#DAF701'
                  - from: 34.43
                    color: '#D3F601'
                  - from: 36
                    color: '#CCF401'
                  - from: 37.57
                    color: '#C4F301'
                  - from: 39.14
                    color: '#BDF101'
                  - from: 40.71
                    color: '#B6F002'
                  - from: 42.29
                    color: '#AEEE02'
                  - from: 43.86
                    color: '#A7ED02'
                  - from: 45.43
                    color: '#A0EC02'
                  - from: 47
                    color: '#99EA02'
                  - from: 48.57
                    color: '#91E903'
                  - from: 50.14
                    color: '#8AE703'
                  - from: 51.71
                    color: '#83E603'
                  - from: 53.29
                    color: '#7BE403'
                  - from: 54.86
                    color: '#74E303'
                  - from: 56.43
                    color: '#6DE104'
                  - from: 58
                    color: '#66E004'
                  - from: 59.57
                    color: '#5EDE04'
                  - from: 61.14
                    color: '#57DD04'
                  - from: 62.71
                    color: '#50DC04'
                  - from: 64.29
                    color: '#48DA05'
                  - from: 65.86
                    color: '#41D905'
                  - from: 67.43
                    color: '#3AD705'
                  - from: 69
                    color: '#33D605'
                  - from: 70.57
                    color: '#2BD405'
                  - from: 72.14
                    color: '#24D306'
                  - from: 73.71
                    color: '#1DD106'
                  - from: 75.29
                    color: '#15D006'
                  - from: 76.86
                    color: '#0ECE06'
                  - from: 78.43
                    color: '#07CD06'
                  - from: 80
                    color: '#00CC07'
                  - from: 81.18
                    color: '#08C410'
                  - from: 82.35
                    color: '#10BC19'
                  - from: 83.53
                    color: '#18B422'
                  - from: 84.71
                    color: '#20AC2B'
                  - from: 85.88
                    color: '#28A434'
                  - from: 87.06
                    color: '#309C3D'
                  - from: 88.24
                    color: '#389446'
                  - from: 89.41
                    color: '#408C4F'
                  - from: 90.59
                    color: '#488458'
                  - from: 91.76
                    color: '#507C61'
                  - from: 92.94
                    color: '#58746A'
                  - from: 94.12
                    color: '#606C73'
                  - from: 95.29
                    color: '#68647C'
                  - from: 96.47
                    color: '#705C85'
                  - from: 97.65
                    color: '#78548E'
                  - from: 98.82
                    color: '#804C97'
                  - from: 100
                    color: '#8845A1'
                unit: '%'
              - type: tile
                entity: sensor.lsjwhXXXXXX_range
                icon: mdi:map-marker-distance
                name: Range
                vertical: true
              - type: custom:mushroom-entity-card
                entity: sensor.lsjwhXXXXXX_auxiliary_battery_voltage
                layout: vertical
                name: Aux Battery
          - type: horizontal-stack
            cards:
              - type: custom:mushroom-entity-card
                entity: binary_sensor.lsjwhXXXXXX_charger_connected
                name: Charger
                layout: vertical
                primary_info: none
              - type: custom:mushroom-entity-card
                entity: binary_sensor.lsjwhXXXXXX_battery_charging
                name: Charging?
                layout: vertical
                primary_info: none
              - type: custom:mushroom-entity-card
                entity: sensor.lsjwhXXXXXX_power
                name: Power
                layout: vertical
                primary_info: none
          - type: horizontal-stack
            cards:
              - type: thermostat
                entity: climate.lsjwhXXXXXX_vehicle_climate
                name: Car Aircon
                show_current_as_primary: true
                features:
                  - type: climate-hvac-modes
                    hvac_modes:
                      - 'off'
                      - auto
              - type: vertical-stack
                cards:
                  - type: custom:mushroom-entity-card
                    entity: counter.ev_days_since_100_soc
                    name: Days Since 100% SOC
                    layout: vertical
                  - type: custom:mushroom-number-card
                    entity: number.lsjwhXXXXXX_target_soc
                    layout: vertical
                    name: Target SOC
          - type: horizontal-stack
            cards:
              - type: custom:mushroom-lock-card
                entity: lock.lsjwhXXXXXX_doors_lock
                name: Doors
              - type: custom:mushroom-lock-card
                entity: lock.lsjwhXXXXXX_boot_lock
                name: Boot
          - type: horizontal-stack
            cards:
              - type: tile
                entity: sensor.lsjwhXXXXXX_mileage
                icon: mdi:counter
                name: Odometer
                show_entity_picture: false
                vertical: false
                color: accent
              - type: tile
                entity: sensor.ev_mileage_monthly
                color: accent
                name: Monthly km