using one input (IDX) for a counter and flow sensor

Moderator: leecollings

Post Reply
HFman
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

Post 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 ?
Raspberry PI 3 - Opentherm Gateway + ESP8826 - EvoHome - ESPEasy CO2 + Fancontrol - RF-Link - zigbee2mqqt -
HFman
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

Post 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.. ?
Raspberry PI 3 - Opentherm Gateway + ESP8826 - EvoHome - ESPEasy CO2 + Fancontrol - RF-Link - zigbee2mqqt -
Nautilus
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

Post 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...:)
HFman
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

Post 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 :).
Raspberry PI 3 - Opentherm Gateway + ESP8826 - EvoHome - ESPEasy CO2 + Fancontrol - RF-Link - zigbee2mqqt -
Nautilus
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

Post by Nautilus »

HFman wrote:Finally..
Good to hear! :D
Post Reply

Who is online

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