找回密码
 立即注册
查看: 136|回复: 3

[已解决] 求助,如何实现点击图标就执行预设的自动化

[复制链接]

4

主题

11

回帖

152

积分

注册会员

积分
152
金钱
137
HASS币
0
发表于 6 天前 | 显示全部楼层 |阅读模式
本帖最后由 stone360 于 2025-6-10 11:44 编辑

求助,如何实现点击图标就执行预设的自动化,我下面的代码点击图标后只能开关自动化

          - type: image
            entity: automation.zhong_qi_xiao_mi
            icon: mdi:play-circle
            tap_action:
              action: toggle
            style:
              top: 89%
              left: 33%
              width: 3%


回复

使用道具 举报

hhh. 手机认证

10

主题

320

回帖

2832

积分

论坛UI达人

积分
2832
金钱
2502
HASS币
0
发表于 6 天前 | 显示全部楼层
tap_action:
  action: call-service
  service: automation.trigger
  target:
    entity_id: automation.zhu_wo_qi_chuang

很简单,选择自动化触发即可
回复

使用道具 举报

56

主题

250

回帖

480

积分

中级会员

积分
480
金钱
174
HASS币
0
发表于 6 天前 | 显示全部楼层
hhh. 发表于 2025-6-9 17:31
tap_action:
  action: call-service
  service: automation.trigger

图形化编辑怎么操作啊
回复

使用道具 举报

4

主题

11

回帖

152

积分

注册会员

积分
152
金钱
137
HASS币
0
 楼主| 发表于 5 天前 | 显示全部楼层
本帖最后由 stone360 于 2025-6-10 11:45 编辑
hhh. 发表于 2025-6-9 17:31
tap_action:
  action: call-service
  service: automation.trigger

多谢启发,修改了一下,可以使用了

          - type: image
            image: /local/ui/auto1.png
            tap_action:
              action: call-service
              service: automation.trigger
              target:
                entity_id: automation.shou_dong_zhong_xin_jia_zai_xiao_mi_ji_cheng
            style:
              left: 99%
              top: 94%
              width: 1.7%


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-15 18:24 , Processed in 1.131675 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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