I have a lump in my head. how can I translate this from LUA to dzvents ?:
z = otherdevices_svalues['PoolZulauf']
k = string.find(z," ")
z = string.sub(z,1,k-1)
TZulauf = tonumber(z)
String operationen
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: String operationen
This should do itOpus wrote: ↑Wednesday 15 July 2020 16:54 I have a lump in my head. how can I translate this from LUA to dzvents ?:Code: Select all
z = otherdevices_svalues['PoolZulauf'] k = string.find(z," ") z = string.sub(z,1,k-1) TZulauf = tonumber(z)
Code: Select all
local z = domoticz.devices('PoolZulauf').sValue
local k = string.find(z," ")
z = string.sub(z,1,k-1)
local TZulauf = tonumber(z)
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: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: String operationen
z = domoticz.devices('PoolZulauf').sValueOpus wrote:I have a lump in my head. how can I translate this from LUA to dzvents ?:
z = otherdevices_svalues['PoolZulauf']
k = string.find(z," ")
z = string.sub(z,1,k-1)
TZulauf = tonumber(z)
k = string.find(z," ")
z = string.sub(z,1,k-1)
TZulauf = tonumber(z)
You can keep using the existing lua functions.
Please check the dzvents wiki for a function like stringSplit(string, [separator ])
-
- Posts: 21
- Joined: Monday 05 October 2015 9:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: String operationen
Thank you!
I will try it tomorrow.
Thumps up!
I will try it tomorrow.
Thumps up!
-
- Posts: 21
- Joined: Monday 05 October 2015 9:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: String operationen
It works fine!
Nice community!
Nice community!
Who is online
Users browsing this forum: No registered users and 0 guests