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.

    Notification Timer none dosent work

    Scheduled Pinned Locked Moved Solved Troubleshooting
    18 Posts 2 Posters 3.4k 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.
    • F Offline
      fischi87
      last edited by fischi87

      Hello guys I trigger a notification with a message but the timer dosend work. Here my simple code snippet:

      {
          commandId: "Finish",
          notiID: "SHOW_ALERT",
          notiPayload: { type: 'notification', message: 'Der Monitor ist eingeschaltet.', timer: 'none'}
        },
      

      the notification shows already fine but after 2 sek is not to see anymore. I want no timers the notification is always on. I hope u can understand me. I tried already with 0 but still doesn’t work.

      thanks

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

        @fischi87 notification has to time out, either the notification timer value or the display_time value

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @fischi87 the doc says do not specify timer

          Screenshot_20240220_170700_Chrome.jpg

          the doc ‘none’ answer means not specified by default

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          F 1 Reply Last reply Reply Quote 0
          • F Offline
            fischi87 @sdetweil
            last edited by fischi87

            @sdetweil

            do u have a idea how can i set none timer so the notification will display until i cancel it by my self?

            with my code the notification is displayed just 3 sek.

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

              @fischi87 just don’t specify the timer value

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              F 1 Reply Last reply Reply Quote 0
              • F Offline
                fischi87 @sdetweil
                last edited by fischi87

                @sdetweil how is it possible the make a notification what will display without a timer? i want show a notification and want cancel this notification by my self where my next question is, how can i cancel a notification, is there a way for it? like the alert.

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

                  @fischi87 just don’t add the timer: value in the notification you send

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  F 1 Reply Last reply Reply Quote 0
                  • F Offline
                    fischi87 @sdetweil
                    last edited by

                    @sdetweil this dont work, it displaed just 3 sek wihout the timer.

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

                      @fischi87 the doc says, if you don’t specify timer in a notification type, then the config option display_time will be used (and defaults to 3.5 seconds, 3500ms)

                      Screenshot_20240222_053646_Chrome.jpg

                      if you use an alert type , then no timer value will cause the message to be displayed til removed

                      note one has a type in the payload (notification type) and one does not (alert type)
                      Screenshot_20240222_054152_Chrome.jpg

                      so your notification should be

                      {
                          commandId: "Finish",
                          notiID: "SHOW_ALERT",
                          notiPayload: {  message: 'Der Monitor ist eingeschaltet.' }
                        },
                      

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      F 1 Reply Last reply Reply Quote 0
                      • F Offline
                        fischi87 @sdetweil
                        last edited by

                        @sdetweil

                        ur are right for the alert but with the type notification (SHOW_ALERT with type = notification) are 2 different things. if i send a show alert without a type it displed me the alert with blur background and so on and with the type: notification it shows me a little box with my message and this notification canceled after 3 sek. i didnt set a timer or a display_time, the alert shows as long i want but the notification canceld alter 3 sek. this is my problem!

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

                          @fischi87 yes, the doc says

                          if you don’t specify timer in a notification type, then the config option

                          display_time 
                          

                          will be used (and defaults to 3.5 seconds, 3500ms)

                          so, add a new property to the alert module config:{} block
                          (if it doesn’t have a config:{} block, add one)

                           display_time: 7*24*60*60*1000  // 7 days in milliseconds
                          

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          F 1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 1 / 2
                          • 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