[Support] Electric Brain Unraid API


304 posts in this topic Last Reply

Recommended Posts

10 minutes ago, ElectricBrainUK said:

Hey, it looks like you are doing the right thing - there may be an issue with the on check let me look into it - is it just the on check that is incorrectly reported? 

As far as I can tell it only seems like the on check is incorrect. Its pulling down the other stats like name/array status/dockers correctly

Link to post
  • Replies 303
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Overview: Support for Docker image unraid-api in the electricbrain repo. Docker Hub: https://hub.docker.com/r/electricbrainuk/unraidapi Github/ Docs: https://github.com/ElectricBrainUK/Unrai

Hey, As for default image I don't see why not, I'll look into it. I currently have no plans to provide a https end point so I would recommend using a proxy for now. I will also look at

@ElectricBrainUK Thank you for your response. Firing Users Scripts would be more than enough.    @Jokerigno For instance firing a script that unbinds a usb device from a running vm

Posted Images

7 minutes ago, ElectricBrainUK said:

I may have found a bug, could you please confirm if you have any VMs and / or attached USBs on those servers? 

Awesome! Both on both, one does have the VM service currently disabled but has an attached USB device regardless. 

Link to post
4 hours ago, ElectricBrainUK said:

I have pushed an update with a fix for the "on" tag
Thanks for pointing it out

Thanks for working on that so quick, I can confirm that when I open the webpage for each API instance they correctly identify the other server as online/offline.

Although it seems like the MQTT message that's coming in every 15 or so seconds no longer has the "On" entry, one of my messages:

 

{
    "arrayStatus": "Started",
    "arrayProtection": "",
    "moverRunning": false,
    "parityCheckRunning": false,
    "title": "GDUnraid",
    "cpu": "Intel® Core™ i7-9700K CPU @ 3.60GHz",
    "memory": "32 GiB DDR4 ",
    "motherboard": "ASUSTeK COMPUTER INC. TUF Z390M-PRO GAMING, Version Rev X.0x",
    "diskSpace": "94.3 TB used of 96 TB (98.2 %)",
    "cacheSpace": "602 GB used of 1 TB (58.8 %)",
    "arrayUsedSpace": "94.3 TB",
    "arrayTotalSpace": "96 TB",
    "arrayFreeSpace": "1.7000000000000028 TB",
    "cacheUsedSpace": "602 GB",
    "cacheTotalSpace": "1 TB",
    "cacheFreeSpace": "422 GB"
}

Is that expected?

 

Edit: It seems like it's only including "on" in the JSON if it changes state to "false".

Rebooted one of my servers, saw the API change to show the server as off, checked the MQTT message and it included it setting to false. Server came back online, API changed to show the server as on but checking the MQTT message it didn't include "on".

Edited by Migz93
Link to post
14 minutes ago, Migz93 said:

Thanks for working on that so quick, I can confirm that when I open the webpage for each API instance they correctly identify the other server as online/offline.

Although it seems like the MQTT message that's coming in every 15 or so seconds no longer has the "On" entry, one of my messages:

 


{
    "arrayStatus": "Started",
    "arrayProtection": "",
    "moverRunning": false,
    "parityCheckRunning": false,
    "title": "GDUnraid",
    "cpu": "Intel® Core™ i7-9700K CPU @ 3.60GHz",
    "memory": "32 GiB DDR4 ",
    "motherboard": "ASUSTeK COMPUTER INC. TUF Z390M-PRO GAMING, Version Rev X.0x",
    "diskSpace": "94.3 TB used of 96 TB (98.2 %)",
    "cacheSpace": "602 GB used of 1 TB (58.8 %)",
    "arrayUsedSpace": "94.3 TB",
    "arrayTotalSpace": "96 TB",
    "arrayFreeSpace": "1.7000000000000028 TB",
    "cacheUsedSpace": "602 GB",
    "cacheTotalSpace": "1 TB",
    "cacheFreeSpace": "422 GB"
}

Is that expected?

 

