Issue with Flogger node

Is anyone using the Flogger node ? If so can you help with my problem ?
The node won’t seem to write to the log file at all. My log file is called flogger.log
If I set the LogDir to /home then the node seems to work, no error messages but no flogger.log is created. I’ve manually created a flogger.log file to see if it will add to it thereafter but it doesn’t.
If I set the LogDir to /home/admin then I get an error on the node “Can’t write file!” debug gives this - “Can’t write file: Error: ENOENT: no such file or directory, open ‘/home/admin/flogger.log’”
This smells of a permissions fault but I just can’t find what’s wrong.

My HA is running on a straight Debian machine.
Thanks

Assuming you’re using the addon, you would need to write to one of the folders within the Node Red container. So one of “/config”, “/share” or “/media”.

On the host machine these are mapped from “/mnt/data/supervisor/homeassistant”, “/mnt/data/supervisor/share” and “/mnt/data/supervisor/media”.

You sir are a Genius !

Sorted. Thank you so much.

anyone have advice for this, I am using the Mustache template?

Payload: {{payload}}, WLED: {{wled}}, Holiday: {{holiday}}, Level: {{level}}, State Message: {{statemsg}}

Sometimes the payload is like this, and it will work correctly >

{"payload":"99","wled":"99","holiday":"none","level":35,"statemsg":"off","garage":1,"kitchen":"99","lutron":100,"_msgid":"bce7f0d93142aca1","_event":"node:c06de56ab5f2bf43-9b51890b860f3172"}

and sometime the payload is an object and it doesnt work>

{"payload":{"brightness":35,"color_temp":360,"state":"ON","transition":2},"wled":"99","holiday":"none","level":35,"statemsg":"off","garage":1,"kitchen":"99","lutron":100,"_msgid":"1536b9b1d908639d","_event":"node:e6bc18b574cd6107-28cd8355d3d338bd"}

The output ends up looking like this>

2024/04/02 00:18:23 DEBUG Payload: 100, WLED: 99, Holiday: none, Level: 35, State Message: off
2024/04/02 00:18:26 DEBUG Payload: [object Object], WLED: 99, Holiday: none, Level: 35, State Message: off
2024/04/02 00:18:35 DEBUG Payload: [object Object], WLED: 99, Holiday: none, Level: 35, State Message: off
2024/04/02 00:18:44 DEBUG Payload: [object Object], WLED: 99, Holiday: none, Level: 35, State Message: off
2024/04/02 00:18:53 DEBUG Payload: 99, WLED: 99, Holiday: none, Level: 35, State Message: off

See if this works for you. Connect the switch node to the node that creates that message, flogger where the debug is.

image

[{"id":"ba89cb7c.457638","type":"debug","z":"0a325c35fc29f44e","name":"flogger node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":970,"y":1780,"wires":[]},{"id":"4d7ae182af99e501","type":"inject","z":"0a325c35fc29f44e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":1720,"wires":[["041f62ce3415a7e9"]]},{"id":"041f62ce3415a7e9","type":"function","z":"0a325c35fc29f44e","name":"payload is an obj","func":"return {\n\t\"payload\": {\n\t\t\"brightness\": 35,\n\t\t\"color_temp\": 360,\n\t\t\"state\": \"ON\",\n\t\t\"transition\": 2\n\t},\n\t\"wled\": \"99\",\n\t\"holiday\": \"none\",\n\t\"level\": 35,\n\t\"statemsg\": \"off\",\n\t\"garage\": 1,\n\t\"kitchen\": \"99\",\n\t\"lutron\": 100,\n\t\"_msgid\": \"1536b9b1d908639d\",\n\t\"_event\": \"node:e6bc18b574cd6107-28cd8355d3d338bd\"\n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":1720,"wires":[["9d2e1ad78443c8d4"]]},{"id":"d3dde51573c521a8","type":"change","z":"0a325c35fc29f44e","name":"","rules":[{"t":"set","p":"brightness","pt":"msg","to":"payload.brightness","tot":"msg"},{"t":"set","p":"color_temp","pt":"msg","to":"payload.color_temp","tot":"msg"},{"t":"set","p":"state","pt":"msg","to":"payload.state","tot":"msg"},{"t":"set","p":"transition","pt":"msg","to":"payload.transition","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":1740,"wires":[["ba89cb7c.457638"]]},{"id":"9d2e1ad78443c8d4","type":"switch","z":"0a325c35fc29f44e","name":"","property":"payload.brightness","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":1780,"wires":[["d3dde51573c521a8"],["ba89cb7c.457638"]]},{"id":"99aba1e4f0474fa8","type":"function","z":"0a325c35fc29f44e","name":"msg that works","func":"\nreturn {\"payload\":\"99\",\"wled\":\"99\",\"holiday\":\"none\",\"level\":35,\"statemsg\":\"off\",\"garage\":1,\"kitchen\":\"99\",\"lutron\":100,\"_msgid\":\"bce7f0d93142aca1\",\"_event\":\"node:c06de56ab5f2bf43-9b51890b860f3172\"};","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":1840,"wires":[["9d2e1ad78443c8d4"]]},{"id":"78711388fdb74c88","type":"inject","z":"0a325c35fc29f44e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":1840,"wires":[["99aba1e4f0474fa8"]]}]
1 Like

Thanks,

That does work, I was just thinking there was a way to do it directly in the Mustache systax.