pauln / tailwind-home-assistant

Tailwind iQ3 integration for Home Assistant
Apache License 2.0
25 stars 3 forks source link

IP Address reassignment #11

Closed mdp716 closed 11 months ago

mdp716 commented 1 year ago

Please modify so that the assigned IP address of the device can be changed in the Integration. As it is now, if the device gets a different IP address the integration has to be deleted and then reinstalled.

sgmorton commented 1 year ago

Easiest fix for me was to go to the my DHCP settings on my router and reserve the IP via MAC address. That way it always got the same DHCP IP number.

mdp716 commented 1 year ago

What is easiest is not what is best IMHO. Further, what is easy for you or any other given individual may not be easy or even possible for others. A good software architect is aware of this as they design their software and then engineer a system that addresses as many possibilities as possible.

You may be perfectly fine assigning whatever random IP address the device was given as a static assignment but that does not address many other potential scenarios, with the following being just a couple I can think of right off the top of my head:

  1. Many prefer to have an IP number assignment logic, in my case all static assignments exist in the first 99 addresses of a Class C network, dynamically assigned addresses exist in the 100 rang, and hardcoded addresses in the 200 range.
  2. Routers vary in how they handle Reserved DHCP addresses. Some require the reservation to pre-exist, some allow for the assignment of the Dynamically assigned address as a Reserved address and some do not.
  3. Other maintenance tasks, such as the replacement of an AP or Wireless Router result in unintentional assignments that need to be addressed.

You speak to only one area of my comments. Suppose someone initially buys and configures the system for a single garage door as a trial before committing to expanding to two or three doors and then they decide to expand. There is no way currently to add another door to an existing configured integration and the only recourse is to delete the integration and then re-install and configure it again.

What if a product owner sells the Tailwind system as well as the entire HA system with their home? The new homeowner will need to get their own Local Control Key and yet there is no way to edit that key value.

A well-engineered integration provides a means to edit all initial settings as doing so covers virtually any situation that may arise whether oneself can imagine it or not.

pauln commented 1 year ago

@mdp716 Firstly, sorry for not responding sooner. I'm a Tailwind customer - not an employee - so I built this component to integrate my own Tailwind device into my Home Assistant instance, and made it available for other Tailwind customers to install/use if they desire. As such, while I'll endeavour to keep up with any changes required to ensure compatibility with Home Assistant (and Tailwind firmware) updates, feature requests aren't generally my highest priority (though if accompanied by a pull request, I'd aim to review it reasonably promptly if possible).

Secondly, core configuration details such as the IP address and local control key don't tend to be configurable in other HA integrations. The "Configure" button which some integrations offer after initial setup is usually used for things which the user might want to change in normal use, rather than for connection details which most users won't typically change. Do you have any examples of device integrations which provide a way to reconfigure their connection parameters via the UI?

The points you raised in relation to the IP address don't really seem particularly relevant - sure, use whatever logic you like and/or work with your router's (or other DHCP server's) ways of doing things, and yes, replacing a router is almost always going to be a little painful (especially if it's also your DHCP server). Personally, I think that it makes sense to use some sort of static assignment for a device like this, as otherwise the integration will stop working any time the device gets assigned a different IP address; sure, making the IP address configurable in the integration would let you recover from that relatively easily, but it seems like an unnecessarily fragile setup which would only cause frustration.

On the other hand, your point about starting with one door and then expanding to additional doors seems like a more reasonable concern - though again, it's not an everyday occurrence, so having to remove and re-add the integration once in order to add the additional doors doesn't seem entirely unreasonable to me. Likewise, if you're selling your house, I guarantee you that removing and re-adding the device to HA won't be the hardest part of that process.

ronaldjeremy commented 11 months ago

is there a way to change the ip address in some config file?

mdp716 commented 11 months ago

is there a way to change the ip address in some config file?

You really should read existing comments before asking a question which had already been answered.

ronaldjeremy commented 11 months ago

is there a way to change the ip address in some config file?

You really should read existing comments before asking a question which had already been answered.

You really should be less of a dick. I read every single comment above before asking my question. All comments were about not being able to change the IP via the UI. My question was, is there a text/config file somewhere that can be manually changed to update the IP. That piece of data is stored somewhere. There must be some sort of file or database that can be manually edited to change it, if anyone knows please share what that place is.

mdp716 commented 11 months ago

