[Support] Electric Brain Unraid API


Recommended Posts

3 hours ago, ElectricBrainUK said:

Hi @giustanca and @danielpiccoli, it looks like you are both having the same problem, relating around it failing to get a piece of information about dockers. Do you guys have dockers enabled? And which version of unraid are you each running?

running 6.8.3, using multiple dockers, all of them work like a charm, unraid-API keeps crashing.

 

image.png.bb1ab85222a912a720da329d0249af79.png

 

also: as out of the box as it gets.

 

image.png.670537c3e602f51f3c426f00e9289e74.png

 

I also attempted giving it a fixed IP: 10.0.0.6

erased everything, reconfigured, now the error is:

although it says connected

 

image.png.03bfeb03d846bec1ce491a70f887839b.png

Edited by danielpiccoli
Link to comment
On 1/5/2021 at 4:22 PM, ElectricBrainUK said:

Sure:

 

- see if there are updates for dockers/plugins/unraid OS - WIP

- able to shut down the server - Available via mqtt command /basetopic/servername/poweroff

- correct info disk usage - Done

- parity check  - Available via mqtt command /basetopic/servername/check (also move for mover)

- reboot server - Available via mqtt command /basetopic/servername/reboot

 

But an unraid api addon in HA would be even better - There is an alpha version available on the github page but there are problems with it communicating over mqtt

Hello ElectricBrainsUK, its me again and I am running your Unraid-API Docker directly in Unraid and it's working pretty good so far. I have only one open Request left do be 100% statisfied. So is it possible to get also an switch for sleep mode? You have already implemented an reboot and power_off, for me only sleep is left for maximum flexiblity. Maybe I can help to achive this?

Edited by ph0b0s101
typo
Link to comment
35 minutes ago, ph0b0s101 said:

Hello ElectricBrainsUK, its me again and I am running your Unraid-API Docker in directly in Unraid so far and it's working pretty good so far. I have only one open Request left do be 100% statisfied. So is it possible to get also an switch for sleep mode? You have already implemented an reboot and power_off, for me only sleep is left for maximum flexiblity. Maybe I can help to achive this?

Hey, I'm glad it has been useful! Just to check do you mean sleeping the unraid host? I could probably do that relatively easily

Link to comment

Hi all,

 

I use this docker container from a while now and I noticed a issue that maybe it's not related to the container because it seems no other has is.

 

This are my settings:

 

image.png.18dcac78fd057a4388b63b6b6becb3e8.png

 

What I noticed is that it tooks more time than declared HA tooks some time to see the status of the containers, vm etc.

 

Look at this picture:

image.png.d7da9de0584c99d51585f2ab788e21fa.png

status is "started" but the switch created by HA is in "off" status.

 

Any hint?

Link to comment
2 minutes ago, Jokerigno said:

Hi all,

 

I use this docker container from a while now and I noticed a issue that maybe it's not related to the container because it seems no other has is.

 

This are my settings:

 

image.png.18dcac78fd057a4388b63b6b6becb3e8.png

 

What I noticed is that it tooks more time than declared HA tooks some time to see the status of the containers, vm etc.

 

Look at this picture:

image.png.d7da9de0584c99d51585f2ab788e21fa.png

status is "started" but the switch created by HA is in "off" status.

 

Any hint?

Hey, that is unusual, I'll take a look tomorrow as well. However I don't recommend having a mqtt cache time and refresh rate of one, you could end up spamming your home assistant and slowing it down or even crashing it depending on the spec of your home assistant box/VM

  • Like 1
Link to comment

Hi both, sorry for the delay.

@Jokerigno Ive looked and I cant see why you would be experiencing this issue, the only thing I can think of is your home assistant appears to be in a language other than English, do you think it could be because my unraid api isnt playing nicely with that? Seems unlikely but it is the only thing I can think of.

 

@ph0b0s101 sleep is definitly achievable but I would like to know if you currently sleep your unraid machine and how you do it? Hooking into an existing function would be easier than writing one from scratch but one from scratch might be more universal

Link to comment
19 hours ago, ElectricBrainUK said:

language other than English

 

Yes my system is in italian (ui) but status are always in english (on - off, true - false) and are visibile in the other language only in the frontend. I don't think it is related. Moreover I want you to notice that it's just a delay. After some time the status is updated.

Link to comment
5 hours ago, Jokerigno said:

 

Yes my system is in italian (ui) but status are always in english (on - off, true - false) and are visibile in the other language only in the frontend. I don't think it is related. Moreover I want you to notice that it's just a delay. After some time the status is updated.

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.

  • Like 1
Link to comment
On 2/2/2021 at 7:53 PM, ElectricBrainUK said:

Hi both, sorry for the delay.

@Jokerigno Ive looked and I cant see why you would be experiencing this issue, the only thing I can think of is your home assistant appears to be in a language other than English, do you think it could be because my unraid api isnt playing nicely with that? Seems unlikely but it is the only thing I can think of.

 

@ph0b0s101 sleep is definitly achievable but I would like to know if you currently sleep your unraid machine and how you do it? Hooking into an existing function would be easier than writing one from scratch but one from scratch might be more universal

Sorry for my late response, i was really busy the last days. I have installed the s3 Sleep plugin, which handles the standby so far. When I manually bring the server in standby mode, I use the sleep button which is in the dashboard, after installation of the dynamics s3 sleep plugin. Sorry that I cannot provide any code 😞

Link to comment
On 2/4/2021 at 8:47 PM, ph0b0s101 said:

