[Support] Electric Brain Unraid API


288 posts in this topic Last Reply

Recommended Posts

16 minutes ago, ElectricBrainUK said:

Ah yeah there was a bug, I’ve pushed a fix if you could try again that would be great

Whatever you fixed, this was the problem ;-) Now it works and i got the message in the log aswell.
 

> unraidapi@0.5.0 start
> cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js


WARN mode option is deprecated. You can safely remove it from nuxt.config

Connected to mqtt broker

READY Server listening on http://0.0.0.0:80

Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: started assigning ID: MQTT-R-kkx4s6l1
MQTT-R-kkx4s6l1 succeeded
Received MQTT Topic: homeassistant/sger-unraid01/sleep and Message: assigning ID: MQTT-R-kkx4swtl
Received MQTT Topic: homeassistant/sger-unraid01/sleep and Message: assigning ID: MQTT-R-kkx4swtl
MQTT-R-kkx4swtl succeeded

 

So what is your plan for the final inplementation. So there will be also a switch or trigger of any kind, which I can use on the HA Dashboard, like reboot, restart, and so on or should I build an automation and call the mqtt service with the topic?

I have to really thank you for your efford to implement this. Great 😄

Link to post
  • Replies 287
  • 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

12 hours ago, ph0b0s101 said:

Whatever you fixed, this was the problem ;-) Now it works and i got the message in the log aswell.
 




> unraidapi@0.5.0 start
> cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js


WARN mode option is deprecated. You can safely remove it from nuxt.config

Connected to mqtt broker

READY Server listening on http://0.0.0.0:80

Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: started assigning ID: MQTT-R-kkx4s6l1
MQTT-R-kkx4s6l1 succeeded
Received MQTT Topic: homeassistant/sger-unraid01/sleep and Message: assigning ID: MQTT-R-kkx4swtl
Received MQTT Topic: homeassistant/sger-unraid01/sleep and Message: assigning ID: MQTT-R-kkx4swtl
MQTT-R-kkx4swtl succeeded

 

So what is your plan for the final inplementation. So there will be also a switch or trigger of any kind, which I can use on the HA Dashboard, like reboot, restart, and so on or should I build an automation and call the mqtt service with the topic?

I have to really thank you for your efford to implement this. Great 😄

That is great that it worked! Im glad and happy to help.

 

As for the switch I think for now it is best left to be manually added, as some people may not have the sleep plug in so I wouldnt want to add the switch to their config. Ill see if I can detect this and set one up automatically in the future. However for now if you add the following to your home assistant config:


- platform: mqtt

  command_topic: "homeassistant/sger_unraid01/sleep"

  payload_on: false,

  payload_off: true,

  value_template: "{{ value_json.on }}",

  state_topic: "homeassistant/sger_unraid01",

  name: "sger_unraid01_sleep"

It will create a switch for you

Edited by ElectricBrainUK
Link to post
On 2/8/2021 at 11:34 PM, ElectricBrainUK said:

That is great that it worked! Im glad and happy to help.

 

As for the switch I think for now it is best left to be manually added, as some people may not have the sleep plug in so I wouldnt want to add the switch to their config. Ill see if I can detect this and set one up automatically in the future. However for now if you add the following to your home assistant config:


- platform: mqtt

  command_topic: "homeassistant/sger_unraid01/sleep"

  payload_on: false,

  payload_off: true,

  value_template: "{{ value_json.on }}",

  state_topic: "homeassistant/sger_unraid01",

  name: "sger_unraid01_sleep"

It will create a switch for you

 

Missed to thank you for information how I can build a switch by myself. Work like a charm. Did managed to build a template switch which start the server via WOL and bring them to Standby with your MQTT implementation. Great.

Link to post
2 hours ago, ph0b0s101 said:

 

Missed to thank you for information how I can build a switch by myself. Work like a charm. Did managed to build a template switch which start the server via WOL and bring them to Standby with your MQTT implementation. Great.

Fantastic, Im happy it has been useful for you :)

Link to post

