Multi Zone Home Alarm Script for openHAB

Tags: #<Tag:0x00007fd30cfe0790> #<Tag:0x00007fd30cfe0650> #<Tag:0x00007fd30cfe0510>

(Gautier) #21

So I had several undefined items remaining in the config for the alertDevices.

But what happened is that after each modification of idealarm/ and OH restart, if I don’t clean-up the .class files in automation directory, I get the same TypeError as above.

Anyway, now it seems to work! Thanks very much for your help!

2018-07-12 09:56:47.910 [DEBUG] [lucid.IdeAlarmZone.Rez-de-chaussée ] - Open sensor: F0_Bureau_Fenetre_CTS
2018-07-12 09:56:47.920 [DEBUG] [lucid.IdeAlarmZone.Rez-de-chaussée ] - Number of open sections in Rez-de-chaussée is: 1
2018-07-12 09:56:47.931 [DEBUG] [lucid.utils                         ] - New postUpdate value for Z1_Open_Sections is 1
2018-07-12 09:57:00.284 [INFO ] [lucid.HelloWorld                    ] - Hello world from lucid!
2018-07-12 09:57:00.325 [DEBUG] [lucid.IdeAlarmZone.Rez-de-chaussée ] - Number of open sections in Rez-de-chaussée is: 0
2018-07-12 09:57:00.332 [DEBUG] [lucid.utils                         ] - New postUpdate value for Z1_Open_Sections is 0

So the conclusion is that the lucid/ is not an optional step (whatever is inside it), and some strange things happen with the .class files that get generated in the python path…

(B Synnerlig) #22

That’s a bit strange I believe. I’ve never needed to clean up those compiled “.class files” after I’ve change a configuration file.

The config file needs to be reloaded after a change, that’s normal and can be done in different ways (Restart openHAB is one of those methods or it can be done in the script which is faster) But as I said, I’ve never seen that changes are not picked up by the compiler after a reload. I’d have to check further on that. Maybe someone else knows what could have caused that.

Thanks to you, I’ve been able to do some changes in the documentation that I hope will make the installation smoother.

Please don’t hesitate to ask if you have further questions and good luck with setting up ideAlarm. What you get out of it is very much up to what you define in the Event helpers.


(Gautier) #23

I just performed another change to idealarm/ and restarting openhab without any other action worked.

Yet it is a pity that a restart is necessary for all these changes, because it takes quite some time on a Pi and is far less convenient that what can be done for items/sitemaps …

I tried the console command indicated on the slack channel:
bundle:restart org.eclipse.smarthome.automation.module.script.rulesupport
but it seems to only reload the main script, but not the config.

(B Synnerlig) #24

We’ll see if we can come up with a convenient solution for that.

(Rick) #25

It would be nice if most of the config scripts are moved out of the lib folder so any change made is automatically refreshed.

Like in the same place as

(B Synnerlig) #26 is placed among other Jython scripts in the scripts directory. Modules must be in the lib directory. As such the module is loaded by Jython through the standard Python import directive and uses sys.path. So, it’s not possible.

I will try to come up with a solution.
bundle:restart org.eclipse.smarthome.automation.module.script.rulesupport should work. I must do some testing.