roleoroleo / yi-hack-utils

This repo contains several programs compiled for yi-hack cams and useful for various situations
25 stars 4 forks source link

Home Assistant Rest Command Not Working #8

Closed johnwilliever closed 1 year ago

johnwilliever commented 1 year ago

Hi, I installed the nanotts on my cam and using the speak page, it works properly. But when I use the rest command in home assistant, it is not working and got a status code 401.

Please see the attached pic for reference. Screenshot_20230725-235109

roleoroleo commented 1 year ago

Did you set http authentication in the cam? And, did you set http authentication after adding the cam to ha?

johnwilliever commented 1 year ago

Yes, first I configured the http authentication in the cam and after, I added the cam into the HA. But, I reset the cam and reapplied the hack and added the nanotts.

Does it require to remove the cam from HA and add it again?

johnwilliever commented 1 year ago

Update: I removed the cam from HA and added it again. Same error, I got status code 401.

johnwilliever commented 1 year ago

Update: It's working now. I added rest command username and password variables in the configuration.yaml.

roleoroleo commented 1 year ago

Now I understand. You are not using the service yi_hack.speak. You are using the rest api directly. In this case you need to add user and password.

You could try to use the service.

johnwilliever commented 1 year ago

I see. I didn't know there's such a service under yi hack integration. I just follow your rest command example code posted on allwinner page. Anyway, thank you for this great camera hack.