https://home-assistant.io/
An open source home automation platform made in Python. There seems to be something called OpenHAB in this area.
By freely combining functions called "components", each component can control and automate the corresponding device. You can also display the status on a web page and control it from there.
Corresponding components includes IoT devices such as electric shutters that are unlikely to be available in Japan.
It is said that it supports such things. Also, it seems to support data acquisition from command line standard output (Command line sensor etc.), control from command line (Command line switch etc.), or creation of custom components using Python, so this kind of thing Those who are accustomed to the command will not be in trouble.
https://home-assistant.io/getting-started/
Raspberry Pi must be Raspbian Jessie. Installation from PyPI completes. https://home-assistant.io/getting-started/installation-raspberry-pi/
At the first startup, it automatically gets the Python module required by the component, or gets the current location from the IP address (used by the Sun (sunrise / sunset) component, etc.).
If you want to start automatically, refer to Launch Home Assistant on Boot. For Raspbian Jessie, set by Systemd method.
If you want to boot in demo mode
$ hass --demo-mode
Start with.
After booting, you can access the control web page by accessing http: // (IP address): 8123. Also, if you add the --open-gui
option at startup, the browser will open automatically after startup.
It feels like Android material design, and you can actually operate it from the browser screen of your smartphone.
I feel like the demo screen is a little overloaded.
https://home-assistant.io/getting-started/configuration/
A .homeassistant
directory is created in the home directory of the invoking user, and a configuration.yaml
file is created in it.
Settings are described in YAML. The time zone etc. has already been set from the current location information obtained from the IP address at the first startup, but you can change it.
For details, see the Configuration page above and the details page for each component.
After changing the settings, go to http: // (IP address): 8123 and click "Configuration" on the side panel. Click the [Configuration.yaml]-[CHECK CONFIG] button to check the setting description. If there are no problems, click [RELOAD CORE] to reflect the settings.
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# C for Celcius, F for Fahrenheit
temperature_unit: C
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Asia/Tokyo
#latitude
latitude: [abridgement]
#longitude
longitude: [abridgement]
#Login password
http:
api_password: [abridgement]
# Track the sun
sun:
Register your BME280 (temperature / humidity / barometric pressure sensor) and CPU temperature as Command line sensor. Also, get the CPU clock with CPU speed sensor. For acquisition from BME280, slightly modify Python script published by Switch Science, operate in Force mode, and operate at the temperature specified by the command line option. , Humidity, and barometric pressure were modified to be displayed.
sensor:
- platform: command_line
name: "BME280 temperature"
command: "/home/pi/sbin/bme280_sample.py -T"
unit_of_measurement: "°C"
- platform: command_line
name: "BME280 pressure"
command: "/home/pi/sbin/bme280_sample.py -P"
unit_of_measurement: "hPa"
- platform: command_line
name: "BME280 humidity"
command: "/home/pi/sbin/bme280_sample.py -H"
unit_of_measurement: "% RH"
- platform: cpuspeed
name: 'CPU speed'
- platform: command_line
name: "CPU Temperature"
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°C"
value_template: "{{ value | multiply(0.001) }}"
When the component is registered independently, it is displayed in the form of a round icon-shaped "badge" at the top of the control Web page. By grouping related components together, it can be displayed in a "card" format on the control Web page, and switches etc. can be controlled collectively. There is also a setting to group tabs. (view: yes) For the components to be grouped, describe the service name (entity_id) of each component in a list.
group:
Weather:
- sun.sun
In the room:
- sensor.bme280_temperature
- sensor.bme280_pressure
- sensor.bme280_humidity
Raspberry Pi 2:
- sensor.cpu_speed
- sensor.cpu_temperature
And the display looks like this.
Click the set component to display details such as graphs.
--Trial of other components --Automation settings using the acquired data --Linkage with various Web services via IFTTT --Creating custom components --Data acquisition from remote sensor
Recommended Posts