I would like to create an item which holds a ton of information, and is adjustable via the UI to simplify creating lights. I wish to simply create one of these virtual items per room or zone, and then do the actual adjustment of the physical items in the background via a rule.
It should hold a JSON payload (or something similar, like metadata), like so:
VirtualLight_Livingroom_Main:
{
toggle:false,
brightness:0,
temperature:0,
target_brightness:55,
target_temperature:90,
brightness_profile:"Sunlight follower 1 - brightness",
temperature_profile:"Sunlight follower 2 - temperature",
adaptive_mode:false
use_RGB:false
RGB_target:{red:0,green:0,blue:0}
}
Then, I’d like to be able to select what Widget card this item displays as. A basic widget might only display an on/off value and be linked to the toggle
data, while a more advanced widget might have a toggle button but also two sliders for the temperature
and brightness
along with a settings button where I can toggle adaptive mode
and select the profiles I want.
My questions:
- Is this possible? I get a feeling that using string items to hold JSON is the “wrong” approach here…
- How would I make a widget that…
- Displays a toggle switch which is set to the initial state of the
toggle
- Changes the
toggle
value in the item when pressed
- Displays a toggle switch which is set to the initial state of the
- How would I make a widget that…
- Displays two sliders for temperature and brightness
- Reads the initial slider values from the item’s
brightness
andtemperature
- Allows adjustment of the sliders and updates them in the item