ElectricBrainUK
-
Posts
133 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
Gallery
Bug Reports
Documentation
Landing
Posts posted by ElectricBrainUK
-
-
Hey,
No not sleep, does unraid support sleep? It can start/stop the array and will be able to restart/ shutdown the host at some point.
Cheers
-
Ah that's great news no worries
-
Sounds like there is a problem with the mqtt connection, can you confirm if you see the mqtt messages being sent when container states change? Also is there anything unusual in the logs?
-
2 hours ago, chip said:
What other type info can be displayed/pulled with API?
Some stats that interest me are - Can this info be pulled?
uptime of system
Unraid Version running
Apps running/installed
Most major things are listed here: https://github.com/ElectricBrainUK/UnraidAPI/wiki/Home-Assistant-Integration
Uptime isn't explicitly but it will report when it turns on so if you're using home assistant that would know uptime. I'll add it to the list though
Unraid version isn't there yet but I'll also add that to the list.
If by apps you means dockers/ VMS that is there, nothing for plugins though
-
14 minutes ago, skank said:
or should i delete the template sensors i created from the binary sensor
and enter the entity "binary sensor" in the card and then point to the attributes?
How did you do this here?
https://github.com/ElectricBrainUK/UnraidAPI/wiki/Lovelace-Config
See also
https://github.com/custom-cards/entity-attributes-card
It also keeps saying the binary sensor is unavailble
the first time under development options i could look at the binary sensor and see the attributes, now i cannot anymore
Hopefully this will all be fixed once you have a HA addon 😛
The person that added that is Ezra a member of our community but as I said best to reach out to him on the discord server as he is not active here, here is the invite link: https://discord.gg/Qa3Bjr9
-
You can try our discord though, the link is in the first post of this topic, there are a few others there that might be able to help!
-
Oh cool I didnt know you could add packages like that, thanks! I had been using !include for each thing but my sensors and other files were getting a bit large so this would be a good way to break them up.
But Im afraid I really don't know what the problem is sorry! The only thing I can thing of is that the template is creating a sensor with the same name as a glances one, though I thought that would just append a _2 to the id.
-
I also have them split but for your sensors you had them inline already so I just used that as an example. Where is your glances configured in the integrations section?
-
3 minutes ago, skank said:
no this is my config yaml
default_config: homeassistant: customize: !include customize.yaml packages: !include_dir_named packages frontend: themes: !include_dir_merge_named themes # Uncomment this if you are using SSL/TLS, running in Docker container, etc. # http: # base_url: example.duckdns.org:8123 lovelace: mode: yaml customizer: custom_ui: local hacs: token: !secret hacs_token appdaemon: true # Text to speech tts: - platform: google_translate group: !include groups.yaml automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml sensor: - platform: unifigateway host: !secret unifi_host site_id: !secret unifi_site username: !secret unifi_username password: !secret unifi_password monitored_conditions: - www - lan - wan - wlan - vpn - alerts - firmware - platform: template sensors: server_motherboard: value_template: "{{state_attr('binary_sensor.unraid_server', 'motherboard') }}" server_cpu: value_template: "{{state_attr('binary_sensor.unraid_server', 'cpu') }}" server_memory: value_template: "{{state_attr('binary_sensor.unraid_server', 'memory') }}" server_diskspace: value_template: "{{state_attr('binary_sensor.unraid_server', 'diskSpace') }}" server_arraystatus: value_template: "{{state_attr('binary_sensor.unraid_server', 'arrayStatus') }}" server_arrayprotection: value_template: "{{state_attr('binary_sensor.unraid_server', 'arrayProtection') }}" remote: - platform: harmony name: Harmony Hub host: !secret harmony
Ah okay, so when you add the API sensors it should be as above?
That wouldn't explain the issue with glances anyway.. Does the unraid stuff show up or is both the Glances and unraid stuff missing?
-
That is strange, you havent ended up with two sesnor: tags in your configuration.yaml have you?
-
Regarding time frame on the add-on I'm not sure but it certainly won't be as long as months! Maybe 1 but if I get an evening where I have a lot of time I'm sure I'll be able to do it.
No that looks right to me, does the ha config check return anything unusual?
-
No I'm not sure yet as I'm a bit busy at the moment, I'll update you when it's available though
-
5 hours ago, skank said:
So , normal step is i install the broker on the pi
so you are setting a API HA addon? So stats will remain visible? Thats cool !
Cant wait
This will mean ,all stats will be visible even when unraid is shut down?
- for the last question about statistics, you misunderstand me
i meant the attributes like wat kind of motherbord, what cpu, what mem
Yep!
For the 2nd point you can do that using the home assistant link I sent, here is an example for motherboard though: (on mobile so excuse formatting)
sensor:
- platform: template sensors:
server_motherboard:
value_template: "{{ state_attr('binary_sensor.server', 'motherboard') }}"
-
15 hours ago, skank said:
According to the github page, that shouldnt be necessary
So im awaiting answer from ElectricBrainUK firts
18 hours ago, skank said:ok so yesterday it suddenly worked after i launched it and logged in (it says fill in username and paswword 2 times)
i now have entities like switches for dockers and a sensor..
i do have other questions though.- al those entitities are in ha saying they are unavailable, is that normal?
- if i shutdown the broker on the unraid machine, will the attributes of the machine still be visible in the broker for the raspberry pi(ha) to read from?
- i have the broker now on the unraid machine, and ha on my raspberry pi, since i shutdown my unraid (and not the pi) shouldnt it be wiser to set up the broker on the pi?
- you have these sensors, how do i get them? they arent made by the discovery
```
- key: binary_sensor.unraid_server.cpu
- key: binary_sensor.unraid_server.memory
- key: binary_sensor.unraid_server.motherboard
- key: binary_sensor.unraid_server.arrayStatus
- key: binary_sensor.unraid_server.diskSpace
- key: binary_sensor.unraid_server.arrayProtection
```
Thx for your support here!Hey, first of all no problem for the support, then I'll answer your questions in the same order they were asked:
- sometimes entities are listed as unavailable for a short period of time (up to 1 hour by default) as entities are only updated on change but once an hour (env variable MQTTCacheTime can change this to any value in minutes) all states are refreshed. If they are not becoming available after that though let me know
- if you shutdown the broker those attributes will not be available. I have my broker on the pi however if the API is shutdown as well it also means those details will become unavailable so I'm working on getting it added to the HA add-on store as well
- for statistics like cpu usage I recommend glances as it already has a lot of great features but if you want the details there (which is actually CPU name etc.) You can create custom sensors based on the details already available (you can see a server entity should have those details as attributes) for examples check here: https://www.home-assistant.io/integrations/template and let me know if you get stuck
Cheers
-
15 hours ago, skank said:
I'm having same issues, cant seem to get it work
2 things
- for the ipadress, i just fill in the ip or with "http://" in front of it?
- what did u do to fix?
Youo say you logged in, that fixed it? log in , in the api ?
The IP shouldn't matter if you have http or not
When you logged in what comes up? Does it display server details or controls?
-
Hey, you need to log on via the web UI (port 3005 by default) for it to work, unless you've already done that
-
If you set the MQTTCacheTime variable to a number in minutes you can change it to whatever you like, an hour is just the default. For more details check the wiki:
https://github.com/ElectricBrainUK/UnraidAPI/wiki/Docker-installation
-
That depends, it could be the unraid API docker crashing, it could be the mqtt broker crashing. Or if the HA restarts while the API is still running it will take up to an hour by default to refresh all the states.
There could also be a few other reasons, if you could give me some more information that would be helpful. Like does it happen at a certain time or when you do a certain thing, does it come back after a certain amount of time etc.
Cheers
-
Hey,
Okay thanks for bringing that to my attention I'll look into it - however I do believe that it should work in HA despite this
Do you have autodiscovery turned on for the MQTT integration in HA?
If so do you have both that and the unraid API configured to use the same base topic?
Cheers
-
Not at the minute, but I'll add it to the to-do list!
-
That's great!
-
Ahh it is probably the non standard port, if you delete your servers.json file and restart the api, then set the server up as ip:port it should work
- 1
-
Okay thanks, just to check:
- is your unraid ui served over https or http?
- do you have any unusual plugins that alter the unraid ui?
- a 404 status code suggests it cannot reach the IP of your server at all, how is the network configured for the unraid API? Host, bridge etc.
-
Hi, that all seems correct to me. I will get rid of the second log in at a later date as it's not necessary.
Are you using https for your unraid instance? If so you need to add the https:// part in the IP section. Will make this more clear in the docs.
Otherwise what information is in the logs?
[Support] Electric Brain Unraid API
in Docker Containers
Posted
Thanks a lot! Looks great!