找回密码
 立即注册

微信扫码登录

搜索
查看: 23469|回复: 21

[UI界面] FLOORPLAN 3D控制求助

[复制链接]

2

主题

412

回帖

2764

积分

金牌会员

积分
2764
金钱
2345
HASS币
30
发表于 2020-12-29 12:39:36 | 显示全部楼层
本帖最后由 fung1006 于 2020-12-30 21:46 编辑

用 input boolean 顯示圖像的狀態就可以解決
 - entity: input_boolean.home_living_lux
                    state_filter:
                      'on': opacity(100%)
                    state_image:
                      'off': /local/floorplan/img/trans.png
                      unavailable: /local/floorplan/img/trans.png
                      'on': /local/floorplan/img/img/living_lux_on.png
                    style:
                      left: 50%
                      top: 50%
                      width: 100%
                    type: image


窗帘的3D效果用gif就可以

ezgif-5-23e11fea9c4e.gif



回复

使用道具 举报

2

主题

412

回帖

2764

积分

金牌会员

积分
2764
金钱
2345
HASS币
30
发表于 2021-1-2 00:23:45 | 显示全部楼层
本帖最后由 fung1006 于 2021-1-2 00:25 编辑
mmygo 发表于 2020-12-30 23:02
救星,折腾了很久还是没有搞定,外网上很多提到INPUT_BOOLEAN,一直不理解,灯的实体ID,怎么和input_boole ...
開關連動到input_boolean
input_boolean:

  switch_unit_door_2:

    name: "ib switch unit door 2"



automation:

  - alias: "switch unit door 2 ON"

    trigger:

      - platform: state

        entity_id: switch.unit_door_2

        to: 'on'



    action:

      - service: input_boolean.turn_on

        entity_id: input_boolean.switch_unit_door_2



  - alias: "switch unit door 2 OFF"

    trigger:

      - platform: state

        entity_id: switch.unit_door_2

        to: 'off'



    action:

      - service: input_boolean.turn_off

        entity_id: input_boolean.switch_unit_door_2
最後直接用 input_boolean.switch_unit_door_2 顯示插座狀態

回复

使用道具 举报

2

主题

412

回帖

2764

积分

金牌会员

积分
2764
金钱
2345
HASS币
30
发表于 2021-1-2 00:37:04 | 显示全部楼层
mmygo 发表于 2020-12-30 23:02
救星,折腾了很久还是没有搞定,外网上很多提到INPUT_BOOLEAN,一直不理解,灯的实体ID,怎么和input_boole ...

先做一個template sensor獲取窗帘現在的打開數值狀況 (假設0-100%)
再按數值做圖...
回复

使用道具 举报

2

主题

412

回帖

2764

积分

金牌会员

积分
2764
金钱
2345
HASS币
30
发表于 2021-1-2 23:08:40 | 显示全部楼层
本帖最后由 fung1006 于 2021-1-2 23:14 编辑

建議不要用官方的floorplan,因為你的需求已超出了
直接用picture elements做floorplan就可以了,按鍵跟燈的狀態顯示要分開做,這個做法可以直接顯示light跟switch的狀態
我做了一個簡單的例子希望你明白最底圖片用全關燈狀態的floorplan
之後在上面蓋上不同燈/房間開關的狀態圖片
再之後在上面蓋上燈/switch的開關按鍵圖片,記得注意圖片的先後次序,按鍵要放最上層才能正常按到

Screenshot 2021-01-02 at 10.57.50 PM.jpg
elements:
    - entity: light.lifx_mini_bed_main
      state_image:
        'off': /local/floorplan/img/trans.png
        unavailable: /local/floorplan/img/trans.png
        'on': /local/floorplan/img/img/fung_on.png
      style:
        left: 50%
        top: 50%
        width: 100%
      type: image

    - entity: light.lifx_mini_bed_main
      state_filter:
        'off': opacity(40%) saturate(0%)
        unavailable: opacity(40%) saturate(0%)
        'on': opacity(100%)
      state_image:
        'off': /local/floorplan/img/ico_bulb.png
        unavailable: /local/floorplan/img/ico_bulb.png
        'on': /local/floorplan/img/ico_bulb.png
      style:
        left: 72%
        top: 55%
        width: 7%
      tap_action:
        action: toggle
      type: image

image: local/floorplan/img/img/floor_off.png
type: picture-elements




回复

使用道具 举报

2

主题

412

回帖

2764

积分

金牌会员

积分
2764
金钱
2345
HASS币
30
发表于 2021-1-3 22:02:31 | 显示全部楼层
mmygo 发表于 2021-1-3 20:44
谢谢回复,我的其他灯就是这么操作的,操作都正常,就是TEMPLATE LIGHT的状态不能第一时间反映出来,需要 ...

先用 value_template 獲取TEMPLATE LIGHT的狀態,然後你懂的
回复

使用道具 举报

2

主题

412

回帖

2764

积分

金牌会员

积分
2764
金钱
2345
HASS币
30
发表于 2022-9-5 12:25:37 | 显示全部楼层
偷心者联盟 发表于 2022-8-30 15:37
大佬用这个代码后,点击每个房间区域的图片会显示一个大椭圆,求解惑

提供代碼看看
確保所有圖片都正確路徑
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-10-16 03:34 , Processed in 0.060739 second(s), 10 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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