@ElectricBrainUK Hey mate, thanks for your work on this.

 

I'm writing a small Windows system tray companion app for quick stop/starting/pausing of containers and VMs using your API but I would like to request a possible change if you're open to it?

 

The problem I have is the icons for Containers and VMs on the Unraid server aren't accessible by the Windows user running the application, what would solve it is if we were able to store the icons inside your API and make them accessible through it, something along the lines of download them when the getServers method is called and store them in the same folder structure inside the UnraidAPI Container and then provide this URL in the json.

 

I've added a screenshot to give you and idea of what I'm talking about where I'm using a dummy icon where the actual icon would be.

 

I've also just noticed I have a typo in stopped haha.

image.thumb.png.c656e8b5057a2d26448a48b0ee07c791.png

 

Edited by Trozmagon
Link to post
On 2/15/2021 at 6:51 PM, Trozmagon said:

@ElectricBrainUK Hey mate, thanks for your work on this.

 

I'm writing a small Windows system tray companion app for quick stop/starting/pausing of containers and VMs using your API but I would like to request a possible change if you're open to it?

 

The problem I have is the icons for Containers and VMs on the Unraid server aren't accessible by the Windows user running the application, what would solve it is if we were able to store the icons inside your API and make them accessible through it, something along the lines of download them when the getServers method is called and store them in the same folder structure inside the UnraidAPI Container and then provide this URL in the json.

 

I've added a screenshot to give you and idea of what I'm talking about where I'm using a dummy icon where the actual icon would be.

 

I've also just noticed I have a typo in stopped haha.

image.thumb.png.c656e8b5057a2d26448a48b0ee07c791.png

 

Hey,

Thanks and also great idea, looks good! I love to see others doing work with the API and this looks like it'll be very useful

 

I'm happy to help with the images, but instead of downloading them I could just proxy the unraid versions right? Unless you think that'll cause an issue?

 

Good spot on the typo, I'll have a look at fixing it but I don't want to break anyone's automations that are already based on the typo, whoops :P

Link to post
3 hours ago, ElectricBrainUK said:

Hey,

Thanks and also great idea, looks good! I love to see others doing work with the API and this looks like it'll be very useful

 

I'm happy to help with the images, but instead of downloading them I could just proxy the unraid versions right? Unless you think that'll cause an issue?

 

Good spot on the typo, I'll have a look at fixing it but I don't want to break anyone's automations that are already based on the typo, whoops :P

 

Haha nah that was my typo but the screenshot included it ;). Yeah mate, proxy would be even better to be honest, should be less work and lighter on the API. I'll share the project here once I've completed it.

Link to post
On 2/16/2021 at 11:41 PM, Trozmagon said:

 

Haha nah that was my typo but the screenshot included it ;). Yeah mate, proxy would be even better to be honest, should be less work and lighter on the API. I'll share the project here once I've completed it.

Hey - sorry for the delay it took a bit longer than I first thought. If you check the beta tag for the api you should be able to get images by just sending the image url to the api. So normally you would have http://unraidServerIpAddress/state/plugins/dynamix.docker.manager/images/bazarr-icon.png now it is http://unraidapi(:port)/state/plugins/dynamix.docker.manager/images/bazarr-icon.png

Link to post
9 hours ago, ElectricBrainUK said:

Hey - sorry for the delay it took a bit longer than I first thought. If you check the beta tag for the api you should be able to get images by just sending the image url to the api. So normally you would have http://unraidServerIpAddress/state/plugins/dynamix.docker.manager/images/bazarr-icon.png now it is http://unraidapi(:port)/state/plugins/dynamix.docker.manager/images/bazarr-icon.png

Hey mate, no delay at all! Thanks for this, I'll check it out in the next day or too, I'm actually dealing with some disk issues at the moment so once I have it sorted I'll be moving back on to this :).

Link to post
On 2/3/2021 at 9:06 PM, ElectricBrainUK said:

Ah okay sure, just a thought. If it is just a delay then I would say it was probably because your MQTTRefreshRate variable is too fast, MQTTCacheTime is also a little fast but that shouldnt matter as much. Try setting them to at least 5.

