💾 Archived View for gemini.susa.net › home_automation.gmi captured on 2022-01-08 at 13:49:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

➡️ Next capture (2022-03-01)

-=-=-=-=-=-=-

Home Automation with Home Assistant

To start the server (based on the systemd configuration information), the following should work


sudo su - homeassistant
./bin/hass --daemon -c /home/homeassistant/.homeassistant

or simply

./bin/hass --daemon  # the above is the default configuration location

The following would run a non-detached instance as my own user (and create a new .homeassistant configuration folder in my home directory).

cd /srv/homeassistant
source bin/activate
./bin/hass

To SSH into the gateway, use root password from /home/homeassistant/README.gmi

ssh root@192.168.1.51

The boot process runs:

/etc/init.d/rcS -> /tuya/tuya_start.sh -> /tuya/serialgateway &

So check that serialgateway is running properly, and kill/restart if needed.

The web server is accessible on http://admin1:8123. No TLS for my LAN.

For reference, the hass usage is:

$ hass -h
usage: hass [-h] [--version] [-c path_to_config_dir] [--safe-mode] [--debug]
            [--open-ui] [--skip-pip] [-v] [--pid-file path_to_pid_file]
            [--log-rotate-days LOG_ROTATE_DAYS] [--log-file LOG_FILE]
            [--log-no-color] [--runner] [--script ...] [--daemon]

Home Assistant: Observe, Control, Automate.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -c path_to_config_dir, --config path_to_config_dir
                        Directory that contains the Home Assistant
                        configuration
  --safe-mode           Start Home Assistant in safe mode
  --debug               Start Home Assistant in debug mode
  --open-ui             Open the webinterface in a browser
  --skip-pip            Skips pip install of required packages on startup
  -v, --verbose         Enable verbose logging to file.
  --pid-file path_to_pid_file
                        Path to PID file useful for running as daemon
  --log-rotate-days LOG_ROTATE_DAYS
                        Enables daily log rotation and keeps up to the
                        specified days
  --log-file LOG_FILE   Log file to write to. If not set, CONFIG/home-
                        assistant.log is used
  --log-no-color        Disable color logs
  --runner              On restart exit with code 100
  --script ...          Run one of the embedded scripts
  --daemon              Run Home Assistant as daemon

Running bellows directly

Home automation uses zigpy to talk to Zigbee Coordinators (gateways). My gateway is a RealTek RTL8196, with a TuYa TYZS4 ZigBee module, which contains a Silicon Labs ARM-M4 CPU with integrated RF stack (EFR32MG1B232).

Paul Banks did some fantastic work rooting and hacking this device to make it useful.

Note that the hass server has to be shut down in order to use bellows directly, because the TCP->UART bridge only allows one connection to be made (obviously, since two processes driving the UART would be problematic!).

./bin/bellows --device 'socket://192.168.178.51:8888' info

The output is as follows:

[58:8e:81:ff:fe:d8:e2:73]
[0x0000]
[<EmberNetworkStatus.JOINED_NETWORK: 2>]
[<EmberStatus.SUCCESS: 0>, <EmberNodeType.COORDINATOR: 1>, EmberNetworkParameters(extendedPanId=5e:9e:4f:93:fd:4a:25:a6, panId=0x4ec9, radioTxPower=13, radioChannel=15, joinMethod=<EmberJoinMethod.USE_MAC_ASSOCIATION: 0>, nwkManagerId=0x0000, nwkUpdateId=0, channels=<Channels.ALL_CHANNELS: 134215680>)]
[<EmberStatus.SUCCESS: 0>, EmberCurrentSecurityState(bitmask=<EmberCurrentSecurityBitmask.TRUST_CENTER_USES_HASHED_LINK_KEY|64|32|HAVE_TRUST_CENTER_LINK_KEY|GLOBAL_LINK_KEY: 244>, trustCenterLongAddress=58:8e:81:ff:fe:d8:e2:73)]
Manufacturer:
Board name:
EmberZNet version: 6.5.0.0 build 188