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

 找回密码
 立即注册
楼主: 花蟋蟀

[进阶教程] 【Lovelace】界面之斐讯DC1

  [复制链接]

17

主题

178

帖子

1472

积分

金牌会员

Rank: 6Rank: 6

积分
1472
金钱
1294
HASS币
0
发表于 2020-7-15 19:20:49 | 显示全部楼层
学习了..
回复

使用道具 举报

28

主题

360

帖子

2011

积分

金牌会员

Rank: 6Rank: 6

积分
2011
金钱
1651
HASS币
0
发表于 2020-8-3 16:39:51 | 显示全部楼层
bjy2005 发表于 2019-8-4 23:03
已经解决了, 是button_card 从网站下载之后是一个压缩包,我直接放入WWW目录中了, 导致系统ui设置的url  ...

系统ui设置的url 地址  在哪里修改
回复

使用道具 举报

28

主题

360

帖子

2011

积分

金牌会员

Rank: 6Rank: 6

积分
2011
金钱
1651
HASS币
0
发表于 2020-8-3 16:51:44 | 显示全部楼层
bjy2005 发表于 2019-8-9 22:40
需要的  需要去你homeassistant  编辑UI  进入原始编辑器,然后在最上面你添加最后一组就行,我的前2个url ...

资源(resources)不应再添加到 Lovelace 配置中,而是在 Lovelace 配置面板中添加。
回复

使用道具 举报

28

主题

360

帖子

2011

积分

金牌会员

Rank: 6Rank: 6

积分
2011
金钱
1651
HASS币
0
发表于 2020-8-3 17:01:27 | 显示全部楼层
bjy2005 发表于 2019-8-9 22:43
再之后你就可以按照楼主说的进入homeassistant  里面编辑UI 直接手动点添加卡片就行 代码粘贴进去就好, ...

请问button-card.js 这个文件在哪里? github下载下来的解压出来的文件夹里面没有这个文件啊
回复

使用道具 举报

76

主题

1357

帖子

1万

积分

元老级技术达人

积分
18384
金钱
16987
HASS币
290
发表于 2020-8-3 20:41:50 | 显示全部楼层
本帖最后由 dscao 于 2020-8-3 20:44 编辑

学习了,感谢分享。
最新版本的锁要用这种格式:
lock:
  enabled: true
有锁后,第一次点击解锁,3秒内再次点击开关生效。3秒后重新上锁。

回复

使用道具 举报

13

主题

238

帖子

3286

积分

论坛元老

Rank: 8Rank: 8

积分
3286
金钱
3048
HASS币
0
发表于 2020-8-15 13:53:33 | 显示全部楼层
dscao 发表于 2020-8-3 20:41
学习了,感谢分享。
最新版本的锁要用这种格式:
lock:

你好,我目前是新版本,确实作者原来的有锁在新版本没作用,目前我是直接添加实体卡片请问我该如何上锁?
1.jpg 2.jpg
回复

使用道具 举报

76

主题

1357

帖子

1万

积分

元老级技术达人

积分
18384
金钱
16987
HASS币
290
发表于 2020-8-15 23:51:13 | 显示全部楼层
本帖最后由 dscao 于 2020-8-15 23:54 编辑
lff520520 发表于 2020-8-15 13:53
你好,我目前是新版本,确实作者原来的有锁在新版本没作用,目前我是直接添加实体卡片请问我该如何上锁? ...

带锁的需要用这个类型的才行:

type: 'custom:button-card'

23.jpg


