• 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
  1. Home
  2. Tuxdiver
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
T
Offline
  • Profile
  • Following 0
  • Followers 0
  • Topics 1
  • Posts 12
  • Groups 0

Tuxdiver

@Tuxdiver

2
Reputation
1.1k
Profile views
12
Posts
0
Followers
0
Following
Joined Aug 16, 2016, 8:02 PM
Last Online Nov 14, 2022, 10:22 AM

Tuxdiver Unfollow Follow

Best posts made by Tuxdiver

  • RE: MMM-Rest

    @konradwalsh said in MMM-Rest:

    I suppose it would be good to have a dynamic situation where it maybe a string.
    For example, I am displaying my Hot Water Level. The result will be Low - Good - High.
    So it maybe a case of comparing a string value and reacting… Low would be blue and high would be red

    For the number values: just pull the current version from git, it should work now :-)

    For your “low/good/high” example: if you deliver numbers to the module and use the mapping feature it should work with the new format option, because format will be set before the mapping takes place.
    Otherwise replacing the “range” parameter with a “compare: ‘string’” could be a solution. I will have a look at that later ;-)

    posted in Utilities
    T
    Tuxdiver
    Feb 2, 2018, 10:29 AM
  • RE: MMM-Rest

    @Tuxdiver said in MMM-Rest:

    Otherwise replacing the “range” parameter with a “compare: ‘string’” could be a solution. I will have a look at that later ;-)

    OK, it’s finished.
    Look at https://github.com/Tuxdiver/MMM-Rest/blob/master/README.md for an example of the new format option.

    posted in Utilities
    T
    Tuxdiver
    Feb 2, 2018, 12:11 PM

Latest posts made by Tuxdiver

  • RE: MMM-Rest

    @Tuxdiver said in MMM-Rest:

    Otherwise replacing the “range” parameter with a “compare: ‘string’” could be a solution. I will have a look at that later ;-)

    OK, it’s finished.
    Look at https://github.com/Tuxdiver/MMM-Rest/blob/master/README.md for an example of the new format option.

    posted in Utilities
    T
    Tuxdiver
    Feb 2, 2018, 12:11 PM
  • RE: MMM-Rest

    @konradwalsh said in MMM-Rest:

    I suppose it would be good to have a dynamic situation where it maybe a string.
    For example, I am displaying my Hot Water Level. The result will be Low - Good - High.
    So it maybe a case of comparing a string value and reacting… Low would be blue and high would be red

    For the number values: just pull the current version from git, it should work now :-)

    For your “low/good/high” example: if you deliver numbers to the module and use the mapping feature it should work with the new format option, because format will be set before the mapping takes place.
    Otherwise replacing the “range” parameter with a “compare: ‘string’” could be a solution. I will have a look at that later ;-)

    posted in Utilities
    T
    Tuxdiver
    Feb 2, 2018, 10:29 AM
  • RE: MMM-Rest

    @konradwalsh just to make it clear: it’s not implemented right now, just a quick draft for discussion about that feature ;-)

    posted in Utilities
    T
    Tuxdiver
    Feb 2, 2018, 8:49 AM
  • RE: MMM-Rest

    @konradwalsh said in MMM-Rest:

    Is it possible to create an in-line if statement to control the formatting?

    So, if the result, say @1 > 10 then color:red else color:green

    At a first look, I would suggest to change the “format:” parameter in “sections” to support something like that:

    [ 
      { range:[0, 10],     format: ' span style="color: yellow"%d /span' },
      { range:[10, undef], format: 'span style="color: red"%d /span' },
      { format: 'span style="color: green"%d /span' },
    ]
    

    and to traverse the array and the first entry which matches wins. “undef” could mean “don’t care about this value” and an entry without range could be the “default” (which has to be the last entry).

    What is your opinion: could this solve your problem?

    Edit: HTML-Tags where removed by the forum system… Code above should be correct HTML of course

    posted in Utilities
    T
    Tuxdiver
    Feb 2, 2018, 8:10 AM
  • RE: MMM-Rest

    @12wsx This could be a problem with the configured URLs: if the connection could not be made or the other side does not deliver any content, the “Module Loading” message does not disappear.

    Try setting the “debug” variable to true in the config and call the MM-Url with a normal browser (Chrome) and look at the development console for messages - maybe that could give you some hints.

    posted in Utilities
    T
    Tuxdiver
    Dec 17, 2017, 1:48 PM
  • RE: MMM-Rest

    @balthaz Please have a look at the last version on Github :-)

    Attention: it has an incompatible change of the config parameters - see README.md!

    posted in Utilities
    T
    Tuxdiver
    Oct 27, 2016, 7:55 PM
  • RE: MMM-Rest

    @Jopyth said in MMM-Rest:

    @Tuxdiver What kind of sensors are you using for this internally (your openHAB)?

    I have an ESP8266 / NodeMCU sensors in every room, which send temperate and humidity values via MQTT to the mirror running mosquitto MQTT broker and openHAB. The values from the openHAB - API are then displayed on the mirror using my module.

    posted in Utilities
    T
    Tuxdiver
    Oct 16, 2016, 4:44 PM
  • RE: MMM-Rest

    @Tuxdiver said in MMM-Rest:

    @balthaz Sorry for the delay… The problem is the same-origin-policy of JavaScript: you must not call any other server than the one, where the mirror is running.

    I will change the module to use a node helper, but that might take some time.

    Module is updated on Github. Please try again. Now it uses a node_helper.js to fetch the remote data. Should solve the security “bug” of AJAX…

    posted in Utilities
    T
    Tuxdiver
    Oct 14, 2016, 9:40 AM
  • RE: MMM-Rest

    @balthaz Sorry for the delay… The problem is the same-origin-policy of JavaScript: you must not call any other server than the one, where the mirror is running.

    I will change the module to use a node helper, but that might take some time.

    posted in Utilities
    T
    Tuxdiver
    Oct 11, 2016, 3:17 PM
  • RE: MMM-Rest

    @Tuxdiver said in MMM-Rest:

    @balthaz Config looks good. Strange…

    I will add some debugging messages to the code later to make it easier to find the problem.

    OK, I added some debugging code. Please pull the current version and set

    debug: true;
    

    to the modules config section.

    I’m not sure, which is the best way to debug the version on the Raspi, but I think you could simply use a browser and connect to the Raspi. Maybe the console.log messages will be visible somewhere when using the electron app, but I don’t know where…

    posted in Utilities
    T
    Tuxdiver
    Sep 1, 2016, 7:40 PM
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