Page 9 of 15
Re: Opentherm gateway and script integration into Homeseer
Posted: Tue Jan 01, 2013 4:30 pm
by Rutger
I'm not satisfied about the many comport errors in Homeseer. Sometimes it works fine for 2 days, most ofthe time I get several errors a day and it doesn't fixed automatically. So I would like to try the Telnet function, but don't have a clue how to start ad can't even find any info about this. The usb-rs232 converter is connected to my HS server, so no remote connection.
I can run the telnet server on HS server, but don't understand how it will connect to the comport (COM4) and so on.
The ini setting is changed to Telnet=true.
Can anyone help me with this?
Re: Opentherm gateway and script integration into Homeseer
Posted: Tue Jan 01, 2013 11:25 pm
by blb
Rutger,
my script support both direct COM port or Telnet conection. You can select this in the INI file. The relevant part in the INI file:
for Serial connection:
Telnet=FALSE
SerialPort=2 <== replace with the comport the gateway is connect to
SerialPortConfig=9600,N,8,1
For Telnet connection:
Telnet=TRUE
TCPAddress=172.31.0.170 <== replace with the IP address your gateway is connected to (e.g. serial to Ethernet converter)
TCPPort=20108 <== replace with the port number your gateway is connected to (e.g. serial to Ethernet converter)
Re: Opentherm gateway and script integration into Homeseer
Posted: Wed Jan 02, 2013 1:18 am
by blb
NEW VERSION uploaded
Hi all,
I discovered creation of OTGW devices was not possible via TELNET connection (only via COM port). I have fixed this in version 02g (in the opening post).
Re: Opentherm gateway and script integration into Homeseer
Posted: Wed Jan 02, 2013 11:48 am
by Rutger
Ik weet dat 't script beide communicatieprotocollen aan kan, maar ondanks dat lukt 't niet.
2-1-2013 10:40:12 OTmonitor error communication: De conversie van tekenreeks ??%??????'?????? naar type Double is ongeldig.
2-1-2013 10:40:12 debugOTGW2 Reply: ??%??????'??????
2-1-2013 10:40:12 debugOTGW3 SendMessageTelnet;Message: PR=T
De poort die is ingesteld werkt wel als ik buiten Homeseer om via Telnet wil verbinden. Kan het zijn dat een wachtwoord o.i.d. in de weg zit, want die melding wordt wel gegeven bij een Telnet sessie starten.
Hoef ik op mn HS server echt niets anders op te starten of te configureren, het OT script moet toch ergens een Telnet verbinding heen maken?
en bij commando PS=1, zie ik verder ook geen updates:
etc.
2-1-2013 10:48:59 debugOTGW3 device: #H12# k1: ## k2: #0# j2: 8
2-1-2013 10:48:59 debugOTGW3 device: #H11# k1: ## k2: #0# j2: 9
2-1-2013 10:48:59 debugOTGW3 device: #H10# k1: ## k2: #0# j2: 10
2-1-2013 10:48:59 debugOTGW2 Reply:
2-1-2013 10:48:59 debugOTGW2 Reply: ??%??????'??????
2-1-2013 10:48:59 debugOTGW3 SendMessageTelnet;Message: PS=1
2-1-2013 10:48:59 debugOTGW2 SendMessage;Message: PS=1
2-1-2013 10:48:59 debugOTGW2 OTCommand: PS OTValue: 1
2-1-2013 10:48:59 debugOTGW2 Parameters used: PS=1
Re: Opentherm gateway and script integration into Homeseer
Posted: Wed Jan 02, 2013 10:12 pm
by raymonvdm
Wat gebruik je om de gateway telnet aware te maken ? Een ip naar com verloop zo ja welke ?
Re: Opentherm gateway and script integration into Homeseer
Posted: Thu Jan 03, 2013 1:51 am
by blb
I'm using
this RS232 to Ethernet converter. This converter doesn't have login options. Currently the script (version 02g) is not taking login action into account; it's assuming direct access to to OTGW via TELNET (or via COM port). If a converter needs login credentials, you should be able to build this into the script.
Re: Opentherm gateway and script integration into Homeseer
Posted: Thu Jan 03, 2013 3:08 pm
by Rutger
I don't have a clue how to run it via telnet because of the errors in my previous post. This morning I changed the OT script that the COM port will be always open and not closed when a new command is send. I see a lot of debug announcements that the com port is still open, so that's good

