OH2 Mail, Astro Binding and Rules Questions

There is no official OH2 Scripts and Rules subforum, so uncertain where to post.

I tried last night installing the Mail 1.x binding in Habmin in OH2, and then setup my mail.cfg settings same as within OH1, same email address, etc.

I then tried to use my same rule from OH1 within OH2 to send an email when I switched on light. That test rule works fines in OH1, but I could not get it work within OH2.

So first, can anyone confirm if the Mail binding is working correctly within OH2? And also if there is anything to specific to be aware in creating rules in OH2?

And then perhaps last, I think I had read previously that OH2 rules and Events may not be fully implemented? ie, to fire off rules during sunset, sunrise, or sunset_minus_30, etc?

That is because they are largely unchanged from OH 1.

I’ve seen no complaints that it doesn’t work on this forum. There are a couple of things that might cause problems in OH 2. You no longer need (nor should you) import the core OH classes so any import statement you have that starts with import org.openhab needs to be removed.

Also, all of the core classes have moved so if you refer to any Class using its fully qualified name (e.g. org.openhab.core.library.types.DateTimeType) needs to be modified and those classes are now in a different package. The easiest fix is to just remove the package name (e.g. DateTimeType).

You should be seeing errors in the logs for this and other errors. After making the above changes do you see any additional errors? When a rule fails to execute you should always check the logs first and in any posting to this forum you should post your rules and any errors in the logs as well. Otherwise we are just blindly making recommendations rather than efficiently solving your actual problem.

The Astro 2.0 binding no longer implements events (i.e. you can no longer bind a Switch to sunset, for example). This feature will be readded in the near future once a more generic method of issuing such events is implemented and tested. In the meantime you can install and use the Astro 1.9 SNAPSHOT binding and use it just as you always have in OH 1.8. This is what I use. If it isn’t listed, you need to enable “Use Legacy 1.x Bindings” in the configuration > _ system in PaperUI.

Thanks for this good information

So now that I’m back and home (and a little less work stressed), doing some testing.

Got the mail binding working. Had a stupid typo in my username!

And turning off the Astro OH2 binding for the OH1. Think I should be ok there now, and will see how it all goes.