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 803 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

      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

      mumblebajM 1 Reply Last reply Reply Quote 0
      • mumblebajM Offline
        mumblebaj Module Developer @Hilt
        last edited by

        @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
        Check my blog-post: https://mumblebaj.xyz/
        Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

        H 1 Reply Last reply Reply Quote 0
        • H Offline
          Hilt @mumblebaj
          last edited by

          @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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            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