请选择 进入手机版 | 继续访问电脑版

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

 找回密码
 立即注册
查看: 1527|回复: 11

[基础教程] 求助:Picture Elements 配置的时候有点问题,求指点!

[复制链接]

3

主题

23

帖子

108

积分

注册会员

Rank: 2

积分
108
金钱
85
HASS币
0
发表于 2021-11-12 14:45:06 | 显示全部楼层 |阅读模式
1.png
一切正常,点灯泡也能发光
2.png
但是现在点灯泡以外的其他地方,就会变成下图这样,找了半天文档,也没找到,有遇到过这类问题的,请指点一下,万分感谢!!!
3.png

我的配置文件:
type: picture-elements
image: http://192.168.0.210/hass/new/house2.png
elements:
  - type: image
    entity: light.keting_light
    tap_action: none
    hold_action: none
    state_image:
      'on': http://192.168.0.210/hass/new/keting1.png
      'off': http://192.168.0.210/hass/new/housebg.png
      unavailable: http://192.168.0.210/hass/new/housebg.png
    style:
      top: 50%
      left: 50%
      width: 100%
  - type: image
    entity: switch.esp8266_switch_shufangdeng
    tap_action: none
    hold_action: none
    state_image:
      'on': http://192.168.0.210/hass/new/shufang1.png
      'off': http://192.168.0.210/hass/new/housebg.png
      unavailable: http://192.168.0.210/hass/new/housebg.png
    style:
      top: 50%
      left: 50%
      width: 100%
  - type: icon
    entity: switch.esp8266_switch_shufangdeng
    tap_action:
      action: toggle
    hold_action: none
    icon: mdi:lightbulb
    style:
      top: 57%
      left: 25%
  - type: icon
    entity: light.light.keting_light
    tap_action:
      action: toggle
    hold_action: none
    icon: mdi:lightbulb
    style:
      top: 57%
      left: 60%
  - type: state-label
    entity: sensor.wendu
    prefix: 温度:
    style:
      top: 92%
      left: 10%
      font-size: 10px


回复

使用道具 举报

2

主题

333

帖子

2278

积分

金牌会员

Rank: 6Rank: 6

积分
2278
金钱
1940
HASS币
30
发表于 2021-11-12 17:53:58 | 显示全部楼层
本帖最后由 fung1006 于 2021-11-12 18:17 编辑

housebg.png是什麼來?換成透明png

建議打包你的圖片上載上來
回复

使用道具 举报

3

主题

23

帖子

108

积分

注册会员

Rank: 2

积分
108
金钱
85
HASS币
0
 楼主| 发表于 2021-11-12 21:27:06 | 显示全部楼层
fung1006 发表于 2021-11-12 17:53
housebg.png是什麼來?換成透明png

建議打包你的圖片上載上來

housebg.png 就是一张透明的图片 housebg.png
回复

使用道具 举报

2

主题

333

帖子

2278

积分

金牌会员

Rank: 6Rank: 6

积分
2278
金钱
1940
HASS币
30
发表于 2021-11-12 23:05:23 | 显示全部楼层
本帖最后由 fung1006 于 2021-11-12 23:06 编辑

第6, 18行錯了。
正確寫法

    tap_action:
      action: none
    hold_action: none
回复

使用道具 举报

2

主题

333

帖子

2278

积分

金牌会员

Rank: 6Rank: 6

积分
2278
金钱
1940
HASS币
30
发表于 2021-11-12 23:10:22 | 显示全部楼层
另外,其實不用額外載入一張空白png的,只要用相同的圖片,然後設成透明即可,效果相同但省資源
例如

    state_image:
      'on': /local/test/bedroom_on.png
      'off': /local/test/bedroom_on.png
    state_filter:
      'off': opacity(0%)
回复

使用道具 举报

3

主题

23

帖子

108

积分

注册会员

Rank: 2

积分
108
金钱
85
HASS币
0
 楼主| 发表于 2021-11-13 20:35:37 | 显示全部楼层
fung1006 发表于 2021-11-12 23:10
另外,其實不用額外載入一張空白png的,只要用相同的圖片,然後設成透明即可,效果相同但省資源
例如

好的 谢谢 我再测试
回复

使用道具 举报

2

主题

333

帖子

2278

积分

金牌会员

Rank: 6Rank: 6

积分
2278
金钱
1940
HASS币
30
发表于 2021-11-14 17:55:19 | 显示全部楼层
silence181 发表于 2021-11-13 20:35
好的 谢谢 我再测试

解決了?
回复

使用道具 举报

3

主题

23

帖子

108

积分

注册会员

Rank: 2

积分
108
金钱
85
HASS币
0
 楼主| 发表于 2021-11-14 21:40:41 | 显示全部楼层

还没有,我把温度的那个块配置放到最上面,用ha APP打开没问题了,但是用浏览器还是一样
回复

使用道具 举报

2

主题

333

帖子

2278

积分

金牌会员

Rank: 6Rank: 6

积分
2278
金钱
1940
HASS币
30
发表于 2021-11-15 12:07:22 | 显示全部楼层
本帖最后由 fung1006 于 2021-11-15 12:08 编辑
silence181 发表于 2021-11-14 21:40
还没有,我把温度的那个块配置放到最上面,用ha APP打开没问题了,但是用浏览器还是一样 ...

你第6, 18行錯了,我已經測試了改完後就沒問題
    tap_action:
      action: none
    hold_action: none
回复

使用道具 举报

3

主题

23

帖子

108

积分

注册会员

Rank: 2

积分
108
金钱
85
HASS币
0
 楼主| 发表于 2021-11-21 10:25:03 | 显示全部楼层
fung1006 发表于 2021-11-15 12:07
你第6, 18行錯了,我已經測試了改完後就沒問題
    tap_action:
      action: none

感谢感谢  我也搜到问题了 现在好了
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-3-29 08:56 , Processed in 0.127531 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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