jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.
834 stars 108 forks source link

[#94] add energy, statistics function #149

Closed jekalmin closed 4 months ago

jekalmin commented 4 months ago

Objective

Example

스크린샷 2024-02-21 오후 10 34 59

Function

get_energy_statistic_ids

- spec:
    name: get_energy_statistic_ids
    description: Get statistics
    parameters:
      type: object
      properties:
        dummy:
          type: string
          description: Nothing
  function:
    type: composite
    sequence:
      - type: native
        name: get_energy
        response_variable: result
      - type: template
        value_template: "{{result.device_consumption | map(attribute='stat_consumption') | list}}"

get_statistics

- spec:
    name: get_statistics
    description: Get statistics
    parameters:
      type: object
      properties:
        start_time:
          type: string
          description: The start datetime
        end_time:
          type: string
          description: The end datetime
        statistic_ids:
          type: array
          items:
            type: string
            description: The statistic ids
        period:
          type: string
          description: The period
          enum:
            - day
            - week
            - month
      required:
        - start_time
        - end_time
        - statistic_ids
        - period
  function:
    type: native
    name: get_statistics