Sorry for my late response, i was really busy the last days. I have installed the s3 Sleep plugin, which handles the standby so far. When I manually bring the server in standby mode, I use the sleep button which is in the dashboard, after installation of the dynamics s3 sleep plugin. Sorry that I cannot provide any code 😞

Hey @ph0b0s101 thanks for the details, I have updated the beta tag with a sleep command, if it works fine for you Ill move it into the latest tag. If you dont know how to switch tags, when you edit the docker, under repository add :beta to the end of electricbrainuk/unraidapi to make electricbrainuk/unraidapi:beta. If you are using Home Assistant / MQTT you need to call it via /basetopic/servername/sleep or via the REST API it would be POST /api/changeServerStatus { action: "sleep", server: "IPAddress", auth: Base64(user:password))

 

If you could let me know how you get on that would be really helpful, thanks :) (Also let me know if there is anything you need help with)

Link to comment
3 hours ago, ElectricBrainUK said:

Hey @ph0b0s101 thanks for the details, I have updated the beta tag with a sleep command, if it works fine for you Ill move it into the latest tag. If you dont know how to switch tags, when you edit the docker, under repository add :beta to the end of electricbrainuk/unraidapi to make electricbrainuk/unraidapi:beta. If you are using Home Assistant / MQTT you need to call it via /basetopic/servername/sleep or via the REST API it would be POST /api/changeServerStatus { action: "sleep", server: "IPAddress", auth: Base64(user:password))

 

If you could let me know how you get on that would be really helpful, thanks :) (Also let me know if there is anything you need help with)

Hi  @ElectricBrainUK,
thank you for your update. I already installed the version from your beta repository. But I am not 100% sure how to use is with MQTT or the REST API. I tried it via developer tools in home assistant with the following code:

chrome_NcG55KzDyO.png.916f36ddb1c6a4eddceaa025ad789b79.png

 

but this command did not bring the server into standby mode.

And for the REST API Call i did not know where I have to put the provided code example. Could you please provide some more in depth details? Sorry I am a total newbie in this subject.

 

Reboot, Restart and so on has switches in home assistant:


chrome_zbvl9pupNU.png.fb7f9d81e6aeee98cec78d9bef5ed2b2.png
 

Edited by ph0b0s101
Link to comment
On 2/7/2021 at 5:28 PM, ph0b0s101 said:

Hi  @ElectricBrainUK,
thank you for your update. I already installed the version from your beta repository. But I am not 100% sure how to use is with MQTT or the REST API. I tried it via developer tools in home assistant with the following code:

chrome_NcG55KzDyO.png.916f36ddb1c6a4eddceaa025ad789b79.png

 

but this command did not bring the server into standby mode.

And for the REST API Call i did not know where I have to put the provided code example. Could you please provide some more in depth details? Sorry I am a total newbie in this subject.

 

Reboot, Restart and so on has switches in home assistant:


chrome_zbvl9pupNU.png.fb7f9d81e6aeee98cec78d9bef5ed2b2.png
 

Hey, sorry for the delay - you don’t need to worry about the REST one using home assistant. Could you try updating again and trying again with the mqtt command now? Could you also let me know if there is anything unusual in the logs after you run the command?

Edited by ElectricBrainUK
Link to comment
31 minutes ago, ElectricBrainUK said:

Hey, sorry for the delay - you don’t need to worry about the REST one using home assistant. Could you try updating again and trying again with the mqtt command now? Could you also let me know if there is anything unusual in the logs after you run the command?

 

Thank you for your reply, i assume, there must be any error on my site firing the mqtt command. Because there is nothing in the logs after i have issued the command. But when I trigger one of the docker switches it will work perfectly fine:

 

> [email protected] 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


READY Server listening on http://0.0.0.0:80

Connected to mqtt broker
Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: started assigning ID: MQTT-R-kkx2p44f
MQTT-R-kkx2p44f succeeded
Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: stopped assigning ID: MQTT-R-kkx2qvab
Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: stopped assigning ID: MQTT-R-kkx2qvab
MQTT-R-kkx2qvab succeeded

 

So maybe I have to alter the command? On the mqtt manual from homeassistant there is mentioned that the payload is nessecary? 

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

 

Sorry that I am not a big help so far 😞

Link to comment
2 minutes ago, ph0b0s101 said:

 

Thank you for your reply, i assume, there must be any error on my site firing the mqtt command. Because there is nothing in the logs after i have issued the command. But when I trigger one of the docker switches it will work perfectly fine:

 


> [email protected] 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


READY Server listening on http://0.0.0.0:80

Connected to mqtt broker
Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: started assigning ID: MQTT-R-kkx2p44f
MQTT-R-kkx2p44f succeeded
Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: stopped assigning ID: MQTT-R-kkx2qvab
Received MQTT Topic: homeassistant/sger-unraid01/binhex-lidarr/dockerState and Message: stopped assigning ID: MQTT-R-kkx2qvab
MQTT-R-kkx2qvab succeeded

 

So maybe I have to alter the command? On the mqtt manual from homeassistant there is mentioned that the payload is nessecary? 

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

 

Sorry that I am not a big help so far 😞

Ah you’re right, the command I gave you is wrong, there should be no / before homeassitant. Thank you for your help, I appreciate it, there is no need to apologise these things often take time to work out the teething issues and by helping me test you are being very helpful.

Link to comment
12 minutes ago, ElectricBrainUK said:

Ah you’re right, the command I gave you is wrong, there should be no / before homeassitant. Thank you for your help, I appreciate it, there is no need to apologise these things often take time to work out the teething issues and by helping me test you are being very helpful.

 

Hm it still seems that no command will reach the unraid server.

Link to comment

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.