Text Dummy without Icon

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
HvdW
Posts: 615
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Text Dummy without Icon

Post by HvdW »

Hi,
I'm playing with text dummies.
energie.jpg
energie.jpg (21.29 KiB) Viewed 543 times
energy colored.jpg
energy colored.jpg (22.95 KiB) Viewed 538 times
Is it possible to have a text dummy without an icon. Set it to None.
Bugs bug me.
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

Re: Text Dummy without Icon

Post by RonkA »

Not the answer you would like but to get the lines to start in the same column I use 'empty' caracters from the Times New Roman font like ' ' to add extra 'empty' caracters to textdevices because Domoticz removes the normal extra spaces.

Maybe add 8 or 9 of these 'empty' caracters to the lines below the icon to get all the lines to allign as the lines beside the icon ?

Copy/paste this one or lookup another in 'speciale tekens' in windows like 'U+2002'('special characters' in Dutch)

Question; how do you set the colour of the text via dzVents?
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
User avatar
habahabahaba
Posts: 233
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: Text Dummy without Icon

Post by habahabahaba »

Code: Select all

        local device = domoticz.devices(40) -- your text device
        
        local text = 'Some text'
      
        local style = '<span style="color: red;">' .. text .. '</span>' 
      
        device.updateText(style)
HvdW
Posts: 615
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Text Dummy without Icon

Post by HvdW »

I'm using simple HTML.

Code: Select all

        domoticz.devices('Energie').updateText('Gas today &emsp;&emsp;&emsp;&emsp;&emsp;' .. tostring(domoticz.devices('Gas').counterToday) .. 
            '\n Gas yesterday &emsp;&emsp;&emsp;' .. tostring(domoticz.devices('Gas gisteren').sensorValue) ..
            '\n Gas the day before&nbsp;&emsp;' .. tostring(domoticz.devices('Gas eergisteren').sensorValue) ..
            '\n \n <font color="red"> Power used today &emsp;&emsp;&emsp;&emsp;' .. tostring(domoticz.devices('Power').counterToday) .. '</font> '..
            '\n &ensp;&emsp;&emsp;&emsp;&emsp; <font color="red">Power consumption now &emsp;' .. tostring(domoticz.devices('Power').rawData[5] .. '</font> ') ..
            '\n \n &ensp;&emsp;&emsp;&emsp;&emsp; <font color="green">Power returned today &emsp;&emsp;' .. tostring(domoticz.devices('Power').counterDeliveredToday) ..'</font> '..
            '\n &ensp;&emsp;&emsp;&emsp;&emsp; <font color="green">Power return now &emsp;&emsp;&emsp;&emsp;' .. tostring(domoticz.devices('Power').rawData[6] .. '</font> \n&emsp; ')
        )
        domoticz.log("Hello world, from " .. _VERSION .. "!\n")
Bugs bug me.
User avatar
habahabahaba
Posts: 233
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: Text Dummy without Icon

Post by habahabahaba »

So... No way to remove icon?
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Text Dummy without Icon

Post by jvdz »

Don't think it is optional in the standard webfrontend:

Code: Select all

else if (item.SubType == "Text") {
		item.Image = (item.CustomImage == 0)  ? 'text48.png' : item.Image + '48_On.png';
		xhtm += '<img src="images/' + item.Image + '" height="48" width="48"></td>\n';
		status = item.Data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br />$2');
	}
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
HvdW
Posts: 615
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Text Dummy without Icon

Post by HvdW »

Where should this be inserted?
Bugs bug me.
User avatar
jvdz
Posts: 2330
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Text Dummy without Icon

Post by jvdz »

This is the actual current code in the webpage of Domoticz standard frontend, which shows that text sensors always show an ICON!
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest