Magic Mirror info via MQTT

This post will show you how to show any sensor information whatsoever from Home Assistant in your Magic Mirror. I have used:

Node Red

MQTT (local or cloud)

Home Assistant

Magic Mirror

MQTT Module (MMM-MQTT)

Renault component for Home Assistant

The first thing would be to install MMM-MQTT as you normally install modules on your mirror. I have used many other modules designed for Home Assistant or specifically for any special vendor but by using the MQTT you can have total control.

I have done the configuration like below. After restarting the mirror you will see the module but without any values.

module: 'MMM-MQTT',
    position: 'top_right',
    header: 'Bil',
    config: {
        mqttServers: [
            {
                address: '192.168.0.1',  // Server address or IP address
                port: '1883',          // Port number if other than default
                subscriptions: [
                    {
                        topic: 'car/battery', // Topic to look for
                        label: 'Batteri', // Displayed in front of value
                        maxAgeSeconds: 60,    // Reduce intensity if value is older
						suffix: '%'
                    },
					{
                        topic: 'car/range', // Topic to look for
                        label: 'Räckvidd', // Displayed in front of value
                        maxAgeSeconds: 60,    // Reduce intensity if value is older
						suffix: 'km'
                    },
                  ]
            }
        ],
    }
},

Now make sure you have a mqtt broker configuration in Home Assistant configuration.yaml. I suppose you could add the component as a local add on if you are running hass.io. I am running my server in a local docker container and have a local mqtt broker as well an account on cloudmqtt. Both will work.

.

mqtt:
  broker: m10.cloudmqtt.com
  port: 100
  username: !secret mqttcloud_user
  password: !secret mqttcloud_password

I am using Node Red to push the sensor information to my MQTT broker. You can start out by creating an inject and push any topic like test/test to your broker. If you are using cloudmqtt you will see that the topic is received. Now you can try any existing sensor you have. Just create the state node and send it to mqtt. You can also modify the mirror module config to see if the test topic is shown on the mirror.

 

I have a Renault Zoe and wanted the battery and range status to be shown on my mirror. The first step ws to create the sensors in Home Assistant. Many Renault users has been migrated to the new myrenault from the old ze and this has not been working untin now. So this component is for the myrenault service.

I started but downloading it here and followed the instructions. Make sure you use the correct language settings. My sensors.yaml looks like this:

# CAR
- platform: renaultze
  name: MyCarBattery
  username: myemail@mydomain.se
  password: !secret renaultze_password
  vin: XXXXXXXXX
  android_lng: sv_SE
  
  
- platform: template
  sensors:
      mycar_remaining_range:
        value_template: "{{ state_attr('sensor.mycarbattery' , 'remaining_range') }}"
        friendly_name: "Range"
        unit_of_measurement: "km"

I have a Juicebox charger that gives me charging status so I did only use the range template sensor. Restart Home Assistant. The sensor should show like below.

Add the correct topic in Node Red and the mirror configuration. Restart. You should now see the battery status and the range of your Zoe on your mirror.