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

 找回密码
 立即注册
查看: 3145|回复: 4

[求助] 0.76.1版 switch 出错,请教是为什么?

[复制链接]

6

主题

556

帖子

3476

积分

论坛元老

Rank: 8Rank: 8

积分
3476
金钱
2920
HASS币
0
发表于 2018-8-20 21:43:23 | 显示全部楼层 |阅读模式
0.76.1版 switch 出错,以前没有这个错误提示,请教大神
The following components and platforms could not be set up:
Please check your config.

回复

使用道具 举报

4

主题

282

帖子

3681

积分

论坛元老

Rank: 8Rank: 8

积分
3681
金钱
3399
HASS币
0
发表于 2018-8-20 21:53:50 | 显示全部楼层
根据你提供的内容答复如下

Keeps track which switches are in your environment, their state and allows you to control them.

Maintains a state per switch and a combined state all_switches.
Registers services switch.turn_on, switch.turn_off, and switch.toggle to control switches.
USE THE SERVICES
In the frontend open the sidebar. At the bottom, under Developer Tools, click Services. From the Service dropdown menu choose switch.turn_on or switch.turn_off from the list of available services. In the Entity dropdown menu choose or enter the entity ID you want to work with. This will enter something like the sample below into the Service Data field. Now hit CALL SERVICE.

{"entity_id":"livingroom_pin2"}
Service data attribute        Optional        Description
entity_id        yes        Only act on a specific switch. Otherwise it targets all switches.
回复

使用道具 举报

6

主题

556

帖子

3476

积分

论坛元老

Rank: 8Rank: 8

积分
3476
金钱
2920
HASS币
0
 楼主| 发表于 2018-8-20 22:12:10 | 显示全部楼层
honry 发表于 2018-8-20 21:53
根据你提供的内容答复如下

Keeps track which switches are in your environment, their state and allows ...

谢谢!我这样写有问题吗?
switch:
      my_smartfan_buzzer:
        value_template: "{{ is_state_attr('fan.my_smartfan', 'buzzer', true) }}"
        turn_on:
          service: fan.xiaomi_miio_set_buzzer_on
          "entity_id": "fan.my_smartfan"
        turn_off:
          service: fan.xiaomi_miio_set_buzzer_off
          "entity_id": "fan.my_smartfan"
回复

使用道具 举报

2

主题

712

帖子

4900

积分

论坛元老

Rank: 8Rank: 8

积分
4900
金钱
4188
HASS币
85
发表于 2018-8-21 13:20:18 | 显示全部楼层
本帖最后由 nice2943 于 2018-8-21 13:22 编辑

配置文件有問題~
寫法不是這樣
參考官網的
switch:  - platform: template    switches:      skylight:        value_template: "{{ is_state('sensor.skylight', 'on') }}"        turn_on:          service: switch.turn_on          data:            entity_id: switch.skylight_open        turn_off:          service: switch.turn_on          data:            entity_id: switch.skylight_close

回复

使用道具 举报

2

主题

712

帖子

4900

积分

论坛元老

Rank: 8Rank: 8

积分
4900
金钱
4188
HASS币
85
发表于 2018-8-21 13:21:27 | 显示全部楼层
switch:
  - platform: template
    switches:
      skylight:
        value_template: "{{ is_state('sensor.skylight', 'on') }}"
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.skylight_open
        turn_off:
          service: switch.turn_on
          data:
            entity_id: switch.skylight_close
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-10 11:07 , Processed in 0.052393 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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