Open dennislv opened 2 years ago
Hmm, that's the same setup I have on my server. Did you restart your instance after adding the the files?
Thanks for responding so quick. I restarted the HA with the reboot host option with the 'Configuration invalid' message still present. Once it restarted, I got the same error component not found error as before.
`Logger: homeassistant.setup Source: setup.py:162 First occurred: 6:51:14 PM (1 occurrences) Last logged: 6:51:14 PM
Setup failed for tuxedo: Integration not found.`
Here's a view of my system version/config. I was just wondering if there is an option to enable custom components or does HA automatically pick them up?
version | core-2022.4.7 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.9.9 |
os_name | Linux |
os_version | 5.10.108 |
arch | x86_64 |
timezone | America/Los_Angeles |
I just updated my Core to match yours, core-2022.4.7
and it still works.
Can you share your home-assistant.log
contents on boot?
It should list that it's found the custom_components
directory and loaded integrations from it.
I was just wondering if there is an option to enable custom components or does HA automatically pick them up?
I don't recall having to do toggle anything to get the integration to load.
2022-04-27 18:51:06 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration tuxedo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-04-27 18:51:06 ERROR (SyncWorker_1) [homeassistant.loader] The custom integration 'tuxedo' does not have a version key in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details
2022-04-27 18:51:06 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-04-27 18:51:13 ERROR (MainThread) [homeassistant.components.panel_custom] Unable to register panel Dominos: Either js_url, module_url or html_url is required.
2022-04-27 18:51:13 WARNING (SyncWorker_2) [pyhik.hikvision] Sensor type "audioexception" is unsupported.
2022-04-27 18:51:14 ERROR (MainThread) [homeassistant.setup] Setup failed for tuxedo: Integration not found.
Interesting, looks like this requirement of version was added afterwards, wonder why I don't receive that.
Can you add a version value to your manifest file and see if it loads?
That worked. But now when I add the Tuxedo Touch integration, I get 'Failed to connect to controller'.
The log shows
2022-04-27 20:31:07 WARNING (SyncWorker_4) [custom_components.tuxedo.config_flow] request to obtain key returned code 404
You are running a much newer firmware than I am, probably a different model of the panel.
If you clicked the System Http API
link what does it take you to?
Can you go to the url manually to see if you get the secret needed for encryption/decryption: http://192.168.0.6/TuxedoAPI or https://192.168.0.6/TuxedoAPI
If the https
version works and the http
does not then my guess is you have enabled it on your panel.
For now you can either disable that on your panel or in the config_flow.py
file modify the method _obtain_key
to use https
.
I will work on adding hassfest
integration into mine, for the version fix, and look into maybe adding a checkbox for https
if that solves your problem.
My version gives a 404 at 192.168.0.6/TuxedoAPI, http or https doesn't matter. When I click on the System Http API link, it takes me to http://192.168.0.6/tuxedoapi.html where I can browse the API calls. From what I can tell, the registration process looks the same, maybe just the endpoint moved in the newer version?
I changed the endpoint and was able to get the integration added to HA. All subsequent calls are broken
Changes to ./config_flow.py 35:- readit = requests.get(f"http://{ip_address}/TuxedoAPI") 35:+ readit = requests.get(f"http://{ip_address}/tuxedoapi.html")
[core-ssh tuxedo]$ cat ../../home-assistant.log 2022-04-28 15:13:01 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration tuxedo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-04-28 15:13:06 ERROR (SyncWorker_0) [custom_components.tuxedo.alarm_control_panel] endpoint /GetSecurityStatus returned a 401 NoneType: None
2022-04-28 15:13:06 ERROR (MainThread) [custom_components.tuxedo.alarm_control_panel] unable to get alarm status NoneType: None
I went into the js and found the register button call. Does it look like the api has changed between the versions?
$("#registerBtn").click(function () {
//var url = protocol + "://" + window.location.hostname + ":" + location.port + apibasepath + "/Registration/Register?Type=" + $("#Type").val() + "&Description=" + $("#Description").val() + "&uname=" + $("#uname").val() + "&pass=" + $("#pass").val() + "&mac=" + $("#mac").val() + "&operation=set";
//var dataCnt = encryptData("Type=" + $("#Type").val() + "&Description=" + $("#Description").val() + "&uname=" + $("#uname").val() + "&pass=" + $("#pass").val() + "&mac=" + $("#mac").val() + "&operation=set");
var dataCnt = encryptData("mac=" + $("#mac").val() + "&operation=set");
var url = protocol + "://" + window.location.hostname;
if (location.port != "")
url += ":" + location.port + "/";
url += apibasepath + "/Registration/Register"; //?param=" + encryptData(dataCnt);
//callAPI(url);
var header = "MACID:Browser,Path:" + hPath + "/Registration/Register";
callAPI_POST(url, dataCnt, dataCnt.length, CryptoJS.HmacSHA1(header, api_key_enc));
});
The line you modified is special. It is where the secret key is provided and used later on in all the actual api calls.
When you go to http(s)://192.168.0.6/tuxedoapi.html
can you open up your DevTools and see what calls are being made?
On my version I get https://{local_ipaddress}/TuxedoAPI
which returns the secret key.
Your registerBtn
and mine have one difference. Mine doesn't have the "/"
at the end of the url generation.
url += ":" + location.port;
is what mine looks like.
I also don't use that API call to register a devices mac address.
What does the beginning of your tuxedo.js
file look like? Mine is below:
function pageload() {
api_key_enc = document.getElementById("readit").value.substring(0,64);
api_iv_enc = document.getElementById("readit").value.substring(64, 96);
//$.ajaxSetup({headers:{"identity":api_iv_enc}});
}
It looks identical to yours. I'll do some digging and look for an endpoint that returns a key
`var api_key_enc; var api_iv_enc;
function pageload() { api_key_enc = document.getElementById("readit").value.substring(0,64); api_iv_enc = document.getElementById("readit").value.substring(64, 96); //$.ajaxSetup({headers:{"identity":api_iv_enc}}); } var protocol = "https"; var apibasepath = "/system_http_api/API_REV01"; var hPath="API_REV01"; `
I followed the instruction provided to install the Tuxedo Touch integration which did not work, Maybe I'm doing something wrong? I'm running the latest homeassistant os. I created the folder /config/custom_components/tuxedo and cloned the repo to that folder. As soon as I add 'tuxedo:' to /config/configuration.yaml home assistant throws the 'Integration error: tuxedo - Integration 'tuxedo' not found.' error. I'm still very new to HA so I'm assuming I've done something wrong. Thank you in advance!
![2022-04-27_17-30-23](https://user-images.githubusercontent.com/4878314/165653008-9171cf1e-192f-4b35-b6b6-cbaa0f17a482.png)