SAIC-iSmart-API/saic-home-assistant-addon

Questions about implementing custom cards

Closed this issue · 8 comments

MG ZS EV owner and fellow dev here.
First of all this is INCREDIBLE. I was ecstatic when I found out about this integration and most of the time it works amazingly well 🤘🤘🤘

I'm a FE engineering mostly and I want to contribute and craft some fancy custom UI cards to this repo with car-specific graphics and animations :) I have few questions:

  1. The way climate controls works in the iSmart app is that you pick a temperature and then "send" it to the car:

iSmart:

WhatsApp Image 2024-01-14 at 14 19 10_90fd7d7c

HA climate:

image

Climate devices work differently in HA, first they need to be turned on, only then can you control the temperature.
This works a little clunky in terms of UI, because of the async communication with the car. If you turn on the AC via the HA SAIC gateway, it takes a while for the "on" state to register in the UI, so the UI won't let you allow you to set the temperature. So instead of selecting the temp and hitting "send" like in iSmart which takes a few secs, it takes 30-60 secs using the HA integration because of the state delay.
If I implement a custom UI for an iSmart-like interface, how can I interface with the API to make the actual call to run the AC?

  1. Is there a way to have a "refresh" button\action so that you can explicitly call refresh, say, on panel load? (iSmart has this implementation with pull-to-refresh)

Hi, i'm using the python gateway, it looks like this:

Screenshot 2024-01-16 22 30 35

In this version you can change the temperature any time you want without activating the heater. So it's possible to set it to 22°C and start the heater by changing the mode to auto. Additionally it has mqtt auto-discovery, so you don't need to create the sensors or switches yourself.

Generally you can do whatever you want with mqtt publish. Creating buttons or automation... Refresh is possible by sending "force" to saic/****/*****/refresh/mode/set, so its pretty easy.

While using the app the car gets awake from sleep before you can see any information (refresh). But the gateway needs time to wake the car up too. That's the reason for the delay by setting the heater on.

Thanks!

To clarify the sensors\controls did get auto-created for me - but the curious thing though... I'm not getting the plus/minus or circle temp control on my card.
Do you mind posting your YAML for the card?

Also - even the default controls (those you get by clicking the auto-created "vehicle climate") don't have the temp set controls.
Maybe the MG ZS EV reports something differently to the gateway than the MG5?
Happy to help debug

image

It's a climate (mqtt) entity which was automatically created by auto discovery.

It's not my code, but i can take a look at this.

Seems to be a known problem: SAIC-iSmart-API/saic-python-mqtt-gateway#125

You can try to set an initial temperature to the following topic and restart the gateway:

saic/<EMAIL>/vehicles/<VIN>/climate/remoteTemperature

This worked perfectly, thank you so much