I have my api somewhat working.
All the developer 101 “hello_world/hello_state” tutorial works. I was using my production hass with a custom.
Also I have forked and created a branch for my future component. I am using PyCharm and can run the hass from the command line. I can connect to that version via 127.0.0.1:8123. So now I have a test environment separate from my production.
I thought I could could create a config directory with the
configuration.yaml and a custom_component directory. I tried
putting it in the home-assistant and home-assistant/homeassistant directory
Question:
Can I create a configuration.yaml and run the hass from the developer environment?
If so where?
usage: hass [-h] [--version] [-c path_to_config_dir] [--demo-mode] [--debug]
[--open-ui] [--skip-pip] [-v] [--pid-file path_to_pid_file]
[--log-rotate-days LOG_ROTATE_DAYS] [--log-file LOG_FILE]
[--log-no-color] [--runner] [--script ...] [--daemon]
Home Assistant: Observe, Control, Automate.
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-c path_to_config_dir, --config path_to_config_dir
Directory that contains the Home Assistant
configuration
--demo-mode Start Home Assistant in demo mode
--debug Start Home Assistant in debug mode
--open-ui Open the webinterface in a browser
--skip-pip Skips pip install of required packages on startup
-v, --verbose Enable verbose logging to file.
--pid-file path_to_pid_file
Path to PID file useful for running as daemon
--log-rotate-days LOG_ROTATE_DAYS
Enables daily log rotation and keeps up to the
specified days
--log-file LOG_FILE Log file to write to. If not set, CONFIG/home-
assistant.log is used
--log-no-color Disable color logs
--runner On restart exit with code 100
--script ... Run one of the embedded scripts
--daemon Run Home Assistant as daemon
@awarecan First, thanks. I actually did get my almond_plus component and switch platform up. Still have a lot of clean up, testing, and I am sure there will be try/catches added.
As my OP suggested, I was going to debug my using the custom_components directory. If I used the -c hass would run the component without issues. But it would not load platforms. Then I tried an example sensor off the developers documentations it did not work either.
Before I tied that I really got off into the weeds. I kept thinking I was doing something wrong. When I tested the example platform sensor, that is what the developer documentation called it, in my production hass, it worked. So I tried my almond_plus component and platform it worked, well at least the first line of _LOGGER.debug worked.
That was the issue. When I started 3.7 was released and rule of thumb down load the newest. Learned that lesson. I downloaded 3.6.6. I am using PyCharm so it it easy to create a new environment.The new one I called venv36. So I can switch back and forth. The example sensor loads without error in the 3.6 environment.
.When you look at 3.7 I guess there will be an issue with this.
I am going to have to research that. Every time I think I am starting to move from ignorant to rookie, I go back to stupid.
I moved them back into the custom_components. I am getting this error
Log Details (ERROR)
Fri Jul 20 2018 00:03:22 GMT-0500 (Central Daylight Time)
Error loading custom_components.almond_plus. Make sure all dependencies are installed
Traceback (most recent call last):
File "C:\Users\paul\PycharmProjects\home-assistant\venv36\lib\site-packages\homeassistant-0.73.1-py3.6.egg\homeassistant\loader.py", line 86, in get_component
module = importlib.import_module(path)
File "C:\Users\paul\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\paul\PycharmProjects\home-assistant\config\custom_components\almond_plus.py", line 14, in <module>
import websocket
ModuleNotFoundError: No module named 'websocket'
I have this line in my code:
REQUIREMENTS = [‘websocket-client’]
I thought hass would load it automatically. Not sure why it worked with dev venv 3.7 and my production.