Jump to content

ElectricBrainUK

Members
  • Posts

    133
  • Joined

  • Last visited

Posts posted by ElectricBrainUK

  1. 1 hour ago, Beaker69 said:

    @ElectricBrainUK

     

    This is a great container, I got it up and running in 5 minutes and spent the next 3 days using your code to create my own version.

    Some of the cards are not working with the current version of Home Assistant. But with a bit of tweaking and cheating I got the set up below.

     

    I use this on its own tab in Panel mode.

     

    If anyone is interested I can post the code to Github.

     

    Unraid.thumb.jpg.86163ebf73a8a498c5de670d296f340b.jpg

    Thanks a lot! Looks great!

  2. 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

  3. 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

     

    1.JPG.ffbd7bfa32328396f4a269b9ec74d1e4.JPG

     

    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

  4. 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. 

  5. 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? 

     

  6. 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') }}"

  7. 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

  8. 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? 

  9. 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

  10. 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

  11. 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?

×
×
  • Create New...