OK changed MQTTCacheTime to 60 and MQTTRefreshRate to 5. Will let you know the results.

Link to post

Hey folks,

Not really sure what happened - all of a sudden getting errors:

Get Docker Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get Main Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get VM Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get Docker Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get Dashboard Details for ip: 192.168.x.x Failed with status code: [object Object]

 

Tried adding privileged to the docker. Didn't work
Tested I can access the docker.sock remotely ok (from node-red)

Bridge network

was working great until I did something - any thoughts

Link to post
6 hours ago, Jaburges said:

Hey folks,

Not really sure what happened - all of a sudden getting errors:



Get Docker Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get Main Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get VM Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get Docker Details for ip: 192.168.x.x Failed
Request failed with status code 503
Get Dashboard Details for ip: 192.168.x.x Failed with status code: [object Object]

 

Tried adding privileged to the docker. Didn't work
Tested I can access the docker.sock remotely ok (from node-red)

Bridge network

was working great until I did something - any thoughts

Hey, I've replied to your message on discord but if you'd rather discuss here that is no problem, my initial thoughts are around the unraid ui being accessible

Edited by ElectricBrainUK
Link to post
On 3/2/2021 at 8:30 AM, Jokerigno said:

hi @ElectricBrainUK can you please add to your docker also information coming from UPS? It would be great to see status, battery percentage and runtime left :) .

 

I don't know if it is better APC UPS or NUT for this.

 

Thank you

Hey, I'll have a look at this over the weekend

Link to post
On 2/21/2021 at 2:24 PM, ElectricBrainUK said:

Hey - sorry for the delay it took a bit longer than I first thought. If you check the beta tag for the api you should be able to get images by just sending the image url to the api. So normally you would have http://unraidServerIpAddress/state/plugins/dynamix.docker.manager/images/bazarr-icon.png now it is http://unraidapi(:port)/state/plugins/dynamix.docker.manager/images/bazarr-icon.png

 

Thanks for this change! One of two Problems solved.

I'm using your API to display and control VMs/Docker from inside of Grafana (with json api datasource and dynamic image plugin). This change helped a lot.

There is one small problem, if vms/docker has no icons. (as you can see in the screenshot)

May it be possible to get a default icon, if there is no icon given? The image plugin I'm using in grafana cant do this.

 

The bigger Problem is, if grafana runs via a https url, it can't show the icons because of security Mixed content. The API Data gets fetched without problems in the background. It's only the frontend. This could be solved by an proxy. Or do you have plans to provide your api via https?

 

And a second kind of feature request unrelated to the above. Could you report the progress of the parity check and mover? This would be very helpful.

 

grafik.thumb.png.8f4fe7e94988334c517cecffdac8c265.png

 

Link to post
12 hours ago, corgan said:

 

Thanks for this change! One of two Problems solved.

I'm using your API to display and control VMs/Docker from inside of Grafana (with json api datasource and dynamic image plugin). This change helped a lot.

There is one small problem, if vms/docker has no icons. (as you can see in the screenshot)

May it be possible to get a default icon, if there is no icon given? The image plugin I'm using in grafana cant do this.

 

The bigger Problem is, if grafana runs via a https url, it can't show the icons because of security Mixed content. The API Data gets fetched without problems in the background. It's only the frontend. This could be solved by an proxy. Or do you have plans to provide your api via https?

 

And a second kind of feature request unrelated to the above. Could you report the progress of the parity check and mover? This would be very helpful.

 

grafik.thumb.png.8f4fe7e94988334c517cecffdac8c265.png

 

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 adding progress for the parity check and mover, shouldn't be a massive change.

 

Let me know if there is anything else

Cheers

Link to post
On 3/8/2021 at 12:25 PM, ElectricBrainUK said:

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 adding progress for the parity check and mover, shouldn't be a massive change.

 

This would be awesome! Thanks!!

 

Link to post

Hi,

 

I updated to 6.9.1 and noticed that when container is on I have a more intense CPU use.

 

