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

 找回密码
 立即注册
查看: 6277|回复: 4

[基础教程] ESP8266+旋转编码器做模拟调光 飞利浦智睿灯球

[复制链接]

7

主题

156

帖子

1327

积分

论坛技术达人

积分
1327
金钱
1171
HASS币
0
发表于 2017-11-16 22:48:51 | 显示全部楼层 |阅读模式
本帖最后由 leoyanger 于 2017-11-16 22:52 编辑

刷ESPEASY 参考https://bbs.hassbian.com/forum.p ... =%E9%97%A8%E7%A3%81参考了https://community.home-assistant ... peasy-mqtt/29448/23

QQ截图20171116222830.png

编码器按钮

编码器按钮

旋转编码器配置

旋转编码器配置
QQ截图20171116222954.png QQ截图20171116222848.png

在configuration里添加传感器:

sensor:
  - platform: mqtt
    state_topic: "/esp01/dimmer/state"
    name: "Office Dimmer Brightness"
    retain: true
  
  - platform: template
    sensors:
      normalised_office_dimmer_brightness_256:
        value_template: '{{ states.sensor.office_dimmer_brightness.state | multiply (4) | round (0) }}'
        friendly_name: 'Normalised Office Dimmer Brightness'

input_boolean:
  philips_sf_dim:
    name: ShuFang Dim
    initial: off

automatiom:- alias: Switch shufang light
  trigger:
    platform: mqtt
    topic: /esp01/dimmer/state
  condition:
    condition: and
    conditions:
    - condition: state
      entity_id: input_boolean.philips_sf_dim
      state: 'off'
    - condition: state
      entity_id: light.xiaomi_philips_smart_led_ball_sf
      state: 'on'
  action:
    service: light.turn_on
    entity_id: light.xiaomi_philips_smart_led_ball_sf  
    data_template:
      brightness: '{{states.sensor.normalised_office_dimmer_brightness_256.state}}'
- alias: Switch shufang light on
   trigger:
     platform: state
     entity_id: light.xiaomi_philips_smart_led_ball_sf
     rom: 'on'
     to: 'off'
  action:
     service: input_boolean.turn_on
     entity_id: input_boolean.philips_sf_dim
- alias: Switch shufang light off
   trigger:
     platform: state
     entity_id: light.xiaomi_philips_smart_led_ball_sf
     from: 'on'
     to: 'off'
  action:
     service: input_boolean.turn_off
     entity_id: input_boolean.philips_sf_dim
      
- alias: Switch sf light
   trigger:
     platform: state
     entity_id: switch.esp_dimmer_switch
  
  action:
     service_template: >
        {%- if states('switch.esp_dimmer_switch') == 'off' -%}
          light.turn_off
        {%- else -%}
          light.turn_on
        {%- endif -%}
     entity_id: light.xiaomi_philips_smart_led_ball_sf







评分

参与人数 1金钱 +12 收起 理由
+ 12 谢谢大神分享!

查看全部评分

回复

使用道具 举报

123

主题

4626

帖子

1万

积分

管理员

囧死

Rank: 9Rank: 9Rank: 9

积分
16009
金钱
11298
HASS币
45
发表于 2017-11-16 23:14:54 | 显示全部楼层
谢谢楼主分享,另外,来个视频会更好些
回复

使用道具 举报

30

主题

441

帖子

1614

积分

金牌会员

Rank: 6Rank: 6

积分
1614
金钱
1173
HASS币
0
QQ
发表于 2017-11-17 11:08:27 | 显示全部楼层
太好了,求硬件购买链接?
回复

使用道具 举报

30

主题

441

帖子

1614

积分

金牌会员

Rank: 6Rank: 6

积分
1614
金钱
1173
HASS币
0
QQ
发表于 2017-11-17 11:11:03 | 显示全部楼层
能否用ESP8266将普通的led灯具变成开关渐变柔和百分比调光效果,并接入HA和HB?还需要什么其他硬件支持吗?大神求思路???
回复

使用道具 举报

39

主题

311

帖子

2891

积分

金牌会员

Rank: 6Rank: 6

积分
2891
金钱
2580
HASS币
0
发表于 2018-4-7 18:59:39 | 显示全部楼层
有没有接线图呢?
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-20 21:13 , Processed in 1.345311 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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