• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-MQTT - JSON Syntax

Scheduled Pinned Locked Moved Solved Troubleshooting
3 Posts 2 Posters 532 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    Hilt
    last edited by May 2, 2023, 9:30 AM

    Hi all

    I’m trying to display MQTT data from my solar system battery logger so that a simple capacity percentage will display on the MagicMirror. I’m using the MMM-MQTT module. While the module loads up fine, it doesn’t seem to interpret the data and simply displays " Loading "

    I need to retrieve a particular value within the topic. That value has a label of capacityP. The Pi running MagicMirror has a Mosquitto broker installed natively. And if I query the MQTT topic, it’s receiving data correctly. I think where I’m falling short is the syntax around retrieving the capacityP value from the topic. Any ideas ? I’ve tried so many different options. But I just can’t get it right!

    	*{					
    		module: 'MMM-MQTT',
    		position: 'bottom_left',
    		header: 'SolarMD Battery',
    		config: {
    			mqttServer: 'mqtt://localhost',
    			port: '1883',
    			label: 'Charge Level',
    			decimals: 1,
    			topic: 'solarmd/energy/outputEnergy/bank1',
    			jsonpointer: '{"solarmd": {"energy": {"outputEnergy": {"bank1": {"capacityP"}}}}}',
    			suffix: '%'*
    

    MM Screenshot.png
    MQTT Explorer Screenshot.png

    M 1 Reply Last reply May 2, 2023, 4:19 PM Reply Quote 0
    • M Offline
      mumblebaj Module Developer @Hilt
      last edited by May 2, 2023, 4:19 PM

      @Hilt If you are using this MMM-MQTT module then your config does not look correct to me. Double check your config.

      {
          module: 'MMM-MQTT',
          position: 'bottom_left',
          header: 'MQTT',
          config: {
              mqttServers: [ 
                  //serverdetails goes here
                  subscriptions[{
                          topic: "",
                          label: "",
                          ...
                      }
                  ],
              ]
          }
      }
      

      Check out my modules at: https://github.com/mumblebaj?tab=repositories

      H 1 Reply Last reply May 8, 2023, 8:45 AM Reply Quote 0
      • H Offline
        Hilt @mumblebaj
        last edited by May 8, 2023, 8:45 AM

        @mumblebaj

        Thanks so much for the response. That syntax/config was the latest version ( of sooo many ) I tried where I just couldn’t get it to work

        I have since taken another route. I’m running Home Assistant and MQTT Docker containers on a Synology NAS. Home Assistant displays the info I need via a simple custom dashboard. I then use an iFrame on the Magic Mirror to display said data. Works a treat

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        1 / 1
        • First post
          1/3
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy