Connect to Hololens via Node-Red

Hello again! I hope everyone is okay.
My question is related to Microsoft Hololens and its battery level. I would like to see the battery level via Node-Red. I did some ways but I took several mistakes.

I can't see the continuation of the mistake I showed with the question mark above. There are three points, but the after is not visible.

[
    {
        "id": "f52f54bdcee82b3b",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "fd6b79463afb23e8",
        "type": "http request",
        "z": "f52f54bdcee82b3b",
        "name": "GET",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "",
        "tls": "49d6016a.ababa",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "basic",
        "senderr": false,
        "headers": [],
        "x": 490,
        "y": 260,
        "wires": [
            [
                "b308c2fd0e691cad",
                "ed1023e20a8ada5d"
            ]
        ]
    },
    {
        "id": "078df7799eb627e9",
        "type": "debug",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 870,
        "y": 180,
        "wires": []
    },
    {
        "id": "f30652210ab7dd28",
        "type": "change",
        "z": "f52f54bdcee82b3b",
        "name": "/api/power/battery",
        "rules": [
            {
                "t": "set",
                "p": "url",
                "pt": "msg",
                "to": "https://192.168.X.XX/api/power/battery",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 310,
        "y": 260,
        "wires": [
            [
                "fd6b79463afb23e8"
            ]
        ]
    },
    {
        "id": "5b61151766da5f29",
        "type": "inject",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 100,
        "y": 260,
        "wires": [
            [
                "f30652210ab7dd28"
            ]
        ]
    },
    {
        "id": "7ab3473ee519d437",
        "type": "ui_text",
        "z": "f52f54bdcee82b3b",
        "group": "f2436bee621336a5",
        "order": 0,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "battery : ",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "className": "",
        "x": 1140,
        "y": 280,
        "wires": []
    },
    {
        "id": "359a43bbd65e3c8b",
        "type": "ui_gauge",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "group": "f2436bee621336a5",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "donut",
        "title": "Gauge",
        "label": "%",
        "format": "{{msg.payload}}",
        "min": 0,
        "max": "100",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "diff": false,
        "className": "",
        "x": 1150,
        "y": 340,
        "wires": []
    },
    {
        "id": "ddc382f5628a457b",
        "type": "function",
        "z": "f52f54bdcee82b3b",
        "name": "ff",
        "func": "msg.payload = Math.floor( msg.payload.RemainingCapacity / msg.payload.MaximumCapacity * 100 );\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 850,
        "y": 340,
        "wires": [
            [
                "359a43bbd65e3c8b",
                "7ab3473ee519d437"
            ]
        ]
    },
    {
        "id": "b308c2fd0e691cad",
        "type": "json",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 650,
        "y": 260,
        "wires": [
            [
                "078df7799eb627e9",
                "ddc382f5628a457b"
            ]
        ]
    },
    {
        "id": "ed1023e20a8ada5d",
        "type": "debug",
        "z": "f52f54bdcee82b3b",
        "name": "debug 25",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 620,
        "y": 140,
        "wires": []
    },
    {
        "id": "49d6016a.ababa",
        "type": "tls-config",
        "name": "",
        "cert": "",
        "key": "",
        "ca": "",
        "verifyservercert": false
    },
    {
        "id": "f2436bee621336a5",
        "type": "ui_group",
        "name": "HoloLens",
        "tab": "690c7d582fe7bd12",
        "order": 1,
        "disp": true,
        "width": "6"
    },
    {
        "id": "690c7d582fe7bd12",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard"
    }
]

Note: As you can see IP address contains XX. But in flow, I tried real numbers.
I found some information about the connection between Node-Red and Hololens. Unfortunately, this is the Japanese language. I did not understand anything. Thank you in advance!

Hi @boarak,

Just looking at your screenshot, the API is returning what appears to be a requirement to setup access to the API.

I cant imagine many here use Hololens, have you followed the guidance in the link below?
are you providing authentication creds in your requests?

Device portal API reference - Mixed Reality | Microsoft Learn

The reason you're only seeing a portion of the response, is because the debug panel is capped to a max number of characters - this is for performance reasons, you can change this in the settings.js file in Node RED

Thank you for your response. Yeah, I looked there and took some information.
There is not so much knowledge about Hololens. Anyway, I will try it.
By the way, I did not find how to increase the max number of characters from settings.

I've been trying to persuade my Microsoft contacts to let me have a Hololens for years now :slight_smile:

If you want to send me one, I'll happily get it working for you! :rofl::rofl:

2 Likes

I wish this hololens could be my personal item. :smiley:

If I continue to watch some more Japanese websites. I will have taught myself a new language. :rofl: :rofl:

1 Like

What do you think about this output? I just want to brainstorm. Because I do not have any idea about it.
Thank you for your interest.

Not sure what you are asking? It appears to be pretty standard to me. Was there something specific you wanted to understand?

Maybe the estimated time? I'm assuming that is the remaining battery time - bit of a guess but I think probably:

=4294967295/1000/1000/60 = ~72 minutes?

Sorry, I sent the wrong picture. I am taking this error. What can be?
Reason: "Missing packageFullName query parameter."

Device portal API reference - Mixed Reality | Microsoft Learn

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.