Closed PulsarFX closed 5 months ago
hello @PulsarFX this is expected, because the card currently only supports numeric values for secondary info.
A workaround that would solve the issue is adding a template to your secondary sensor in addition to the sensor inside the entity
property (this way you can still click inside the secondary info to see more info about your switch):
- entity: sensor.car_charger
secondary_info:
entity: switch.car_charger
template: '{{states(''switch.car_charger'')}}'
color_value: true
unit_of_measurement: '%'
icon: mdi:battery-low
display_zero: true
unit_white_space: true
accept_negative: true
Nice workaround. :-D It's important to have the entity for secondary_info set to the same as the template. Otherwise the details won't open. The modified code from my first post looks like this:
individual:
- entity: sensor.steckdose_11_pc_power
name: PC Büro
icon: mdi:desktop-classic
secondary_info:
entity: switch.steckdose_11_pc
icon: mdi:electric-switch
display_zero: true
unit_white_space: false
accept_negative: true
decimals: 0
template: '{{states(''switch.steckdose_11_pc'')}}'
Previous to 0.2 it was possible to add a switch sensor to the secondary info. This is still possible to do, but the icon is not shown in the circle. Clicking this icon had opened the standard switch dialog for this entity.
old code:
new code:
Please make sure all of this applies and check the checkboxes, by writing "X" inside of them.
[X] I understand that this is a channel for reporting bugs, not a support forum (If you need help configuring the card, go to: Discussions).
[X] I have the latest version of the card installed.
[X] I have cleared my browser cache after installing, updating and configuring the card.
[X] The issue is not related to the UI-Editor not being rendered: "s.entries is not a function". This is a known bug, and is caused by Card Mod. Check the warning this readme section for more information on how to fix it.