Page 1 of 1
using one input (IDX) for a counter and flow sensor
Posted: Sunday 05 March 2017 12:27
by HFman
I am quite new in LUA scripts... end my feeling it most be very easy but couldn't figure out yet how to do it.
Issue is as follow :
For electric we have an instant and total counter, but not for gas and water. So my "dream" is to have this also for gas and water, but this seems complicated.
So as in between solution, would like to keep the normal gas and water counter, and add the flow sensor as a seperated sensor.
So how to use 1 IDX 2 times ?
Re: using one input (IDX) for a counter and flow sensor
Posted: Sunday 05 March 2017 22:21
by HFman
After hours and hours, complex scripts to easy ones... end of with an easy one.. but still not working.. :
Code: Select all
commandArray = {}
if devicechanged['Water'] then
WaterF1 = otherdevices_svalues['Water']
commandArray['UpdateDevice'] = 207,0, ..WaterFl
end
return commandArray
Ending up with :
Error: EventSystem: in WaterF3: [string "commandArray = {} ..."]:7: unexpected symbol near '..'
Where is my misstake.. ?
Re: using one input (IDX) for a counter and flow sensor
Posted: Monday 06 March 2017 8:31
by Nautilus
HFman wrote:
commandArray['UpdateDevice'] = 207,0, ..WaterFl
Where did you find this syntax?
The correct syntax for updatedevice is:
Code: Select all
commandArray['UpdateDevice'] = '207|0|' ..WaterFl
Hope you get it working...

Re: using one input (IDX) for a counter and flow sensor
Posted: Monday 06 March 2017 20:26
by HFman
Finally.. Thanks man !
I tried this one before, but didn't work.. but bassed on your reply found out that the the input are 2 value's which I first need to split.
After that.. It works perfect !! Extremely happy !
Now can see how effecient my Hot water heating is (shower etc.) and what the impact is after adding a Heat exchanger

.
Re: using one input (IDX) for a counter and flow sensor
Posted: Monday 06 March 2017 23:10
by Nautilus
HFman wrote:Finally..
Good to hear!
