Closed Rick-Jongbloed closed 5 years ago
Moved this from #130
This kinda replicated the startup trigger.
That'll do it! Another way is to just call the rule function in the script, passing it None for the event. I added a note in the docs for this. StartupTrigger is working in S1566 and newer.
Also i couldn't get my regular rules working, rules were using the helpers but without the decoraters like:
The hello_world.py has some examples using the extensions. It looks like you just need to add the .trigger...
ItemCommandTrigger("timer_rule_scene_woonkamer_new_init_hardware", command="OFF").trigger
I couldn't yet find a way to get command
I assume you are using a command trigger... does event.itemCommand provide what you need? This is similar to receivedCommand implicit variable in the rules DSL. The name of the Item that triggered the rule is event.itemName and then if you need the Item itself, ir.getItem(event.itemName). I have this all documented in the "But how do I...?" section of the docs.
I'm glad to help here, but this would be good info for the forum in case others are having issues. Maybe we should call out to the people using lucid to get a thread going?
StartupTrigger is working in S1566 and newer.
I'll test the snapshot release thx.
The hello_world.py has some examples using the extensions. It looks like you just need to add the .trigger...
I tried it again and apparently the rule generated an error due to the startuptrigger still in the script.
I have this all documented in the "But how do I...?" section of the docs.
i will look this up again and learn some new stuff, haha.
Maybe we should call out to the people using lucid to get a thread going?
Yes that would maybe be a good idea. When i have time this weekend, i'll try to make a post. If you have time earlier, feel free to use my info. Atm i need to upgrade openhab and get the startuptrigger working again. π―
@besynnerlig, I'm about to merge the JS libraries, but there will need to be some testing and tweaks. After they are polished, I plan to post an announcement about the repo/org name changes, inclusion of JS and Groovy, and migration of lucid and the other repos. So after that, since lucid was your baby, maybe you'd like to create a topic for helping people upgrade/migrate from the lucid repo?
@besynnerlig, I'm about to merge the JS libraries, but there will need to be some testing and tweaks. After they are polished, I plan to post an announcement about the repo/org name changes, inclusion of JS and Groovy, and migration of lucid and the other repos. So after that, since lucid was your baby, maybe you'd like to create a topic for helping people upgrade/migrate from the lucid repo?
Sure, I can do that. At least I'll try ;)
@besynnerlig, I'm about to merge the JS libraries, but there will need to be some testing and tweaks. After they are polished, I plan to post an announcement about the repo/org name changes, inclusion of JS and Groovy, and migration of lucid and the other repos. So after that, since lucid was your baby, maybe you'd like to create a topic for helping people upgrade/migrate from the lucid repo?
When it comes to ideAlarm and weatherStationUploader, they both used to have their own documentation that needs to be rewritten and put somewhere.
I see the need to define where such documentation should be put and the preferred way how to get it there. I also see the need for a "generic community script" installation documentation that describes in general terms how to install and configure any arbitrary community script in the standard way. Then the documentation for a specific community script can be kept to a minimum.
I think I'd want to have the documentation for ideAlarm and weatherStationUploader up to date before I try to start helping people to migrate.
I see the need to define where such documentation should be put and the preferred way how to get it there.
This should be linked to from the table of contents, and then everything that goes into Community gets a link.... https://github.com/openhab-scripters/openhab-helper-libraries/blob/master/Docs/Python/Community.md
I'll rework this doc a bit and get it linked up. I think this is a good place for summary info, but details can go into a readme inside the directory, linked to from this doc. WDYT? The document rewrite PR may change this.
I think I'd want to have the documentation for ideAlarm and weatherStationUploader up to date before I try to start helping people to migrate.
:+1:
I see the need to define where such documentation should be put and the preferred way how to get it there.
This should be linked to from the table of contents, and then everything that goes into Community gets a link.... https://github.com/openhab-scripters/openhab-helper-libraries/blob/master/Docs/Python/Community.md
I'll rework this doc a bit and get it linked up. I think this is a good place for summary info, but details can go into a readme inside the directory, linked to from this doc. WDYT? The document rewrite PR may change this.
I think I'd want to have the documentation for ideAlarm and weatherStationUploader up to date before I try to start helping people to migrate.
π
Thanks. Just to get started, I added 2 community script entries in a separate branch in my own fork, planning to submit a PR later.
Shouldn't the entries be sorted in some way (like in alphabetical order or so)? Can I propose that in my PR?
Previous entries are linking to the main scripts py-file. That will not be the case for my two entries. One of them even had a 12 page wiki assigned to it. I'll have to rework it into multiple md files instead.
Can I suggest that all community scripts should have a Docs folder in it's "root folder" (not in the lib, nor in the jsr223 folders) together with at least a single README.md file?
If we can sort this out first I'll start working with the documentation for my two entries. ;)
You guys can close this issue whenever you feel suit. I received several guidelines which i implemented, thanks for this! When i run into another issue where i think it's a question, i'll create a thread on the forum.
:+1:
openhab-5iver commented 4 hours ago Hello, Rick... glad to see you updated! I don't use ideAlarm, so I don't have an opinion on this. But...
(But then i decided to migrate from 2.3 to 2.4 and all the stuff stopped working :-)).
... caught my eye. Was there functionality lost in the migration, or is it just a matter of setting things up again/in a different way? (sorry if I'm polluting your enhancement request with support questions π)
@ricadelic Member Author ricadelic commented 6 minutes ago β’ Hi Scott,
no worries of hijacking this thread. If it's going to contain useful info for others, i'll create an issue for it.
The startup trigger didn't work anymore, which i used very much. I saw you fixed it, kudos to you! π― To get around this, I implemented a file watcher and a cron job which disabled itself. This updated an item which triggered all the other rules. This kinda replicated the startup trigger.
Also i couldn't get my regular rules working, rules were using the helpers but without the decoraters like:
so i migrated them to the @rule/@when decorators to get it working. However i had a few rules that parsed the trigger name and the command that was send. I couldn't yet find a way to get command, apart from parsing the event text and taking the last bit of the array. Because these kind of little changes, it took me a while to transfer.
i changed it like
However i would rather just have the whole object available. Or know how to retrieve this information in a better way.