BlaM Posted February 2 Share Posted February 2 13 hours ago, light2089 said: @BlaM - I use the APC UPS integration in HA to extract UPS information from my Unraid server Uh, nice. I didn't know that Unraid would open a port you can connect to. I have seen the integration in HA, but assumed that you have to connect directly to the UPS (and mine does not have a network connection). Thanks - Problem solved. Quote Link to comment
twistedsanity Posted February 2 Share Posted February 2 (edited) 3 hours ago, BlaM said: Uh, nice. I didn't know that Unraid would open a port you can connect to. I have seen the integration in HA, but assumed that you have to connect directly to the UPS (and mine does not have a network connection). Thanks - Problem solved. Hahaha, exactly the same for me I've spent ages trying to work out how to run NUT on hassio or on my pfsense firewall and then share with unraid, but never could be bothered with the effort. I could kick myself that I never knew this before now. (and its already fully working and looking good....grrr) Edited February 2 by twistedsanity added my result Quote Link to comment
AServ Posted February 5 Share Posted February 5 Cool project, just what I was looking for! I just installed it on unraid and I can start/stop my VMs via API calls (I did not do any HA integration, I just curl the API from a script on another machine). My only problem is that even though the APIs seem to work at first, my unraid panel becomes unresponsive soon after I start Unraid-API-RE. Anything I can do to avoid this? Thanks. Quote Link to comment
corgan Posted February 14 Share Posted February 14 thank you so much! Works great directly as datasource in grafana. Quote Link to comment
viktortras Posted February 16 Share Posted February 16 hello I can't connect through HTTPS I can see this in logs: getaddrinfo ENOTFOUND I put the long address ended in myunraid.net Any help please? Thank you Quote Link to comment
Orishas Posted February 16 Share Posted February 16 (edited) Hi, first off all great work and thank you. I am using the Unraid API to turn my server on and off with Home Assistant. However, I am having a problem where the server state changes back to "on" a few seconds after I send the "server power_off" command. I have been able to reproduce the issue consistently. It only happens if on off the disks is in sleep mode before I send the power_off command. When Unraid starts to shut down, it wakes the disks up, and then the server state changes back to "on". Steps to reproduce: Put all of the disks in sleep mode. Send the "server power_off" command using the Unraid API. Wait a few seconds. Check the server state. Expected behavior: The server state should remain "off". Actual behavior: The server state changes back to "on". Thank you Edited February 16 by Orishas Quote Link to comment
WexfordStyle Posted February 24 Share Posted February 24 On 2/14/2024 at 6:10 AM, corgan said: thank you so much! Works great directly as datasource in grafana. Did you do anything special to get this to work? I am having trouble adding the data source to Grafana. I am following the guide here: https://github.com/HStep20/Ultimate-Unraid-Dashboard-Guide Which details how to add the data source below: UnraidAPI Hit 'Add Data Source' and choose an 'JSON API' data type With the containers being on the same docker compose network, we can refer to them by container name in URLs. Top fields: URL - http://YOURSERVERIP:YOURUNRAIDAPIPORT/api/getServers Note: The default unraidapiport is 3005. If you did not edit the docker-compose.yml, set the port to 3005 When I do this, I am presented with the following error: JSON API: Internal Server Error Any advice on how to get this to work? Quote Link to comment
corgan Posted February 24 Share Posted February 24 Data Source: Type: JSON API Data Source Config: my server is on 192.168.2.254 port of the api: 3005 So the URL must be http://192.168.2.254:3005/api/getServers Grafana Panel Config for Docker Container: Panel https://grafana.com/grafana/plugins/dalvany-image-panel/ use your IP! $.['servers']['192.168.2.254']['docker']['details']['containers'][*].name $.['servers']['192.168.2.254']['docker']['details']['containers'][*].imageUrl $.['servers']['192.168.2.254']['docker']['details']['containers'][*].status 1 Quote Link to comment
corgan Posted March 4 Share Posted March 4 (edited) I'm looking for a way to filter what is published via mqtt to not clutter up my home assistant with dozen of switches again. Sadly with autodiscover ON in HA I can't filter which devices are discovered. With autodiscover, it woudl create 130 switches, 52 sensors, aso. I found the mqttDisabledDevices.json in the appdata folder, but no documentation or example how to use this file. In the end, I only want to have 2 docker container controlled via HA and don't want all the information inside HA. Edited March 4 by corgan Quote Link to comment
apedance Posted March 10 Share Posted March 10 Hey there, thanks for your work. Any updates for 6.12.8 switches are not working, mover status is constant true and parity status is not working either. Thank you. Quote Link to comment
corgan Posted April 4 Share Posted April 4 Valid question. Is there any development on this project? vg Stefan Quote Link to comment
BoKKeR Posted April 4 Author Share Posted April 4 Yes, when I find time i will the entities that are broken. Hopefully this weekend. 1 Quote Link to comment
corgan Posted April 4 Share Posted April 4 44 minutes ago, BoKKeR said: Yes, when I find time i will the entities that are broken. Hopefully this weekend. Great! That's are good news! I have some questions regards the update interval. Is there any rule that defines how often components are updated? Sometimes it takes forever after a Home assistant restart till the components are available, and sometimes there are dozens of updates in one minute. And is there any way to request or trigger an update? Is it an expected behavior that the API sends the discovery message over and over, or is there something broken? For me, the API sends all sensors from the server, docker and the VMs. I don't have broken entities after discovery. Thanks and greetz Stefan Quote Link to comment
vicious-transgression6851 Posted April 21 Share Posted April 21 Thanks for reviving this. I have been trying to get this work on Unraid 6.12.8, but seems like there is something I am missing. I got the unraidapi running and can only see dockers. No server details are displayed. Don't see anything in the logs either. Servers.json has all the details as can be seen below. Here is my docker compose (Fyi: Using docker compose first time). Also, I don't see MQTTUser in there. Is it not required or defined somewhere else? unraidapi: container_name: GUS-unraidapi image: bokker/unraidapi-re:6.12 # Use tag for your version - 6.11 or 6.12 network_mode: bridge hostname: ${HOSTNAME} ports: - ${UNRAID_API_UI_PORT}:80 volumes: - ${APPDATA_PATH}/GUS-UnraidAPI:/app/config environment: MQTTBroker: hassio MQTTPort: 1883 MQTTPass: pass MQTTBaseTopic: homeassistant KeyStorage: config TZ: ${TIMEZONE} restart: unless-stopped depends_on: - influxdb labels: - "net.unraid.docker.icon=https://raw.githubusercontent.com/ElectricBrainUK/UnraidAPI/master/static/iconx64.png" - "net.unraid.docker.webui=http://[IP]:[PORT:3005]/" Quote Link to comment
Puntoboy Posted April 23 Share Posted April 23 Hello, I'm having no joy getting this to work. The documentation isn't very clear and, certain on my server, the Docker image isn't working correctly. I added the Management Server app from the CA then added the Docker image using the image from the OP here (not the old one). Added the environment variables for my MQTT broker and started the container. But when I connect, there's nothing there. The webpage loads, I enter my server details, it says connected but that's it. Nothing populates. If wait, nothing happens, if I refresh the server details on "setup unraid server" disappear. On the Home Assistant side, I cannot get the add-on to install at all. I wasn't sure if there was a newer add-on I should be using. Quote Link to comment
BoKKeR Posted April 23 Author Share Posted April 23 (edited) @corgan I am not sure how mqttDisabledDevices.json works, It looks like you can disable docker for a full host, but not really specific containers? I could look into disabling auto discovery since its quite messy with the docker containers... I am also not sure if the discovery feature is broken. I have not touched it from the old project and frankly I am not sure how that feature should behave. I will have to do some research or you can fill me in on the details if you have experience. The update intervall can be possibly adjusted with an environmental variable `MQTTRefreshRate` also seen on the screenshot. @viktortras I have not tested with a public myunraid address. Could you try locally on the same network? @Orishas Noted, will have to revisit this issue @vicious-transgression6851 You seem to have all the data so it might be unrelated to unraid-api? I mostly use this with home assistant. @Puntoboy There is no home assistant version. I am using it as a container deployed on UNRAID connecting it to HA with MQTT. The home assistant version would just run the unraid api container within HA OS. Edited April 23 by BoKKeR Quote Link to comment
Puntoboy Posted April 23 Share Posted April 23 (edited) Thanks @BoKKeR that's fine then, however my other two issues persist. I have the Docker deployed on the Unraid server. I have noticed that I am getting these MQTT errors on my Home Assistant server since deploying this. Edited April 23 by Puntoboy Quote Link to comment
BoKKeR Posted April 24 Author Share Posted April 24 @Puntoboy can you check the config folder if there are any files? You could try wiping them also. You could enable writing the HTML files with the WRITE_HTML_OUTPUT=true environmental variable. That will generate more logs about the scraping. You can share these logs privately with me for more debugging. Quote Link to comment
vicious-transgression6851 Posted April 24 Share Posted April 24 19 hours ago, BoKKeR said: @vicious-transgression6851 You seem to have all the data so it might be unrelated to unraid-api? I mostly use this with home assistant. Got it working. Had to specify Home assistant IP as mqttbroker rather than the name. Still I can only see all the dockers listed, but no server info including drives. What am I missing? Quote Link to comment
Puntoboy Posted April 24 Share Posted April 24 (edited) 6 hours ago, BoKKeR said: @Puntoboy can you check the config folder if there are any files? You could try wiping them also. You could enable writing the HTML files with the WRITE_HTML_OUTPUT=true environmental variable. That will generate more logs about the scraping. You can share these logs privately with me for more debugging. Sorry for the stupid question, but how can I browse to the config files? I've added that variable. Snippet from the log file I have found {"log":"}\n","stream":"stdout","time":"2024-04-24T11:16:36.312422879Z"} {"log":"The secure keys for mqtt may have not been generated, you need to make 1 authenticated request via the API first for this to work\n","str> {"log":"Failed to retrieve config file, creating new.\n","stream":"stdout","time":"2024-04-24T11:16:47.408770032Z"} {"log":"Error: ENOENT: no such file or directory, open 'secure/mqttKeys'\n","stream":"stdout","time":"2024-04-24T11:16:56.313429941Z"} {"log":" at Object.openSync (node:fs:590:3)\n","stream":"stdout","time":"2024-04-24T11:16:56.313845917Z"} {"log":" at Object.readFileSync (node:fs:458:35)\n","stream":"stdout","time":"2024-04-24T11:16:56.313862841Z"} {"log":" at updateMQTT (/app/mqtt/index.js:382:19)\n","stream":"stdout","time":"2024-04-24T11:16:56.313876898Z"} {"log":" at Timeout._onTimeout (/app/mqtt/index.js:439:7)\n","stream":"stdout","time":"2024-04-24T11:16:56.313885199Z"} {"log":" at listOnTimeout (node:internal/timers:559:17)\n","stream":"stdout","time":"2024-04-24T11:16:56.313892732Z"} {"log":" at processTimers (node:internal/timers:502:7) {\n","stream":"stdout","time":"2024-04-24T11:16:56.313898864Z"} {"log":" errno: -2,\n","stream":"stdout","time":"2024-04-24T11:16:56.313904981Z"} {"log":" syscall: 'open',\n","stream":"stdout","time":"2024-04-24T11:16:56.31391113Z"} {"log":" code: 'ENOENT',\n","stream":"stdout","time":"2024-04-24T11:16:56.313917005Z"} {"log":" path: 'secure/mqttKeys'\n","stream":"stdout","time":"2024-04-24T11:16:56.313923134Z"} {"log":"}\n","stream":"stdout","time":"2024-04-24T11:16:56.313929404Z"} {"log":"The secure keys for mqtt may have not been generated, you need to make 1 authenticated request via the API first for this to work\n","str> {"log":"Error: ENOENT: no such file or directory, open 'secure/mqttKeys'\n","stream":"stdout","time":"2024-04-24T11:17:16.315129599Z"} {"log":" at Object.openSync (node:fs:590:3)\n","stream":"stdout","time":"2024-04-24T11:17:16.315161179Z"} {"log":" at Object.readFileSync (node:fs:458:35)\n","stream":"stdout","time":"2024-04-24T11:17:16.315170932Z"} {"log":" at updateMQTT (/app/mqtt/index.js:382:19)\n","stream":"stdout","time":"2024-04-24T11:17:16.315192317Z"} {"log":" at Timeout._onTimeout (/app/mqtt/index.js:439:7)\n","stream":"stdout","time":"2024-04-24T11:17:16.315198664Z"} {"log":" at listOnTimeout (node:internal/timers:559:17)\n","stream":"stdout","time":"2024-04-24T11:17:16.315203648Z"} {"log":" at processTimers (node:internal/timers:502:7) {\n","stream":"stdout","time":"2024-04-24T11:17:16.315208523Z"} {"log":" errno: -2,\n","stream":"stdout","time":"2024-04-24T11:17:16.31521341Z"} {"log":" syscall: 'open',\n","stream":"stdout","time":"2024-04-24T11:17:16.315218275Z"} {"log":" code: 'ENOENT',\n","stream":"stdout","time":"2024-04-24T11:17:16.31522497Z"} {"log":" path: 'secure/mqttKeys'\n","stream":"stdout","time":"2024-04-24T11:17:16.315231808Z"} {"log":"}\n","stream":"stdout","time":"2024-04-24T11:17:16.315236996Z"} {"log":"The secure keys for mqtt may have not been generated, you need to make 1 authenticated request via the API first for this to work\n","str> {"log":"Get VM Details for ip: 192.168.1.19 Failed\n","stream":"stdout","time":"2024-04-24T11:17:36.564266739Z"} {"log":"Request failed with status code 500\n","stream":"stdout","time":"2024-04-24T11:17:36.56429392Z"} {"log":"There was a problem retrieving a field for a docker image\n","stream":"stdout","time":"2024-04-24T11:17:36.593781823Z"} {"log":"Cannot read properties of undefined (reading '0')\n","stream":"stdout","time":"2024-04-24T11:17:36.593810992Z"} Edited April 24 by Puntoboy Quote Link to comment
BoKKeR Posted April 24 Author Share Posted April 24 (edited) @Puntoboy what version are you running of unraid? The config folder is the one thats set in the template, probably /mnt/user/docker/Unraid-API Edited April 24 by BoKKeR Quote Link to comment
emilgil Posted April 24 Share Posted April 24 (edited) Is there no way to slow down the polling frequency of the disks? Every 30 s is way too fast for me, my server rarely changes over a day or two. Also, is there really no way to prevent unneccessary entities from the MQTT queue? I have 4 disks + a cache drive but the API seems to think I have 23 or so... Edited April 24 by emilgil Quote Link to comment
BoKKeR Posted April 24 Author Share Posted April 24 No granular way to set polling on each feature, you can slow down polling as a whole by changing MQTTRefreshRate=20000 Quote Link to comment
emilgil Posted April 24 Share Posted April 24 23 minutes ago, BoKKeR said: No granular way to set polling on each feature, you can slow down polling as a whole by changing MQTTRefreshRate=20000 As an environment variable when launching the container or in the GUI? Quote Link to comment
Puntoboy Posted April 24 Share Posted April 24 34 minutes ago, BoKKeR said: @Puntoboy what version are you running of unraid? The config folder is the one thats set in the template, probably /mnt/user/docker/Unraid-API 6.12.10 I don't see that path on my server. This is my container setup. Quote Link to comment
Recommended Posts
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.