Hi everybody,
I am trying to clean up my lovelace; what took one entire row is now, thanks to button-card
just one card. There is just one little thing I cannot fix: the little green circle one Prusa MK3S Current State
is an input_number
entity, which is float
by default.
Can I display it as int
instead? It will always be an integer, anyway (by that, I mean that the first float value is always 0
).
Below is how I display the card. I have tried piping to int
, but that will make the entire card disappear from lovelace. I didn’t find a setting to define the input_number
as integer
by default. Is there something I can do? Thank you for your ideas
- type: "horizontal-stack"
cards:
- type: "custom:button-card"
entity: sensor.prusa_mk3s_current_state
show_state: true
label: >
[[[
return "ETA " + states['sensor.mk3s_rest'].state
]]]
show_label: true
size: 20px
styles:
grid:
- position: relative
custom_fields:
notification:
- background-color: green
- border-radius: 50%
- position: absolute
- left: 51%
- top: -10%
- height: 20px
- width: 20px
- font-size: 10px
custom_fields:
notification: >
### this is the part in question >
[[[
return states['input_number.gedruckt_ohne_reinigung'].state
]]]
### <
tap_action:
action: call-service
service: input_number.set_value
service_data:
entity_id: input_number.gedruckt_ohne_reinigung
value: 0