If this is working fine for several days, I'm satisfied.
Re: Opentherm gateway and script integration into Homeseer
Posted: Thu Jan 03, 2013 4:05 pm
by raymonvdm
Rutger wrote:I don't have a clue how to run it via telnet because of the errors in my previous post. This morning I changed the OT script that the COM port will be always open and not closed when a new command is send. I see a lot of debug announcements that the com port is still open, so that's good

If this is working fine for several days, I'm satisfied.
Can you please help me to keep the com port open. As this will also be my solution i think ...
Re: Opentherm gateway and script integration into Homeseer
Posted: Thu Jan 03, 2013 6:22 pm
by Rutger
Even uit m'n hoofd, je hebt in het script op een aantal plaatsen "'hs.CloseComPort(SerialPort)" staan, als je hier het enkele aanhalingsteken ' voor zet krijg je 'hs.CloseComPort(SerialPort) en dat gebruik je als je commentaar toegevoegd. Het CloseComPort commando wordt dan niet meer uitgevoerd. Cosmetisch verdient 't niet de schoonheidsprijs, maar vooralsnog werkt 't wel. Als dit goed functioneert, zal je meer zaken moeten deactiveren, zodat ook de debug meldingen niet meer getoond worden.
Re: Opentherm gateway and script integration into Homeseer
Posted: Sun Jan 06, 2013 1:57 am
by raymonvdm
Ik heb vanavond op twee plekken de CloseComport uitgecommentarieerd (groeneboekje?) en het script lijk nog te werken. Daarnaast heb ik ook de tijd aangepast het script loopt nu elke 30 seconden i.p.v 130 seconden. Op deze manier heb ik sneller de actuele status van de brander enz..
Ik snap ook eigenlijk niet waarom het script elke zoveel seconden moet draaien. Eigenlijk wil je toch dat de connectie continue openstaat ?
p.s. Soms heb ik nog wel het probleem dat mijn set temperatuur event niet werkt, hij blijft dan hangen op de oude temperatuur
Code: Select all
Run script: BLB_OT_monitor_02.vb("Main","TC=22,0")
versus
Code: Select all
Run script: BLB_OT_monitor_02.vb("Main","TC=15,5")
Re: Opentherm gateway and script integration into Homeseer
Posted: Sun Jan 06, 2013 11:23 am
by fabian
raymonvdm wrote:Ik snap ook eigenlijk niet waarom het script elke zoveel seconden moet draaien. Eigenlijk wil je toch dat de connectie continue openstaat ?
p.s. Soms heb ik nog wel het probleem dat mijn set temperatuur event niet werkt, hij blijft dan hangen op de oude temperatuur
ik ben ook fan van snelle updates, maar dit kan ook wel de oorzaak van je probleem zijn. Wanneer het PS=1 event toevallig net draait op het moment dat je een TT stuurt met een ander event (of andersom), dan is de COM poort via telnet of serieel nog in gebruik. Bij mij moet ik homeseer herstarten als dat gebeurd omdat vanaf het moment dat er een conflict is geweest, geen enkel event meer werkt wat wil communiceren met die COM poort.
Ben nog niet helemaal zeker of dit DE oplossing is, maar het is mogelijk om een virtueel device aan te maken voor ON/OFF in al je OTG events aanvinken dat het event pas is afgelopen wanneer het script volledig klaar is. Boven het script 'virtueel device = ON' , onder het script 'virtueel device = OFF' en bij je PS=1 event aangeven dat het alleen uitgevoerd mag worden als 'virtueel device = OFF' . Dit zou conflicten moeten voorkomen.
Re: Opentherm gateway and script integration into Homeseer
Posted: Sun Jan 06, 2013 11:25 am
by fabian
Toevallig vanacht last van gehad:
Code: Select all
6-1-2013 0:59:17 ~!~X10 Received~!~ F All Units Off
6-1-2013 0:59:35 ~!~debugOTGW~!~Debug Level: 1
6-1-2013 0:59:35 ~!~debugOTGW1~!~Parameters used: PS=1
6-1-2013 0:59:35 ~!~debugOTGW1~!~SendMessage;opening COM4 port succesful
6-1-2013 0:59:35 ~!~debugOTGW1~!~Reply: PF00000010/00000000,10.00,00000000/00000000,0.00,0/0,17.00,0.00,0.00,19.99,39.00,0.00,0.00,0.00,0/0,0/0,0.00,0.00,17275,0,0,0,1216,0,0,160
6-1-2013 1:00:00 ~!~Event~!~Event Trigger "OT Gateway PR commands"
6-1-2013 1:00:00 ~!~Event~!~Running script in background: BLB_OT_monitor_02.vb("Main","PR=all")
6-1-2013 1:00:00 ~!~debugOTGW~!~Debug Level: 1
6-1-2013 1:00:00 ~!~debugOTGW1~!~Parameters used: PS=1
6-1-2013 1:00:00 ~!~debugOTGW~!~Debug Level: 1
6-1-2013 1:00:00 ~!~debugOTGW1~!~Parameters used: PR=all
6-1-2013 1:00:00 ~!~Error~!~In OpenComPort, error opening port: Unable to obtain a handle to the COM port
6-1-2013 1:00:00 ~!~debugOTGW~!~SendMessage;Error opening COM4 ,error: Error: Unable to obtain a handle to the COM port
6-1-2013 1:00:00 ~!~Warning~!~Attempt to send to COM port 4, port is not open
6-1-2013 1:00:00 ~!~debugOTGW1~!~SendMessage;opening COM4 port succesful
6-1-2013 1:00:00 ~!~Error~!~In SendToComPort: Object reference not set to an instance of an object.
6-1-2013 1:00:00 ~!~OTmonitor error~!~communication: Object reference not set to an instance of an object.
6-1-2013 1:00:00 ~!~Error~!~Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Scheduler.clsComPorts.CloseComPort(Int32 port) at Scheduler.hsapplication.CloseComPort(Int32 port) at scriptcode5.scriptcode5.Main(Object varParameters) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
6-1-2013 1:00:00 ~!~OTmonitor error~!~communication: Object reference not set to an instance of an object.
6-1-2013 1:00:00 ~!~Error~!~Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Scheduler.clsComPorts.CloseComPort(Int32 port) at Scheduler.hsapplication.CloseComPort(Int32 port) at scriptcode3.scriptcode3.Main(Object varParameters) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
6-1-2013 1:00:25 ~!~debugOTGW~!~Debug Level: 1
6-1-2013 1:00:25 ~!~debugOTGW1~!~Parameters used: PS=1
Vanaf dat moment komt bij iedere PR=all dezelfde error voorbij. Dus vanmorgen geen TT=20, dus koud

