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

    Posts

    Recent Best Controversial
    • RE: MMM-Temperature uncaught exception...

      @Brown19

      Just released the new version 0.0.8 which (hopefully) fixes the problem.

      I integrated your script, too. But i named it sht31d.

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: MMM-Temperature uncaught exception...

      @sdetweil @Brown19
      Hi,

      i did some more investigation today and think i found a solution.
      Although the exception looks different i think the problem is the execSync command.
      The only way i was able to fix it is to use spawnSync.

      But i can not say where or why the problem happens.
      I tried different node versions (latest 16, 18, 20) and different electron versions (25.3.0, 25.3.2 and 25.4.0) with execSync.

      I will release a new version of MMM-Temperature today which uses spawnSync instead of execSync.

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: MMM-Temperature uncaught exception...

      @sdetweil Hi Sam, it looks like both MMM-Temperature and MMM-Tools cause the error.

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: MMM-Temperature uncaught exception...

      @Brown19
      Hi,

      today i installed a new instance of MagicMirror 2.24.0 with both your node version 18 any my current used one (16).
      In the installation which uses electron i can reproduce the error now. But i am pretty sure this is a problem related to the combination of the version 2.24.0 and the used electron version.
      I found this thread with the same error but MMM-Tools instead in the forum of bogusnet, too.
      It might be a general MagicMirror issue and not a problem of the module.

      Maybe one of the core developers can have a look into it. I never had been that deep in the MagicMirror code and do not have much time to investigate the problem at the moment.

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: MMM-Temperature uncaught exception...

      @Brown19 Do you see any errors in the development console of the browser?

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: MMM-Temperature uncaught exception...

      @Brown19

      I tried your script and the current version of the module in both of my setups (2.24.0 native and 2.25.0-develop container) and do not have any problems.

      As i wrote already the problem looks like there is problem during communication between the node_helper.js and the frontend (either electron or the browser of your choice).

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: apt upgrade question

      @ankonaskiff17 Hi,

      it’s basically the same but not exactly…

      • apt full-upgrade upgrades all packages and removes old versions of the packages
      • apt dist-upgrade upgrades all packages and removes old versions but it tries to figure out which upgrade is more “worthful” if there are occur conflicts cause of the upgrades
      • apt update updates the locally saved list of available packages by downloading the current package list of all configured repositories
      • apt is the new replacement command of apt-get
      posted in General Discussion
      wishmaster270W
      wishmaster270
    • RE: MMM-Temperature uncaught exception...

      @Brown19 Hi,

      your python script looks good to me and also the output of node_helper till the moment it tries to send the data to the frontend.
      Can you provide your MagicMirror and nodejs version information to me, please?

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: Display image based on state or time

      @chimera Hi and sure,

      just tested a config which uses the values send by MQTT directly to decide which icon to display:

      var mqttHook = [
          {
            mqttTopic: "magicmirror/tarrif/set",
            mqttPayload: [
              {
                mqttNotiCmd: ["energy_tarrif_value"]
              }
            ]
          }
        ];
      var mqttNotiCommands = [
          {
            commandId: "energy_tarrif_value",
            notiID: "ENERGY_TARRIF"
          }
        ];
      
        module.exports = { mqttHook,  mqttNotiCommands};
      
      {
      	module: "MMM-MQTTbridge",
      	disabled: false,
      	config: {
      		mqttServer: "mqtt://my_user:my_pass@my_server:the_port",
      		mqttConfig: {
      			listenMqtt: true,
      		},
      	}
      },
      {
      	module: "MMM-ValuesByNotification",
      	position: "top_left",
      	header: "Energy",
      	config: {
      		updateInterval: 10,
      		reuseCount: 90,
      		valuePositions: "i",
      		valueNaPositions: "i",
      		itemPositions: "e",
      		groupPositions: "e",
      		groups: [
      			{
      				items: [
      					{
      						notification: "ENERGY_TARRIF",
      						valueImgIcon: "modules/MMM-ValuesByNotification/icons/tom.jpg",
      						values: [
      							{
      								jsonpath: "state",
      								thresholds: [
      									{
      										type: "eq",
      										value: "PEAK",
      										valueImgIcon: "modules/MMM-ValuesByNotification/icons/peak.jpg",
      									},
      									{
      										type: "eq",
      										value: "OFF-PEAK",
      										valueImgIcon: "modules/MMM-ValuesByNotification/icons/off-peak.jpg",
      									},
      									{
      										type: "eq",
      										value: "NIGHT",
      										valueImgIcon: "modules/MMM-ValuesByNotification/icons/night.jpg",
      									},
      								]
      							},
      						]
      					},
      				]
      			},
      		]
      	},
      },
      

      Explanation…

      MMM-MQTTbridge:

      • The module connects to the MQTT-Server my_server to port the_port with user my_user and password my_pass
      • As listenMqtt is set to true the settings in mqttDictionary.js are used which results in:
        • If a message to mqttTopic magicmirror/tarrif/set is received the message is processed by the mqttNotiCmd energy_tarrif_value
        • As no payloadValue is specified the command is called independent of the message that is send to the topic
        • As no notiPayload is set in the command configuration but the notiID ENERGY_TARRIF every time a message is received of the specified topic a notification is send to all other modules with notification id ENERGY_TARRIF and the original MQTT message as payload

      MMM-ValuesByNotification:

      • the module refreshes every ten seconds as updateInterval is set to 10
      • if no new notification is received for a configured notification of a item but the module refreshes it will reuse the last received value for a maximum of 90 times (reuseCount)
      • As valuePositions and valueNaPositions are set to i only a specified icon will be displayed instead of the value itself (which will be v or if both should be displayed vi; see Positions-Documentation for more info)
      • As itemPositions and groupPositions are both set to e only the elements and no additional titles (t) or icons (i) are displayed ( see Positions-Documentation for more info)
      • A single group with one item which contains one value is specified
      • The values of the item use the payload of the notification with id ENERGY_TARRIF
      • As default icon a image for the value (valueImgIcon) is used which has the path modules/MMM-ValuesByNotification/icons/tom.jpg (see Icon-Documentation for more details)
      • The value element selects the content with jsonpath state as its value. This means the payload of the notification is parsed as JSON and the value which is used in further processing is the content of the state element. This can be everything the HomeAssistant sends but should be either PEAK, OFF_PEAK or NIGHT
      • As there are thresholds specified they are validated against the previously selected state
        • If the payload is equal to (eq) to the value PEAK the path of the valueimgIcon is changed to modules/MMM-ValuesByNotification/icons/peak.jpg
        • If the payload is equal to (eq) to the value OFF_PEAK the path of the valueimgIcon is changed to modules/MMM-ValuesByNotification/icons/off-peak.jpg
        • If the payload is equal to (eq) to the value NIGHT the path of the valueimgIcon is changed to modules/MMM-ValuesByNotification/icons/night.jpg

      Directly after the start the MMM-ValuesByNotification module will display the default icon. Every 10 seconds it refreshes. If a message for the specified topic is received by MMM-MQTTbridge the notification is send. The next time the module refreshes it will validate the message content and changes the icon depending on the content.

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • RE: Display image based on state or time

      @chimera Hi and no problem, great you found a solution. My modules are much more complicated in this situation.

      posted in Troubleshooting
      wishmaster270W
      wishmaster270
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 33
    • 34
    • 6 / 34