Read the statement by Michael Teeuw here.
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.
-
@Tuxdiver Yes it’s working good now :)
Is it possible to display alphanumeric response?Thanks
-
-
Hello, i have problem with this module : saying Module Loading. I have installed newest version from github. It is clear instalation with no others module. How can I check where is the problem.
No need copy my config because it’s only one module copied from repository this module. -
@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.
-
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
-
@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
-
{ 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’ },Thanks for the prompt reply… Seems my PI has gone offline and I am at work… so I will try this later and report back
-
@konradwalsh just to make it clear: it’s not implemented right now, just a quick draft for discussion about that feature ;-)
-
@Tuxdiver
yes of course
I feel confident in implementing it myself and see what I come up with…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 -
@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 redFor 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 ;-) -
QUALITY!
Thanks my friend… looking forward to getting home and getting this going -
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. -
ah… very cool
-
works perfectly
thanks!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login