Re: Opentherm gateway and script integration into Homeseer
Posted: Sun Jan 06, 2013 11:31 am
by Rutger
Het aanmaken van het virtual device heb ik voorkomen door het events wat de losse commando's als PS=1 verstuurd, te disablen en later te enablen zodra ik bijv. de temperatuur ga wijzigen. En er zit natuurlijk de nodige tijd tussen de diverse commando's.
Re: Opentherm gateway and script integration into Homeseer
Posted: Sun Jan 06, 2013 11:31 am
by fabian
Na een jaar met op blb ot monitor 20111206 te hebben gedraaid, heb ik ook de laatste versie gepakt. Ondanks het verwijderen van alle script gerelateerde devices krijg ik geen pulldown menu met temperaturen in het 'Kamerthermostaat - tijdelijk' device. Device wordt wel aangemaakt, maar zonder settings en waarde blijft 'Unkown'. Wat doe ik fout ?
Re: Opentherm gateway and script integration into Homeseer
Posted: Sun Jan 06, 2013 1:55 pm
by Rutger
Probably there is a bug is the OT script from BLB, or at least 3 persons do something wrong.. In my post from 16 Dec 2012, 10:06, I told already about this. At the end of next week I've more time, maybe I can combine both scripts into 1, or BLB can look at this issue?