Edit: It seems like it's only including "on" in the JSON if it changes state to "false".

Rebooted one of my servers, saw the API change to show the server as off, checked the MQTT message and it included it setting to false. Server came back online, API changed to show the server as on but checking the MQTT message it didn't include "on".

Oh dear - silly me, sorry about that 
Pushed a fix 

Link to post
  • 2 weeks later...
1 hour ago, Keith Ellis said:

Hi, trying to get this up and running.  Does this docker include an MTQQ broker? Or do I need to provide my own.?

Hi, it does not include a broker, you need to set your own up and connect it, let me know if you need any help with that. 

 

Here are some notes from the home assistant team:

https://www.home-assistant.io/docs/mqtt/broker/

Link to post

Hello,

Two items/suggestions:

 

  • Can you have the API do an update periodically or have the messages persist.  If HA is restarted, the switches show 'unavailable' since they don't seem to persist on the MQTT broker.  Restarting the API corrects.
  • Getting this error.  Think its due to having docker containers that weren't created through the Unraid Apps section - created using command line in docker.  These types don't show at all in the API, and think they should still have the ability to stop, restart etc since you can do this through the dockers tab in Unraid.  Possible to handle these more gracefully?

 

There was a problem retrieving a field for a docker image
Cannot read property 'contents' of undefined

 

Love the API - thanks for putting the time into this!

 

Edited by rgabrlson@gmail.com
Link to post
  • 2 weeks later...

First off, thanks for your work on this. This is exactly what I was looking for. 

 

I've gotten everything set up (first time doing anything with MQTT so it's been interesting). I have the Unraid API configured and connected to Home Assistant. I'm running Hassio in a VM on Unraid. In HA I see the Unraid entities. I've also set up Glances as a docker in Unraid and it's showing all the information correctly. I installed glances in Home Assistant. 

 

In Home Assistant, Glances is showing only the information from the VM, so CPU usage, memory, ect. is all only showing what's in the "VM" and not the actual system wide information. Is there any way to change it to look at the system as a whole instead of the VM? 

 

Also, I'm unable to figure out how to get the CPU usage and other information as a Home Assistant entity so that I can display it on my HA dashboard. Am I missing something? 

Link to post

Hi all,

Sorry for my delay in replying to these I will reply to them in order:
Can the api update all topics periodically? Yes it already does this (by default once an hour but that can be changed with the MQTTCacheTime variable)

Adding support for other docker images is on my list - I hope Ill get time to do it soon if not over the holiday period is likely

I will also add the ability to control user scripts in a similar time frame as this would be a great feature 

@Budget Audiophile I believe you have 2 Glances one in HA (which you can see and details VM stats) and one on the Unraid server which you need to connect as an integration in order to see the stats for
I will also add the ability to pause and resume the pairty check in the next update as I dont think itll be too difficult to do

 

Thanks all 

Link to post
8 hours ago, ElectricBrainUK said:

Hi all,

Sorry for my delay in replying to these I will reply to them in order:
Can the api update all topics periodically? Yes it already does this (by default once an hour but that can be changed with the MQTTCacheTime variable)

Adding support for other docker images is on my list - I hope Ill get time to do it soon if not over the holiday period is likely

I will also add the ability to control user scripts in a similar time frame as this would be a great feature 

@Budget Audiophile I believe you have 2 Glances one in HA (which you can see and details VM stats) and one on the Unraid server which you need to connect as an integration in order to see the stats for
I will also add the ability to pause and resume the pairty check in the next update as I dont think itll be too difficult to do

 

Thanks all 

 

Thanks for your response. Is there any guide out there how to connect those by chance? 

Link to post

@BudgetAudiophile there is a guide on the GitHub but let me know if more detail is needed. https://github.com/ElectricBrainUK/UnraidAPI/wiki the variables are under docker installation and on unraid you just edit the template and click add variable at the bottom.

 

@Jokerigno I'm still not sure sorry, are you seeing messages on your mqtt broker? Do you have any other integrations between mqtt and HA? 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.