##################################################
## Components/Sensors
##################################################
cover:
  - platform: mqtt
    name: "PetDoor"
    command_topic: "homeassistant/cover/petdoor/set"
    state_topic: "homeassistant/cover/petdoor/state"
    # availability_topic: "homeassistant/cover/petdoor/availability"
    qos: 0
    retain: true
    payload_open: "OPEN"
    payload_close: "CLOSE"
    state_open: "OPEN"
    state_closed: "CLOSED"
    payload_available: "online"
    payload_not_available: "offline"
    optimistic: false

##################################################
## Recorder/History
##################################################
recorder:
  include:
    entities:
      - cover.petdoor

history:
  include:
    entities:
      - cover.petdoor
##################################################
## Components/Sensors
##################################################
cover:
  - platform: mqtt
    name: "PetDoor"
    command_topic: "homeassistant/cover/petdoor/set"
    state_topic: "homeassistant/cover/petdoor/state"
    # availability_topic: "homeassistant/cover/petdoor/availability"
    qos: 0
    retain: true
    payload_open: "OPEN"
    payload_close: "CLOSE"
    state_open: "OPEN"
    state_closed: "CLOSED"
    payload_available: "online"
    payload_not_available: "offline"
    optimistic: false

sensor:
  - platform: history_stats
    name: PetDoor opened today count
    entity_id: cover.petdoor
    type: count
    state: 'open'
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

##################################################
## Recorder/History
##################################################
recorder:
  include:
    entities:
      - cover.petdoor
      - sensor.petdoor_opened_today_count

history:
  include:
    entities:
      - cover.petdoor
      - sensor.petdoor_opened_today_count
Add count of uses of PetDoor
Add count of uses of PetDoor
