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.
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.
The api
package implements the F&Home API. Use it if you want make your own
program interacting with it.
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
Provides integration between F&Home and HomeKit. Intended to be used as a background daemon.
Depends on the api
package.
Registering with systemd
- Copy the binary to a common location
$ sudo cp ./fhomed /usr/local/bin
- Create a service file
$ sudo cp ./fhomed.service /etc/systemd/system
- 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