chip Posted February 14, 2020 Share Posted February 14, 2020 Do you know what is causing the binary_sensor.hptower_server to go into a unavailable state? Quote Link to comment
ElectricBrainUK Posted February 14, 2020 Author Share Posted February 14, 2020 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 Quote Link to comment
chip Posted February 15, 2020 Share Posted February 15, 2020 Ok I wasn't aware of the - 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. I will monitor it and let you know...but I have been making lots of changes on my HA so I am rebooting alot. Quote Link to comment
ElectricBrainUK Posted February 15, 2020 Author Share Posted February 15, 2020 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 Quote Link to comment
uniqueunraid Posted February 18, 2020 Share Posted February 18, 2020 Can anyone help with this error i'm getting in the logs at Object.openSync (fs.js:447:3) at Proxy.readFileSync (fs.js:349:35) at updateMQTT (/app/mqtt/index.js:218:30) at Timeout._onTimeout (/app/mqtt/index.js:450:5) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7) { errno: -2, syscall: 'open', code: 'ENOENT', path: 'config/mqttKeys' } 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 Error: ENOENT: no such file or directory, open 'config/mqttKeys' Quote Link to comment
ElectricBrainUK Posted February 18, 2020 Author Share Posted February 18, 2020 Hey, you need to log on via the web UI (port 3005 by default) for it to work, unless you've already done that Quote Link to comment
chip Posted February 18, 2020 Share Posted February 18, 2020 On 2/15/2020 at 2:32 AM, ElectricBrainUK said: 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 Good info to know. Thanks! 1 Quote Link to comment
skank Posted February 19, 2020 Share Posted February 19, 2020 On 1/10/2020 at 5:34 PM, meep said: OK, have it working. Many thanks! One thing I missed after updating the server details was that I needed to login via the docker UI. I'd stopped and started unraid-API a few times as I wasn't getting the response to the MQTT request. Once I logged in, I was golden. I'll have a play over the weekend to see what I can do with this. 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 ? Quote Link to comment
skank Posted February 19, 2020 Share Posted February 19, 2020 i logged in, it says connected, but still nog go Quote Link to comment
ElectricBrainUK Posted February 20, 2020 Author Share Posted February 20, 2020 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? Quote Link to comment
skank Posted February 20, 2020 Share Posted February 20, 2020 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! Quote Link to comment
chip Posted February 20, 2020 Share Posted February 20, 2020 1 hour 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! I wasn't able to figure that out so I came across this card that pulls those attributes https://github.com/custom-cards/secondaryinfo-entity-row Quote Link to comment
skank Posted February 20, 2020 Share Posted February 20, 2020 31 minutes ago, chip said: I wasn't able to figure that out so I came across this card that pulls those attributes https://github.com/custom-cards/secondaryinfo-entity-row According to the github page, that shouldnt be necessary So im awaiting answer from ElectricBrainUK firts Quote Link to comment
ElectricBrainUK Posted February 21, 2020 Author Share Posted February 21, 2020 (edited) 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 Edited February 21, 2020 by ElectricBrainUK Quote Link to comment
skank Posted February 21, 2020 Share Posted February 21, 2020 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 Quote Link to comment
ElectricBrainUK Posted February 21, 2020 Author Share Posted February 21, 2020 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') }}" Quote Link to comment
skank Posted February 21, 2020 Share Posted February 21, 2020 ok thx will try any idea when we can expect the ha addon? Quote Link to comment
ElectricBrainUK Posted February 22, 2020 Author Share Posted February 22, 2020 No I'm not sure yet as I'm a bit busy at the moment, I'll update you when it's available though Quote Link to comment
skank Posted February 22, 2020 Share Posted February 22, 2020 Cool thx, i hope its not years, or much months... :p Quote Link to comment
skank Posted February 22, 2020 Share Posted February 22, 2020 (edited) I had the glances stuff working so i added the new sensors for the attributes, and now all is gone... is there something wrong with my page? title: Server icon: mdi:nas path: server theme: ios-dark-mode cards: - type: vertical-stack cards: - type: custom:vertical-stack-in-card title: Unraid Server cards: - type: horizontal-stack cards: - type: custom:card-modder card: type: picture image: /local/unraid.png - type: custom:entity-attributes-card title: Kenmerken filter: include: - key: sensor.server_motherboard - key: sensor.server_cpu - key: sensor.server_memory - key: sensor.server_diskspace - key: sensor.server_arraystatus - key: sensor.server_arrayprotection - type: conditional conditions: - entity: sensor.glances_disk_used_percent state_not: "unavailable" - entity: sensor.glances_disk_used_percent state_not: "unknown" card: type: custom:bar-card align: split show_icon: true padding: 4px columns: 2 card_style: border-radius: 5px severity: - value: 50 color: '#3bb3ee' - value: 80 color: '#e7a24a' - value: 100 color: '#ff0000' entities: - entity: sensor.glances_disk_used_percent title: Disk max: 100 - entity: sensor.glances_cpu_used title: CPU max: 100 - type: conditional conditions: - entity: sensor.glances_disk_used_percent state_not: "unavailable" - entity: sensor.glances_disk_used_percent state_not: "unknown" card: type: custom:bar-card align: split show_icon: true padding: 4px columns: 2 card_style: border-radius: 5px severity: - value: 50 color: '#3bb3ee' - value: 80 color: '#e7a24a' - value: 100 color: '#ff0000' entities: - entity: sensor.glances_swap_used_percent title: SWAP max: 100 - entity: sensor.glances_ram_used_percent title: RAM max: 100 - type: conditional conditions: - entity: sensor.glances_containers_active state_not: '0' - entity: sensor.glances_disk_used_percent state_not: "unavailable" - entity: sensor.glances_disk_used_percent state_not: "unknown" card: type: custom:bar-card align: split show_icon: true padding: 4px columns: 2 card_style: border-radius: 5px entities: - entity: sensor.glances_containers_ram_used title: Docker RAM max: 10000 - entity: sensor.glances_containers_cpu_used title: Docker CPU max: 100 - type: conditional conditions: - entity: sensor.glances_disk_used_percent state_not: "unavailable" - entity: sensor.glances_disk_used_percent state_not: "unknown" card: type: custom:bar-card align: left title_position: left show_icon: true padding: 4px columns: 1 card_style: border-radius: 5px severity: - value: 50 color: '#3bb3ee' - value: 80 color: '#e7a24a' - value: 100 color: '#ff0000' entities: - entity: sensor.glances_containers_active title: Containers max: 40 My sensors: sensor: - 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') }}" Edited February 23, 2020 by skank Quote Link to comment
ElectricBrainUK Posted February 23, 2020 Author Share Posted February 23, 2020 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? Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 (edited) 9 minutes ago, ElectricBrainUK said: 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? config check says all is valid Dunno why the glances info all are gone, as soon as i add the attributes... If i delete the attributes cards, then its back visible Edited February 23, 2020 by skank Quote Link to comment
ElectricBrainUK Posted February 23, 2020 Author Share Posted February 23, 2020 That is strange, you havent ended up with two sesnor: tags in your configuration.yaml have you? Quote Link to comment
skank Posted February 23, 2020 Share Posted February 23, 2020 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 remote: - platform: harmony name: Harmony Hub host: !secret harmony 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.