skank Posted February 23, 2020 Share Posted February 23, 2020 and my server.yaml #### CUSTOMIZE ################################################################# homeassistant: customize_glob: sensor.unraid_server: templates: hs_color: "if (state === 'up') return [115,100]; else return [360,100];" glances: - host: !secret unraid_server sensor: - platform: template sensors: unraid_server: entity_id: device_tracker.unraid_server friendly_name: Unraid icon_template: mdi:nas value_template: > {% if is_state('device_tracker.unraid_server', 'home') %} up {% else %} down {% endif %} 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') }}" Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 or should i use as entities card? Quote Link to comment
ElectricBrainUK Posted February 23, 2020 Author Share Posted February 23, 2020 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? Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 both are missing, the glances and the attributes Why do you put the sensors back into the config file? i split them up so it easier to find everything back if i get rid of the attributes, the glances come back up Quote Link to comment
ElectricBrainUK Posted February 23, 2020 Author Share Posted February 23, 2020 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? Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 its under packages > server.yaml #### CUSTOMIZE ################################################################# homeassistant: customize_glob: sensor.unraid_server: templates: hs_color: "if (state === 'up') return [115,100]; else return [360,100];" glances: - host: !secret unraid_server sensor: - platform: template sensors: unraid_server: entity_id: device_tracker.unraid_server friendly_name: Unraid icon_template: mdi:nas value_template: > {% if is_state('device_tracker.unraid_server', 'home') %} up {% else %} down {% endif %} 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') }}" Quote Link to comment
ElectricBrainUK Posted February 23, 2020 Author Share Posted February 23, 2020 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. Quote Link to comment
ElectricBrainUK Posted February 23, 2020 Author Share Posted February 23, 2020 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! Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 2 hours ago, ElectricBrainUK said: 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. ur welcome :p damn so im on my own ? Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 (edited) 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 :p Edited February 23, 2020 by skank Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 i delete the attributes and tada, there are the glances again Quote Link to comment
ElectricBrainUK Posted February 23, 2020 Author Share Posted February 23, 2020 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 Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 mmm how do you have it then? Can you show me? I think the card-mod thing is causing all stuff Quote Link to comment
ezra Posted February 23, 2020 Share Posted February 23, 2020 Hit me up on discord to troubleshoot. Quote Link to comment
chip Posted February 26, 2020 Share Posted February 26, 2020 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 Quote Link to comment
ElectricBrainUK Posted February 27, 2020 Author Share Posted February 27, 2020 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 Quote Link to comment
skank Posted February 27, 2020 Share Posted February 27, 2020 ElectricBrainUK, any chance to add to the list: - Power up the unraid machine - power down the unraid machine - possible to see the download status of sabnzb on unraid? - possible to add nzb to sabnzb on unraid this all through Home assistant? Quote Link to comment
chip Posted February 27, 2020 Share Posted February 27, 2020 19 hours ago, ElectricBrainUK said: 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 Apps I meant plugins. Would be great on those other items. Thanks! Quote Link to comment
Stephan296 Posted March 16, 2020 Share Posted March 16, 2020 I use your plugin at my unraid server and have connect it with my Home Assistant. But when i check the state of a container in Home Assistant, is shows always off but the container is running for sure at my unraid server. In your webinterface it shows also running but in HA it's shows off. Can you help me? Quote Link to comment
ElectricBrainUK Posted March 16, 2020 Author Share Posted March 16, 2020 (edited) 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? Edited March 16, 2020 by ElectricBrainUK Quote Link to comment
Stephan296 Posted March 16, 2020 Share Posted March 16, 2020 1 hour ago, ElectricBrainUK said: 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? Forget my post It was a setting which i found at your site. after a restart works now perfect since i add MQTTRefreshRate and MQTTCacheTime to the unraid api docker. Thx for your reply Quote Link to comment
ElectricBrainUK Posted March 16, 2020 Author Share Posted March 16, 2020 Ah that's great news no worries Quote Link to comment
CSmits Posted March 23, 2020 Share Posted March 23, 2020 Absolutely fantastic! Thank you very much! 1 Quote Link to comment
realrift Posted March 26, 2020 Share Posted March 26, 2020 Hi All, I haven't installed the Unraid API yet but was just wondering if I can use it to send a sleep command to the Unraid server from HA? Cheers Quote Link to comment
ElectricBrainUK Posted March 27, 2020 Author Share Posted March 27, 2020 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 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.