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

 找回密码
 立即注册
查看: 2682|回复: 1

[已解决] 关于yaml语法错误的问题,求助

[复制链接]

65

主题

853

帖子

3038

积分

论坛元老

Rank: 8Rank: 8

积分
3038
金钱
2180
HASS币
40
发表于 2018-2-22 11:52:24 | 显示全部楼层 |阅读模式
求助(格式肯定没有问题的,把语句换成别的不会报错,用上{% xxx %}就错了)
message: >
   {%for sens in states.sensor%}
  {{sens.name}}剩余电量{{sens.state_with_unit}}
  {%endfor%}电量不足{{now().strftime('%s')|int | timestamp_custom('%Y-%m-%d %H:%M:%S')}} !!!

这句话有什么问题呢?会导致配置检测不通过:
错误信息如下:
Testing configuration at /config
2018-02-22 11:50:17 ERROR (SyncWorker_0) [homeassistant.util.yaml] while scanning for the next token
found character '%' that cannot start any token
  in "/config/automations.yaml", line 527, column 16
2018-02-22 11:50:17 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: while scanning for the next token
found character '%' that cannot start any token
  in "/config/automations.yaml", line 527, column 16
回复

使用道具 举报

65

主题

853

帖子

3038

积分

论坛元老

Rank: 8Rank: 8

积分
3038
金钱
2180
HASS币
40
 楼主| 发表于 2018-2-22 12:31:21 | 显示全部楼层
找到错误了,原来是前面的语法有问题,不是527行...看来yaml检查判断也有不不准确的时候
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-20 00:57 , Processed in 0.347974 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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