How can I use cover.garage in Lovelace Mini Graph Card? I am able to use Lovelace Mini Graph Card with occupancy sensors just fine and I am able to use cover.garage with history-graph just fine but I can’t figure out how to use cover.garage with Lovelace Mini Graph Card. Do I need to make a sensor out of cover.garage in order for it to work with Lovelace Mini Graph Card?
If I need to use a template how do I add it apart from the following?
sensor:
platform: template
sensors:
garage_door:
I see there is a Binary Sensor for garage_door but I don’t understand how to implement that.
Yeah, you’ll need to make a template sensor follow whatever you want.
All a template sensor does is combine various states of whatever you want to create a new sensor.
For a garage door, this would be a template binary sensor.
This goes with all of your other binary sensors if you have any. Don’t create another ‘binary_sensor’ in configuration.yaml unless you don’t have one.
binary_sensor:
- platform: template
sensors:
garage_door:
# This template needs to evaluate to true or false. When true, the binary sensor is on.
# So in this example, the sensor is 'on' if cover.garage_door state is open. Otherwise it's off.
value_template: "{{ is_state('cover.garage_door', 'open') }}"
device_class: "garage_door"
Now you can use this new binary_sensor.garage_door in a mini graph, or whatever else you need.
The thing you linked defines ‘device classes’. If you specify the device class of ‘garage_door’ to this template sensor, it will get the garage icon and a few other things with it.