The operator used to compare the current state against the value
value
/
string/number
required (unless operator is default)
If your entity is a sensor with numbers, use a number directly, else use a string
The value which will be compared against the current state of the entity. JS template is NOT supported if operator is regex
name
string | list
optional
Any string, 'Alert', 'My little switch is on', ...
if show_name is true, the name to display for this state. If defined uses the general config name and if undefined uses the entity name. Can also be built from parts, see Entity Names.
icon
string
optional
mdi:battery
The icon to display for this state - Defaults to the entity icon. Hide with show_icon: false.
color
string
var(--primary-text-color)
Any color, eg: rgb(28, 128, 199) or blue
The color of the icon (if color_type: icon) or the background (if color_type: card)
The order of your elements in the state object matters. The first one which is true will match. The value field for all operators except regex support JS templates.
Operator
value example
Description
<
5
Current state is inferior to value
<=
4
Current state is inferior or equal to value
==
42 or 'on'
This is the default if no operator is specified. Current state is equal (== javascript) to value
>=
32
Current state is superior or equal to value
>
12
Current state is superior to value
!=
'normal'
Current state is not equal (!= javascript) to value
regex
'^norm.*$'
value regex applied to current state does match
template
See templates for examples. value needs to be a javascript expression which returns a boolean. If the boolean is true, it will match this state