rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
404 stars 82 forks source link

Change ports manually #387

Closed jmlugones closed 2 months ago

jmlugones commented 2 months ago

Hello. Thank you very much for developing this plugin. I have a question. I would like to know if it is possible to change the HTTP and RTSP ports without having to delete and add the device again. Maybe by editing some configuration file. Let me explain why I need that. I have Home Assistant in a virtual machine in Windows on an unused notebook. I use the Dahua plugin to add the cameras from the DVR I have at home, on my local network, which has an IP and uses the default ports. I have no problem with that. I want to add the cameras from another DVR that is in another house. I do not have a public IP in my house or in the other house. That is why I use SmartPSS on the notebook, which when you click Link To Web, creates a connection on the notebook's IP and assigns random ports that are indicated in the link. With this I can add the cameras with the Dahua plugin. The problem is that this connection lasts approximately 24 hours, then you have to click Link To Web again and it changes the ports. I have no choice but to remove the cameras and add them again with the new ports. I would like to know if there is a way to do this easily by editing some configuration file. Thanks.

HowserMD commented 2 months ago

I did not add all the events I needed to the cameras when I added them to HA, so I was able to edit config/.storage/core.config_entries, restart HA and that seemed to do the trick.

This of course, might not necessarily be the right way of doing this.

jmlugones commented 2 months ago

Hi. Sorry for my ignorance. How can I access that path? I have File Editor installed but it only allows me access to the "/homeassistant" folder.

HowserMD commented 2 months ago

I used the Samba share Add On and the editor (VS Code) on my local machine.

jmlugones commented 2 months ago

Hey, I hadn't thought of that. I'll give it a try. Thanks!

jmlugones commented 2 months ago

It worked perfectly. Thank you!