Jump to content
ElectricBrainUK

[Support] Electric Brain Unraid API

156 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

Share this post


Link to post
38 minutes ago, Migz93 said:

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

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

Share this post


Link to post
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. 

Share this post


Link to post
16 minutes ago, Migz93 said:

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

Okay cool thanks, I'll look into it in the morning and let you know

Share this post


Link to post
12 hours ago, Migz93 said:

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

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

Edited by ElectricBrainUK

Share this post


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

Share this post


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 

Share this post


Link to post
3 hours ago, ElectricBrainUK said:

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

Working perfectly now, thank you very much for such a quick fix!

Share this post


Link to post
Posted (edited)
On 6/12/2020 at 11:42 AM, Damix21 said:

You're right, thank you so much!

Hi @Damix21can you please share your working settings? I have the same issue! 

 

Moreover I noticed that switch status and sensor status are different

 

image.png.4250e419cbe46769e9af27840d204839.png

 

It is a bug @ElectricBrainUK ?

Edited by Jokerigno

Share this post


Link to post
5 hours ago, Jokerigno said:

Hi @Damix21can you please share your working settings? I have the same issue! 

 

Moreover I noticed that switch status and sensor status are different

 

image.png.4250e419cbe46769e9af27840d204839.png

 

It is a bug @ElectricBrainUK ?

Hey, that is unusual - was this configured automatically or manually?

Share this post


Link to post

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

Share this post


Link to post
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/

Share this post


Link to post

may it possible to add parityCheck and mover progress to the export, like in the unraid GUI? That would be nice!

Share this post


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

Share this post


Link to post
On 10/4/2020 at 12:09 AM, ElectricBrainUK said:

Hey, that is unusual - was this configured automatically or manually?

I just added the docker in my unraid and connected it to my mqtt broker...

Share this post


Link to post

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? 

Share this post


Link to post

Would it be possible to add the capability to pause/resume a parity check via this API? I would like to be able to automate the pause/resume more than the scheduling options available in the Parity Check Tuning plugin allow for.

Share this post


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 

Share this post


Link to post
2 hours ago, ElectricBrainUK said:

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

Awesome!

Share this post


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? 

Share this post


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? 

Share this post


Link to post

@ElectricBrainUK no. MQTT is running inside my unraid as a docker container (as yours). No other middle man.

 

Regarding the message what should I search? For example I searched for the unraid server name using MQTT Explorer but I didn't find anything.

Share this post


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.