Open titiviking opened 1 year ago
A pull request with a narrower scope is in #280.
It does not implement templating (which would be better, of course) but allows for setting two additional options for hide_if
configuration object:
entity
, andattribute
The named entity's state or attribute will be evaluated against value/below/above condition when set.
UPDATED: Not to claim credit - hiding by attribute value has already been implemented; it was just not mentioned in the documentation.
Can you make an exemple of hiding_by with an other entity state ? I can't find the correct YAML :
- entity: switch.wake_on_lan
name: Wake On Lan
hide_if:
- entity: sensor.my_pc_state
state: on
Please use the same keys (value
, below
, above
) as with the original version. The new keys entity
and attribute
just set the pointer to the value that should be evaluated when hiding/showing the entity.
Example:
- entity: sensor.fireplace_pump_speed
name: Pump
hide_if:
entity: fan.fireplace_pump_fan
value: "off"
the hide_if don't work in my config... I will do some tests to understand...
- entity: switch.wake_on_lan
name: false
show_icon: true
icon: mdi:power
hide_if:
entity: sensor.my_pc_state
value: 'on'
If this hide_if feature actually work, can someone add an example on the documentation? I have the same issue and can not get the correct yaml either. Thanks!
Pull request is on a feature branch. You have to install the Javascript manually and provide a gzipped version too.
Something in the lines of (use correct path depending on your Home Assistant installation):
$ cd /config/www/community/lovelace-multiple-entity-row
$ curl -O https://raw.githubusercontent.com/akomelj/lovelace-multiple-entity-row/feature/hide-if-entity/multiple-entity-row.js
$ gzip -c multiple-entity-row.js > multiple-entity-row.js.gz
I have just run these commands, cleared the browser cache, reloaded the Lovelace and hide_if
example from a few comments above works as intended.
$ ls -l multiple-entity-row.js multiple-entity-row.js.gz
-rw-r--r-- 1 andrej andrej 36073 jan 31 19:46 multiple-entity-row.js
-rw-r--r-- 1 andrej andrej 11906 jan 31 19:47 multiple-entity-row.js.gz
$ sha256sum multiple-entity-row.js multiple-entity-row.js.gz
1cba1ec64cdc4649d2b435e795676dea8b7996ed39b07f6c1b16d6a29a588ee8 multiple-entity-row.js
11440aade20aa6993e56f4842e39221fb27475d53bd8883de273a164ad29efd8 multiple-entity-row.js.gz
Thank you Andrej for your quick responds. I spend more time last night, followed your instructions but was unable to make it work. I may be doing this with incorrect syntax but I tried a few combinations and it still failed to hide. I was trying to hide the "distance" attribute from Espresense sensor but it did not work.
- entity: sensor.ble_iphonedad
secondary_info: last-updated
type: custom:multiple-entity-row
name: BLE_iPhoneDad
entities:
- attribute: distance
unit: m
hide_if:
entity: sensor.ble_iphonedad
value: "not_home"
Any progress here to get this feature request and the associated pull request done? I would need this feature, too, but am unable to contribute due to lack of programming skills.
Any progress on this? I really like this card, but want to hide the entire entity based on a state of the entity itself.
Allow for adding conditional element that displays or hides the complete multiple-entity-row from the dashboard based on the specified condition.
Currently the "Conditional Entity" type does not support attributes, but only entity states. A condition element in this multiple-entity-row would allow to also use templates to use attributes or more complex condition statements.