alignment of text in a dummy text device

Moderator: leecollings

Post Reply
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

alignment of text in a dummy text device

Post by JuanUil »

Hi all,

is there a way to change the alignment in a dummy text device in LUA?
I would also like to change the color of the text is that possible?

Thank you for any help

Juan
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: alignment of text in a dummy text device

Post by freijn »

I believe the sensor does accept html format. try that.
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

freijn wrote: Sunday 13 January 2019 17:02 I believe the sensor does accept html format. try that.
and how do you do that in LUA?

sorry a newbie in programming :o
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: alignment of text in a dummy text device

Post by freijn »

Try this in your " <font color="red">This is some text!</font>"

not sure thought... sorry..
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: alignment of text in a dummy text device

Post by jvdz »

That indeed works fine. :)
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

So for instance
meldtekst= <font color="red">Dit is een melding</font>
should work?

this gives me a fault unexpeted symbol near <
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: alignment of text in a dummy text device

Post by jvdz »

JuanUil wrote: Sunday 13 January 2019 17:34 So for instance
meldtekst= <font color="red">Dit is een melding</font>
should work?
That should be: meldtekst= '<font color="red">Dit is een melding</font>'

Jos
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

No, not working.
Jos I use this in the afvalwijzer.
I now get the <fontcolor> in the text device

Code: Select all

txt ='<font color="red">txt..web_afvaldate .. " = " .. web_afvaltype .. "\r\n"</font>'
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: alignment of text in a dummy text device

Post by jvdz »

Yes, that won't work. ;)
Try this version:

Code: Select all

                     txt = txt..'<font color="red">'..web_afvaldate .. " = " .. web_afvaltype .. "</font>'\r\n"
Jos
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

nope, now I get

Code: Select all

<font color="red">vr 18 jan = Plastic, Metaal en Drankkartons</font>' <font color="red">vr 18 jan = GFT</font>'
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: alignment of text in a dummy text device

Post by jvdz »

I've just actually tried it with a text sensor and worked fine for me.
Knipsel.PNG
Knipsel.PNG (14.59 KiB) Viewed 1701 times
How does it look for you?

ps: I do see there is an single quote too many at the end, so the line should be:

Code: Select all

                     txt = txt..'<font color="red">'..web_afvaldate .. " = " .. web_afvaltype .. "</font>\r\n"
Jos
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

Hoi Jos,

I now get in the TAB others the right format.
Knipsel1.JPG
Knipsel1.JPG (20.12 KiB) Viewed 1677 times
but I also placed the textbox on my floorplan.
here I get
Knipsel.JPG
Knipsel.JPG (23.66 KiB) Viewed 1677 times
So the alignment is crap and the color is not coming over.
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

no Idea why the textbox on the floorplan is different then in devices
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: alignment of text in a dummy text device

Post by jvdz »

I don't know either, I am not using àny floor plans, but guess the text isn't treated as regular HTML in the floorplan, unlike the Text sensor text display.
Maybe somebody knows.
JOs
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

Anybody who can help me further with this.
any help is very appreciated.
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
JuanUil
Posts: 500
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: alignment of text in a dummy text device

Post by JuanUil »

Nobody? :o :o
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest