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

 找回密码
 立即注册
123
返回列表 发新帖
楼主: 秋雨轩

[UI界面] 大家都用什么UI来显示电视遥控器?

[复制链接]

5

主题

357

帖子

2046

积分

金牌会员

Rank: 6Rank: 6

积分
2046
金钱
1674
HASS币
60
发表于 2021-11-16 21:43:50 | 显示全部楼层
chenquanhao 发表于 2021-11-12 21:46
可以提供一下你的配置参考吗
type: vertical-stack
cards:
  - type: custom:state-switch
    entity: template
    template: >-
      {% if is_state('media_player.keting_xiaomi_tv', 'off') %} weather {% else
      %} tv {% endif %}
    states:
      tv:
        type: picture-entity
        entity: camera.xiaomi_tv_capture
        name: mdi:television
        show_state: false
        show_name: false
        camera_image: camera.xiaomi_tv_capture
      weather:
        type: vertical-stack
        cards:
          - type: grid
            cards:
              - type: custom:button-card
                entity: sensor.processor_temperature
                name: ' '
                icon: mdi:raspberry-pi
                size: 50%
                aspect_ratio: 1/1
                styles:
                  card:
                    - height: 121px
                    - padding: 10%
                    - font-size: 10px
                    - text-shadow: 0px 0px 5px black
                    - text-transform: capitalize
                  grid:
                    - grid-template-areas: '"i temp" "n n" "cpu cpu" "ram ram" "disk disk"'
                    - grid-template-columns: 1fr 1fr
                    - grid-template-rows: 1fr min-content min-content min-content min-content
                  name:
                    - font-weight: bold
                    - font-size: 12px
                    - color: white
                    - align-self: middle
                    - justify-self: start
                    - padding-bottom: 3px
                  img_cell:
                    - justify-content: start
                    - align-items: start
                    - margin: none
                    - margin-top: '-15%'
                    - margin-left: '-12%'
                  icon:
                    - color: |
                        [[[
                          if (entity.state < 50) return 'lime';
                          if (entity.state >= 50 && entity.state < 70) return 'orange';
                          else return 'red';
                        ]]]
                    - margin-top: '-17%'
                  custom_fields:
                    temp:
                      - font-size: 16px
                      - align-self: start
                      - justify-self: end
                      - margin-top: 0%
                    cpu:
                      - font-size: 13px
                      - padding-bottom: 3px
                      - margin-left: '-2%'
                      - align-self: middle
                      - justify-self: start
                      - '--text-color-sensor': >-
                          [[[ if (states["sensor.processor_use_percent"].state >
                          80) return "red"; ]]]
                    ram:
                      - font-size: 13px
                      - padding-bottom: 3px
                      - align-self: middle
                      - margin-left: '-2%'
                      - justify-self: start
                      - '--text-color-sensor': >-
                          [[[ if (states["sensor.memory_free"].state < 1024)
                          return "red"; ]]]
                    disk:
                      - font-size: 13px
                      - margin-bottom: '-4%'
                      - margin-left: '-1%'
                      - align-self: middle
                      - justify-self: start
                      - '--text-color-sensor': >-
                          [[[ if (states["sensor.disk_free_config"].state < 10)
                          return "red"; ]]]
                custom_fields:
                  temp: |
                    [[[
                      return `<ha-icon
                        icon="mdi:thermometer"
                        style="width: 20px; height: 20px; color: yellow;">
                        </ha-icon><span>${entity.state}</span>`
                    ]]]
                  cpu: |
                    [[[
                      return `<ha-icon
                        icon="mdi:cpu-32-bit"
                        style="width: 19px; height: 19px; color: deepskyblue;">
                        </ha-icon><span> <span style="color: var(--text-color-sensor);">${states['sensor.processor_use_percent'].state} %</span></span>`
                    ]]]
                  ram: |
                    [[[
                      return `<ha-icon
                        icon="mdi:memory"
                        style="width: 19px; height: 19px; color: deepskyblue;">
                        </ha-icon><span> <span style="color: var(--text-color-sensor);">${(states['sensor.memory_free'].state/1024).toFixed(2) } GB</span></span>`
                    ]]]
                  disk: |
                    [[[
                      return `<ha-icon
                        icon="mdi:content-save"
                        style="width: 16px; height: 16px; color: deepskyblue;">
                        </ha-icon><span> <span style="color: var(--text-color-sensor);">${states['sensor.disk_free_config'].state} GB</span></span>`
                    ]]]
              - type: vertical-stack
                cards:
                  - type: custom:button-card
                    entity: sensor.time
                    show_state: true
                    show_name: false
                    show_icon: false
                    styles:
                      card:
                        - font-size: 35px
                        - height: 56.5px
                      state:
                        - font-weight: null
                  - type: custom:button-card
                    entity: sensor.date
                    show_state: true
                    show_name: false
                    show_icon: false
                    styles:
                      card:
                        - font-size: 18px
                        - height: 56.5px
                      state:
                        - font-weight: bold
              - type: vertical-stack
                cards:
                  - type: custom:button-card
                    icon: mdi:home-assistant
                    styles:
                      card:
                        - height: 56.5px
                      icon:
                        - color: '#4DBFF3'
                    tap_action:
                      action: url
                      url_path: https://www.home-assistant.io/docs/
                  - type: custom:button-card
                    icon: mdi:google
                    styles:
                      card:
                        - height: 56.5px
                      icon:
                        - color: '#4285F4'
                    tap_action:
                      action: url
                      url_path: https://google.com
            columns: 3
            square: true
          - type: weather-forecast
            entity: weather.home
            secondary_info_attribute: humidity
            name: ' 上海'
          - type: entities
            entities:
              - entity: sensor.jiang_shui_gai_lu
              - entity: sensor.feng_li
              - entity: sensor.feng_xiang
              - entity: sensor.kong_qi_zhi_liang
  - type: vertical-stack
    cards:
      - type: custom:mini-media-player
        entity: media_player.keting_xiaomi_tv
        state_label: ture
        source: full
        hide:
          volume: false
          source: false
          power_state: false
          icon_state: false
          icon: true
        tts:
          platform: edge_tts
          entity_id: media_player.airplay_f434f03785ad
        shortcuts:
          columns: 3
          column_height: 100
          hide_when_off: true
          buttons:
            - icon: mdi:home
              type: service
              id: shell_command.tv_home
            - icon: mdi:arrow-up
              type: service
              id: shell_command.tv_up
            - icon: mdi:menu
              type: service
              id: shell_command.tv_menu
            - icon: mdi:arrow-left
              type: service
              id: shell_command.tv_left
            - icon: mdi:image-filter-center-focus
              type: service
              id: shell_command.tv_enter
            - icon: mdi:arrow-right
              type: service
              id: shell_command.tv_right
            - icon: mdi:cog
              type: service
              id: shell_command.tv_settings
            - icon: mdi:arrow-down
              type: service
              id: shell_command.tv_down
            - icon: mdi:keyboard-return
              type: service
              id: shell_command.tv_back
        group: false
        volume_stateless: false
        name: MITV
回复

使用道具 举报

11

主题

266

帖子

2574

积分

金牌会员

Rank: 6Rank: 6

积分
2574
金钱
2298
HASS币
50
 楼主| 发表于 2021-11-17 19:16:44 | 显示全部楼层
muxiachuixue 发表于 2021-11-16 21:39
第二张是电视打开后的画面,30秒更新一次电视画面,用的电视截屏接口,然后把图标以camera实体形式显示出 ...

电视截屏用的什么集成?小米电视才支持吧?
我在想要是电视开机状态下这个截屏刷新间隔设置成1秒,是不是就可以完全低着头用手机遥控电视了,不用来回来去抬头看电视低头看手机了,会很大程度提升使用移动端进行电视遥控的体验。
回复

使用道具 举报

5

主题

357

帖子

2046

积分

金牌会员

Rank: 6Rank: 6

积分
2046
金钱
1674
HASS币
60
发表于 2021-11-17 19:35:49 | 显示全部楼层
本帖最后由 muxiachuixue 于 2021-11-17 19:38 编辑
秋雨轩 发表于 2021-11-17 19:16
电视截屏用的什么集成?小米电视才支持吧?
我在想要是电视开机状态下这个截屏刷新间隔设置成1秒,是不是 ...

截屏用的Miot Auto 里面电视的接口(直接在这个插件里面添加电视即可);刷新时间设置成1秒,你网络反应也没那么快啊,肯定会延迟的平时还是老老实实用实体遥控器。如果换台,调整音量啥的,我更喜欢用iPhone 控制中心的遥控器,操作起来更方便,可以盲操。另外控制中心的遥控器随便按一个按钮,就是开机,也不需要喊小爱来开机。
回复

使用道具 举报

11

主题

266

帖子

2574

积分

金牌会员

Rank: 6Rank: 6

积分
2574
金钱
2298
HASS币
50
 楼主| 发表于 2021-11-17 19:48:18 来自手机 | 显示全部楼层
muxiachuixue 发表于 2021-11-17 19:35
截屏用的Miot Auto 里面电视的接口(直接在这个插件里面添加电视即可);刷新时间设置成1秒,你网络反应也 ...

好的谢谢了
回复

使用道具 举报

8

主题

86

帖子

279

积分

中级会员

Rank: 3Rank: 3

积分
279
金钱
193
HASS币
0
发表于 2023-9-1 10:08:43 | 显示全部楼层

兄弟,这个卡片怎样实现同步电视画面呀?
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-27 18:30 , Processed in 0.068347 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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