DzVents stopped working  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: DzVents stopped working

Post by emme »

MartinManders wrote: Wednesday 25 July 2018 17:43
emme wrote: Wednesday 25 July 2018 10:18 can you please post the result for

sudo systemctl start domoticz

Hai Emme,

pi@Meterkast:~/domoticz$ sudo systemctl start domoticz
pi@Meterkast:~/domoticz$

No result/error or working server ...
Or do you need some logging, and if yes, witch logging?
my bad!
sudo systemctl start domoticz does show nothing
systemctl status domoticz
is much better :P :P
The most dangerous phrase in any language is:
"We always done this way"
Andyf66
Posts: 44
Joined: Wednesday 13 June 2018 12:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: DzVents stopped working

Post by Andyf66 »

I reverted to a database from 24 hours pervious and all seems working again.

I'll reintroduce my (fixed) dzvents changes today and see how it goes.
MartinManders
Posts: 23
Joined: Tuesday 24 July 2018 9:23
Target OS: Linux
Domoticz version: 2023.2
Location: Netherlands

Re: DzVents stopped working

Post by MartinManders »

Andyf66 wrote: Wednesday 25 July 2018 22:40 I’ve been having dzvents problems that started today too. Not sure if they are related.

Everything was working fine until I edited some scripts this morning. I left them saved and enabled all day but with some syntax errors.Ive now fixed these errors.

The events system starts up ok, but some scripts resolutely refuse to be called on device events. I see the event in the logs, but the script isn’t called.

What makes it more weird is that it is inconsistent. I made identical copies of scripts, and enabled them alternately so that only a single one was enabled at a time. Some are called, and some not, and even worse, enabling and disabling them seems to change whether unrelated other scripts respond to their events or not. It makes no sense!

The Ras Pi has not be changed in any way for a number of days so I’m sure it’s not that.

Any suggestions? Database corruption? Luckily I have hourly/daily dB backups and full nightly system backups.
I don't see a direct relation, but there are many similarities. On the KaKu system every script worked, on the Zwave system not.
And it started after a minor script editing, strange.
After the new install there are no faults regarding python, maybe thats caused the trouble?
On the other hand the "working" system has the old python (2.7.13), .....
- Reliability means:
never have to say i am sorry -
Rpi's 3B 1x RFX com + 20 dev 1x ZWave + 130 dev + rpi 4 remote
Andyf66
Posts: 44
Joined: Wednesday 13 June 2018 12:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: DzVents stopped working

Post by Andyf66 »

I'm now in a situation that editing scripts randomly stop other scripts being triggered. Rolling back the database fixes it, but not being able to change things is a bit of a pain in the ass.

I'm not sure if its the actual changes I'm trying to make are in some way breaking dzevents, or if its something more fundamentally broken deeper down.
MartinManders
Posts: 23
Joined: Tuesday 24 July 2018 9:23
Target OS: Linux
Domoticz version: 2023.2
Location: Netherlands

Re: DzVents stopped working

Post by MartinManders »

Hey Guys,

Another update.
I'am pretty sure that the fault is in the DzVents system, not in hardware, Domoticz or Python.
I've installed new Raspberry, fresh Stretch install, latest domoticz updates/upgrades, then did a restore of my Zwave environments and everything worked. On the other raspberry I installed a newer version of Python; result nothing worked. The reason of installing a newer version was the strange behavior of the device "DzVents stopped working" ....

Today when editing a DzVents script exactly the same behavior! There was an error in the script (device name).
And that was it! Again DzVents stopped working.

2018-07-27 19:55:27.499 Status: dzVents: Info: Handling events for: "KF1", value: "Open"
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Start internal script: laatstepoging1: Device: "KF1 (AEON)", Index: 623
2018-07-27 19:55:27.499 Status: dzVents: Info: Device KF1 was changed
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Finished laatstepoging1
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Start internal script: laatstepoging: Device: "KF1 (AEON)", Index: 623
2018-07-27 19:55:27.499 Status: dzVents: Info: Device KF1 was changed
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Finished laatstepoging
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Start internal script: Veranda: Device: "KF1 (AEON)", Index: 623
2018-07-27 19:55:27.500 Status: dzVents: Error (2.4.6): There is no device with that name or id: Robin Spots
2018-07-27 19:55:27.500 Status: dzVents: Error (2.4.6): An error occured when calling event handler Veranda
2018-07-27 19:55:27.500 Status: dzVents: Error (2.4.6): ...i/domoticz/scripts/dzVents/generated_scripts/Veranda.lua:10: attempt to index a nil value
2018-07-27 19:55:27.500 Status: dzVents: Info: ------ Finished Veranda

And this was the last message from DzVents. Over and out!

Can somebody explain this behavior?
Is there a way to reset the eventsystem, other than rebooting?
Thanks in advance.

Martin
- Reliability means:
never have to say i am sorry -
Rpi's 3B 1x RFX com + 20 dev 1x ZWave + 130 dev + rpi 4 remote
MartinManders
Posts: 23
Joined: Tuesday 24 July 2018 9:23
Target OS: Linux
Domoticz version: 2023.2
Location: Netherlands

Re: DzVents stopped working

Post by MartinManders »

MMMh I think it's vacation time.

Nobody an idea?
On this moment i've not rebooted the device, but the DzVents systems stopped working as I mentioned.
I think I'am gonna try a reboot, but my confidence in this application is gone ;-(
The cool examples and most of the reactions toke me to DzVents adventure.

But the "real" Lua scripts still remain working, thus maybe a more stable environment?

Martin
- Reliability means:
never have to say i am sorry -
Rpi's 3B 1x RFX com + 20 dev 1x ZWave + 130 dev + rpi 4 remote
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents stopped working

Post by waaren »

MartinManders wrote: Friday 27 July 2018 20:16 ...
Spoiler: show
2018-07-27 19:55:27.499 Status: dzVents: Info: Handling events for: "KF1", value: "Open"
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Start internal script: laatstepoging1: Device: "KF1 (AEON)", Index: 623
2018-07-27 19:55:27.499 Status: dzVents: Info: Device KF1 was changed
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Finished laatstepoging1
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Start internal script: laatstepoging: Device: "KF1 (AEON)", Index: 623
2018-07-27 19:55:27.499 Status: dzVents: Info: Device KF1 was changed
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Finished laatstepoging
2018-07-27 19:55:27.499 Status: dzVents: Info: ------ Start internal script: Veranda: Device: "KF1 (AEON)", Index: 623
2018-07-27 19:55:27.500 Status: dzVents: Error (2.4.6): There is no device with that name or id: Robin Spots
2018-07-27 19:55:27.500 Status: dzVents: Error (2.4.6): An error occured when calling event handler Veranda
2018-07-27 19:55:27.500 Status: dzVents: Error (2.4.6): ...i/domoticz/scripts/dzVents/generated_scripts/Veranda.lua:10: attempt to index a nil value
2018-07-27 19:55:27.500 Status: dzVents: Info: ------ Finished Veranda
And this was the last message from DzVents. Over and out!

Can somebody explain this behavior?
Is there a way to reset the eventsystem, other than rebooting?
I see 3 different scripts starting on a devicechange of "KF1 (AEON)" within 0.001 seconds. Is that what you want ?
The Error message want us to believe there is no device on your system named Robin Spots. If you are sure it is, you could replace the name with the idx number of that device (without surrounding quotes) at the place where you have now domoticz.devices("Robin Spots") to ensure there are no funny bytes somewhere playing tricks on you.
dzVents system can be stopped / started via [SETUP][SETTINGS][OTHER] and scroll down to the bottom
What do you mean exactly with "Over and out" Please be a little bit more descriptive on what works and what doesn't
Last edited by waaren on Wednesday 01 August 2018 0:10, edited 1 time in total.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
MartinManders
Posts: 23
Joined: Tuesday 24 July 2018 9:23
Target OS: Linux
Domoticz version: 2023.2
Location: Netherlands

Re: DzVents stopped working

Post by MartinManders »

Hi Waaren,

Thanks for your reply.

I uses this simpel code:

