flashsoft 发表于 2018-2-28 20:40:06

25989406 发表于 2018-2-28 20:08
问下,接入之后entity_id是以fan开头的吗,还是别的?

举个Automation的例子
- alias: sync turn on airx
trigger:
- entity_id: fan.airx, fan.airx2
    platform: state
    to: 'on'
action:
- service: fan.turn_on
    entity_id: fan.airx, fan.airx2

- alias: sync turn off airx
trigger:
- entity_id: fan.airx, fan.airx2
    platform: state
    to: 'off'
action:
- service: fan.turn_off
    entity_id: fan.airx, fan.airx2

godflamingo 发表于 2018-2-28 21:38:17

厉害了我的楼主

25989406 发表于 2018-2-28 21:40:22

flashsoft 发表于 2018-2-28 20:40
举个Automation的例子
- alias: sync turn on airx
trigger:


多谢,那我的天猫精灵接入代码不用改,应该默认支持:)

debitus 发表于 2018-2-28 21:44:07

本帖最后由 debitus 于 2018-2-28 21:51 编辑

感谢分享,这个不错。

令狐鸣 发表于 2018-2-28 21:53:06

本帖最后由 令狐鸣 于 2018-2-28 23:13 编辑

不会写python,之前自己一直用的command_line和shell_command的方式控制airx,风速的获取一直有些问题,会写python还是方便.
顺便在附加一条屏幕开关的command_line,楼主应该可以加进去
#屏幕开关
- platform: command_line
    switches:
      airx_pm:
      command_on: "curl -d 'device_id=1111&Inlight=1&token=airxtk&userId=1111&' 'http://luxcar.com.cn/airx/airx_iot_reportup/web/equipment/DeviceOther'"
      command_off: "curl -d 'device_id=1111&Inlight=0&token=airxtk&userId=1111&' 'http://luxcar.com.cn/airx/airx_iot_reportup/web/equipment/DeviceOther'"
      command_state: "curl -d 'userId=1111&token=airxtk&device_id=1111&' 'http://luxcar.com.cn/airx/airx_iot_reportup/web/equipment/loadDeviceData'"
      value_template: '{{ value_json["data"]["Inlight"] == 1 }}'
      friendly_name: "屏幕"

alex950418 发表于 2018-2-28 21:57:59

佩服,感谢分享

u20074 发表于 2018-2-28 23:37:08

什麼是airx呢?來學習

freelyfish 发表于 2018-3-1 02:14:27

谢谢分享

neroxps 发表于 2018-3-1 08:49:18

大佬厉害了

iLee 发表于 2018-3-1 08:54:12

感谢大神提供。正需要X的插件
页: 1 [2] 3 4 5 6 7 8 9 10 11
查看完整版本: 【11月8日升级,更新yaml】【空气净化器】Airx的ha插件....