Add Check Configuration To Menu

I know I cant be the first to ask… but I could find no mention with a search!

Can this be done?

When I’m toying around I typically have three views open on my machine (I have three monitors) Center is the IDE where Im futzing with code… the second is the primary UI and the third is generally a web search… it would be relly helpful If I could put check config button on the Main menu… I know I could just drop to the cmd line and run a check but command lines give me hives (windows developer here… you know the type…lol)!

There is already a check config service so you should be able to create a switch/button to call that service. The problem is that the results won’t be conveniently displayed as they are when using the regular check config button. The results using that service are only printed to the home-assistant.log and in the info page log listing.

Thanks… yeah… I was hoping to get the same functionality… just in a more convenient place… No bother… Its not a deal breaker…

You’re not the first person I’ve seen request this. I am working on something that will do exactly what you’re looking for, using AppDaemon. It should be released in the next couple days.

1 Like

hahaha ask and ye shall receive!

THX

Version 0.1.0 of my Config Check app has been released! Details here: Apop's Home Assistant Setup and Other Resources

Been using this and just upgraded to appdaemon 4 addon. Getting this error for check_config:

2020-01-15 10:37:53.551616 WARNING check_config: ------------------------------------------------------------
2020-01-15 10:37:53.551987 WARNING check_config: Unexpected error running initialize() for check_config
2020-01-15 10:37:53.552299 WARNING check_config: ------------------------------------------------------------
2020-01-15 10:37:53.556375 WARNING check_config: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 145, in initialize_app
    await utils.run_in_executor(self, init)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/appdaemon/apps/check-config/checkconfig.py", line 25, in initialize
    self.set_state("sensor.config_result", state="-", attributes = {"friendly_name": "Config Result", "detail": None})
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 191, in inner_sync_wrapper
    f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs))
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 285, in run_coroutine_threadsafe
    result = future.result(self.AD.internal_function_timeout)
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/site-packages/appdaemon/adapi.py", line 1360, in set_state
    return await self.AD.state.set_state(self.name, namespace, entity_id, **kwargs)
  File "/usr/lib/python3.8/site-packages/appdaemon/state.py", line 431, in set_state
    result = await plugin.set_plugin_state(namespace, entity_id, **kwargs)
  File "/usr/lib/python3.8/site-packages/appdaemon/plugins/hass/hassplugin.py", line 369, in set_plugin_state
    api_url = "{}/api/states/{}".format(config["ha_url"], entity_id)
KeyError: 'ha_url'

2020-01-15 10:37:53.556654 WARNING check_config: ------------------------------------------------------------
2020-01-15 10:37:53.557812 INFO AppDaemon: App initialization complete

When do you think there will be support for appdaemon 4/
I also added to the github issue that had been started already.

Thanks.

This is fixed in an update to Appdaemon4 to 0.1.1 just now.

BUT I can’t trigger it to refresh unless I reload scripts and then it runs.

Thanks for letting me know. I haven’t had a chance to migrate to AppDaemon 4 yet, but I’ll take a look at this as soon as I do. Should be in the next week or so.

Starting to look into this now - are you using the folder watcher mode or manually running the script?

Just manually running it. It automatically runs if I reload scripts and this is the only way I can trigger it to execute now with appdaemon 4

Ok, I just upgraded to AD 4 so will run some tests here shortly and can hopefully find an easy fix.

1 Like

Install the config_check custom component in HACS. You could stop there as the config_check.run service sends the result to a persistent notification.

You could also install custom:home-feed-card to automatically display all persistent notifications on the page.

However, I also have browser_mod installed. One of its features allows you to display “toast” style popup messages in the lower left corner of the page. So, I use that to display the result.

script:
  config_check:
    sequence:
      - service: script.toast
        data:
          message: ✔️ config is running!
          duration: 5000

      # Run the config_check
      - service: config_check.run

      # Wait for the notification to appear
      - wait_template: "{{ states('persistent_notification.1337') is string }}"
        timeout: 00:03:00

      # Display the message as a toast notification
      - service: script.toast
        data_template:
          message: "{{ state_attr('persistent_notification.1337','message') }}"
          duration: 0
1 Like

I just pushed version 0.3.1 out. This should resolve the issue, go ahead and test when you have a chance. Thanks!

EDIT: Accidentally replied to my own post, so tagging @DavidFW1960 to make sure you see it.

2 Likes