I’m working since days on integrating my AJAX alarm in openHAB.
I tried python example from eavanvalkenburg (Eduard van Valkenburg) · GitHub with no sucess. ( not all sensor are managed and I not even know how to modify the code ).
So I have setup a small homeassistant server to install existing AJAX module, then activated debug and now home-assistant.log is logging raw message from my alarm ( SIA ).
I made a file sensor on home assistant to send last line of this log to my openhab server via mqtt broker.
It works but some lines are lost if there is too message in a short time.
So I would like to simplify.
How can I monitor the home-assistant log ( \\homeassistant.local\config\home-assistant.log ) to get all the new lines added since last call and line by line directly with openhab server ?
I tried the LogReader binding, all is green but no event is generating ( due to the file that are on the network, unc ? ).
You need to set the QOS on Home Assistant and on openHAB to 1 or 2 so the messages are not dropped.
If log reader doesn’t work, there really is nothing on the openHAB server that is going to work. You’ll have to put something on the Home Assistant server to read the logs and publish them to openHAB, which puts you right back where you started.
Logreader binding on openhab seems to take full control on the log file on \192.168.1.78\config\home-assistant.log so it works on start but then homeassistant stop to log until I pause the binding…
It seems that this logfile is not writed line by line, it seems to exists a “memory storage” and memory is written to logfile frequently but it is possible that several log lines are written at the same time, and the sensor on home assistant take only care of the last line.
So the both way I tried seems not to work.
I see no solutions for the moment…
Edit : Just wonder if the memory written to logile several lines at one time is a windows problem ???
Indeed it is a common approach to cache a bunch of log statements and write them out in bulk all at once in order to improve performance and reduce the number of writes on the media.
Home Assistant is a hub like openHAB. Can’t you just have Home Assistant publish the values over MQTT? It seems overly complicated to make it log out the values only to have something else read the log and publish the messages. Why not have Home Assistant just publish the messages itself?
The share is made by a homeassistant add-on using samba share.
unfortunately, the AJAX add-on on home assistant is not fully compatible with my alarm bundle, there is smoke detector, humidity detector but my doorprotect and motion cam detector are not driven by the add-on, and so I can’t simply resend to mqtt broker and I need the raw message from my alarm.
I tried to explore python code of the add-on but it’s too hard for my knowledge.
I think i will try with the python code ( not homeassistant dependant ) , this will be more simple to add a send to mqtt broker.
When accessing files over samba, the file events that tell a tool like tail or the LogReader add-on don’t happen so they never know that the file has been added to. That’s why you’ll need to access the file on the home assistant machine itself where the file events are occurring.
Sorry to re-open this topic, but which are the values to change in this script?
I’ve changed the “IPADRESSOFBROKER” to the IP of my AJAX hub, but what else to change?