fhome

module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT

README

Welcome to F&Home – the worst smart home system ever.

– me

I did this thing not because it's easy, but because I thought it would be easy.

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 to make your own program interact with it.

Command-line 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
    
  2. Create a service file

    $ sudo cp ./fhomed.service /etc/systemd/system
    
  3. 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.
fhomed/webserver
Package webserver implements a few simple HTTP endpoints for discovery and control of smart home devices.
Package webserver implements a few simple HTTP endpoints for discovery and control of smart home devices.
Package highlevel provides convenient wrappers around some common functionality in the api package.
Package highlevel provides convenient wrappers around some common functionality in the api package.

Jump to

Keyboard shortcuts

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