@cowboysdude Samsungs have an ECO option but I turned it off completely thinking it was going to get in the way… I’ll take a look at that to see if it will work the way yours does.
Read the statement by Michael Teeuw here.
Best posts made by j.e.f.f
-
RE: Disable No-Singal output for any tv?
-
Show/Hide my own module in combination with MMM-Facial-Recognition
Hello. I’ve written a module the hides itself when no data is currently available, otherwise it shows itself. I’m using the standard this.hide() / this.show() methods.
However things get messed up when I combine this with MMM-Facial-Recognition. I’ve read about using lockStrings to lock the module’s visibility, but as far as I understand it, I’d need the Facial Recognition module to supply a lock string upon sending the hide command as well as my own module to supply a lockString to itself upon hiding.
Essentially I want the following behaviour:
- My Module has no data, never show, even if called to be displayed by MMM-FR
- My module supplies a lockString to itself with its hide command
- module remains hidden regardless of what MMM-FR wants to do
- My module has data, but MMM-FR wants it hidden
- MMM-FR would need to supply a lock string with its hide command
- module remains hidden regardless of the fact that there is data
- My module has data AND MMM-FR wants it visible
- both call the show() method with their respective lockStrings, thereby removing both lockStrings from my module
- module is visible.
- Do I understand this correctly?
- Is there another way to get this behaviour without requiring a modification to MMM-Facial-Recognition? I can see myself running into this problem with some other show/hide modules, and I’d rather not have manage my own modified versions of others’ modules.
- My Module has no data, never show, even if called to be displayed by MMM-FR
-
RE: MMM-MyCommute
@Fonfon @BlackTalon I’ve made an update that adds this capability, plus a whole lot more:
- added the config
showSummary
to toggle a brief route summary. For transit, this gives you the route names (bus, streetcar, subway numbers, etc). - added the config
colorCodeTravelTime
to colour the travel red, yellow or green depending on traffic conditions. Only works formode : 'driving'
. - added two configs
moderateTimeThreshold
andpoorTimeThreshold
to adjust the threshold for red (i.e.: poor) and yellow (i.e.: moderate) traffic. Defaults to1.1
and1.3
respectively for 10% and 30% time delays. - for destinations where
mode : 'transit'
, you can specify an additional configtransitMode
to instruct which transit modes you would like Google to use when calculating your route. Can bebus
,subway
,train
,tram
, orrail
. Multiple choices allowed, separated by the|
character (e.g.:transitMode : 'bus|subway'
). Specifyingrail
is equivalent to specifyingsubway|train|tram
. - added more icons to support the various modes of transit.
It’s still possible to use the old compact mode, by specifying
showSummary : false
. e.g.: - added the config
-
RE: My display so far...
@twosix For traffic I used mrx-work-traffic, but I made some js modifications, both to get it working, and to add the travel mode options (e.g.: biking, driving, transit, walking). For music, I’m using MMM-Sonos. I modified the JS to comment out much of the information being supplied to the display, and to reformat the remaining HTML such that it could be styled like you see in my photo.
-
RE: MMM Google assistant
@gauravsacc said in MMM Google assistant:
@cowboysdude how do I get a module developer badge?
If you click on @cowboysdude 's “Module Developer” badge (or anyone else’s) you’ll be taken to a screen where you can request to join the group. It’ll take a few days for the moderators to add you.
-
RE: So then, what languages to learn?
@NathTheDude If you’re already familiar with programming, even as a novice, JavaScript won’t be that hard to learn. Here’s a great place to start: https://www.codecademy.com/learn/learn-javascript
And as @cowboysdude mentions, definitely look at other modules to see how things work specifically in MagicMirror.
Don’t overlook the importance of how you structure your HTML markup. Resist the temptation to lay things out using table elements (
table
). Try to usediv
(typically for outer containers) andspan
(typically for elements within a larger container) elements instead. This will give you far more flexibility in your CSS when positioning elements. Take a look at my scoreboard module for an example of how the same markup can be laid out many different ways by specifying a particular CSS class to the outer container. Also, add CSS classes to all the significant parts of your markup. That way you can target any element using your CSS, and you’ll also make other people happy when they want to customize your module with their own CSS. A couple of great places to learn CSS: http://www.css-101.org/ (beginner) and https://css-tricks.com/ (advanced). -
RE: MMM-MyCommute
@beck0r Can you try doing a git pull in your MMM-MyCommute directory and restarting your mirror? I think I found your issue – I didn’t have an icon definition for High-speed rail.
EDIT Maybe not… I need to add definitions for all sorts of possible transit vehicle types. Stay tuned…
EDIT OK fixed for real this time. I added definitions for all of the transit modes listed here: https://developers.google.com/maps/documentation/directions/intro#VehicleType
Note: You’ll see the tram icon while the route is loading, as that is the default icon used when no transitMode is specified. But you’ll see it change to the train icon after your travel times are retrieved.
-
RE: My display so far...
@cowboysdude In my case, I’ve also changed the HTML markup. It’s difficult to move things around in the CSS when the visual elements are marked up with tables. So in many cases the markup has been changed significantly – especially in the sports modules – so that I was free to position things as I wished.
In some case using tables makes sense. For example the weather forecast is tabular data, so using a table to present the information is appropriate. But when you use tables, your layout is pretty much fixed to be in a table format, and the information will always be presented in the order that it is marked up. For example, for the sports modules, I wanted the visiting team’s scores first (i.e. on the left) and the home team’s score second (on the right). The NHL module had this reversed. I also wanted to hide the scores when the game hadn’t yet started. So the logos are marked up first, then the game status. Based on the status, I decide whether to markup the scores. So the markup looks like this:
<div> <img src="modules/MMM-NHL/icons/NSH.svg" class="team-logo home" /> <img src="modules/MMM-NHL/icons/STL.svg" class="team-logo visitor" /> < span class="status in-progress"> < span class="live time">13:45< /span> < span class="period">3< sup>RD< /span> < /span> < span class="score home">2< /span> < span class="score visitor">1< /span> </div>
Elements are written in this order:
- Home Team’s logo
- Visiting Team’s logo
- Game status
- Home Team’s score
- Visiting Team’s score
But with the CSS, I’m able to position them in this order:
- Visiting Team’s logo
- Visiting Team’s score
- Game status
- Home Team’s score
- Home Team’s logo
Scores and logos are positioned relative the their respective left and right edges, while the status is centered. So this layout will adapt to changing container widths. And if I wanted to swap the display to have home team on the left, and visitor on the right, it’s a simple CSS change, with no need to touch the markup.
So it works out better to render each piece as its own HTML element (e.g.:
div, span, p, img,
etc), and then position them using CSS. This gives you WAY more flexibility. Maybe the way forward here is to work with the module devs to change their markup to something that lends itself to more flexible CSS styling.
P.S. Does anyone know how to make span elements show up in markdown? I had to put spaces between the < character and
span>
, otherwise they don’t show up in the code block. Also have the same problem with the class name on the outer div. There shouldclass="box-score"
on that element. -
RE: Microwave/doppler motion detection -- anyone got it to work?
I’m going to guess you issue isn’t the sensor, but instead how your monitor reacts to the vcgencmd command. Had you tried installing LibCEC and sending direct CEC power commands?
-
RE: JSON-RPC need help
@tbe You need to add an event listener to react to the response. example:
HTTP.onreadystatechange = function() { if (HTTP.readyState == 4 && HTTP.status == 200) { //response complete and OK //do something with HTTP.response; } else if (HTTP.readyState == 4) { //response complete but some error console.log("Error: " + HTTP.status + " " + HTTP.statusText); } }
Alternatively you can add individual event listeners for different states:
HTTP.addEventListener("progress", updateProgress); HTTP.addEventListener("load", transferComplete); HTTP.addEventListener("error", transferFailed); HTTP.addEventListener("abort", transferCanceled);
Full documentation on the XMLHttpRequest object here:
https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest