Hide card toggle? Custom ui

HI,

ive made a group and related card of several of my mqtt switches, to have their states ON/Off checked.
Since they are switches, i had to custom ui them and hide their individual toggle and show last state change, like thus:

switch.sw_cv_garage_state_cl:
  hide_control: true
  show_last_changed: true
switch.sw_cv_stookhok_state_cl:
  hide_control: true
  show_last_changed: true
switch.sw_cv_zolder_state_cl:
  hide_control: true
  show_last_changed: true
switch.sw_zonneboiler_zolder_state_cl:
  hide_control: true
  show_last_changed: true
switch.sw_freezer_bijkeuken_state_cl:
  hide_control: true
  show_last_changed: true

extra question: could i have done this for the full card instead of for the individual entities in the card?
to give you an idea of the switches:

sw_cv_zolder_state_cl:
      friendly_name: CV Zolder state
#          command_on: >-
#            curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"d3d82f50", "prop":"command", "value":"on"}}' http://ip/iungo/api_request
#          command_off: >-
#            curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"d3d82f50", "prop":"command", "value":"off"}}' http://ip/iungo/api_request
      command_state: >-
        curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"d3d82f50", "prop":"state"}}' http://ip/iungo/api_request
      value_template: >-
        {%- if value_json.rv.value == 'on' -%}
        {{ true }}
        {%- else -%}
        {{ false }}
        {%- endif -%}

the card shows fine now, with only one caveat: the toggle next to the title. Ive been fiddling with the custom ui, but can’t seen to get rid of it. How would i be able to do that?

please have a look for me? Also, originally i would have wanted to create binary sensors out of these mqtt switches but my mind started hurting ;-))( still, if you think thats possible, i would love to hear of course!

20

Read this:

From that page:

control (Optional): Set value to hidden. If hidden then the group switch will be hidden.

ofcourse! thanks!

53

now find a way to have them show on/off instead of a toggle and i’m done. or a V, like in this badge:
06
any thoughts for that?

Cheers,
Marius

I’m not sure but i think you can,t do that directly with a switch. Maybe creating a template binary sensor for each item that reads the state of the switch… It’s just a thought…

Hope that helps.

yes sure, thanks. This what I’ve been trying, without succes sofar :wink:
will pursue some more,
cheers,
Marius

Can you post what you have got so far?

sure, evolved quite some bit today;-)

06
Appliances on: Boolean sensors, with custom UI value derived from mqtt sensors
(note how the threshold I’ve set determines the Quooker is off, because is isn’t heating but in order/standby. I can now continue to build with the on/off state)

30
Critical devices: Commandline switches (mqtt doesn’t publish on/off), combined with custom ui value of mqtt sensor

41
Schakelaars, my original quest to be able to have cl switches combined with current power value, a lock here and there, and some nice icon.

All in all, im quite happy with the result sofar!
The empty badges are a result of the mqtt implementation of the hub. If the devices aren’t switched on, they don’t publish any value, hence my sensors are empty. Ive asked the dev to publish with the retain flag, and have good hopes they will soon.

Cheers,
Marius

1 Like

@Mariusthvdb that is a wonderful job! Well done!

thx,

made some extra boolean switches today:

once you know how, its quite simple really…

Cheers,
Marius

@andrey used his magic again:
i asked for this no more than 2 days ago, and delivered already. Wonderful!

extra extra badge is now an option in latest custom ui!

10

which is wonderful, cause now i can show 1 card while before a had to use 3…
cheers!
Marius

2 Likes

BTW for my home setup I use extra_data_template to display wattage and only when it is nonzero.

check, i hear you.

empty badges are because i had just restarted, and the sensors weren’t fully populated yet. They are mqtt sensors turned into switches, and my mqtt publisher doesn’t yet support the retain value, so home assistant has to wait for the new topic to be published.

Was trying the extra_data_template also, and maybe combine the option, would that also be possible: have a badge for lets say actual usage, and a extra_data_template to display asome other below the icon, for example total power, as in my double badge setup.

would you care to show your definition please?

btw: on my iPhone (6s, iOS 11.2.5) the double badges are gone. none are displayed. Rest showing fine, including the locks.
Might be a refresh issue, but theres no real way to tell, since the app doesn’t do refresh properly, even after hitting the refresh icon in settings.

I have

light:
  custom_ui_state_card: state-card-custom-ui
  extra_data_template: >
    if (attributes.power_consumption) return attributes.power_consumption + 'W'; return null;

My yard door has constant consumption of 0.7W so I have:

cover:
  custom_ui_state_card: state-card-custom-ui
  state_card_mode: single-line
  extra_data_template: >
    if (attributes.power_consumption && attributes.power_consumption > 1) return attributes.power_consumption + 'W'; return null;

thanks. that looks convenient indeed
the thing is i need them to read their power from a sensor like this:

- platform: mqtt
  state_topic: 'Mac_address/powerswitch-zwave/58ab8595/power'
  name: "CV Garage totaal"
  unit_of_measurement: "kWh"
  value_template: "{{ value | round(2) }}"

this mqtt sensor is made into a: sensor.cv_garage_totaal.

could you please suggest the correct template syntax for that? im a bit stuck here. it either results in unknown, or nothing at al…using the same template as in the definition above doesn’t do anything either.

Cheers,
Marius

Hi Marius.

Could you tell me how did you put sensors values into badges on right card? I 'm asking because I’m trying to do it with some extra badges but the state value is always visible (not in badge). And how about chart card when you click on one of device? - shows up or not?

sure, through customize.

binary_sensor.cv_garage_active_threshold:
  extra_badge:
    entity_id: sensor.cv_garage_actueel

Unfortunatelly, this not working for me.

This is what I have:
problem

And this is what I want:
ok

But I don’t know how to get rid of this value on the right and put it into badge or replace it with value from other sensor.
Here is my code in customize:

sensor.tmp_net_nodemcu_kth:
extra_data_template: ‘192.168.60.121’
extra_badge:
entity_id: device_tracker.wio_w__iot_huzzah_w_salonie

Use hide_control: true

1 Like