joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
854 stars 187 forks source link

[Feature Request] More Colors for Icons on Screensaver #1229

Closed patricknitsch closed 1 month ago

patricknitsch commented 1 month ago

FEATURE DESCRIPTION

A clear and concise description of what the feature should do.

On my screensaver I have Icons for my devices. The color changes, if the device goes on or off. Additionally I want to change the color, if the device is running or not.

I tested it with the following command:

ScreensaverEntityIconColor: getState('esphome.0.48551917BA07.Sensor.1144390574.state').val > 5 ? Red : Blue,

After reloading the panel it works, but it doesn't change the color during use.

Is it possible to implement it?

ADDITIONAL CONTEXT

Add any other context about the problem here.

PANEL / FIRMWARE VERSION

Please add the Panel/Firmware Version you are using (EU, US-L or US-P)

EU, Firmware 4.3.3.43

Armilar commented 1 month ago

The section for defining the entities is only loaded when the script starts, so a "getState" is not helpful as it is only a definition and not a trigger. This means that a “getState” only has an effect at startup. A trigger fires later in runtime when a data point changes.

image

In order to still get a result, you can either, as in the example shown above

Wiki: https://github.com/joBr99/nspanel-lovelace-ui/wiki/ioBroker-Config-Screensaver

patricknitsch commented 1 month ago

@Armilar: That was the trick! With seperate datapoints it works perfect. I red the doc for Screensaver but not good enough :) Thank you!!