I noticed a new portable lamp in my livingroom. It’s touch controlled with three rotating brightness levels and it balances bold forms: newworks.dk/en/productsheet/kizu-portable-table-lamp-2
It was not connectible to Home Assistant, so it needed to be fixed.
testing with a dev nodemcu esp8266 (led just for connectivity testing):
- voltage on this pin seems to change with the brightness level
1.1. the voltage range is off/full/med/low → 0mV / 1.2mV / 0.6mV / 0.3mV, measured pretty consistently with a multimeter
1.2. I tested getting a reading with the A0 adc pin (without the vcc measuring that was added later), but it barely read the brightest setting as 0.00098V, 0V for the other levels. Also not consistent, at least without soldering. - luckily a touch could be simulated by connecting the touch rod directly to an esp8266 pin
2.1. found info about usingmode: OUTPUT_OPEN_DRAIN
from Simulate touch (capacitive) button from nodemcu
ESPhome config
esphome:
name: new-works-kizu
friendly_name: New Works Kizu
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "X"
ota:
- platform: esphome
password: "5"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "New-Works-Kizu Fallback Hotspot"
password: "b"
captive_portal:
# New Works Kizu portable lamp's circuit has a pin with a voltage corresponding to the brightness,
# but it is out of the ADC range of ESP8266 (~0.075V to ~3.12V)
# off: 0 mV
# full: ~1.2 mV
# med: ~0.6 mV
# low: ~0.3 mV
#sensor:
# - platform: adc
# pin: GPIO17
# name: "Voltage sensor"
# update_interval: 1.0s
switch:
- platform: gpio
pin:
number: GPIO05
mode: OUTPUT_OPEN_DRAIN
id: kizu_touch
device_class: switch
restore_mode: RESTORE_DEFAULT_ON
button:
- platform: template
name: "Kizu touch"
on_press:
then:
- switch.turn_off: kizu_touch
- delay: 300ms
- switch.turn_on: kizu_touch
sensor:
- platform: adc
pin: VCC
name: "VCC Voltage"
Final fitting was with a WeMos D1 Mini esp8266, with no brightness reading.
The lamp has a battery that outputs 4.2V, and that’s connected to the esp8266 5V pin. Appears to work, the VCC sensor reads about 2.9V.
Is there a way to use those low voltage levels to read the brightness settings, maybe with some additional components? Or is there a place that could have a more suitable voltage on the lamp circuit? I think I tested all the connectors, but maybe I missed it: