Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration parameter to be able to set the unique id part in HA #30

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

khakhux
Copy link
Contributor

@khakhux khakhux commented Mar 10, 2024

I made a change to be able to set the unique identifier part in sensors name in Home Assistant.

This can be useful in case you want to replace the ESP without having to reconfigure automations, etc in Home Assistant.

I tested the changes replacing my ESP with a new one and managing the device in Home Assistant as it was the old one.

Consider merging the code in case you think it could benefit anyone.

Thanks

Carlos

Copy link
Owner

@rbroker rbroker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @khakhux,

Thanks for the PR, I agree this sounds like it may be useful for people and the code changes look good to me. I only have a couple of very minor suggestions if you have a moment to check them!

Thanks,
Richard

README.md Outdated
| ----------- | ------------| -------- |
| `Unique Id` | Identifier to be used in Home Assistant sensors for this device. It should be unique for each Ecodan HVAC in the network. | False (It uses MAC address by default) |

Changing the defaul value can be used to replace the ESP device without having to reconfigure the entities in Home Assistant or the software reading the MQTT messages and writing the values in influxdb.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a very tiny thing but I guess this should say default?

@@ -173,6 +174,11 @@ namespace ehal::http
else
page.replace(F("{{cool_enabled}}"), "");

if (config.UniqueId)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess because this is a string not a boolean it might be clearer if we wrote it as:

if (config.UniqueId.length() > 0)

@khakhux
Copy link
Contributor Author

khakhux commented Mar 12, 2024

Thanks Richard I made both changes as suggested.

@rbroker rbroker merged commit c73c984 into rbroker:main Mar 12, 2024
@rbroker
Copy link
Owner

rbroker commented Mar 12, 2024

Thank you!

@khakhux
Copy link
Contributor Author

khakhux commented Mar 12, 2024

Thanks Richard for your good work and generosity.

The idea for this change originated when I had a problem with my ESP and tried to replace it with a different one.

I was a whole day without data from my HVAC and I felt a little bit lost. That's how much I benefit from this project 😀

@khakhux khakhux deleted the configure-uniqueid branch March 13, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants