dzVents: Logfile has less info Topic is solved

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: dzVents: Logfile has less info

Post by gizmocuz »

Kedi wrote: Monday 08 July 2024 9:09 I understand that it is a done case.
But please remove the line, it makes no sense.

Code: Select all

Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
I agree with you, but this message was there before.
You can disable this message with the checkbox'Log 'event script triggers'' (uncheck this) under Settings->Other

I guess when you use a lua script, or maybe a script outside the internal editor, you do get the real filename here... no idea... not my code

Hope someone knows this and sees another filename here
Quality outlives Quantity!
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: dzVents: Logfile has less info

Post by Kedi »

Tnx, Now I got rid of that message.
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: dzVents: Logfile has less info

Post by McMelloW »

waltervl wrote: Monday 08 July 2024 8:15 With default log level in settings
info,status,error,execution info
and no log level defined I get below with the test script.

When I set LOG_INFO in the script I get no execution lines (as expected)

Code: Select all

 2024-07-08 08:10:55.976 Status: User: admin (IP: 192.168.1.58) initiated a switch command (107/Test/On)
2024-07-08 08:10:55.979 Dummy: Light/Switch (Test)
2024-07-08 08:10:56.007 dzVents: Handling events for: "Test", value: "On"
2024-07-08 08:10:56.007 dzVents: log_script: ------ Start internal script: logging_test: Device: "Test (Dummy)", Index: 107
2024-07-08 08:10:56.007 dzVents: log_script: INFO log line!
2024-07-08 08:10:56.007 Status: dzVents: log_script: STATUS log line!
2024-07-08 08:10:56.007 Error: dzVents: log_script: ERROR log line!
2024-07-08 08:10:56.007 dzVents: log_script: ------ Finished logging_test 
When I try this, with no log settings in the script, I only get these 2 lines. Where are the execution and info lines

Code: Select all

2024-07-08 12:55:42.732 Status: User: mcmellow (IP: 192.168.123.16) initiated a switch command (291/Test-Switch/Off)
2024-07-08 12:55:42.880 Status: dzVents: STATUS log line!
2024-07-08 12:55:42.880 Error: dzVents: ERROR log line!
Does this also has anything to do with the DAEMON_ARGS setting in /etc/init.d/domoticz.sh
Greetings McMelloW
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzVents: Logfile has less info

Post by waltervl »

McMelloW wrote: Monday 08 July 2024 13:02
When I try this, with no log settings in the script, I only get these 2 lines. Where are the execution and info lines


Does this also has anything to do with the DAEMON_ARGS setting in /etc/init.d/domoticz.sh
What are your settings in menu Setup, Settings, Tab Other, Dzvents logging ? As shown in screenshots earlier in this topic....
It should be at least "Info,Status, Error"
If only "Status,Error" you only will get Status and Error messages in the log and no Info.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: dzVents: Logfile has less info

Post by McMelloW »

waltervl wrote: Monday 08 July 2024 13:43
What are your settings in menu Setup, Settings, Tab Other, Dzvents logging ? As shown in screenshots earlier in this topic....
It should be at least "Info,Status, Error"
If only "Status,Error" you only will get Status and Error messages in the log and no Info.
The setup, settings... etc are: info,status,error,execution info.
The loglevel lines including logging = { .... }, in the script are marked out.
Greetings McMelloW
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzVents: Logfile has less info

Post by lost »

gizmocuz wrote: Monday 08 July 2024 9:30 I guess when you use a lua script, or maybe a script outside the internal editor, you do get the real filename here... no idea... not my code
Hope someone knows this and sees another filename here
Yes, all my scripts are external and I have full script path/name:

Code: Select all

grep EventSystem /tmp/domoticz.txt 
2024-07-08 14:46:28.034  Status: EventSystem: Script event triggered: /home/domo/domoticz/scripts/lua/script_device_smartMeter.lua
2024-07-08 14:46:33.163  Status: EventSystem: Script event triggered: /home/domo/domoticz/scripts/lua/script_device_smartMeter.lua
But this only shows up if, in Parameters/Others, I set the middle switch in the Events section (still in 2024.4, if this now changed). I only set this for debug if I want to verify a script is triggered, usually I don't have this set and no such logs. So when useless/internal there is already a way to get rid of this.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzVents: Logfile has less info

Post by waltervl »

McMelloW wrote: Monday 08 July 2024 14:08
waltervl wrote: Monday 08 July 2024 13:43
What are your settings in menu Setup, Settings, Tab Other, Dzvents logging ? As shown in screenshots earlier in this topic....
It should be at least "Info,Status, Error"
If only "Status,Error" you only will get Status and Error messages in the log and no Info.
The setup, settings... etc are: info,status,error,execution info.
The loglevel lines including logging = { .... }, in the script are marked out.
This what I had changed to get previous mentioned results. Default settings were info,status,error,execution info. Perhaps you did not press on Save Changes in settings?

Code: Select all

	logging = {
		marker = 'log_script',
		-- level = domoticz.LOG_DEBUG
	},
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: dzVents: Logfile has less info

Post by McMelloW »

log settings in /etc/init.d/domoticz.sh

DAEMON_ARGS="$DAEMON_ARGS -loglevel status,error" # these loglevels will make it to the logfile

log settings in setup, settings, others, dzVents = Info, Status, Errors, Executions Info Yes, save changes is done.

logging in script = none, the line is marked out with -- Here you see the results of the log when I trigger the log-level script with a dummy switch

Code: Select all

2024-07-08 15:47:11.347 Status: EventSystem: reset all events...
2024-07-08 15:47:11.349 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/EnergyConsumption.lua
2024-07-08 15:47:11.350 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/SimSolarBattery.lua
2024-07-08 15:47:11.350 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/KM2-Zonneboiler.lua
2024-07-08 15:47:11.351 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/SolarEdgeStatus.lua
2024-07-08 15:47:11.351 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/TestLogLevel.lua
2024-07-08 15:47:24.721 Status: User: mcmellow (IP: 192.168.123.16) initiated a switch command (291/Test-Switch/On)
2024-07-08 15:47:24.811 Status: dzVents: log-level: STATUS log line!
2024-07-08 15:47:24.812 Error: dzVents: log-level: ERROR log line!
2024-07-08 15:47:26.309 Status: User: mcmellow (IP: 192.168.123.16) initiated a switch command (291/Test-Switch/Off)
2024-07-08 15:47:26.430 Status: dzVents: log-level: STATUS log line!
2024-07-08 15:47:26.430 Error: dzVents: log-level: ERROR log line!
I have tried another script and set logging to level = domoticz.LOG_DEBUG. In this script are a number of lines to show values with domoticz.LOG_DEBUG And none of these lines showed up in the log. Where else is the logging set for dzVents scripts
Last edited by McMelloW on Monday 08 July 2024 17:03, edited 1 time in total.
Greetings McMelloW
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: dzVents: Logfile has less info

Post by Kedi »

lost wrote: Monday 08 July 2024 14:54
gizmocuz wrote: Monday 08 July 2024 9:30 I guess when you use a lua script, or maybe a script outside the internal editor, you do get the real filename here... no idea... not my code
Hope someone knows this and sees another filename here
Yes, all my scripts are external and I have full script path/name:

Code: Select all

grep EventSystem /tmp/domoticz.txt 
2024-07-08 14:46:28.034  Status: EventSystem: Script event triggered: /home/domo/domoticz/scripts/lua/script_device_smartMeter.lua
2024-07-08 14:46:33.163  Status: EventSystem: Script event triggered: /home/domo/domoticz/scripts/lua/script_device_smartMeter.lua
But this only shows up if, in Parameters/Others, I set the middle switch in the Events section (still in 2024.4, if this now changed). I only set this for debug if I want to verify a script is triggered, usually I don't have this set and no such logs. So when useless/internal there is already a way to get rid of this.
For me now it is a BIG question mark. I have all my scripts external and always had and have this line.

Code: Select all

/home/pi/domoticz/dzVents/runtime/dzVents.lua
In my startup I have.

Code: Select all

DAEMON_ARGS="$DAEMON_ARGS -loglevel normal,status,error"
In my scripts always.

Code: Select all

    logging =
    {   marker = 'AutoOff',
        level = domoticz.LOG_INFO,
--      level = domoticz.LOG_DEBUG,
    },
And switch between LOG_INFO and LOG_DEBUG only when I have to debug. My 'middle' switch is normally green.
What could be difference between our settings?
Logic will get you from A to B. Imagination will take you everywhere.
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: dzVents: Logfile has less info

Post by Kedi »

Oke, I see the difference now -> script_device_ in lua dir.
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzVents: Logfile has less info

Post by waltervl »

@McMellow By default there is no loglevel argument in domoticz.sh

https://github.com/domoticz/domoticz/bl ... omoticz.sh

So you could try by removing it.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: dzVents: Logfile has less info

Post by willemd »

gizmocuz wrote: Monday 08 July 2024 7:17 .....
There is also another setting 'Log event script triggers', is that enabled or disabled?

...
Thanks, that at least removed the useless messages....
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: dzVents: Logfile has less info

Post by McMelloW »

waltervl wrote: Monday 08 July 2024 17:16 @McMellow By default there is no loglevel argument in domoticz.sh

https://github.com/domoticz/domoticz/bl ... omoticz.sh

So you could try by removing it.
Thanks for your advice.
These loglevel arguments were put in domoticz.sh a long time ago to suppress a lot of messages. Some of my hardware was set to debug as well as info, status and error. I have checked all hardware settings and put them to a more normal stable situation.

Playing with the loglevel test script shows the different results of the loglevels. Thanks for all the support with this subject. It is very helpful. 👍👍
Greetings McMelloW
janpep
Posts: 212
Joined: Thursday 14 March 2024 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: dzVents: Logfile has less info

Post by janpep »

Both @waltervl and @gizmocuz thank for your support and all attempts to help people.
gizmocuz wrote: Monday 08 July 2024 8:11 I guess your previous Domoticz update was ~6 months ago?
I went to 2024.4 very soon after it was available.
So, the idea rose to have a global way of turning this off. Hence the new Log Levels in the application settings. The default level (when you install Domoticz new) is still Info+Status+Error+Exec_Info. It is possible some users did change this level previously and they experience a different log level.

But still, if you set this to Status+Error, you can override this in your script

This is also explained in the dzVents manual that can be found on our WIKI (logging = { … } (optional))

And this is also why a new example template is available called 'Logging' that you can use as tutorial.

The idea is to remove/mark all "logging = { … } (optional)" in your scripts when the script is finished so the application default level will apply.
When you need extensive script logging you can use LOG_DEBUG there
Indeed, I want that extensive logging, but only for the script I am working on. Like Kedi, until now I set it to INFO or DEBUG in the script itself.

You gave an explanation on what changed in the new version and of how it should work, But it doesn't seem like a response to my findings.

Meanwhile update 2024.6 installed, did all the cache clean-up and tried again. Still this is very confusing for me and I do not consider myself the most stupid in this area.

Earlier I already had understood, that when notyhing is specified, the general setting is used and that a specification in the script will override that. In the quote above you confirm this. My point however was clear! When I test this, that does not seem to be the case.

1. I have set the general Settings --> Other now to: 'Info, Status, Erros, Execution Info'.
2. In the template, I set the level = domoticz.LOG_DEBUG
3. Then I run the template.
4. I expect to see now all four template lines (INFO, STATUS, ERROR, DEBUG.) in URL/#/Log.

But the result is still:

Code: Select all

2024-07-08 22:22:43.523 Status: dzVents: logtest: STATUS log line!
2024-07-08 22:22:43.523 Error: dzVents: logtest: ERROR log line!
I hope I am missing something stupid here, but I'm going around in circles now.
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
janpep
Posts: 212
Joined: Thursday 14 March 2024 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: dzVents: Logfile has less info

Post by janpep »

OOPS.
Maybe stupid or perhaps the result of the way of working so far, because of how it turned out to be convenient to work.
For the script logging I always went to see my DEBUG information in tab STATUS. This filtered out already a lot of noise comming from the devices.
So this became my standard place to look at.
I just found the missing info under tab ALL :oops:
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: dzVents: Logfile has less info

Post by gizmocuz »

How bizarre right? Because before my changes everything ended in ALL (as all logs were handled as INFO internally in Domoticz)
Now you do have the Status and Error logs in their correct tabs/places. :ugeek:
Quality outlives Quantity!
janpep
Posts: 212
Joined: Thursday 14 March 2024 10:11
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: dzVents: Logfile has less info

Post by janpep »

gizmocuz wrote: Tuesday 09 July 2024 8:24 Now you do have the Status and Error logs in their correct tabs/places. :ugeek:
May I elaborate a little more on this? I understaqnd that these tabs are a kind of filter that show STATUS and ERROR logs.
For what purpose was the status log created? What would I use it for? I'm thinking of giving a LOG_STATUS in every script, which displays the end result? e.g. Air conditioning is turned off or the success or failure of a certain script or action.
In that case the tab Status gives a nice overview of these results. Does that make sense?
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest