Hello,
I want to combine two textstrings in dzvents but I cant get it to work.
I want to combine a piece of a url (http://api.pilot.patrickferreira.com/w6PLXsg32Dy/') with a piece of text to create a url that I can open in dzvents to send a notification. is this possible in dzvents?
combine strings
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: combine strings
Combine strings in dzVents ( dzVents = LUA)
resultString = string1 .. string2
resultString = string1 .. string2
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 27
- Joined: Monday 19 February 2018 6:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.9117
- Contact:
Re: combine strings
Thanks the combining works so I'm 1 step closer.
What is try to do is add the time in my message. I tried it like this.
This is working as long as I only use text. as soon as I try to incorperate the time from domoticz I get the following error.
What is try to do is add the time in my message. I tried it like this.
Code: Select all
local setURL
local Header
local Message
local MessageURL
local Now
Now = domoticz.time
setURL=('http://api.pilot.patrickferreira.com/w6PsfgLXh32Dy/')
Header=('de lamp is niet meer/')
Message=('aan sinds ')
MessageURL= setURL .. Header .. Message .. Now
domoticz.openURL(MessageURL)
orattempt to concatenate upvalue 'Now'
So what I try to do is convert The time to a textstring so i can use it in my url variableAttempt to call Global time
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: combine strings
In dzVents, a time-like attribute is an object with properties and methods meaning you have to specify what you want from it.
Code: Select all
Now = domoticz.time
print("************* getISO(): " .. Now.getISO())
print("************* hour: " .. Now.hour)
print("************* seconds: " .. Now.seconds )
print("************* minutes: " .. Now.minutes )
print("************* combined: " .. Now.hour .. ":" .. Now.minutes .. ":" .. Now.seconds )
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 27
- Joined: Monday 19 February 2018 6:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.9117
- Contact:
Re: combine strings
thanks
the following did work for me.
the following did work for me.
Code: Select all
now= (Now.hour .. ":" .. Now.minutes .. ":" .. Now.seconds )
Who is online
Users browsing this forum: No registered users and 0 guests