• 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.

Starting from an existing module?

Scheduled Pinned Locked Moved Development
6 Posts 2 Posters 734 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.
  • S Offline
    sifuhall
    last edited by Jan 6, 2022, 9:40 PM

    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 Jan 6, 2022, 10:02 PM Reply Quote 0
    • S Away
      sdetweil @sifuhall
      last edited by sdetweil Jan 6, 2022, 10:04 PM Jan 6, 2022, 10:02 PM

      @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

      S 1 Reply Last reply Jan 6, 2022, 10:05 PM Reply Quote 0
      • S Offline
        sifuhall @sdetweil
        last edited by Jan 6, 2022, 10:05 PM

        @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 Jan 6, 2022, 10:47 PM Reply Quote 0
        • S Away
          sdetweil @sifuhall
          last edited by sdetweil Jan 6, 2022, 10:52 PM Jan 6, 2022, 10:47 PM

          @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

          S 1 Reply Last reply Jan 6, 2022, 11:20 PM Reply Quote 0
          • S Offline
            sifuhall @sdetweil
            last edited by Jan 6, 2022, 11:20 PM

            @sdetweil Thank you

            S 1 Reply Last reply Jan 7, 2022, 12:12 AM Reply Quote 0
            • S Away
              sdetweil @sifuhall
              last edited by Jan 7, 2022, 12:12 AM

              @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
              1 / 1
              • First post
                6/6
                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