Giter Club home page Giter Club logo

ha-commander's Introduction

GitHub all releases

Installation:

Flow Launcher:

Flow_launcher

Simply type pm install ha-commander to have the plugin installed

Manual Installation:

Unzip HA-Commander.zip to your launchers plugin directory.

Launcher Plugin Path
Wox %appdata%\Wox\Plugins
Flow Launcher %appdata%\FlowLauncher\Plugins

Configuration

NEW in HA-Commander v3.0.0 and up with Flow Launcher 1.9.0 and up:

147866332-5574f241-9da8-44b8-96eb-8aa526fdeee6

Your settings are now located in your Launcher's settings directory:

Setting Type Default Description
host string http://127.0.0.1 Your Home Assistant URL
port int 8123 Your Home Assistant port
token string None https://developers.home-assistant.io/docs/auth_api/#long-lived-access-token
verify_ssl boolean true Rejects unverified SSL certs if set to true
max_items int 50 The max results the launcher will display (Lower is faster)

How-To:

Basic:

Begin by typing the default ActionWord: "ha" and an entity_id or friendly_name

image

Advanced:

Filter by domains:

Typing # will bring up a list of available domains. Selecting any domain will show all entities from that domain only.

image

Show only light entities:

by typing ha <domain>. HA-Commander shows only entities that start with that domain.

image

Show Logbook:

See recently changed entities by typing ha @. Selecting an entry brings up the entity in HA-Commander.

image

Control light brightness:

Change a lights brightness percentage by typing a number between 0-100 after a light entity

image

Light color and effects:

Light Color & Effects are now in the context menu of supported lights

image

Hide entities from results:

You can now hide entities by invoking the context menu and selecting "Hide Entity"

image

Requirements

Python 3.8 or higher

Flow Launcher 1.9.0 or higher

Buy Me A Coffee

ha-commander's People

Contributors

actions-user avatar akrasia avatar garulf avatar github-actions[bot] avatar lumattr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ha-commander's Issues

Flow Crashed because of HA Comander

Hi, the Flow Launcher crashed and it told me to open a new issue here

  1. copy below exception message

Flow Launcher version: 1.13.0
OS Version: Microsoft Windows NT 10.0.19045.0
IntPtr Length: 8
x64: True

Python Path: C:\Users\krona\AppData\Roaming\FlowLauncher\Environments\Python\PythonEmbeddable-v3.8.9\pythonw.exe
Node Path: C:\Users\krona\AppData\Roaming\FlowLauncher\Environments\Node.js\Node-v16.18.0\node-v16.18.0-win-x64\node.exe
Date: 02/19/2023 23:30:54
Exception:
HA-Commander Exception:
Websites: https://github.com/Garulf/HA-Commander
Author: Garulf
Version: 5.0.1
Flow.Launcher.Core.ExternalPlugins.FlowPluginException: C:\Users\krona\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\lib\urllib3\connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '******.duckdns.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(

---> System.IO.InvalidDataException: C:\Users\krona\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\lib\urllib3\connectionpool.py:1045: InsecureRequestWarning: Unverified HTTPS request is being made to host '*****.duckdns.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(

at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 294
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 299
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 314
at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 191
--- End of stack trace from previous location ---
at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 34
at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 190
--- End of inner exception stack trace ---
at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 210
at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass135_0.<g__QueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 811
--- End of stack trace from previous location ---
at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 785
at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.
2023-02-19.txt
ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

KeyError

Hello, I can see you have been busy creating Flow Launcher plugins. I love them all! Great work!

I am having some issues setting this one up though, and I'm sure it's just because I'm doing something wrong.

I have installed the plugin through PM command and I have given it the correct URL and generated a token and disabled Verify SSL, since I will be accessing over local network always on this PC.

I have disabled Verify SSL, since I didn't think it would work with SSL because I access it over LAN. Though, when I enable Verify SSL and restart flow launcher, then Flow Launcher crashes before it even starts and the Flow command window never opens on shortcut, until I open Flow Launcher settings, disable HA-Commander and restart Flow Launcher again.

So Flow Launcher crashes completely when I enable Verify SSL.

Trace Log

Traceback (most recent call last):
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.0\lib\flox\launcher.py, line 44, in run
    results = request_method(*request_parameters) or self._results
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.0\lib\flox\__init__.py, line 131, in _query
    self.query(query)
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.0\plugin\main.py, line 53, in query
    states = self.client.states()
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.0\plugin\homeassistant.py, line 118, in states
    entities.append(self.create_entity(entity))
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.0\plugin\homeassistant.py, line 143, in create_entity
    return _cls(self, entity)
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.0\plugin\homeassistant.py, line 432, in __init__
    for option in self.attributes[options]:
KeyError: 'options'

HTTPError

Please type any relevant information here

not sure when this started happening, but ha-commander will no longer connect--on any of my 3 machines---to homeassistant. it's been working with my token and this url for months.

image

any ideas?

Trace Log

``
Traceback (most recent call last):
File "C:\Users\xxxxxxx\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox\launcher.py", line 44, in run
results = request_method(*request_parameters) or self.results
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxxxxxx\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox_init
.py", line 131, in _query
self.query(query)
File "C:\Users\xxxxxxx\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\main.py", line 53, in query
states = self.client.states()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxxxxxx\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py", line 120, in states
_states = self.request("GET", "states").json()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xxxxxxx\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py", line 87, in request
response.raise_for_status()
File "C:\Users\xxxxxxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://XXXXXX.com/api/states