is there a way to change the ip address in some config file?

You really should read existing comments before asking a question which had already been answered.

You really should be less of a dick. I read every single comment above before asking my question. All comments were about not being able to change the IP via the UI. My question was, is there a text/config file somewhere that can be manually changed to update the IP. That piece of data is stored somewhere. There might be some sort of file or database that can be manually edited to change it, if anyone knows please share what that place is.

You really should be less of an ignoramus. There is absolutely nowhere in my comments, or those of the developer that makes any mention of the UI. The reference by both of us is to the Integration. An integration refers to the entirety of the product.

For a bonus, an ignoramus is defined as an ignorant or stupid person. However, there is a difference between the two and my hope is that you are merely ignorant. Therefore, with that hope, allow me to educate your ignorance, as ignorance is curable whereas stupidity is not.

Integration = the action or process of combining two or more things in an effective way.

Based on that definition, a database value, XML file value pair, a text file, or for that matter any other object that is integral to the solution would be considered a component of the overall integration. Hopefully now you are better educated.

Your assumption that there is a value somewhere that contains the IP address is precisely the basis for my initial question. However, depending on home HA is set up, access to those values may not be readily apparent or advisable. As the developer mentioned, he is a customer of the product and so while he developed this integration, he may not know where the IP address gets stored in the HA system, nor would he need to know as that is what standards are for, so components can interoperate without having to fully understand the other pieces involved in the solution.

As it is now, the developer recommends removing the solution and re-installing it with the new IP address and even if he knows precisely where that IP address value is and how to change it, he has chosen not to share that knowledge and that is certainly within his right as he voluntarily submitted the solution for the greater good - so you, as a consumer of this integration have the choice of using it or not, as-is, since the developer has addressed the issue in the manner that he saw fit.

Enjoy your day.

ronaldjeremy commented 11 months ago

You really should be less of an ignoramus. There is absolutely nowhere in my comments, or those of the developer that makes any mention of the UI.

So it seems you are the one who needs to read existing comments. Because the developer explicitly says, "Do you have any examples of device integrations which provide a way to reconfigure their connection parameters via the UI". Read his reply again.

mdp716 commented 11 months ago

You really should be less of an ignoramus. There is absolutely nowhere in my comments, or those of the developer that makes any mention of the UI.

So it seems you are the one who needs to read existing comments. Because the developer explicitly says, "Do you have any examples of device integrations which provide a way to reconfigure their connection parameters via the UI". Read his reply again.

Thank you, you have effectively declared yourself a Stupid person, disappointing my hopes that you were just ignorant. As I choose not to engage in a battle of wits against someone who is woefully ill-equipped I will cease this engagement immediately out of an expression of charity to you.

pauln commented 11 months ago

Yikes! @ronaldjeremy Sorry you've had to suffer these responses from @mdp716 - who unfortunately doesn't seem to be particularly adept at fitting in to a community or treating others with respect.

Since @mdp716 never replied to my previous comment in this thread, it's possible that he didn't actually take the time to read it in full (despite referring authoritatively to the "comments... of the developer"), and so wasn't aware that I'd asked for examples of other integrations which provide connection configuration options via the UI after installation. Had he read and understood my comment, perhaps he would've responded that no, he didn't have any examples, but that he wasn't necessarily asking for a UI - that a way to change the IP address via a configuration file or similar non-UI approach would suffice.

I did indeed suggest that removing and re-adding the integration (noting that I'm just talking about the instance of the integration on the Settings -> Devices and Services page, not the removal and reinstallation of the integration's code/files) should probably suffice for the rare occasion when you need to change the IP address, such as shifting it from a dynamic IP address assigned during initial setup to a reserved/static address for ongoing use - or the number of doors, since most people don't add or remove doors to their garage on a daily basis. That said, if you'd prefer to instead modify a configuration file and restart HA, the configuration (along with that of your other integrations) is stored in the core.config_entries file within .storage inside your HA config folder. If you search for "tailwind" in that file, you should find the section for this integration; making your change(s) there and restarting HA should do the trick. Removing and re-adding the integration (instance) doesn't require restarting Home Assistant, though - so as long as you have your local control key handy (or don't mind checking it again), that might still be the nicer option (you'll probably have to assign your doors to an area again, but should be prompted to do so at the end of the setup process anyway - so it shouldn't be a massive imposition).