Page 2 of 3
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Wednesday 07 September 2016 9:36
by ayasystems
Kmtronic allows you connect at Nopen and NClose.....
Could be possible set as normal or inverted the Kmtronic devices?
For this devices that normally are ON all day I'm ussing NClose but in domoticz it is showed "Off" when really is "On"
Regards
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Tuesday 18 October 2016 15:10
by miroslavpetrov
gizmocuz wrote:@miroslavpetrov, dont know why this is happening to you, but it does not make any sense, as these are out-side processes, nothing todo with any hardware.
So this should not happen
And you should also try the beta version then
I know it does not make any sense but as you can see other user also faced that issue...However, it is fixed in the Beta version.
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Saturday 12 November 2016 19:39
by mscory
Hello,
Currently all my lights are controlled with teleswitches (a short 220V pulse inverts the relays). I'd like to expand my Domoticz system to control the lights. To do that:
1. I should be able to invert the teleswitches
2. As I don't know their initial state, I should be able to check if current is sent to the light: I imagine to convert 220VAC to 5VCC and then to action a relay (difficult to find relays with 220VAC relay coil)
In both cases the load will be extremely low and I was told that for such low current golden relay contacts are necessary. Would Kmtronic relays are adequate in my situation ?
220VAC --> 5VCC conversion is not very clean. Another idea ?
Thanks
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 12 March 2017 20:31
by Zuikkis
Hi,
is it possible to add support for this UDP box as well:
http://info.kmtronic.com/lan-ethernet-i ... board.html
It uses exactly the same protocol as USB version, but is just listening on a UDP port 12345.
I'm stupid and bought it before checking if Domoticz supports it or not..
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Tuesday 14 March 2017 20:27
by Derik
mmm
See this KMTronic in the hardware list... I see it is a relayboard. [ i now what i can do with a relaisboard ]
Only what are the options when i add this hardware?
Do i get standard devices?
Or what is possible with this hardware...
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Tuesday 21 March 2017 21:57
by Derik
Dear all..
Please a little information..
How can i use this board.
Perhaps a http push action possible?
Or just on and off?
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Tuesday 12 December 2017 14:18
by jono
gizmocuz wrote:Since version #2434, Domoticz now supports the KMTronic USB and TCP(Web) relay boards.
They are not expensive, and the hardware devices look very professional
Supported:
USB:
1,2,4 and 8 channels
* needs external 12 Volt power supply with more then 1 channel
TCP(Web)
2 and 8 channels
* needs external 12 Volt power supply
More information is available at:
http://kmtronic.com
I cannot get mine to work 8ch lan relay board labeled Domoticz and get the following in log any ideas ?
KMTronic : tcp/ip worker stopped
KM Tronic : stopped
Thanks in advance
Sent from my iPhone using Tapatalk
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Thursday 14 December 2017 13:21
by jono
hi all
I’ve recently brought a DOMOTICZ LAN Ethernet IP 8 channels WEB Relay board I have configured my router ports settings and fire walls works perfect ,
but when I tryand integrate it with Domoticz selecting KM tronic LAN interface in hardware domoticz docent recognise the box in devices
Any ideas ???
- product_423.jpg (22.9 KiB) Viewed 3117 times
Thanks in advance
John
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 10:19
by mcgiak
RATA1 wrote: ↑Wednesday 13 April 2016 18:29
RATA1 wrote:Hello,
Any plans to support the KMTronic LAN DS18B20 WEB Temperature Monitor too?
Thanks
I have written a little LUA script to read the temperature values and put them into virtual temperature sensors now if it is of some use to someone.
It is my first attempt at LUA so let me know if you think it can be modified/improved on.
Runs several times at once (from what I see in the log file) and I don't know why. If you do let me know.
Thanks
Code: Select all
------------------------------------------------------------------------------
--
--
-- Domoticz lua script to convert XML output from KMTronic DS1820 LAN module
-- Reads the temperature based on the unique ID of the sensor and passes it
-- back to a virtual temperature sensor(s)
-- sensors in Domoticz
--
------------------------------------------------------------------------------
-- Rob Allen 12/04/2016
------------------------------------------------------------------------------
commandArray = {}
function XML_Capture(cmd,flatten)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if flatten then
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
end
return s
end
--set to true to print to log file.
debug = false
--define the idx of your temperature sensors - i.e. what you have called your sensors and their IDX numbers
HWTemp_Flow = 108
HWTemp_Return = 109
HWTemp_Tank_Top = 110
HWTemp_Tank_Bottom = 111
--define temperature sensor UID's - i.e. the DS1820 serial number
--up to 4 per DS1820 LAN interface
sensorID_1 = "28006D2307000061"
sensorID_2 = "28AC0924070000C8"
sensorID_3 = "28FA1B24070000AB"
sensorID_4 = "28B30924070000B7"
-- Define your device IP@
Device_IP = "172.16.227.201"
if debug == true then
print("Reading values from: 'http://"..Device_IP.."/status.xml'")
end
-- Read the XML data from the device
XML_string=XML_Capture("curl -s 'http://"..Device_IP.."/status.xml'",1)
valid = string.find(XML_string, "<response>") -- check we are looking in the right place
if debug == true then
print(XML_string)
end
if valid == nil then
print ("Bad XML status read - temperatures NOT updated")
else
--Find the first sensor based on its UID
i = string.find(XML_string,sensorID_1) -- find the unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Flow_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[1] = {['UpdateDevice'] = HWTemp_Flow.."|0|"..HWTemp_Flow_Temperature} --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Flow_Temperature.."'")
end
-- Second sensor based on its UID
i = string.find(XML_string, sensorID_2) -- find the next unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Return_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[2] = { ['UpdateDevice'] = HWTemp_Return.."|0|"..HWTemp_Return_Temperature } --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Return_Temperature.."'")
end
-- Third sensor based on its UID
i = string.find(XML_string, sensorID_3) -- find the next unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Tank_Top_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[3] = {['UpdateDevice'] = HWTemp_Tank_Top.."|0|"..HWTemp_Tank_Top_Temperature } --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Tank_Top_Temperature.."'")
end
-- Fourth sensor based on its UID
i = string.find(XML_string, sensorID_4) -- find the next unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Tank_Bottom_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[4] = { ['UpdateDevice'] = HWTemp_Tank_Bottom.."|0|"..HWTemp_Tank_Bottom_Temperature } --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Tank_Bottom_Temperature.."'")
end
end
return commandArray
Thank you for the work.
I have some problems with the script, I have about 2 years the Kmtronic temperature monitor for a wood boiler puffer control. This solution is a great job. Can you contact me via PM and give me your e-mail for some questions? Thank you very much and a Merry Christmas.
Jack
Edit:
When i post the script LUA in Events i get this message:
LUA: Bad XML status read - temperatures NOT updated
What's the problem?
Thank you
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:04
by RATA1
Turn on debug in the script and see what is printed in the Domoticz log. Looks like it is not reading anything back to throw that error. Have you changed the ip@ of the relay box and not updated the script? Can you web browse to the ip of the kmtronic and see any output I.e. http://kmtronic-ip@/status.xml
The script hasn't changed so it is not getting or reading something right.
Mine have been fine and I am running three on the latest Domoticz beta so check your output from kmtronic box.
Cheers.
Sent from my SM-G935F using Tapatalk
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:16
by mcgiak
Thank you for reply and help!
This is the output from KMtronic Board:
Code: Select all
<response>
<sensor>
<id>28FFA4555115031C</id>
<name>ACS</name>
<temp>48.25</temp>
</sensor>
<sensor>
<id>28FF228C541503EC</id>
<name>Interna</name>
<temp>21.00</temp>
</sensor>
<sensor>
<id>28FFE28B54150348</id>
<name>Puffer</name>
<temp>78.43</temp>
</sensor>
<sensor>
<id>28FF0E8B541503B3</id>
<name>Esterna</name>
<temp>10.50</temp>
</sensor>
<version>
<model>KMtronic DS1820 Temperature Monitor</model>
<ver>1.0</ver>
</version>
</response>
And this is your script:
Code: Select all
------------------------------------------------------------------------------
--
--
-- Domoticz lua script to convert XML output from KMTronic DS1820 LAN module
-- Reads the temperature based on the unique ID of the sensor and passes it
-- back to a virtual temperature sensor(s)
-- sensors in Domoticz
--
------------------------------------------------------------------------------
-- Rob Allen 12/04/2016
------------------------------------------------------------------------------
commandArray = {}
function XML_Capture(cmd,flatten)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if flatten then
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
end
return s
end
--set to true to print to log file.
debug = false
--define the idx of your temperature sensors - i.e. what you have called your sensors and their IDX numbers
ACS = 108
Interna = 109
Puffer = 110
Esterna = 111
--define temperature sensor UID's - i.e. the DS1820 serial number
--up to 4 per DS1820 LAN interface
sensorID_1 = "28FFA4555115031C"
sensorID_2 = "28FF228C541503EC"
sensorID_3 = "28FFE28B54150348"
sensorID_4 = "28FF0E8B541503B3"
-- Define your device IP@
Device_IP = "192.168.1.199"
if debug == true then
print("Reading values from: 'http://"..Device_IP.."/status.xml'")
end
-- Read the XML data from the device
XML_string=XML_Capture("curl -s 'http://"..Device_IP.."/status.xml'",1)
valid = string.find(XML_string, "<response>") -- check we are looking in the right place
if debug == true then
print(XML_string)
end
if valid == nil then
print ("Bad XML status read - temperatures NOT updated")
else
--Find the first sensor based on its UID
i = string.find(XML_string,sensorID_1) -- find the unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Flow_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[1] = {['UpdateDevice'] = HWTemp_Flow.."|0|"..HWTemp_Flow_Temperature} --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Flow_Temperature.."'")
end
-- Second sensor based on its UID
i = string.find(XML_string, sensorID_2) -- find the next unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Return_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[2] = { ['UpdateDevice'] = HWTemp_Return.."|0|"..HWTemp_Return_Temperature } --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Return_Temperature.."'")
end
-- Third sensor based on its UID
i = string.find(XML_string, sensorID_3) -- find the next unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Tank_Top_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[3] = {['UpdateDevice'] = HWTemp_Tank_Top.."|0|"..HWTemp_Tank_Top_Temperature } --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Tank_Top_Temperature.."'")
end
-- Fourth sensor based on its UID
i = string.find(XML_string, sensorID_4) -- find the next unique ID of the sensor
p = string.find(XML_string,"<temp>",i) --look for the next occurrence of <temp> after ID
HWTemp_Tank_Bottom_Temperature=string.sub(XML_string,p+6,p+10) --temperature is the 5 characters after <temp> - i.e. 6-10
commandArray[4] = { ['UpdateDevice'] = HWTemp_Tank_Bottom.."|0|"..HWTemp_Tank_Bottom_Temperature } --send updated values to Domoticz
if debug == true then
print("temp returned = ".."'"..HWTemp_Tank_Bottom_Temperature.."'")
end
end
return commandArray
I do not find mistakes.
Any suggestion?
Code: Select all
2017-12-24 21:23:00.487 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:23:00.502 LUA:
2017-12-24 21:23:00.502 LUA: Bad XML status read - temperatures NOT updated
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:22
by RATA1
See post 27? It is supported in domoticz directly now I think but I have not tried it.
What does the debug output in the log?
Sent from my SM-G935F using Tapatalk
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:25
by mcgiak
I have set
Code: Select all
--set to true to print to log file.
debug = true
but no log file in
Domoticz directory/log
what am I doing wrong?
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:28
by RATA1
It prints out in the general log - it's an option under right hand menu (settings) at the bottom.
Sent from my SM-G935F using Tapatalk
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:29
by mcgiak
RATA1 wrote: ↑Sunday 24 December 2017 21:22
See post 27? It is supported in domoticz directly now I think but I have not tried it.
What does the debug output in the log?
Sent from my SM-G935F using Tapatalk
Yes i saw but i have a temperature board not a relay board. If i try to configure in Hardware "KMTronic Gateway with LAN interface" with correct remote adress (
http://192.168.1.199) and port (80)
I have this reponse:
Code: Select all
2017-12-24 21:28:39.718 Error: KMTronic: Error connecting to: http://192.168.1.199
2017-12-24 21:28:52.258 Error: KMTronic: Error connecting to: http://192.168.1.199
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:31
by mcgiak
This is log:
Code: Select all
2017-12-24 21:22:00.063 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:22:00.074 LUA:
2017-12-24 21:22:00.074 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:23:00.487 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:23:00.502 LUA:
2017-12-24 21:23:00.502 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:24:00.406 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:24:00.416 LUA:
2017-12-24 21:24:00.416 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:25:00.085 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:25:00.103 LUA:
2017-12-24 21:25:00.104 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:26:00.306 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:26:00.318 LUA:
2017-12-24 21:26:00.318 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:27:00.516 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:27:00.530 LUA:
2017-12-24 21:27:00.530 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:28:00.193 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:28:00.208 LUA:
2017-12-24 21:28:00.208 LUA: Bad XML status read - temperatures NOT updated
Any ideas?
Maybe I forgot some pass?
I installed Domoticz, after on Setup - More Options - Events I created a "Board1", Lua, All, Event active (V) event, and your script compiled and modified in its parts. After I saved.
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:43
by RATA1
This bit is reading nothing back or the string is not being populated so there is nothing to progress in the script - hence the error you ate getting. I did have an issue ages ago with a beta version that broke them as the data was empty/corrupted. If you have updated recently this might be the issue.
There was no explanation for why this happened as the beta version should not have done anything but it did.
Sorry I can't help more at the moment as it appears to be a variable issue in Domoticz . Upgrade or roll back or ask a dev to help?
Sent from my SM-G935F using Tapatalk
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 21:46
by mcgiak
I try with a Beta version, I'll let you know, in the meantime Merry Christmas!
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 22:05
by RATA1
mcgiak wrote:This is log:
Code: Select all
2017-12-24 21:22:00.063 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:22:00.074 LUA:
2017-12-24 21:22:00.074 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:23:00.487 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:23:00.502 LUA:
2017-12-24 21:23:00.502 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:24:00.406 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:24:00.416 LUA:
2017-12-24 21:24:00.416 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:25:00.085 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:25:00.103 LUA:
2017-12-24 21:25:00.104 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:26:00.306 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:26:00.318 LUA:
2017-12-24 21:26:00.318 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:27:00.516 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:27:00.530 LUA:
2017-12-24 21:27:00.530 LUA: Bad XML status read - temperatures NOT updated
2017-12-24 21:28:00.193 LUA: Reading values from: 'http://192.168.1.199/status.xml'
2017-12-24 21:28:00.208 LUA:
2017-12-24 21:28:00.208 LUA: Bad XML status read - temperatures NOT updated
Any ideas?
Maybe I forgot some pass?
I installed Domoticz, after on Setup - More Options - Events I created a "Board1", Lua, All, Event active (V) event, and your script compiled and modified in its parts. After I saved.
Ok. I don't write/create/use it like that in the script editor like you have done. I use it in the script folder under domoticz folder as a time base script as a txt file saved as a .lua- don't recall where exactly as I am wrapping presents. Maybe you need to do it like that and not the editor but can't see why as I use the editor for other scripts just fine.
If it has never worked then it will need some investigation. Are the Domoticz and the board on the same network and reachable?
No password needed far as I know.
Sent from my SM-G935F using Tapatalk
Re: new: KMTronic USB/485/TCP(Web) support
Posted: Sunday 24 December 2017 22:21
by mcgiak
I have already created the script_temperature_Board1.lua file with the code you have created and modified.
But once open domoticz, no feedback.
At the temperature tab "No Temperature sensors found or added in the system ..."
I would not know what else to do..!
In fact, the PC on which Domoticz is installed is under a network (10.10.1.x) while the board in another (192.168.1.x), however, is easily reachable.
Can this create problems?