Look below

 

image.thumb.png.acf399794633be63d5fa4a1e9481717a.png

 

At left when container is on. On the right when it is switched off.

 

I'm the only one who noticed it?

 

Moreover I  found this on Supervisor LOG of HA:

 

21-03-11 15:37:48 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of Unraid API.

 

 

Link to post
41 minutes ago, Jokerigno said:

Hi,

 

I updated to 6.9.1 and noticed that when container is on I have a more intense CPU use.

 

Look below

 

image.thumb.png.acf399794633be63d5fa4a1e9481717a.png

 

At left when container is on. On the right when it is switched off.

 

I'm the only one who noticed it?

 

Moreover I  found this on Supervisor LOG of HA:

 


21-03-11 15:37:48 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of Unraid API.

 

 

That is quite intense, what is your Cache and Refresh rate at the moment? Ill look into it but in the meantime slowing those down should calm it down.

 

Also cheers for the heads up on the HA thing

Link to post
22 hours ago, ElectricBrainUK said:

That is quite intense, what is your Cache and Refresh rate at the moment? Ill look into it but in the meantime slowing those down should calm it down.

 

I rebuild the container and found a new template. In this one there are not variable as reflesh and cache.

 

Look:

 

immagine.thumb.png.73f971144df0769c2d059525518bb151.png

Link to post
Posted (edited)
2 hours ago, Jokerigno said:

 

I rebuild the container and found a new template. In this one there are not variable as reflesh and cache.

 

Look:

 

immagine.thumb.png.73f971144df0769c2d059525518bb151.png

Ah yeah that is the standard as most users shouldn't need to change them from the defaults, check here for details if you'd like to change them (you can just press add variable at the bottom):

 

https://github.com/ElectricBrainUK/UnraidAPI/wiki/Docker-installation
 

But seeing as yours are the default it is clearly a problem with the api itself. Do you know the percentage values for your graph? I can't tell if it's a jump in 10% or 50%. Also do you have one server configured or multiple?

 

Cheers

Edited by ElectricBrainUK
Link to post
2 hours ago, ElectricBrainUK said:

But seeing as yours are the default it is clearly a problem with the api itself. Do you know the percentage values for your graph? I can't tell if it's a jump in 10% or 50%. Also do you have one server configured or multiple?

 

Cheers

 

I would say a 40-50%. I noticed that the MQTT settings for user and pass are uncorrect it is not present (even if my overall cpu is more intense with this new release. I'm thinking to dowgrade.

Link to post
20 minutes ago, Jokerigno said:

 

I would say a 40-50%. I noticed that the MQTT settings for user and pass are uncorrect it is not present (even if my overall cpu is more intense with this new release. I'm thinking to dowgrade.

Okay sure thanks

Link to post

1057456982_Screenshot2021-03-15at18_28_36.thumb.png.edd8c835392247acd42b1068fdf2a07d.png

 

I'm far from an expert user (both Unraid and HA), but would be great if I could get this up and running. I think I'm close and not willing to give up yet.

HA (including working MQTT broker) is running on a different device. The MQTT broker discovers the Unraid entities. When I try to stop the Unraid array from HA, the docker crashes and this is the docker log (after crash).

I am very grateful for your thoughts on the point(s) I'm missing here.

Thanks a lot for the great work on this docker!

Link to post
55 minutes ago, smoldersonline said:

1057456982_Screenshot2021-03-15at18_28_36.thumb.png.edd8c835392247acd42b1068fdf2a07d.png

 

I'm far from an expert user (both Unraid and HA), but would be great if I could get this up and running. I think I'm close and not willing to give up yet.

HA (including working MQTT broker) is running on a different device. The MQTT broker discovers the Unraid entities. When I try to stop the Unraid array from HA, the docker crashes and this is the docker log (after crash).

I am very grateful for your thoughts on the point(s) I'm missing here.

Thanks a lot for the great work on this docker!

Hey, sure that is odd I've not seen that before. Can you control the server via the unraid apis ui?

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.