Page 1 of 1

small & clean text field in Dashticz?

Posted: Sunday 12 February 2023 12:00
by renerene
To minimise place on my tablet I would lilke to show some data (temperatures, daily energy price) in a text field. That takes less room than the devices. How can this best be done?
I could make a dummy text sensor, but how to handle end of line returns?

Re: text field?

Posted: Sunday 12 February 2023 12:22
by willemd
I use the log of a text field to show a table.
have a look at the example here
https://user-images.githubusercontent.c ... a9ab04.png
I had to change the default font of domoticz, to make it non-proportional and I had to replace spaces with underscore to get a nice table.

The top line of the log is then shown in the icon, example shown on the same page
https://github.com/WillemD61/battery-planning/

Re: text field?

Posted: Sunday 12 February 2023 12:35
by madpatrick
You can make a dummy text sensor in Domoticz and the text can easily confiured in Dashticz
I've several text " blocks" in Dashticz and the text is controlled via a Dzvents script to update the text or control the text

Here an example of Dashticz Screenssaver
2023-02-12 12_33_25-Fully Remote Admin.png
2023-02-12 12_33_25-Fully Remote Admin.png (29.76 KiB) Viewed 594 times

Re: text field?

Posted: Monday 13 February 2023 19:36
by renerene
madpatrick wrote: Sunday 12 February 2023 12:35 You can make a dummy text sensor in Domoticz and the text can easily confiured in Dashticz
I like the clean layout of these texts.
How do you make multiple lines? A table layout option also would be nice.
Just need something smal to place a lot of textdata in.

Re: small & clean text field in Dashticz?

Posted: Monday 13 February 2023 20:12
by madpatrick
It is very dependable where the information is coming from.
You can use tables or formatting it by html code
Dashticz is very flexibel

Re: small & clean text field in Dashticz?

Posted: Tuesday 14 February 2023 22:09
by renerene
madpatrick wrote: Monday 13 February 2023 20:12 It is very dependable where the information is coming from.
From Domiticz offcourse ;-)
Maybe use dzVents to create some in-between variable / data file?
You can use tables or formatting it by html code
Dashticz is very flexibel
Sounds promising. Please elaborate. Do you have an example or instructions?

Re: small & clean text field in Dashticz?

Posted: Wednesday 15 February 2023 18:30
by madpatrick
Sure.

This is a part of my DzVents script

Code: Select all

        if warmwater.state == "WW" and sensor.state =="On" then
            if not(afzuiging.active) then
                afzuiging.cancelQueuedCommands()
                afzuiging.switchOn().checkFirst()
                local message =  os.date("%H:%M",os.time() ) .. ' Ventilatie staat AAN'
                dz.log(message, dz.LOG_FORCE)
                textblock.updateText(message)
            else
                afzuiging.cancelQueuedCommands()
                dz.log('Ventilatie staat (al) AAN' , dz.LOG_FORCE)
                local message =  os.date("%H:%M",os.time() ) .. ' Ventilatie staat AAN'
                textblock.updateText(message)
            end
in Dashticz

Code: Select all

blocks['vent_block'] 		= {idx: 532, width : 4,hide_data : true,icon: ' ',title: 'Ventilatie'}

in Domoticz
make a virtual text sensor (mine is in this example idx: 532)

Re: small & clean text field in Dashticz?

Posted: Friday 17 February 2023 8:47
by renerene
Thank you madpatrick. Got it working

1) For testing I copied the same text three times and experimented a bit with "/n" symbol and string.char(10). But have not found a "new line" method yet. But good to see Dashticz shows multiple lines and breaks automaticly. That is a good starting point.
2) the reserved space for the icon and the title is a bit of a waste of space.

Image


UPDATE:
ah, needs some manual adjustments...
Image