fhome

module
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT

README

fhome

Go Reference Go Report

Package and CLI to communicate with F&Home – a smart home system.

F&Home doesn't provide any kind of API, but I managed to figure out how it works using Chrome Devtools and by looking at the messages it sends over websockets.

Then I started putting together this project.

Package

The api package implements the F&Home API. Use it if you want make your own program interacting with it.

CLI apps

fhome

Command-line program to easily interact with your F&Home-enabled devices.

Depends on the api package.

Build

$ go build -o fhome ./cmd/fhome/*.go

Install

$ go install ./cmd/fhome

Help

$ fhome help
fhomed

Provides integration between F&Home and HomeKit. Intended to be used as a background daemon.

Depends on the api package.

Registering with systemd

  1. Copy the binary to a common location
$ sudo cp ./fhomed /usr/local/bin
  1. Create a service file
$ sudo cp ./fhomed.service /etc/systemd/system
  1. Reload changes
$ sudo systemctl daemon-reload

Extracing status logs from journald

$ journalctl \
  _SYSTEMD_UNIT=fhomed.service \
  --no-pager \
  --output json-pretty \
  | jq --slurp \
    --compact-output \
     '.[] | {timestamp: .__REALTIME_TIMESTAMP, msg: .MESSAGE}'

Or in a single line:

$ journalctl _SYSTEMD_UNIT=fhomed.service --no-pager -o json-pretty | jq -s -c  '.[] | {timestamp: .__REALTIME_TIMESTAMP, msg: .MESSAGE}'

Build

$ go build -o fhomed ./cmd/fhomed/*.go

Install

$ go install ./cmd/fhomed

Directories

Path Synopsis
Package api provides functionality to interact with smart home devices connected to F&Home system.
Package api provides functionality to interact with smart home devices connected to F&Home system.
cmd
fhomed/homekit
Package homekit bridges F&Home Cloud with HomeKit.
Package homekit bridges F&Home Cloud with HomeKit.
Package internal contains internal logic of the command line tools.
Package internal contains internal logic of the command line tools.

Jump to

Keyboard shortcuts

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