I use Phillips hue like cards in my dashboards, but now I want it to update the lights as I’m sliding the sliders like Philips hue does.
this is the code of one card:
type: custom:hue-like-light-card
title: Woonkamer
entities:
- light.woonkamer_lamp_light
now did I ask chat gpt to write some code to do the real-time sliders, its calling it “dynamic interaction sliders” and this is what came rolling out:
1. Create an Input Number: Define an input_number
in your Home Assistant configuration. This will represent the brightness level you want to control.
input_number:
light_brightness:
name: Light Brightness
min: 0
max: 255
step: 1
2. Create an Automation: Set up an automation that triggers when the input number changes. This automation should update the brightness of your light when the slider changes.
automation:
- alias: Update Light Brightness
trigger:
platform: state
entity_id: input_number.light_brightness
action:
service: light.turn_on
target:
entity_id: light.your_light_entity_id
data_template:
brightness: "{{ states('input_number.light_brightness') | int }}"
Adjust the light.your_light_entity_id
with the actual entity ID of your light.
3. Create a Lovelace UI Card: In your Lovelace UI configuration, add an entities
card that displays the input number slider.
type: entities
entities:
- input_number.light_brightness
in not that great in putting yaml code to use I start to understand it a bit so I can read it and make some automations to link lights and buttons and so on but this got a little complex. does any one know how I can intergrade this code to my use case?
do I need to use different card in my dashboard or can I keep using the Phillips hue like cards as my girlfriend liked the look of them and she was used to the Phillips hue app