- Beiträge: 68
- Dank erhalten: 12
xPhcLog, log events on the PHC module bus
- haribo
- Offline
- Senior Mitglied
-
yes I have an example for a dimmer. It's still experimental but it works.
item:
rule:
Suggestions for enhancements are welcome.
Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Mitglied
-
- Beiträge: 68
- Dank erhalten: 12
Jan schrieb:
For a simple switch function controlled by a 'toggle' I use following solution. The state in OH2 is always represented correctly regardless the switch is operated by OH2 or PHC.
Code:Switch LE_Wc "WC Boven" <light> {http=">[*:GET:http://localhost:8888/icontrol.dll?ccmd=imd.3.in5.ingt0]", mqtt="<[mosquitto:myHouse/sta/omd.4.out.5:state:MAP(offon.map)]"}
My Switch-Items look like this:
It' similar but has the following advantages:
- You need not know the mapping of PHC-Input->PHC-Output
- You can control outputs that are not associated to any physical switches (PHC-Inputs)
- You can turn on/off outputs in OH-rules - not only toggle them
Maybe this is an inspiration for you.
Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Eckert258
- Offline
- Junior Mitglied
-
- Beiträge: 10
- Dank erhalten: 0
haribo schrieb: Hi Jo,
I changed the connection as suggested. It's the same - no traffic is logged.
So I made another approach: I use the following USB - RS485 Converter .
Still no reaction in the logfile.
What about the 'mode' problem. I still have the affect, that xphclogd terminates using mode=1
Code:pi@raspberrypi ~/xphclog $ ./xphclogd.raspi --ini xphclogd.ini --loglevel 0xFFFFFFFF + xPhcLogd (Linux/RbPI) ------ v4.0.0.4, Sep 16 2016, Jo Simons (c) 2007-2016 + ============================================================================= Press CTRL-C to quit... 2016-12-03,19:19:59,00090000,A,version=4.0.0.4,Sep 16 2016 2016-12-03,19:19:59,00090010,A,legend: 2016-12-03,19:19:59,00090011,A, o0=out0-7,o1=out8-15 2016-12-03,19:19:59,00090012,A, i0=in0-7,i1=in8-15 2016-12-03,19:19:59,00090013,A, l0=out0,l1=out1,l2=out2,l3=out3 (amd/ebd/dim) CTRL-C pressed,terminating app - 0 (Success) pi@raspberrypi ~/xphclog $
But I did not press CTRL-C. Do you have an explanation for this? Should I be able to see logging activity using mode=0?
Harald
Hi,
ich habe das selbe Problem bei Version 4.0.0.4
Was mich wundert, mit Version 1.0.6.0 funktioniert xPhcLog einwandfrei. Weiß jemand an was das liegen könnte?
Grüße
Eckert258
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Biland
- Offline
- Senior Mitglied
-
- Beiträge: 34
- Dank erhalten: 0
zur Zeit nutze ich xwrc mittels des moxa nport 5110a dies funktioniert sehr zuverlässig.
Nun plane ich zum Abgreifen der Schaltzustände diverser Ausgansmodule xPhcLog / MQTT / ioBroker zu nutzen.
An meinem Raspi habe ich noch alle USB Ports frei und würde xPhcLog am liebsten mittels einem USB RS485 Adapter in Betrieb nehmen.
Kann mir hierzu einer von euch einen USB - RS 485 Adapter empfehlen?
Gruß,
Michel
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
The problem is that my code is not complete for using the "--ini xphclogd.ini" parameter, I need to add code for that.
You can use inidividual command line params to get by for now.
mvg, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Mitglied
-
- Beiträge: 68
- Dank erhalten: 12
leider kann ich dir keinen konkreten USB-Stick empfehlen - ich kann nur über Erfahrungen berichten.
Ich habe an die 10 verschiedene USB-Serial-Konverter für den Einsatz von xPhcLog getestet - RS485 und RS232. Einige aus China, andere von deutschen Ebay-Verkäufern. Dabei funktionierten einige gar nicht, einige blockierten das Steuermodul und 2 bis 3 funktionierten schließlich halbwegs zuverlässig. Nachdem ich dann auch xwrc über USB betreiben wollte, funktionierte keiner der RS232-Konverter.
Schließlich habe ich mir bei Ebay einen gebrauchten Moxa Nport 5210 (für 20€) gekauft - eine gute Wahl! Der läuft seit Wochen auf Anhieb stabil. Ich nutze einen RS232-Port für xwrc und den anderen für xPhcLog.
Gruß, Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Biland
- Offline
- Senior Mitglied
-
- Beiträge: 34
- Dank erhalten: 0
vielen Dank für deine Rückmeldung.
Dein Bericht hinsichtlich der Erfahrungen mit den USB-Serial-Konverter bestätigt meine Bedenken und ich denke die stabilste Lösung wird es sein, auch für xPhcLog ein Moxa Nport zu verwenden. Mit dem habe in Verbindung mit xwrc bisher auch Null Probleme!
Ich denke ich werde mich mal nach einem günstigen 5210A umschauen und meinen 5110A durch diesen ersetzten und ggf. Verkaufen.
Danke nochmal für dein Feedback.
Gruß,
Michel
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Eckert258
- Offline
- Junior Mitglied
-
- Beiträge: 10
- Dank erhalten: 0
ich verwende die INI-Funktoin nicht. Habe alles über die Aufrufparameter geregelt.
@Biland: Ich habe folgenden USB-Adapter Einsatz: LINK
Dieser funktioniert mit 1.0.6.0 und bei Version 4.0.0.4 hoffe ich das Jo wieder einen genialen Tipp hat

