Hi,
I created a small remote control for a light using a potentiometer to set the brightness.
Works like a charm.
However the potentiometer is attached to the adc pin (A0) and in order to have a smooth brightness, I set the update_interval to 200ms.
this means that every 200ms, the node sends the value to Home Assistant, even if it hasn’t changed (as it provides its measure, but ignoring the delta filter).
Can we set some sensors (here the adc) to remain internal to the node and not displayed as sensor in Home Assistant. This would avoid the node sending its data every 200ms…
As I have a LED attached to the board (using PWM), it flickers due to the usage of the Wifi.
In addition, such update interval and sending of measures would drastically reduce uptime in case the node is battery powered (Wifi consumes a lot).
# Example configuration entry
output:
- platform: esp8266_pwm
pin: D3
frequency: 200 Hz
id: pwm_output
sensor:
- platform: adc
pin: A0
#name: "TV Light Brightness"
id: "set_brightness"
filters:
- calibrate_linear:
- 0.0 -> 255
- 1.0 -> 0
- lambda: |-
return (int)x;
- delta: 3
update_interval: 200ms
on_value:
then:
if:
condition:
light.is_on: toggle_led
then:
- logger.log:
format: "Stored value set to: %i"
args: ['id(last_measure_set)']
- homeassistant.service:
service: light.turn_on
data:
entity_id: light.tv_light
brightness: !lambda "return (int)x;"
light:
- platform: monochromatic
name: "Small LED test"
id: toggle_led
output: pwm_output