landroid_cloud icon indicating copy to clipboard operation
landroid_cloud copied to clipboard

[FR]: Change the attributes into Entities or split them into single states

Open a-jey opened this issue 2 years ago β€’ 6 comments

Hi there.

After updating to the new version (coming from 1.8.2 i see that you completely got away from all sensors and now use attributes only. In addition to that it's one attribute for several states.

To be honest: this is hard to deal with as it just became tremendous complicated to work with all the states in own cards. For example: display the current blade-time or the battery percentage on a gauge card.

I created this complete page and I got no idea how to get this working with the new landroid_cloud version: https://community.home-assistant.io/t/worx-landroid-package-deprecated/119345/118?u=a-jey

At the moment I am trying to figure out how to get template sensors for these attributes running, but i stumble upon this:

For example, when I enter the following into developer template {{ states.vacuum.robby.attributes.firmware.version }} i got the result: "3.27" but if I enter it this way: {{ state_attr('vacuum.robby', 'firmware.version') }} the result is: "none" If I only enter firmware (without.version), both results are "{'auto_upgrade': False, 'version': 3.27}"

Same problem if I use attribute on an entities-card:

  • type: entities
    • type: attribute entity: vacuum.robby name: Firmware Version attribute: firmware.version

it doesn't work.

As you plan to become this an official addon I guess you'll need to change it back into entities. Please read frencks comment on this post: https://community.home-assistant.io/t/wth-are-attributes-such-a-pain-to-work-with/467837

And if you won't do that, then at least please split all states into single attributes.

Thank you.

a-jey avatar Oct 07 '22 22:10 a-jey

The integration is build around the vacuum platform, which generally just have contained everything as attributes.

As for the package you link to, that is not my work, but it's deprecated in favor of a custom card made by the same person.

MTrab avatar Oct 08 '22 02:10 MTrab

And as for the attributes, I find them no harder to work with than plain states.

MTrab avatar Oct 08 '22 02:10 MTrab

I ran into the same problem initially - just make template sensors like this:

  • Version --> value_template: "{{ state_attr('vacuum.robby', 'firmware').version }}"
  • Auto Upgrade --> value_template: "{{ state_attr('vacuum.robby', 'firmware').auto_upgrade }}"
  • Bladetime --> value_template: "{{ state_attr('vacuum.robby', 'blades').current_on }}"

etc.

phantomsphorever avatar Oct 08 '22 08:10 phantomsphorever

Thanks a lot. I really tried every combination but that one with the point after the closed bracked.

Now I can get my hands on the mower page again.

@MTrab A big thank you for doing this great work with the landroid cloud!

a-jey avatar Oct 08 '22 09:10 a-jey

while we're on the subject of attributes (i'm being lazy), how do I reference a nested attribute for a lovelace entity card?

I want to refer to the "error" -> "description" attribute but just can't seem to figure it out (without going down the template route which i'm trying to avoid);

Here's how its displayed in developer tools

vacuum.mower Attributes:

error: 
id: 0
description: no error

and here's how my sample Dashboard (Lovelace) card looks like:

type: entity
entity: vacuum.mower
attribute: error

But I just want to display the description value (not the 3). I have a feeling its something simple so apologies in advance for the ametuer question πŸ‘πŸ»

rosscullen avatar Oct 08 '22 20:10 rosscullen

@rosscullen not sure that's possible. Never had the usecase to test this, actually.

MTrab avatar Oct 10 '22 07:10 MTrab

while we're on the subject of attributes (i'm being lazy), how do I reference a nested attribute for a lovelace entity card?

I want to refer to the "error" -> "description" attribute but just can't seem to figure it out (without going down the template route which i'm trying to avoid);

Here's how its displayed in developer tools

vacuum.mower Attributes:

error: 
id: 0
description: no error

and here's how my sample Dashboard (Lovelace) card looks like:

type: entity
entity: vacuum.mower
attribute: error

But I just want to display the description value (not the 3). I have a feeling its something simple so apologies in advance for the ametuer question πŸ‘πŸ»

@rosscullen If I am understanding you correctly, You just need to set the value template as so - "{{ state_attr('vacuum.landroid_s', 'error').description}}"

Change vacuum.landroid_s to your device name, β€˜error’ being the attribute and .description pulling the nested attribute.

tektonnic avatar Oct 15 '22 13:10 tektonnic

Is it on the roadmap to move attributes to entities? HA is moving away from "everything is an attribute to an entity" to "everything is an entity to a device" since some month now. For example, battery should be a separate entity now with the correct device and state class

mbo18 avatar Jun 02 '23 06:06 mbo18

It is, yes - but have been postponed due to the issues with the new API and now the Vision series mower. Some day it will be split up into entities. If not before, then when we get the mower domain in public release.

MTrab avatar Jun 02 '23 06:06 MTrab

I ran into the same problem initially - just make template sensors like this:

  • Version --> value_template: "{{ state_attr('vacuum.robby', 'firmware').version }}"
  • Auto Upgrade --> value_template: "{{ state_attr('vacuum.robby', 'firmware').auto_upgrade }}"
  • Bladetime --> value_template: "{{ state_attr('vacuum.robby', 'blades').current_on }}"

etc.

Thank you, this was just what I also needed! :-)

NoralfG avatar Aug 20 '23 15:08 NoralfG