Grüße
Eckert
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
Can you send me the logging when xPhcLog starts
Which MQTT broker are you using?
About the USB stick, are all dip switches open? You can try and play with switches 2, 3 and 4
mvg, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Mitglied
-
- Beiträge: 68
- Dank erhalten: 12
I have detected the following problem with xphclogd in my living room scenario:
I have a group of 5 sockets connected to OMDs. To control and synchronize this group, I made one output the "master" (OMD.2.2) and the "slaves" (OMD.2.3, OMD.2.6, OMD.2.7 and OMD.7.6) follow the master, when it's output state changes.
The problem is that xphclogd does not propagate the right states:
As you can see, myHouse/sta/omd.2.out.2,payload=0 is wrong and myHouse/sta/omd.2.out.3,payload=1 is missing.
Then I changed the behaviour and put some delays to the slaves. Now xphclogd reports correctly:
Do you have any idea what's going wrong in the first scenario?
Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
xPhclogd maintains an internal cache with the states of the outputs, this is cleared when xPhclogd is started. When status packets are captured, the value is compared to the cache and differences are reported. After that the cache is updated.
If for some reason the cache is not in synch with the real state of the outputs, then things are not reported correctly.
After starting xPhclogd it would be good to query each output module for its status (i.e. omd.0;omd.1;omd.2; ...) this way xPhclogd can update it's cache.
Another point of problems can be that xPhclogd puts all MQTT messages on a queue first, then later the msgs are sent to the broker. It could be that the queue is too small (now set to 64), but then an error msgs would be logged.
mvg, Jo
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- haribo
- Offline
- Senior Mitglied
-
- Beiträge: 68
- Dank erhalten: 12
Hi Jo,simonjo schrieb: Hi Harald,
xPhclogd maintains an internal cache with the states of the outputs, this is cleared when xPhclogd is started. When status packets are captured, the value is compared to the cache and differences are reported. After that the cache is updated.
If for some reason the cache is not in synch with the real state of the outputs, then things are not reported correctly.
After starting xPhclogd it would be good to query each output module for its status (i.e. omd.0;omd.1;omd.2; ...) this way xPhclogd can update it's cache.
I did another test after restart of xPhclogd and forced omd status updates:
As you can see there is still something going wrong.
simonjo schrieb: Another point of problems can be that xPhclogd puts all MQTT messages on a queue first, then later the msgs are sent to the broker. It could be that the queue is too small (now set to 64), but then an error msgs would be logged.
No error was logged.
Harald
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- simonjo
-
Autor
- Offline
- Elite Mitglied
-
- Beiträge: 148
- Dank erhalten: 55
Looking further in the coming days... takes some time as it was quiet some time ago

Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Biland
- Offline
- Senior Mitglied
-
- Beiträge: 34
- Dank erhalten: 0
So after a few steps I connected the Pin 2 (RX) – black wire of my RS232 cable to the “B” port of the PHC power supply device and the Pin 5 (Ground) – brown wire of the RS232 cable to the “A” port of the power supply unit.
After installing I start the program with: /xwrc/xphclog/xphclogd.raspi --ini /xwrc/xphclog/xphclogd.ini
In the next step I try to create some traffic by using some hardware switches or some switches of my visualisation. And it works.
Thanks a lot but after some minutes I recognized that the e.g. omd.0 (port 3) doesn’t react to my hardware Switches (e.g. imd.1 port 2). Interesting is, that the port of the outputmodule can be toggled by using a switch of my visualisation.
Here is a short logfile.
I hope that somebody can help me:
XWRC works well.
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- Biland
- Offline
- Senior Mitglied
-
- Beiträge: 34
- Dank erhalten: 0
Bitte Anmelden oder Registrieren um der Konversation beizutreten.