oyvindwe / connectlife-ha

ConnectLife integration for Home Assistant
GNU General Public License v3.0
18 stars 5 forks source link

Dehumidifier missing "current humidity entity" #22

Closed trajano closed 1 week ago

trajano commented 1 week ago

in 0.5.0 the current humidity entity is missing image

oyvindwe commented 1 week ago

Yes, this is because it is now a state attribute of humidifier. Whenever the type of a property is changed, the former entity will no longer be created. It will still exist as unavailable in HA until deleted. Another thing that needs to be documented.

trajano commented 1 week ago

image

trajano commented 1 week ago

Actually re-opening this unless you claim that you cannot have both the current_humidity device state and the sensor at the same time because at present there's no way I can find to display the current humidity value.

oyvindwe commented 1 week ago

It is displayed in the humidifier UI (disregard the actual % value - this is an AC that does not measure humidity which I reconfigured to be a humidifier to create the screenshot):

image

Current humidity also shows up in the charts:

image

If you want to build a dashboard, the "Entity" card can show state attributes:

image

Finally, in templates you would do like this (replace the entity id): {{ state_attr('humidifier.my_dehumidifier', 'current_humidity') }}

trajano commented 1 week ago

I'm actually just trying to get the current humidity value in the "badges" area of the dashboard. Right now it's not an option.

oyvindwe commented 1 week ago

Can you try to create a template sensor of the state attribute from the humidifier entity: https://www.home-assistant.io/integrations/template/ ?

It is not recommended to expose state attributes as sensors as well by the integration to avoid storing the same history on two separate entities.

That said, it is not difficult to support mapping ConnectLife properties to more than one entity, but it goes against a core principle of Home Assistant.

trajano commented 1 week ago

Thanks I used {{ state_attr('humidifier.dehumidifier', 'current_humidity') | float }} since I want it numeric. If HA's architecture recommends not to expose it that's fine let's not. Though I am curious why they made it difficult to get.

trajano commented 1 week ago

@oyvindwe I noticed that current_humidity_changed trigger does not appear to work. I am switching it to the template to as a workaround.

oyvindwe commented 1 week ago

@trajano That's unfortunate. Did you make a trigger using the template sensor or the state attribute? E.g.:

image
trajano commented 1 week ago

Yup that's how I did it.
image

trajano commented 1 week ago

After 0.7.0 update the template stopped working and I am not getting anything on the badge image

trajano commented 1 week ago

Actually after the update image

oyvindwe commented 1 week ago

Anything in the log?

trajano commented 1 week ago

Nothing of note in logbook. The entity just disappeared I think. But the sensors are still there?

trajano commented 1 week ago

Deleted and re-added all I see is the fan speed selector

image

So likely there are changes on humidifier that broke this.

trajano commented 1 week ago

Tracking the above problem in a new issue