Skip to content

Conversation

@ederjc
Copy link

@ederjc ederjc commented May 25, 2025

Display Name

Added display_name to allow displaying original variable name / documented name in Home Assistant
image
Before: Devices were displayed e.g. as ac_discharge_watts

Related Commits

Device Serial

If serial number is auto discovered and not provided in configuration, it was not updated in the device dict and therefore not available in Home Assistant.
Also, the device name in Home Assistant was shown with "_" separation, would also allow space for nicer displaying.
Now:
image
Before: Growatt_

Related Commits

Model Number

Device model number has not been parsed from configuration and was not displayed in Home Assistant.
Now (if model available in config.cfg, here model = SPF6000 ES Plus):
image

Related Commits

Redundant Name Cleaning

Name cleaning is already done in

variable_name = variable_name.strip().lower().replace(" ", "_").replace("__", "_") #clean name
and has been removed from mqtt.py in 7ce4c43.

Add Attribute for availability_topic

Availability topic in offline message was not matching topic in online message:
Offline:

self.client.publish( self.base_topic + "/" + self.device_identifier + "/availability","offline")

Online:
info = self.client.publish(self.base_topic + "/" + from_transport.device_identifier + "/availability","online", qos=0,retain=True)

Added one common availability topic in 1683c96.

Thanks in advance for considering my changes.

@HotNoob
Copy link
Owner

HotNoob commented May 25, 2025

oh wow, much more organized than myself :P
i'll have to fully review it in a few days when i'm back from a trip.

look good at a glance.

@HotNoob HotNoob changed the base branch from main to v1.1.10 May 30, 2025 00:17
@HotNoob
Copy link
Owner

HotNoob commented May 30, 2025

hmmmn. so 2 things come to my mind for the display name change.

i think this should be user-configurable. this is a bit of a personal preference type of situation.
maybe something like "display_name_seperator" or "display_name_space"
under the mqtt transport config.
display_name_space=" "
display_name_space="_"
display_name_space=","

not sure if it's necessary to add an additional self.display_name variable.
since it's only in the mqtt discovery payload it would be ideally handled there.
ie, not needed for modbus -> canbus bridges ect... ( future design )

let me know if your up to make the changes, or i can go for it.

ty for contributing. it's a good idea / detail that i didnt notice.

@ederjc
Copy link
Author

ederjc commented Jun 4, 2025

sorry for the delayed reply! I absolutely agree with both your suggestions but will not find time in the next weeks to implement them. Please feel free to modify my PR or I will get back to it when I have the time to go deeper into your code.

@HotNoob HotNoob deleted the branch HotNoob:v1.1.10 August 13, 2025 01:34
@HotNoob HotNoob closed this Aug 13, 2025
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.

2 participants