return {
on = {
devices = {
'KF1'
}
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
end
}


It worked, until a made some more test and then I got the error and logging you saw.
After that error there is no reaction at all from a input device, if a press the key, I see the action in the logging, but no reaction from DzVents?

All de "old fashionated" Lua scripts are working, but no action at all from Dz, thats wat I meant with "over and out".

After stopping and starting DzVents as described still no action from Dz.
Exactly the same script on my other RPi works like a charm?

Can't figure out wat went wrong, and why it isn't working after restarting.

Martin
- Reliability means:
never have to say i am sorry -
Rpi's 3B 1x RFX com + 20 dev 1x ZWave + 130 dev + rpi 4 remote
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents stopped working

Post by waaren »

MartinManders wrote: Tuesday 31 July 2018 23:57 ...
Can't figure out wat went wrong, and why it isn't working after restarting.
Hi Martin,

could you try this time based script to see if dzVents reports anything in the log. Might help to find a root cause.

Code: Select all

return {
    on = { timer = { "every minute" }},

    execute = function(domoticz)
        domoticz.log("This timer based script does send something to the domoticz log",domoticz.LOG_FORCE)
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
MartinManders
Posts: 23
Joined: Tuesday 24 July 2018 9:23
Target OS: Linux
Domoticz version: 2023.2
Location: Netherlands

Solved: DzVents stopped working

Post by MartinManders »

waaren wrote: Wednesday 01 August 2018 0:41
MartinManders wrote: Tuesday 31 July 2018 23:57 ...
Can't figure out wat went wrong, and why it isn't working after restarting.
Hi Martin,

could you try this time based script to see if dzVents reports anything in the log. Might help to find a root cause.

Code: Select all

return {
    on = { timer = { "every minute" }},

    execute = function(domoticz)
        domoticz.log("This timer based script does send something to the domoticz log",domoticz.LOG_FORCE)
    end
}
Hi Waaren,

I gave the eventsystem again a rest by starting and stopping.

Then put your script in the DzVents and activated it.

This is the result:

2018-08-02 10:44:12.271 Status: EventSystem: reset all events...
2018-08-02 10:44:12.273 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/Batterij_Check.lua
2018-08-02 10:44:12.273 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/laatstepoging.lua
2018-08-02 10:44:12.273 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/waaren.lua
2018-08-02 10:44:14.872 (AEON) Thermostat (Therm R-L)
2018-08-02 10:44:50.849 (Slimme meter) P1 Smart Meter (Power)
2018-08-02 10:45:00.238 Status: dzVents: Info: ------ Start internal script: waaren:, trigger: every minute
2018-08-02 10:45:00.238 Status: dzVents: !Info: This timer based script does send something to the domoticz log
2018-08-02 10:45:00.238 Status: dzVents: Info: ------ Finished waaren
2018-08-02 10:45:01.231 (Slimme meter) P1 Smart Meter (Power)


Looks good, then trying to push the KF1 button.

2018-08-02 10:49:00.281 Status: dzVents: Info: ------ Start internal script: waaren:, trigger: every minute
2018-08-02 10:49:00.281 Status: dzVents: !Info: This timer based script does send something to the domoticz log
2018-08-02 10:49:00.281 Status: dzVents: Info: ------ Finished waaren
2018-08-02 10:49:08.355 (AEON) Thermostat (Therm R-L)
2018-08-02 10:49:32.578 (AEON) Thermostat (Therm R-R)
2018-08-02 10:49:38.307 (AEON) Light/Switch (KF1)
2018-08-02 10:49:40.876 (Slimme meter) P1 Smart Meter (Power)


No reaction on this event, and again a reaction from my other RPi?
Checked again both script, exactly the same, then a drunk a cup of strong coffee, and looked again on both configs in Domoticz.
And... I found the difference, in the non-working config I use switch type ="contact", in my working device I shared the switch as "On/Off".
Changed it, and the script works!

I'm really embarrassed that I overlooked it 5 days.......
And almost destroyed my believe in DzVents, sorry guys.

The devil is in the detail, thanks a lot Waaren for your time !

Cheers,

Martin
- Reliability means:
never have to say i am sorry -
Rpi's 3B 1x RFX com + 20 dev 1x ZWave + 130 dev + rpi 4 remote
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents stopped working  [Solved]

Post by waaren »

Good to read that you found the reason for not getting the expected result.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest