2 values, 1 text device.

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

Moderator: leecollings

Post Reply
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

2 values, 1 text device.

Post by OedzesG »

Hello all,

short question about updating a text sensor in Domoticz.

I have 2 user variables which contain content about a possible update-state and a link quality.

These user variables are updated directly from MQTT.

I would like for my dashticz dashboard that both values ​​are placed one below the other in the text device.

With:

Code: Select all

updateText (text)
I can update a text sensor but how do I get 2 different values ​​in 1 text sensor?

thnx!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 2 values, 1 text device.

Post by waaren »

OedzesG wrote: Sunday 20 December 2020 21:12 I can update a text sensor but how do I get 2 different values ​​in 1 text sensor?

Code: Select all

local text = dz.variables('var1').value 
text = text ..  '\n' .. dz.variables('var2').value
updateText (text)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 2 values, 1 text device.

Post by OedzesG »

@waaren

thnx!

marry christmas!
Post Reply

Who is online

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