</p>
</details>

verify_ssl is ignored

The field verify_ssl in the settings is ignored.
Hard coding it in homeassistant.py:113 fixes it for me, but I couldn't figure out the correct way to use the settings value.

AttributeError

Please type any relevant information here

Heya! Love the work you've done on HA Commander, it's been wonderful to use.
I've added a Sonos Era 100 speaker in my setup and since then, every time I type ha to invoke a command, I get this error.

This happens whenever I played something on the Sonos via Spotify Connect, attributes on the media player entity are updated and include source: Spotify Connect and stays that way until I play something using another source.

If I play something using Sonos Radio for instance, the source attribute disappear on the media player entity.

Trace Log

Traceback (most recent call last):
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox\launcher.py, line 44, in run
    results = request_method(*request_parameters) or self._results
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox\__init__.py, line 131, in _query
    self.query(query)
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\main.py, line 53, in query
    states = self.client.states()
             ^^^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py, line 122, in states
    entities.append(self.create_entity(entity))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py, line 147, in create_entity
    return _cls(self, entity)
           ^^^^^^^^^^^^^^^^^^
  File C:\Users\skiant\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py, line 328, in __init__
    getattr(self, current_source).icon = radiobox-marked
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MediaPlayer' object has no attribute 'Spotify Connect'

Could not connect error

I'm getting this error both if trying the https with fully qualified domain name or http with IP:port.
Getting the error clears my settings.

Windows 11 HA does not react nor log anything to plugin.log

Hello,
this is a bit awkward.
I am trying to connect my Home Assistant instance to FlowLauncher using your plugin.
When I enter the address and secret, I hit the key combination to bring up the launcher and type "ha" and wait.
It loads for a while, but then ultimately fails.
My first step was, to enter the plugin directory and look out for any errors or hints in the log - but there are none!
The file is 0KB in size;
image

This seems to not be a device related issue, because I had the same log problem on my other AMD based machine.

I would love to provide more information, but there sadly isn't any obvious.
What steps could I take to debug further?

First install, getting TypeError

Hi, I have just discovered Flowlauncher and I have try tu use your plugin for HA but it seems that something is wrong.
I'm not even sure if it's correctly login to my HA instance because I don't see anything on the HA Log side

I have set the correct URL + Port put SSL to false and create a long Auth API key :
image

Am I missing something else ?

Trace Log

Traceback (most recent call last):
  File "C:\Users\mnage\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox\launcher.py", line 44, in run
    results = request_method(*request_parameters) or self._results
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mnage\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\lib\flox\__init__.py", line 131, in _query
    self.query(query)
  File "C:\Users\mnage\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\main.py", line 53, in query
    states = self.client.states()
             ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mnage\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py", line 122, in states
    entities.append(self.create_entity(entity))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mnage\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py", line 147, in create_entity
    return _cls(self, entity)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\mnage\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.1.1\plugin\homeassistant.py", line 455, in __init__
    for option in self.attributes["options"]:
TypeError: 'NoneType' object is not iterable

Screenshot :
image

ImportError: cannot import name 'Clipboard' from 'flox'

Python Path:
Date: 01/13/2022 17:17:06
Exception:

System.IO.InvalidDataException: HA-Commander|Traceback (most recent call last):
  File "C:\Users\aviv\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-3.0.3\main.py", line 10, in <module>
    from plugin.main import Commander
  File "C:\Users\aviv\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-3.0.3\plugin\main.py", line 7, in <module>
    from flox import Flox, Clipboard
ImportError: cannot import name 'Clipboard' from 'flox' (C:\Users\aviv\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-3.0.3\lib\flox\__init__.py)

UnboundLocalError

Sorry for bothering you again. But just tried updating the plugin and I am getting this error. Seems like a trivial bug, but just wanted to let you know.

Thanks! :)

Trace Log

Traceback (most recent call last):
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\lib\flox\launcher.py, line 44, in run
    results = request_method(*request_parameters) or self._results
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\lib\flox\__init__.py, line 131, in _query
    self.query(query)
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\plugin\main.py, line 53, in query
    states = self.client.states()
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\plugin\homeassistant.py, line 118, in states
    entities.append(self.create_entity(entity))
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\plugin\homeassistant.py, line 143, in create_entity
    return _cls(self, entity)
  File C:\Users\Anthon\AppData\Roaming\FlowLauncher\Plugins\HA-Commander-5.0.1\plugin\homeassistant.py, line 324, in __init__
    setattr(self, current_source, partial(self._select_source, source))
UnboundLocalError: local variable 'source' referenced before assignment

Does not show up after install

First of all, great plugin! (if it could be installed that is)

After installation, nothing shows up. I've changed the variables one's supposed to change.

The plugins show up in the directory you said it would show up: C:\Users\albin\AppData\Roaming\Wox\Plugins

But all other plugins are located in AppData/local and not AppData/roaming, C:\Users\albin\AppData\Local\Wox\app-1.3.524\Plugins

And as you can see from the directory path I have wox version 1.3.524.

My home assistant is running via duckdns and have ssl encryption activated, do you think that could be the issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.