Skip to content

Home Assistant

Marc-Olivier Arsenault edited this page Dec 13, 2022 · 1 revision

Home Assistant

There is a light Home Assistant integration using the rest api.

Configuration

In configuration.yaml

rest:
  - scan_interval: 60
    authentication: basic
    username: "user"
    password: "pass"
    resource: http://127.0.0.1:5000/state
    method: "POST"
    sensor:
      - name: "Tefnut"
        value_template: "'{{value_json.state}}'"
        json_attributes:
          - "current_temp"
          - "future_temp"
          - "humidity"
          - "humidity delay"
          - "humidity time"
          - "mode"
          - "state"
          - "target_humidity"
          - "target_temp"
          - "auto_delta"
          - "temp delay"
          - "temp time"

rest_command:
  tefnut_mode:
    url: http://127.0.0.1/state
    username: "user"
    password: "pass"
    method: POST
    #payload: '{"profile":{"status_text": "{{ status }}","status_emoji": "{{ emoji }}"}}'
    payload: '{"mode":"{{ mode }}"}'
    content_type:  'application/json; charset=utf-8'
  tefnut_target_humidity:
    url: http://127.0.0.1/state
    username: "user"
    password: "pass"
    method: POST
    #payload: '{"profile":{"status_text": "{{ status }}","status_emoji": "{{ emoji }}"}}'
    payload: '{"manual_target":{{ manual_target }}}'
    content_type:  'application/json; charset=utf-8'

UI (Lovelace)

You can add an entity card image

type: entities
entities:
  - type: attribute
    entity: sensor.tefnut
    name: Mode
    icon: mdi:auto-fix
    attribute: mode
  - type: attribute
    entity: sensor.tefnut
    name: State
    icon: mdi:air-filter
    attribute: state
  - type: attribute
    entity: sensor.tefnut
    name: Humidity
    icon: mdi:water-percent
    attribute: humidity
  - type: attribute
    entity: sensor.tefnut
    name: Current Humidity
    icon: mdi:water-percent
    attribute: target_humidity
title: Tefnut
state_color: false

Command

To change Tefnut mode

service: rest_command.tefnut_mode
data:
  mode: "OFF"

To change Tefnut target

service: rest_command.tefnut_target_humidity
data: {manual_target: 32}
Clone this wiki locally