4
57
277
论坛分享达人
sensor: - platform: rotary_encoder name: "Rotary Encoder" pin_a: D1 pin_b: D2 id: my_dimlevel min_value: 1 max_value: 100
on_value: then: - light.control: id: Light(你的灯ID) state: on brightness: !lambda |- // output value must be in range 0 - 1.0 return id(my_dimlevel).state/100.0;
使用道具 举报
6
292
2098
金牌会员
lfp136 发表于 2020-5-12 22:26 编码器按传感器方式创建:https://esphome.io/components/sensor/rotary_encoder.html#see-also 第二步, ...
924215947 发表于 2020-5-13 23:28 好的 我试试 今天测试了你发的 我这边测试不够稳定 不知道是什么原因 调光会自动调整 ...
lfp136 发表于 2020-5-14 23:40 编码器A-B脚对VCC加10K电阻,对地并一个1NF电容试试
7
367
2119
sensor: - platform: rotary_encoder name: "Rotary Encoder" pin_a: D1 pin_b: D2 min_value: 1 max_value: 100 resolution: 1 id: ec11 on_value: then: - light.control: id: led state: on brightness: !lambda |- return id(ec11).state/100.0; output: - platform: esp8266_pwm pin: D0 id: pwm # power_supply: relay light: - platform: monochromatic name: "text" output: pwm id: led
bjy2005 发表于 2020-6-27 15:41 已经可以初步实现调光了,用的EC11编码器5点的 编码器A B分别接10K上拉到5V ,同时通过1nf电容到GND(看论 ...
924215947 发表于 2020-7-3 14:24 完整的代码有没有
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2024-11-27 23:48 , Processed in 0.388959 second(s), 30 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.