Actually, using these I’ve got accurate readings now:
- platform: hlw8012
model: BL0937
sel_pin:
number: GPIO19
inverted: true
cf_pin: GPIO10
cf1_pin: GPIO22
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
change_mode_every: 1
update_interval: 5s
current:
id: current
unit_of_measurement: A
accuracy_decimals: 3
internal: true
voltage:
id: voltage
unit_of_measurement: V
accuracy_decimals: 1
internal: true
power:
name: "${channel_1} power"
unit_of_measurement: W
id: power
icon: mdi:flash-outline
on_value_range:
- above: ${max_power}
then:
- switch.turn_off: relay
- homeassistant.service:
service: persistent_notification.create
data:
title: Message from ${device_name}
data_template:
message: Switch turned off because power exceeded ${max_power} W
substitutions:
device_name: shelly-plus-plug-s-1
friendly_name: shelly-plus-plug-s-1
channel_1: Relay
max_power: "1500" # 2000
max_temp: "65.0" # 70.0
# Higher value gives lower watt readout
current_res: "0.001"
# Lower value gives lower voltage readout
voltage_div: "1830"
Now how would we go about and figure out how to control the LED ring? GPIO3 seems to react to a monochromatic light, but only fully on or off, and only at a certain percentage 