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

 找回密码
 立即注册
查看: 4243|回复: 7

[已解决] 求一个猪头先生M1的定时亮度调整自动化脚本

[复制链接]

1

主题

24

帖子

126

积分

注册会员

Rank: 2

积分
126
金钱
102
HASS币
0
发表于 2019-6-28 15:37:06 | 显示全部楼层 |阅读模式
本帖最后由 deam 于 2019-7-2 21:14 编辑

初学还未入门,搜了论坛,没有搜到类似的脚本,无从尝试修改,只好发帖求助,感谢。

参考链接:https://bbs.hassbian.com/forum.p ... d=4824&highlight=M1
回复

使用道具 举报

40

主题

3057

帖子

1万

积分

超级版主

Nero

Rank: 8Rank: 8

积分
11135
金钱
8028
HASS币
182
发表于 2019-6-28 15:58:22 | 显示全部楼层
先入门 学下怎么配置ha 怎么写自动化
Nero
回复

使用道具 举报

33

主题

687

帖子

4383

积分

论坛元老

Rank: 8Rank: 8

积分
4383
金钱
3686
HASS币
50
发表于 2019-6-29 01:12:08 | 显示全部楼层
很简单啊,写到automations.yaml里面,复制过来可能缩进有问题,自己调整下。
- alias: m1_morning  #早上
  trigger:
  - at: '7:30:00'
    platform: time
  condition: []
  action:
  - service: mqtt.publish
    data_template:
      topic: MICO_B0F893174697/setscreen
      retain: true
      payload: 75
  id: 8dcdd7125b2d49498af3375bb8bf2a8f
- alias: m1_noon  #上午
  trigger:
  - at: '10:30:00'
    platform: time
  condition: []
  action:
  - service: mqtt.publish
    data_template:
      topic: MICO_B0F893174697/setscreen
      retain: true
      payload: 100
  id: 9be36963979045cea69842c02b47b13e
- alias: m1_afternoon  #下午
  trigger:
  - at: '19:30:00'
    platform: time
  condition: []
  action:
  - service: mqtt.publish
    data_template:
      topic: MICO_B0F893174697/setscreen
      retain: true
      payload: 50
  id: 02d7dfee02b846978de6e3308cf63c4b
- alias: m1_night  #晚上
  trigger:
  - at: '22:30:00'
    platform: time
  condition: []
  action:
  - service: mqtt.publish
    data_template:
      topic: MICO_B0F893174697/setscreen
      retain: true
      payload: 25
  id: a4773a432a624be38781effd729874b1
- alias: m1_sleep   #睡觉熄屏
  trigger:
  - at: 00:10:00
    platform: time
  condition: []
  action:
  - service: mqtt.publish
    data_template:
      topic: MICO_B0F893174697/setscreen
      retain: true
      payload: 0
  id: a86782437d7e4fc2bfc3027022a5e7c9
回复

使用道具 举报

7

主题

1975

帖子

5663

积分

论坛元老

流水无味

Rank: 8Rank: 8

积分
5663
金钱
3688
HASS币
145

灌水之王

发表于 2019-6-29 08:34:24 | 显示全部楼层
入门级自动化 建议学习研究 不然后面得了路长着
回复

使用道具 举报

1

主题

24

帖子

126

积分

注册会员

Rank: 2

积分
126
金钱
102
HASS币
0
 楼主| 发表于 2019-7-1 16:41:03 | 显示全部楼层
huang7dede 发表于 2019-6-29 01:12
很简单啊,写到automations.yaml里面,复制过来可能缩进有问题,自己调整下。
- alias: m1_morning  #早上
...

十分感谢~~终于有方向了。。
回复

使用道具 举报

1

主题

24

帖子

126

积分

注册会员

Rank: 2

积分
126
金钱
102
HASS币
0
 楼主| 发表于 2019-7-1 16:57:50 | 显示全部楼层
谢谢各位,因为fei讯才开始接触ha,,自己看了两天网上的教程,,我发现看了楼上朋友写的之后明白自己错在哪了,再次感谢。
回复

使用道具 举报

33

主题

687

帖子

4383

积分

论坛元老

Rank: 8Rank: 8

积分
4383
金钱
3686
HASS币
50
发表于 2019-7-2 02:02:43 | 显示全部楼层
deam 发表于 2019-7-1 16:57
谢谢各位,因为fei讯才开始接触ha,,自己看了两天网上的教程,,我发现看了楼上朋友写的之后明白自己错在 ...

请把帖子题目改成“已解决”
回复

使用道具 举报

0

主题

9

帖子

66

积分

注册会员

Rank: 2

积分
66
金钱
57
HASS币
0
发表于 2020-6-5 13:02:12 | 显示全部楼层
按方法,搞好的,太感谢了。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-2 16:16 , Processed in 1.152546 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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