MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. MMRIZE
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    M
    Offline
    • Profile
    • Following 0
    • Followers 9
    • Topics 29
    • Posts 952
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: MMM-CalendarExt3 no Entries since last update

      @Andreas1956
      OK. Look inside deeper.

      1. Execute MM as dev mode.
      • If you are using pm2, stop it first.
      • In your MM directory, run this script.
      npm run start:dev
      
      1. Or alternatively, After MM’s normal execution, Ctrl + Shift + i (Or Alt+F12, it could be different by your system environment), Anyway, open the dev-console on the browser/client with hotkeys.

      2. It will open this kind of dev-console as a side panel.

      1e00b3f6-d008-47c9-ba17-796153605271-image.png

      1. At the panel, you can see Elements or Console tab. Go to Elements Tab.

      83c1acb2-4f63-4510-a27b-56d3a7664d98-image.png

      1. There would also be cursor icon (left side of the Elements Tab mark); select it and click to any event element

      28523e3f-0fec-4105-b8fe-34241127eac8-image.png

      1. Now, the side Elements tab will focus on the HTML code for the element you clicked.
        070d4a1e-643f-4597-b629-25a90d804b8c-image.png

      2. navigate into the title element

      cca41ebc-8b42-481a-990f-49b3d5952a8c-image.png

      1. Check whether proper text exists there.

      4359a8bb-f893-44b6-9806-6f38caa7dd56-image.png

      1. And See the Styles tab.(Somewhere in the side panel. Usually below the Elements window)

      39cd2337-4303-4ea2-afc2-00ef9193b41d-image.png

      You can see there are --calendarColor and oppositeColor attributes there. And there is no other overridden colors.

      1. Or you can check this in Computed tab.

      be8733f9-f456-4be7-9691-3e3001752b1b-image.png

      There are some calculated results for the style.

      Could you find any suspicious things on watching your case?

      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-CalendarExt3 no Entries since last update

      @Andreas1956
      I checked your config and css but nothing seems wrong.
      From which version were you updated to new one? (I think you cannot remember, but how long has it been since the previous update?)
      Anyway, I think you may have missed something in the last update.

      1. Go to the CX3 module directory, then;
      git pull
      npm update
      

      I doubt you may miss npm update part in your last update process.

      1. If it still does not work, do this in your CX3 module directory
      git submodule update --init --recursive
      
      1. Still not working; remove the CX3 directory and then reinstall again.

      2. Still not working; let’s discuss deeper.

      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-CalendarExt3 no Entries since last update

      @Andreas1956
      Not tested yet… but .CX2 in css/custom.css ???

      posted in Troubleshooting
      M
      MMRIZE
    • RE: Modulo MMM-TelegramBot screenshot

      @nic0rz
      To avoid this, the module had to send the image as a file, not an image. But in that case, the preview of the image will not work in the Telegram App. Dillemma. (I’ll consider enabling the selection both ways.)

      posted in Troubleshooting
      M
      MMRIZE
    • RE: Modulo MMM-TelegramBot screenshot

      @nic0rz
      Telegram mobile app will reduce the size of the same image than the desktop app.

      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-CalendarExt3 no Entries since last update

      @Andreas1956
      Share me the config and custom.css.

      posted in Troubleshooting
      M
      MMRIZE
    • RE: Switch URL based on value

      @htilburgs
      Just for your reference

      const ip_a = "..."
      const ip_b = "..."
      
      const apiQuery = (index, url) => {
        if (!url) return Promise.reject({ index, reason: 'url is not defined' })
        return new Promise((resolve, reject) => {
          try {
            fetch(url)
              .then(response => response.json())
              .then(data => {
                resolve({ index, value: data })
              })
              .catch(error => {
                reject({ index, reason: error })
              })
          } catch (error) {
            reject({ index, reason: error })
          }
        })
      }
      
      const queries = []
      queries.push(apiQuery('A', ip_a))
      queries.push(apiQuery('B', ip_b))
      Promise.allSettled(queries).then((results) => {
        console.log('All jobs are done')
        results.values().forEach((result) => {
          if (result.status === 'fulfilled') {
            console.log(`Index: ${result.value.index}, Value:`, result.value.value)
          } else {
            console.log(`Index: ${result.reason.index}, Error:`, result.reason.reason)
          }
        })
      })
      
      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-CalendarExt3

      @Ragged4310

      See the green events
      0771ed78-ac78-4934-a294-ffb5c971240e-image.png

      b4009779-62fa-4c74-975d-5d5460f16111-image.png

      eventPayload in CX3 config;

      /* CX3 config section in `config/config.js` */
      eventPayload: (payload) => {
      	const targetCalendar = "Reservation"
      	const divideGap = 1000 * 60 * 60 * 1
      	const locale = 'en-US'
      	const timeStyle = { timeStyle: 'short' }
      
      	const condition = (ev) => { return (ev.calendarName === targetCalendar && ev.fullDayEvent === false) }
      	const target = payload.filter(condition).sort((a, b) => a.endDate - b.endDate)
      	const result = payload.filter(e => !condition(e))
      	const dateStr = (dateValue) => Intl.DateTimeFormat(locale, timeStyle).format(new Date(+dateValue))
      	const collapse = (template, ev) => {
      		if (!template?.["title"]) template = { ...ev, collapseCount: 0, description: '', location: '' }
      		template.collapseCount++
      		template.startDate = String(Math.min(+template.startDate, +ev.startDate))
      		template.endDate = String(Math.max(+template.endDate, +ev.endDate))
      		template.title = `${dateStr(template.startDate)} - ${dateStr(template.endDate)}`
      		if (template.collapseCount > 1) template.title += ` <span class="count">${template.collapseCount}</span>`
      		template.description += `<div class="collapsedEvent">
      			<p class="title">${ev.title}</p>
      			<p class="period">${dateStr(ev.startDate)} - ${dateStr(ev.endDate)}</p>`
      		if (ev.description) template.description += `<p class="description">${ev.description}</p>`
      		if (ev.location) template.description += `<p class="location">${ev.location}</p>`
      		template.description += '</div>'
      		return template
      	}
      	const dateKey = (dateValue) => new Date(+dateValue).toLocaleDateString('en-CA')
      	let collapsedEvent = {}
      	for (const ev of target) {
      		const currentKey = dateKey(ev.startDate)
      		if (!collapsedEvent?.[ 'title' ]) {
      			collapsedEvent = collapse(collapsedEvent, ev)
      			continue
      		}
      		const collapsedKey = dateKey(collapsedEvent.startDate)
      		if (collapsedKey !== currentKey || +ev.startDate - +collapsedEvent.endDate > divideGap) {
      			result.push(collapsedEvent)
      			collapsedEvent = collapse({}, ev)
      		} else {
      			collapsedEvent = collapse(collapsedEvent, ev)
      		}
      	}
      	if (collapsedEvent?.[ 'title' ]) result.push(collapsedEvent)
      	return result
      }
      

      You can modify targetCalendar, divideGap, locale ande timeStyle for your purpose.

      To beautify;

      /* css/custom.css */
      .CX3 .event.calendar_Reservation .headline .time {
        display: none;
      }
      
      #CX3_POPOVER .title .count,
      .CX3 .calendar_Reservation .title .count {
        font-weight: bold;
        color: gray;
      }
      
      #CX3_POPOVER .title .count::before,
      .CX3 .calendar_Reservation .title .count::before {
        content: "[";
      }
      
      #CX3_POPOVER .title .count::after,
      .CX3 .calendar_Reservation .title .count::after {
        content: "]";
      }
      
      #CX3_POPOVER .description .collapsedEvent {
        line-height: 115%;
        border-bottom: 2px solid silver;
      
        p {
          margin-top: 0;
          margin-bottom: 0;
        }
      
        .title {
          font-weight: bold;
        }
      
        .period {
          text-align: right;
        }
      
        .description {
          font-style: italic;
          white-space: pre;
          padding-left: 20px;
        }
      
        .location {
          font-style: italic;
          text-align: right;
        }
      }
      
      posted in Utilities
      M
      MMRIZE
    • RE: MMM-CalendarExt3

      @Ragged4310
      Sure, that’s doable. There’s no reason why it shouldn’t be possible.

      This kind of work is domain analysis, which is basically my real-world job.

      However, it’s not exactly simple. By simple, I mean it’ll take more than the usual 10 minutes I’d spend diving into this hobby project that genuinely interests me.

      And honestly, my rate is quite high. :D (Just kidding.)

      Let’s clarify a few things first.

      • CX3 is usually useful for viewing events from multiple calendars at once, so you’re probably using other types of calendars (e.g., personal meetings, family schedules) together. For this task, let’s assume that the target “customer reservation” events are in a separate, independent calendar. For convenience, I’ll call this calendar “Reservation” from now on.
      • Given the nature of calendars, I assume that there won’t be any overlapping events in the Reservation calendar. Additionally, I’ll assume there are no full-day events or events that span midnight.

      With these assumptions, I’ll give it a shot sometime tomorrow when I have some free time. I can’t make any promises, so please don’t get your hopes up too high.

      posted in Utilities
      M
      MMRIZE
    • RE: Multiple URL Querys to fill JSON

      This is not a direct answer to the question, but just for your reference.
      The fetch API can be executed directly in the browser, not just in a Node.js environment. You can call the fetch API directly in MMM-MyModule.js without needing node_helper.js.

      Additionally, since the fetch API works asynchronously, you can manage the responses of two fetch calls as follows:

      • If you need to use the response that arrives first, use Promise.race() or Promise.any().
      • If you need to wait for both responses to arrive before proceeding, use Promise.all().

      Using these methods can help you manage data synchronization more efficiently.

      posted in Troubleshooting
      M
      MMRIZE
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 95
    • 96
    • 4 / 96