『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: 27hh

[进阶教程] 闲置安卓手机安装HA变身智能家居中枢,及网关接入教程

  [复制链接]

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-18 22:20:09 | 显示全部楼层
polofun 发表于 2018-3-18 21:50
连不上,我输入了两个运行,你看下问题在哪里
1@localhost:~$ sudo /etc/init.d/avahi-daemon start
* Sta ...

你先把HA的启动搞好再说 (查看HA日志文件,看看报啥错)。
你说的那"两个运行"跟HA没关系,都是HB的东东,玩HK的才需要。

我只玩 HA, 所以你说的那"两个运行"及之后的东东我都没装,没相应的经验哈。
回复

使用道具 举报

1

主题

27

帖子

85

积分

注册会员

Rank: 2

积分
85
金钱
58
HASS币
0
发表于 2018-3-18 23:19:51 | 显示全部楼层
本帖最后由 polofun 于 2018-3-18 23:31 编辑
MAPGPS 发表于 2018-3-18 22:20
你先把HA的启动搞好再说 (查看HA日志文件,看看报啥错)。
你说的那"两个运行"跟HA没关系,都是HB的东东 ...

(homeassistant) homeassistant@localhost:/home/1$ hass
Traceback (most recent call last):
  File "/srv/homeassistant/bin/hass", line 11, in <module>
    sys.exit(main())
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/__main__.py", line 368, in main
    exit_code = setup_and_run_hass(config_dir, args)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/__main__.py", line 247, in setup_and_run_hass
    from homeassistant import bootstrap
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/bootstrap.py", line 14, in <module>
    from homeassistant import (
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config_entries.py", line 120, in <module>
    from .setup import async_setup_component, async_process_deps_reqs
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 9, in <module>
    from homeassistant import requirements, core, loader, config as conf_util
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/requirements.py", line 7, in <module>
    import homeassistant.util.package as pkg_util
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/package.py", line 10, in <module>
    from pip.locations import running_under_virtualenv
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/__init__.py", line 45, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 40, in <module>
    from pip._vendor import requests, six
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/_vendor/requests/__init__.py", line 98, in <module>
    from . import packages
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/_vendor/requests/packages.py", line 12, in <module>
    sys.modules['pip._vendor.requests.packages.' + mod] = sys.modules["pip._vendor." + mod]
KeyError: 'pip._vendor.urllib3.contrib'
(homeassistant) homeassistant@localhost:/home/1$

我运行hass就显示这一段,请问从那里开始修复重装

回复

使用道具 举报

0

主题

30

帖子

106

积分

注册会员

Rank: 2

积分
106
金钱
76
HASS币
0
发表于 2018-3-19 00:08:19 | 显示全部楼层


把图一中里的“Home”,改成“Home OK“,修改了configuration.yaml(见4),重启hass,没有修改成功,原因?另外,如何去掉图一的用户图标?
1、
conf1.png
2、----------------------------------------------------
The following errors have been logged this session:2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=turn_off, domain=homeassistant>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=turn_on, domain=homeassistant>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=toggle, domain=homeassistant>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=restart, domain=homeassistant>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=check_config, domain=homeassistant>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=reload_core_config, domain=homeassistant>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=create, domain=persistent_notification>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: service=dismiss, domain=persistent_notification>2018-03-18 23:58:21 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized2018-03-18 23:58:21 INFO (MainThread) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend2018-03-18 23:58:21 INFO (MainThread) [homeassistant.loader] Loaded api from homeassistant.components.api2018-03-18 23:58:21 INFO (MainThread) [homeassistant.loader] Loaded http from homeassistant.components.http2018-03-18 23:58:21 INFO (MainThread) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api2018-03-18 23:58:21 INFO (MainThread) [homeassistant.loader] Loaded introduction from homeassistant.components.introduction2018-03-18 23:58:21 INFO (MainThread) [homeassistant.setup] Setting up introduction2018-03-18 23:58:21 INFO (Thread-4) [homeassistant.components.introduction]

---------------
3、
conf.png

4、
-------------------configuration.yaml-------------------
homeassistant:
  # Name of the location where Home Assistant is running
  name: Home OK
  # Location required to calculate the time the sun rises and sets
  latitude: 38.909664
  longitude: 121.601487
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 53
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Asia/Shanghai
  # Customization file
  customize: !include customize.yaml


# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Track the sun
sun:

# Weather prediction
sensor:
  - platform: yr
  weather:
  - platform: yweather
    woeid: 2147986  

# Text to speech
tts:
  - platform: google



group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml


回复

使用道具 举报

1

主题

35

帖子

632

积分

高级会员

Rank: 4

积分
632
金钱
597
HASS币
0
发表于 2018-3-19 00:53:23 | 显示全部楼层
闲置的手机可以用起来了
回复

使用道具 举报

1

主题

27

帖子

85

积分

注册会员

Rank: 2

积分
85
金钱
58
HASS币
0
发表于 2018-3-19 00:57:41 | 显示全部楼层
本帖最后由 polofun 于 2018-3-19 01:01 编辑
MAPGPS 发表于 2018-3-18 22:20
你先把HA的启动搞好再说 (查看HA日志文件,看看报啥错)。
你说的那"两个运行"跟HA没关系,都是HB的东东 ...

1@localhost:~$ /home/homeassistant/.homeassistant/home-assistant.log
-bash: /home/homeassistant/.homeassistant/home-assistant.log: Permission denied
断开重连,输入你给的日志命令给我这个回答,不知道问题出在哪里
回复

使用道具 举报

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-19 07:45:23 来自手机 | 显示全部楼层
polofun 发表于 2018-3-18 23:19
(homeassistant) homeassistant@localhost:/home/1$ hass
Traceback (most recent call last):
  File "/s ...

手动运行hass的话,每次都要在终端窗口里先进入homeassistant的运行环境。请按以下步骤运行hass:
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
hass
回复

使用道具 举报

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-19 08:23:30 来自手机 | 显示全部楼层
jackwang99 发表于 2018-3-19 00:08
把图一中里的“Home”,改成“Home OK“,修改了configuration.yaml(见4),重启hass,没有修改成功,原 ...

我正在上班的班车上,用手机VNC连上家里红米手机服务器,把configuration.yaml里名字"Home"改为"Home No83",重启HA后网页显示是改成功的:

Screenshot_2018-03-19-08-16-53.png
回复

使用道具 举报

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-19 08:33:10 来自手机 | 显示全部楼层
jackwang99 发表于 2018-3-19 00:08
把图一中里的“Home”,改成“Home OK“,修改了configuration.yaml(见4),重启hass,没有修改成功,原 ...

你说的"用户图标"是主页中那一排红圆圈图标吧?
那是些传感器图标,你以后接入小米传感器后也是缺省显示在这里(当然你可以自己定制UI界面)。
是由你的configuration.yaml里的这一段控制的:
# Track the sun
sun:

# Weather prediction
sensor:
  - platform: yr
  weather:
  - platform: yweather
    woeid: 2147986
回复

使用道具 举报

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-19 08:44:52 来自手机 | 显示全部楼层
polofun 发表于 2018-3-19 00:57
1@localhost:~$ /home/homeassistant/.homeassistant/home-assistant.log
-bash: /home/homeassistant/.ho ...

你的用户名"1"没有权限去看用户homeassistant的东东,你在命令行前面加上 sudo 就可以了。
回复

使用道具 举报

1

主题

27

帖子

85

积分

注册会员

Rank: 2

积分
85
金钱
58
HASS币
0
发表于 2018-3-19 12:35:10 来自手机 | 显示全部楼层
MAPGPS 发表于 2018-3-19 08:44
你的用户名"1"没有权限去看用户homeassistant的东东,你在命令行前面加上 sudo 就可以了。 ...

用户1是我的安卓手机哎,我用户名叫1密码是1
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-6-2 22:12 , Processed in 4.401544 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表