Setup Esp32 with this configuration ESPHome:
esphome:
name: room_light
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "2bb927ef9bd6f92cf78e314d882176e7"
wifi:
ssid:
password:
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32 Fallback Hotspot"
password: "ytjYEl8Vudtl"
captive_portal:
output:
- platform: ledc
id: gpio_19
pin: GPIO19
frequency: 19531Hz
- platform: ledc
id: gpio_18
pin: GPIO18
frequency: 19531Hz
light:
- platform: cwww
name: "Livingroom Lights"
cold_white: gpio_18
warm_white: gpio_19
cold_white_color_temperature: 6536 K
warm_white_color_temperature: 2000 K
constant_brightness: false
When I create automation in HA, there is no actions to change color temperature, only for brightness. But I can change it from UI card. How can I add actions to automation?
UPD
I need to change color temperature with rotation of Mi Cube. As I understand, is a can do it with change set color_temp parameter of service Light: Turn on, but I don’t understand how to do this.
UPD2
Now I can change color temperature to any specified value in mireds with this automation YAML code, but I don’t understand how to increase and decrease it with rotation.:
- id: '4637506987354'
alias: ChangeColorTemp
description: ''
trigger:
- platform: device
domain: mqtt
device_id: 7741d39c619b7082d69125c514ccec22
type: action
subtype: rotate_right
discovery_id: 0x00158d000708191f action_rotate_right
condition: []
action:
- service: light.turn_on
target:
entity_id: light.livingroom_lights
data:
color_temp: 255
mode: single