Is it possible to control the onboard LED on a nodemcu with esphome.
A quick google and its seems it should be…but im unable to get anything to work.
Infact, the LED on one o my boards constantly lashes every 60 seconds ish.
esphome:
name: sonoff_sensor_node_bedroom
platform: ESP8266
board: nodemcuv2
wifi:
ssid: hidden
password: hidden
ap:
ssid: "Sensor Node Bedroom"
password: hidden
captive_portal:
logger:
# Enable Home Assistant API
api:
ota:
output:
- platform: esp8266_pwm
id: onboard_led
pin:
number: D0
inverted: true
light:
- platform: monochromatic
name: "Sensor Node Bedroom LED"
output: onboard_led
id: led
binary_sensor:
- platform: gpio
pin: D5
name: "Bedroom Motion"
device_class: motion
sensor:
- platform: dht
model: AM2302
pin: D4
temperature:
name: "Bedroom Temperature"
humidity:
name: "Bedroom Humidity"
update_interval: 60s
- platform: adc
pin: A0
name: "Bedroom Brightness"
unit_of_measurement: lux
filters:
- lambda: |-
return (x / 10000.0) * 2000000.0;
- platform: wifi_signal
name: Sensor Node Bedroom WiFi Signal
update_interval: 60s
accuracy_decimals: 0
unit_of_measurement: dB
icon: mdi:wifi
force_update: false
- platform: uptime
id: uptime_sec
accuracy_decimals: 0
unit_of_measurement: s
icon: mdi:timer
update_interval: 60s
force_update: false
text_sensor:
- platform: template
name: Sensor Node Bedroom Uptime
lambda: |-
int seconds = (id(uptime_sec).state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
icon: mdi:clock-start
update_interval: 113s