Heating timer in the MG iSmart app

baader

Standard Member
Joined
Nov 28, 2023
Messages
36
Reaction score
11
Points
9
Location
CZECH
Driving
MG4 SE LR
Hi, is it possible to set a timer in the MG iSmart app for when the vehicle should be heated? Or do I have to do it manually in the app each time?
 
If you mess about with MQTT and Home Assistant you can schedule cabin heating but that isn't via ismart
 
Home Assistant I have. Can you please give me instructions on how to integrate the controls? Thank you
 
Home Assistant I have. Can you please give me instructions on how to integrate the controls? Thank you
It will log you out of ismart as it pretends to be ismart.

I'm not at my computer at the mo I'll post how to setup when I'm on it.

Do you know how to use docker?
 
I'm not sure what docker means. I use this version of HA on a Raspberry Pi.
 

Attachments

  • HA.jpg
    HA.jpg
    29.5 KB · Views: 37
on your RaspberryPI, log into the command line and do the following:

install docker via the shell:
Bash:
sudo apt install docker

install MQTT into Docker:
Bash:
sudo docker run -it -d --name mosquitto --network host -p 1883:1883 -p 9001:9001 -v /mosquitto/mosquitto.conf:/usr/mosquitto/config/mosquitto.conf eclipse-mosquitto

configure MQTT on docker:
Bash:
sudo docker ps

Copy the Docker ID of the container
Bash:
docker exec -it [CONTAINER ID HERE] sh

inside the docker shell (Replace [MQTT USERNAME] with your chosen username):
Bash:
mosquitto_passwd -c /mosquitto/config/passwordfile.txt [MQTT USERNAME]

On the next prompt enter your MQTT Password, and confirm it on the 2nd prompt.
Exit Docker Shell:
Bash:
Exit

Populate MQTT Config:
Bash:
sudo nano /mosquitto/config/mosquitto.conf

Crtl + A all the text, and delete, paste the following:
Bash:
allow_anonymous false
listener 1883
listener 9001
password_file /mosquitto/config/passwordfile.txt
Ctrl + X, then press Y and enter

This is MQTT Configured, now to load in the MQTT-SAIC Gateway which interfaces with the SAIC Servers and your car.

in the shell (Replacing [MG iSmart... ], [MQTT... ] & [IP ADDRESS... ] with your values make sure you remove the [ ] also):
Bash:
sudo docker run -ti \
    -e "-u [MG iSmart USERNAME]" \
    -e "-p [MG iSmart PASSWORD]" \
    -e "--mqtt-user [MQTT USERNAME]" \
    -e "--mqtt-password [MQTT PASSWORD]" \
    -e "--mqtt_uri tcp://[IP ADDRESS OF MQTT SERVER]:1883" \
    saicismartapi/saic-python-mqtt-gateway
(NOTE: iSMART Will now log you out ofyour phone as it believes you have logged into another phone)

then in Home Assistant go to add integration, and add MQTT, and enter your MQTT server details, namely Server IP Address, Username and Password, and it will auto discover and setup all the known parts of the API that have been reverse engineered.

Once MQTT has discovered all of the API points exposed by the reverse engineered API, you can see them in settings >> integrations >> MQTT on Home Assitant.

Go to settings >> automations and scenes

Select create automation >> create new automation

Add Tigger >> Time (Enter your chosen time)

(It takes 2 API calls to run remote heating)

Add Actions >> Device (Enter the car name I renamed mine in MQTT to "MG4 SE SR")
Action "Change HVAC mode on Remote Air-Con"
HVAC MODE >> Select "AUTO"
Add Actions >>
Device (Enter the car name I renamed mine in MQTT to "MG4 SE SR")
Action "Change preset on Remote Air-Con"
PRESET MODE >> Select "On"

and then save.

this will at your preset time run the HVAC system to preheat the cabin, you can add other criteria to the automation such as temp ranges etc, but this is a basic over view of how to do it, and the HVAC will only run for 10Mins like when prompted via iSmart as it is using the official API calls just in a non-official way.
 

Are you enjoying your MG4?

  • Yes

    Votes: 509 79.3%
  • I'm in the middle

    Votes: 86 13.4%
  • No

    Votes: 47 7.3%
Support us by becoming a Premium Member

Latest MG EVs video

MG3 Hybrid+ & Cyberster Configurator News + hot topics from the MG EVs forums
Subscribe to our YouTube channel
Back
Top Bottom