i'm using DzVents scripts, i use to set some value with energy, text, or electricity devices (could be other).
i would like to change the label (name) of virtual devices depending of the contents of the scripts.
by exemple:
i'am using 2 virtuals devices to display a % and text to display
Code: Select all
Day_Pourcent_self_conso = domoticz.utils.round(Day_SelfConsumption_value / Day_Consumption_value * 100, 1) -- calcul of % with 1 decimal
domoticz.devices(65).updateText(tostring(Day_SelfConsumption_value).." Wh ,"..Day_Pourcent_self_conso.. "% of the day Consumption (" ..Day_Consumption_value..")") -- display the text within Text device
domoticz.devices(66).updatePercentage(Day_Pourcent_self_conso) -- display % within % device

i would like to change the name of the virtual device to with
domoticz.devices(65).updateName ("xxxx .. Day_Pourcent_self_conso .. " xxx") -- display % within % device name
