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 ?
using one input (IDX) for a counter and flow sensor
Moderator: leecollings
-
- Posts: 82
- Joined: Thursday 02 March 2017 20:28
- Target OS: Linux
- Domoticz version: V4.1174
- Location: Netherlands
- Contact:
using one input (IDX) for a counter and flow sensor
Raspberry PI 3 - Opentherm Gateway + ESP8826 - EvoHome - ESPEasy CO2 + Fancontrol - RF-Link - zigbee2mqqt -
-
- Posts: 82
- Joined: Thursday 02 March 2017 20:28
- Target OS: Linux
- Domoticz version: V4.1174
- Location: Netherlands
- Contact:
Re: using one input (IDX) for a counter and flow sensor
After hours and hours, complex scripts to easy ones... end of with an easy one.. but still not working.. :
Ending up with :
Error: EventSystem: in WaterF3: [string "commandArray = {} ..."]:7: unexpected symbol near '..'
Where is my misstake.. ?
Code: Select all
commandArray = {}
if devicechanged['Water'] then
WaterF1 = otherdevices_svalues['Water']
commandArray['UpdateDevice'] = 207,0, ..WaterFl
end
return commandArray
Error: EventSystem: in WaterF3: [string "commandArray = {} ..."]:7: unexpected symbol near '..'
Where is my misstake.. ?
Raspberry PI 3 - Opentherm Gateway + ESP8826 - EvoHome - ESPEasy CO2 + Fancontrol - RF-Link - zigbee2mqqt -
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: using one input (IDX) for a counter and flow sensor
Where did you find this syntax?HFman wrote: commandArray['UpdateDevice'] = 207,0, ..WaterFl
The correct syntax for updatedevice is:
Code: Select all
commandArray['UpdateDevice'] = '207|0|' ..WaterFl

-
- Posts: 82
- Joined: Thursday 02 March 2017 20:28
- Target OS: Linux
- Domoticz version: V4.1174
- Location: Netherlands
- Contact:
Re: using one input (IDX) for a counter and flow sensor
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
.
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

Raspberry PI 3 - Opentherm Gateway + ESP8826 - EvoHome - ESPEasy CO2 + Fancontrol - RF-Link - zigbee2mqqt -
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: using one input (IDX) for a counter and flow sensor
Good to hear!HFman wrote:Finally..

Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest