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

 找回密码
 立即注册
查看: 8224|回复: 8

[基础教程] 新手请教packages的事情

[复制链接]

33

主题

312

帖子

1849

积分

金牌会员

Rank: 6Rank: 6

积分
1849
金钱
1532
HASS币
40
发表于 2019-3-27 23:54:14 | 显示全部楼层 |阅读模式
本帖最后由 lione95678 于 2019-3-28 07:40 编辑

新手请教,群晖安装的hass,在homeassistan文件夹下新建了packages文件夹,复制了其他人的yaml文件(比如和风天气插件),然后在configuration.yaml修改,增加了packages: !include_dir_named packages,但是在配置-通用-配置重载-配置检查中,总是有错误,显示配置无效Invalid config for [sensor]: required key not provided @ data['platform']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor/。但是我在群晖的docker-容器-重启后,可以进入ha。请教应该怎么解决配置检查的问题(新手学习中,需不断试用配置检查)。看过一些帖子,把automations.yaml文件中的[]删除也不行,删除configuration.yaml文件中的automation: !include automations.yaml也不行,修改成#automation: !include automations.yaml也不行。

homeassistant:
  packages: !include_dir_named packages
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude:
  longitude:
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # 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


回复

使用道具 举报

14

主题

660

帖子

3959

积分

论坛元老

Rank: 8Rank: 8

积分
3959
金钱
3294
HASS币
10
发表于 2019-3-28 01:15:46 | 显示全部楼层
缩进问题 packages 第二级
回复

使用道具 举报

33

主题

312

帖子

1849

积分

金牌会员

Rank: 6Rank: 6

积分
1849
金钱
1532
HASS币
40
 楼主| 发表于 2019-3-28 07:41:40 | 显示全部楼层
本帖最后由 lione95678 于 2019-3-28 07:47 编辑

是缩进了啊
homeassistant:
  packages: !include_dir_named packages
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude:
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: [url]http://en.wikipedia.org/wiki/List_of_tz_database_time_zones[/url]
  time_zone: Asia/Shanghai
  # Customization file
  customize: !include customize.yaml

回复

使用道具 举报

8

主题

2073

帖子

6053

积分

论坛元老

流水无味

Rank: 8Rank: 8

积分
6053
金钱
3980
HASS币
145

灌水之王

发表于 2019-3-28 08:05:07 | 显示全部楼层
你的别人的 yaml文件发上来看看
回复

使用道具 举报

8

主题

736

帖子

4568

积分

论坛元老

Rank: 8Rank: 8

积分
4568
金钱
3827
HASS币
40
QQ
发表于 2019-3-28 08:16:48 | 显示全部楼层
本帖最后由 Aiden1 于 2019-3-28 08:18 编辑
homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: [url=http://en.wikipedia.org/wiki/List_of_tz_database_time_zones]http://en.wikipedia.org/wiki/List_of_tz_database_time_zones[/url]
  time_zone: Asia/Shanghai 
  # Customization file
  customize: !include customize.yaml
  packages: !include_dir_named packages
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
回复

使用道具 举报

33

主题

312

帖子

1849

积分

金牌会员

Rank: 6Rank: 6

积分
1849
金钱
1532
HASS币
40
 楼主| 发表于 2019-3-28 15:14:09 | 显示全部楼层
这是我的configuration.yaml
homeassistant:
  packages: !include_dir_named packages
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: [url=http://en.wikipedia.org/wiki/List_of_tz_database_time_zones]http://en.wikipedia.org/wiki/List_of_tz_database_time_zones[/url]
  time_zone: Asia/Shanghai
  # Customization file
  customize: !include customize.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Show the introduction message on startup.
introduction:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# 传感器
sensor:

# Text to speech
tts:
  - platform: google

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







回复

使用道具 举报

33

主题

312

帖子

1849

积分

金牌会员

Rank: 6Rank: 6

积分
1849
金钱
1532
HASS币
40
 楼主| 发表于 2019-3-28 15:18:58 | 显示全部楼层
这是homeassistant\packages\  文件夹的heweather.yaml文件
sensor: 
  - platform: heweather
    city: shanghai
    appkey: cece7677b23827608881ffa266c73cd9
    options:
      - temprature
      - humidity
      - pm25
      - no2
      - so2
      - co
      - o3
      - qlty

  - platform: heweather_hourlyforecast
    city: shanghai
    appkey: cece7677b23827608881ffa266c73cd9
    options:
      - remind
      - 3hour
      - 6hour
      - 9hour


weather:
    - platform: heweather_forecast
      city: shanghai
      appkey: cece7677b23827608881ffa266c73cd9

group:
  weather:
    view: no 
    name: 本地天气
    entities:
      - weather.localweather
  heweatherAQI: 
    view: no
    name: 本地空气质量
    entities:
      #- sensor.sensor.heweather_humidity
      #- sensor.heweather_temperature
      - sensor.heweather_qlty 
      - sensor.heweather_no2 
      - sensor.heweather_pm25
      - sensor.heweather_co 
      - sensor.heweather_so2 
      - sensor.heweather_o3

      
  hourlyforecast:
    view: no
    name: 小时天气预报
    entities:
      - sensor.remind
      - sensor.hourly_forcast_3 
      - sensor.hourly_forcast_6 
      - sensor.hourly_forcast_9
  


        

回复

使用道具 举报

33

主题

312

帖子

1849

积分

金牌会员

Rank: 6Rank: 6

积分
1849
金钱
1532
HASS币
40
 楼主| 发表于 2019-3-28 15:21:12 | 显示全部楼层
关键是在群晖的docker-容器-重启后,可以进入ha,而且和帖子的教程里面一下正常显示天气了,但是在配置-通用-配置重载-配置检查中,总是有错误,显示配置无效Invalid config for [sensor]: required key not provided @ data['platform']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor/
回复

使用道具 举报

1

主题

23

帖子

117

积分

注册会员

Rank: 2

积分
117
金钱
94
HASS币
0
发表于 2019-7-5 16:59:45 | 显示全部楼层
我的同样问题,安装斐讯DC1插件是一样显示:
nvalid config for [switch.phicomm_dc1m]: required key not provided @ data['192.168.123.107']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.phicomm_dc1m/。求教大神。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 04:25 , Processed in 0.058545 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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