cards:
  - cards:
      - cards:
          - color: 'rgb(223, 150, 97)'
            color_type: card
            entity: sensor.dc1_power
            name: 功率
            show_icon: false
            show_label: false
            show_last_changed: false
            show_name: true
            show_state: true
            show_units: true
            state:
              - color: 'rgb(255, 255, 255)'
                operator: <
                styles:
                  card:
                    - filter: opacity(80%)
                  icon:
                    - filter: grayscale(100%)
                value: 0.1
            styles:
              card:
                - height: 40px
            type: 'custom:button-card'
          - color: 'rgb(142, 189, 208)'
            color_type: card
            entity: sensor.dc1_current
            name: 电流
            show_icon: false
            show_label: false
            show_last_changed: false
            show_name: true
            show_state: true
            show_units: true
            state:
              - color: 'rgb(255, 255, 255)'
                operator: <
                styles:
                  card:
                    - filter: opacity(80%)
                  icon:
                    - filter: grayscale(100%)
                value: 0.1
            styles:
              card:
                - height: 40px
            type: 'custom:button-card'
          - color: 'rgb(106, 180, 197)'
            color_type: card
            entity: sensor.dc1_voltage
            name: 电压
            show_icon: false
            show_label: false
            show_last_changed: false
            show_name: true
            show_state: true
            show_units: true
            state:
              - color: 'rgb(255, 255, 255)'
                operator: <
                styles:
                  card:
                    - filter: opacity(80%)
                  icon:
                    - filter: grayscale(100%)
                value: 220
            styles:
              card:
                - height: 40px
            type: 'custom:button-card'
        type: vertical-stack
      - color: 'rgb(146, 180, 97)'
        color_type: card
        entity: switch.dc1_1
        entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
        icon: 'mdi:power'
        lock:
          enabled: true
        name: 插孔1
        show_entity_picture: false
        show_icon: true
        show_label: false
        show_last_changed: false
        show_name: true
        show_state: false
        show_units: true
        state:
          - styles:
              card:
                - filter: opacity(80%)
              icon:
                - filter: grayscale(100%)
            value: 'off'
        styles:
          card:
            - height: 135px
        type: 'custom:button-card'
      - color: 'rgb(100, 200, 140)'
        color_type: card
        entity: switch.dc1_2
        entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
        icon: 'mdi:power'
        lock: false
        name: 插孔2
        show_entity_picture: false
        show_icon: true
        show_label: false
        show_last_changed: false
        show_name: true
        show_state: false
        show_units: true
        state:
          - styles:
              card:
                - filter: opacity(80%)
              icon:
                - filter: grayscale(100%)
            value: 'off'
        styles:
          card:
            - height: 135px
        type: 'custom:button-card'
      - color: 'rgb(123, 200, 164)'
        color_type: card
        entity: switch.dc1_3
        entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
        icon: 'mdi:power'
        lock: false
        name: 插孔3
        show_entity_picture: false
        show_icon: true
        show_label: false
        show_last_changed: false
        show_name: true
        show_state: false
        show_units: true
        state:
          - styles:
              card:
                - filter: opacity(80%)
              icon:
                - filter: grayscale(100%)
            value: 'off'
        styles:
          card:
            - height: 135px
        type: 'custom:button-card'
      - cards:
          - color: 'rgb(76, 195, 97)'
            color_type: card
            entity: sensor.dc1_today
            icon: 'mdi:wifi'
            name: 今日电量
            show_icon: false
            show_label: false
            show_last_changed: false
            show_name: true
            show_state: true
            show_units: true
            state:
              - operator: ''
                styles:
                  card:
                    - filter: opacity(60%)
                  icon:
                    - filter: grayscale(100%)
                value: -86
            styles:
              card:
                - height: 40px
            type: 'custom:button-card'
          - color: 'rgb(76, 195, 97)'
            color_type: card
            entity: sensor.dc1_yesterday
            icon: 'mdi:wifi'
            name: 昨日电量
            show_icon: false
            show_label: false
            show_last_changed: false
            show_name: true
            show_state: true
            show_units: true
            state:
              - operator: ''
                styles:
                  card:
                    - filter: opacity(60%)
                  icon:
                    - filter: grayscale(100%)
                value: -86
            styles:
              card:
                - height: 40px
            type: 'custom:button-card'
          - color: 'rgb(76, 195, 97)'
            color_type: card
            entity: sensor.dc1_total
            icon: 'mdi:wifi'
            name: 总电量
            show_icon: false
            show_label: false
            show_last_changed: false
            show_name: true
            show_state: true
            show_units: true
            state:
              - operator: ''
                styles:
                  card:
                    - filter: opacity(60%)
                  icon:
                    - filter: grayscale(100%)
                value: -86
            styles:
              card:
                - height: 40px
            type: 'custom:button-card'
        type: vertical-stack
    type: horizontal-stack
  - color: 'rgb(241, 103, 69)'
    color_type: card
    entity: switch.dc1_total
    entity_picture: /ha_sidebar-local/1.6.3/lovelace/air.jpg
    lock:
      enabled: true
    name: 1号插排电源总控 | USB电源
    show_entity_picture: false
    show_icon: false
    show_label: false
    show_last_changed: false
    show_name: true
    show_state: false
    show_units: true
    state:
      - styles:
          card:
            - filter: opacity(80%)
          icon:
            - filter: grayscale(100%)
        value: 'off'
    styles:
      card:
        - height: 40px
    type: 'custom:button-card'
type: vertical-stack


回复

使用道具 举报

13

主题

238

帖子

3286

积分

论坛元老

Rank: 8Rank: 8

积分
3286
金钱
3048
HASS币
0
发表于 2020-8-17 09:43:11 | 显示全部楼层
本帖最后由 lff520520 于 2020-8-17 14:59 编辑
dscao 发表于 2020-8-15 23:51
带锁的需要用这个类型的才行:

type: 'custom:button-card'

button-card
这个对0.114.0版本不兼容么?一直提示未找到button-card

==================================================
已解决,看来确实是button-card插件开始对0.114.0不支持了,作者已经两个多月没更新了,难受,现在homeassistant降级0.113.3正常显示
QQ截图20200817135110.jpg


ps:
代码最后一段有问题,一开始单纯以为添加设备号就行,没想到啊没想到,吃亏了才明白
QQ截图20200817145558.jpg
总控应该是  switch.dc1_1
上面三个插座的顺序应该是2、3、4,而不是1、2、3
回复

使用道具 举报

76

主题

1357

帖子

1万

积分

元老级技术达人

积分
18384
金钱
16987
HASS币
290
发表于 2020-8-19 10:42:33 | 显示全部楼层
lff520520 发表于 2020-8-17 09:43
button-card
这个对0.114.0版本不兼容么?一直提示未找到button-card

昨天先用测试机升级了一下,一开始也是出现所有自定义的模块都找不到。但半天后再打开一切都正常了。于是晚上又将正式的机器升级到0.114.2,结果一切正常。
回复

使用道具 举报

2

主题

76

帖子

1610

积分

金牌会员

Rank: 6Rank: 6

积分
1610
金钱
1534
HASS币
0
发表于 2020-8-19 13:30:48 | 显示全部楼层
试了很久都不能像楼主这样显示   0.113.3
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-27 22:06 , Processed in 1.775400 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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