@Eunanibus I’m probably more worried about people reviewing my crappy code I will definitely put it up though.
Read the statement by Michael Teeuw here.
Posts made by mongo116
-
RE: Hive current room temperature
-
RE: Hive current room temperature
I’ve spent some time on this (well all of my spare time really since I posted my request!) seeing if I could bodge something together, and have come up with the following:
I would imagine it’s totally unoptimised, but it pulls the temperature back from the hive server, which is the main thing! The thermometer also changes depending on the temperature, and the flame changes to white when the heating is on. Need to spend some more time tidying it up and will then probably submit it here.
-
RE: Passing variable from one request to another
@strawberry-3.141 Fantastic - just needed to be nested. That now works like a charm - thank you so much
-
RE: Passing variable from one request to another
This is from node_helper.js:
request({ url: "https://api-prod.bgchprod.info:443/omnia/auth/sessions", headers: { 'Content-Type': 'application/vnd.alertme.zoo-6.1+json', 'Accept': 'application/vnd.alertme.zoo-6.1+json', 'X-Omnia-Client': 'Hive Web Dashboard', 'cache-control': "no-cache", }, method: "POST", body: JSON.stringify(body), }, function (error, response, body) { if (!error && response.statusCode == 200) { var responseJson = JSON.parse(body); } }); request({ url: "https://api-prod.bgchprod.info:443/omnia/nodes", headers: { 'Content-Type': 'application/vnd.alertme.zoo-6.1+json', 'Accept': 'application/vnd.alertme.zoo-6.1+json', 'X-Omnia-Client': 'Hive Web Dashboard', 'cache-control': "no-cache", 'X-Omnia-Access-Token': , }, method: "GET", }, function (error, response, body) { if (!error && response.statusCode == 200) { var responseJson = JSON.parse(body); } });
The Session ID is part of the JSON response from the first request (responseJson.sessions[0].sessionId). Session ID needs to be put into the ‘X-Omnia-Access-Token’: , of the second request.
Thanks
-
RE: Passing variable from one request to another
Thanks for the reply. Sorry to be a pain, but any chance of you putting a simple example of both on here.
-
Passing variable from one request to another
Hi,
Hopefully a simple question.I am trying to pull data for my heating system, which requires two requests be made. The first request gets the sessionID, and the second logs in using the sessionID and pulls back the JSON data.
I can see the SessionID in the first request, but how do I have this value available to the second request?
Thanks
-
RE: Motion Detector
@reaper81 I had the following in my config.js:
{ module: 'motiondetector', config: { timeout: 5*60*1000 } },
You will need to ensure that the 3 files are located in the modules/motiondetector folder.
I ended up using a different method for motion detection though, as tvservice kept stopping working.
-
RE: Motion Detector
@strawberry-3.141 Thanks for that. I’ve amended this slightly so will keep an eye on it. Might also have a look at putting on some heatsinks to see if that helps.
One (hopefully!) final question. When the monitor is turned off, is there a way to ‘freeze’ the other modules, so they stop running for the duration that the monitor is off? This would hopefully help with performance, in that the other modules are no longer running.
-
RE: Motion Detector
I’ve got the motion detection now working - had to add bcm2835-v4l2 to \etc\modules - restarted and screen now turns off after defined period and on when motion is detected. This is really great, and I’m nearly there - but… Now when the motiondetector is running, the RPi3 temp just goes up and up and up, until it eventually crashes/freezes and I have to pull the power as RPi is completely unresponsive. If I remove motiondetector from MagicMirror, temperature stays stable and no crashing. Is there something I can change in the config to sort out this performance issue?
-
RE: Motion Detector
Just to add to this, I have checked that the camera is working and motion is detected by testing with https://github.com/pageauc/motion-track. All appears to be working as expected. No motion is detected unless I move in front of the camera.