Based on this info I’ve created a custom component
You will need to get your API key and generate a reCAPTCHA token to use it.
Please test it and let me know
Based on this info I’ve created a custom component
You will need to get your API key and generate a reCAPTCHA token to use it.
Please test it and let me know
Hi Matt, Exciting news to see this integration - thank you!.
Bit of a newbie question but how do I add in the custom HACS integration.
If I click on the custom repositories (within HACS/Integrations)
and add the repository as GitHub - matthewcky2k/homeassistant-perfectdraft: Perfect draft pro custom component for Home assistant
As soon as i click add I get the following prompted
“No manifest.json file found 'custom_components/.translations/manifest.json”
Is there an easier way to install or do I need to create the perfectdraft folder in custom_components,
then drop in the manifest.
Cheers
Steve
I restarted HA and it’s installed fine now. must of been the hacs service that was slightly borked out.
I will try, but not sure to know how to retrieve the reCAPTCHA token and the API key…
I’ll read google manual.
Zolric, If you find out how to retrieve the API key could you share the process please.
I’ll try also will share if I have any joy.
Thanks
Well, that’s interesting! Hadn’t considered getting a computer to write the plugin for me. I’ll install it now and see what happens - I can sniff the captcha code and the api key from the app’s comms and see how it works out.
If it works OK then I guess the next step would be to prompt the user to perform the captcha activity at the point of signing in with their username and password, generating the code that way. It’s only used at the point of initial sign-in to the API, once you are authenticated you have a token to use. I assume that expires, but there is a RefreshToken returned as well. Not clear yet from the traffic I’ve seen how that is used.
@matthewcky2k I’ll message you directly.
For you others on the thread - there is no way on earth this is ready for any of you to test out yet.
Huh well I guess there is no DM facility on here.
Well, x-api-key is cAyzERqthCJXYVExjNAhr9CzE8ncLN2cQK3WGK10
The recaptcha key (this is public info) is 6LdrqmApAAAAAB_kTEHVnx9pua3TMurf4i75a-aQ - this is used to generate the recaptcha token which is sent to the API as part of the authentication process. It is not what you need to paste into the integration, it needs to be generated for each login attempt. It would go in the recaptcha.html file.
OK my integration can handle the Recapcha according to the code you need to register here
Step 1: Register Your Site for reCAPTCHA v3Go to the Google reCAPTCHA admin console.Register your site, selecting reCAPTCHA v3.Take note of your site key and secret key.
Once you have this the integration handles the generation based on the site key and secret key. It asks for these values in the config flow.
Remember we are creating a recaptcha against perfectdraft’s token. They have already generated the key (begins with 6 in my previous post) and they already verify it at their side when signing into the API. We just need the user to be prompted to perform the recaptcha using that key that starts with a 6. User-side only needs the site key, which I have provided.
Separately, I can add your repo to HA but not the integration, I get:
Humm OK let me look at the error. Can you see anything else in the log?
Ah yeah should have looked there first! Have restarted HA etc.
Error occurred loading flow for integration perfectdraft: No module named ‘custom_components.perfectdraft.config_flow’
Regarding the recaptcha secret key - we as users will never know that, and it will never be required for this to work. recaptcha is a bit like PKI key exchange - we know the public key, we generate a value using that public key (which google calls a site key, starts 6Ldr in this case) and Perfectdraft verify it their side by processing it with their private key (which google calls a secret key).
Humm OK can you check the custom component folder to make sure that the config_flow.py file is definitely there? That error seems to suggest it doesn’t exist.
It appears to only be downloading en.json and manifest.json. Same if I click ‘redownload’ in HACS, nothing obviously related in the logs. A bit like it is only pulling down the translations directory rather than the whole repo.
If I manually clone the repo into that directory I can add the integration, when I go to configure it none of the fields have any names (so it is just a form of input fields with no text labels)
Then if I put the right text in the right boxes, I get:
2024-06-21 18:57:49.138 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform ‘perfectdraft.sensor’: Platform not found (No module named ‘custom_components.perfectdraft.sensor’)
I tried to remove
#self.recaptcha_site_key = recaptcha_site_key
#self.recaptcha_secret_key = recaptcha_secret_key
because i didn’t understand where it’s used. I replace the reptchaca.htm by the good one…
but no entity come up…
something should be wrong…
Like I said, this is in no way ready for other people to test it yet.
I have an error when i call recaptcha api… “website owner error”
I think i didn’t understand how it works exactly…
good, I have my token now… lets continu.
It seems like the folder structure is getting messed up somehow in github. Let me check my local code.