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.

    Starting from an existing module?

    Scheduled Pinned Locked Moved Development
    6 Posts 2 Posters 750 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.
    • sifuhallS Offline
      sifuhall
      last edited by

      I saw in this post a couple of people recommend starting with an existing module when attempting to create your own module.

      I have a JSON command that returns information I was to display on my Magic Mirror.

      The only two variables I want to specify in the config are the device IDs to pass to the JSON command and the amount of time (in minutes?) I would like to refresh this data.

      What would be a good module to start with for these requirements?

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @sifuhall
        last edited by sdetweil

        @sifuhall what is the ‘json command’ written in? python?

        see my PythonPrint module
        https://github.com/sdetweil/MMM-PythonPrint

        which launches a python script, captures it’s print/stdout content, and sends it to the front end to process

        it can launch python scripts that output repeatedly over time, or it can launch a one time script on some timed cycle

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        sifuhallS 1 Reply Last reply Reply Quote 0
        • sifuhallS Offline
          sifuhall @sdetweil
          last edited by

          @sdetweil

          Thanks for the reply.

          The JSON command works from a browser.

          This is the command
          http://192.168.1.9/JSON?request=getstatus&ref=260,175,233

          260,175,233 would be the IDs I would like to pass

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @sifuhall
            last edited by sdetweil

            @sifuhall you should be able to do that right in the browser side with built in fetch()

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            sifuhallS 1 Reply Last reply Reply Quote 0
            • sifuhallS Offline
              sifuhall @sdetweil
              last edited by

              @sdetweil Thank you

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @sifuhall
                last edited by

                @sifuhall my SampleModule has all the parts. u won’t need the helper if fetch works

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • 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
                  OSZAR »