本帖最后由 yinjiong 于 2019-9-6 12:27 编辑
更新:
2019/9/6:适配0.92 later。
自从斐讯翻车以后,我一直在用这个M1插件https://bbs.hassbian.com/thread-4601-1-1.html
插件本身代码很优雅,只是少了对M1屏幕亮度设置的支持。
这两天自己动手改了下,主要增加了对M1屏幕亮度设置的支持,另外通过ha的自动化可以实现定时息屏。
配置方法:
sensor:
- platform: aircat
name: m1
mac: {'第一台MAC':'brightness_m1a','第二台MAC':'brightness_m1b'}
brightness_force_update: True
input_select:
brightness_m1a:
name: 亮度
options:
- 关闭
- 夜间
- 白天
brightness_m1b:
name: 亮度
options:
- 关闭
- 夜间
- 白天
group:
m1a:
name: 客厅M1
view: no
entities:
- sensor.m1_hcho
- sensor.m1_humidity
- sensor.m1_pm25
- sensor.m1_temperature
- input_select.brightness_m1a
m1b:
name: 卧室M1
view: no
entities:
- sensor.m12_hcho
- sensor.m12_humidity
- sensor.m12_pm25
- sensor.m12_temperature
- input_select.brightness_m1b
MAC格式为:'AABBCCDDEEFF'
brightness_force_update 用来强制刷新M1的亮度设置,设为True后每5分钟强制推送一次亮度设置给M1
注意:options里面的选项不要随便改,改了要去py里做对应修改。
DNS劫持:
方法可参考原插件。
劫持aircat.phicomm.com到ha地址。
简单的自动化控制息屏亮屏时间:
- alias: auto swith screen brightness of m1 part A
hide_entity: True
trigger:
platform: time
at: '9:00:00'
action:
- service: input_select.select_option
data:
entity_id:
- input_select.brightness_m1a
option: "白天"
- service: input_select.select_option
data:
entity_id:
- input_select.brightness_m1b
option: "白天"
- alias: auto swith screen brightness of m1 part B
hide_entity: True
trigger:
platform: time
at: '22:00:00'
action:
- service: input_select.select_option
data:
entity_id:
- input_select.brightness_m1a
option: "关闭"
- service: input_select.select_option
data:
entity_id:
- input_select.brightness_m1b
option: "关闭"
|