home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.02k stars 29.09k forks source link

izone control zone name is no longer populated #110696

Open alexeiw123 opened 5 months ago

alexeiw123 commented 5 months ago

The problem

the climate.name entity that is created for my izone system used to provide an attribute with the name of the control zone.

I have noticed that this is now showing as: control_zone_name: null at all times.

image

What version of Home Assistant Core has the issue?

core-2024.2.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

izone

Link to integration documentation on our website

https://www.home-assistant.io/integrations/izone

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 5 months ago

Hey there @swamp-ig, mind taking a look at this issue as it has been labeled with an integration (izone) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `izone` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign izone` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


izone documentation izone source (message by IssueLinks)

alexeiw123 commented 2 months ago

Any way that I'm able to provide something meaningful to progress this? I ran some debug logs but couldn't see anything useful.

I'm using the control zone in a template to get this for now:

{% set d ={
0: 'Room 1',
1: 'Room 2',
2: 'Room 3',
3: 'Room 4',
4: 'Room 5'
} -%}

{%- if state_attr('climate.izone_controller_x','control_zone') in d.keys() -%}
  {{ d.get(state_attr('climate.izone_controller_x','control_zone')) }}
{%- else %}
  {{ 'No Target Zone' }}
{%- endif %}
Swamp-Ig commented 2 months ago

I think what needs to happen is this line needs to change to:

return zone._zone.name

If you want to create a PR and test it, then I'll review and accept.

Swamp-Ig commented 2 months ago

Alternately you could create a template sensor that would do what you want it to too.

alexeiw123 commented 2 months ago

I think what needs to happen is this line needs to change to:

return zone._zone.name

If you want to create a PR and test it, then I'll review and accept.

Great, I'll take a look. I'm new to all this PR stuff, have done a few easy ones but will need to learn how to test my changes. Seems like a good place to start.

Alternately you could create a template sensor that would do what you want it to too.

Yep, that's what I've done above but I'd also like to fix it properly :)

Swamp-Ig commented 2 months ago

That would be great. The main thing that's holding back ongoing improvement of this component is getting stuff through code review. If I have someone else who can work on it with me, then they can approve PRs and then I can add further functionality.

alexeiw123 commented 2 months ago

That would be great. The main thing that's holding back ongoing improvement of this component is getting stuff through code review. If I have someone else who can work on it with me, then they can approve PRs and then I can add further functionality.

At the moment, I'm struggling a little with how I can make that change in my local install, considering that I don't have a development environment. Making the PR is fine - but testing it, not so much.

I'd love to be able to review and approve PRs but I don't have the development knowledge to be able to do so effectively to be honest.

Swamp-Ig commented 2 months ago

https://developers.home-assistant.io/docs/development_environment/

Any change needs to be tested before being accepted. You can set up a dev environment and add izone to it. You can have multiple HA instances connect to your existing izone.

stormshaker commented 2 months ago

Is there any way to figure out when rooms map to the d.keys() when creating a template sensor?

Also, the HA development environment looks very good. Maybe I can test it, too.

stormshaker commented 2 months ago

I setup the HA dev container yesterday to test the above change, and was able to start an instance of HA on my laptop. But, how can I connect it out to the iZone controller on the network? I added --network=host to the container runArgs, but it seems the iZone integration needs to discover the controller out on the network. When I try to add the iZone integration, it just doesn't discover the bridge. Someone said the dev container can't receive broadcast packets.

Swamp-Ig commented 2 months ago

I think I had it set up on a remote dev container on a linux VM. I don't think docker allows host mode on windows. I can't really remember though sorry.