esphomehomekit

package module
v0.0.0-...-bdbaa64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

README

ESPhome -> HomeKit Bridge

This library allows esphome device to be published and controlled over HomeKit.

It required a small Linux server with local connection to esphome device. I'm using Raspberry Pi 3, but also older versions should work without any problem. One instance consumes about 15 MB of RAM. For every device, you have to run a separate instance that will publish a new HomeKit device.

Fast Lane

  • compile library for your architecture
  • copy esphome-homekit executable on your server
  • create config.yaml in the same directory – here is one example:
name: mylight
address: 172.33.5.22:6053
password: myESPHomeAPIPassword

homekit:
  pin: "13062022"
  storage_dir: ./.homekit
  • run esphome-homekit binary from the same directory

Application will create a new subdirectory and store HomeKit information there (private key, connections, etc...).

What is supported?

This bridge is still in development phase and not all esphome features/types are not supported. Currently, supported types are:

  • Switch - will create HomeKit switch (simple On/Off)
  • Binary Sensor - will create Programmable Switch in HomeKit (single press will be mapped as On, double press as off). Using this, you can configure HomeKit devices to react on Binary Sensor from esphome
  • Fan - will create Fan in HomeKit but only with On/Off support
  • Light - will create Lightbulb in HomeKit. Only Brightness and On/Off is mapped
  • Sensor with device class of temperature and humidity - will create Temperature or Humidity sensor in HomeKit

Will Always be created single accessory with multiple HomeKit services.

Install as Service on Linux (Raspberry Pi)

Create systemd service file - for example esphk-bathroommirror.service

[Unit]
Description=ESPHome-HomeKit Bathroom Mirror
After=network.target
StartLimitIntervalSec=0

[Service]
RestartSec=1
Type=simple
Restart=always
User=pi
ExecStart=/usr/bin/esphome-homekit
WorkingDirectory=/home/pi/smart-home/bathroommirror

[Install]
WantedBy=multi-user.target

Install and start service

sudo ln -s /home/pi/smart-home/bathroommirror/esphk-bathroommirror.service /lib/systemd/system/esphk-bathroommirror.service

sudo systemctl daemon-reload

sudo systemctl enable esphk-bathroommirror

sudo systemctl start esphk-bathroommirror

To check the log use

journalctl -fu esphk-bathroommirror

Thanks to...

Contributions

Any kind of contributions/ideas are welcome.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ESPHomeService

type ESPHomeService interface {
	Start() error
}

func New

func New() ESPHomeService

type EntityType

type EntityType int
const (
	EntityTypeUnknown EntityType = iota
	EntityTypeBinarySensor
	EntityTypeCover
	EntityTypeFan
	EntityTypeLight
	EntityTypeSensor
	EntityTypeSwitch
	EntityTypeTextSensor
	EntityTypeCamera
	EntityTypeClimate
	EntityTypeNumber
	EntityTypeSelect
	EntityTypeLock
	EntityTypeButton
	EntityTypeMediaPlayer
)

type EntryMap

type EntryMap map[uint32]*entity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL