openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.57k forks source link

Astrobinding for openhab 2 is not support all features of the openhab 1 version #310

Closed Marty56 closed 7 years ago

Marty56 commented 9 years ago

in Astrobinding in OPENHAB 1, one could create items like "DateTime Sunset_minus_30_Time {astro="planet=sun, type=set, property=start, offset=-30"}" and also for generating an event "Switch Sunset_Event_minus_30 {astro="planet=sun, type=set, property=start, offset=-30"}" that could trigger an rule ahead of the Sun Set (in my example).

Please add this feature to the version 2 of the binding.

kaikreuzer commented 9 years ago

You are right, this has been left our deliberately for now, see https://github.com/openhab/openhab2/pull/113#issuecomment-90228983

I'd like to synchronize this with the new modular rule engine, so that such triggers will smoothly fit into it, so please allow some more time for these features to be added.

dominicdesu commented 9 years ago

Do I understand it correctly that this is not only about the offset, but also about the triggering of the Switch item in general? I tried to add a Switch item similar as I use it in openHAB1: Switch SunsetEvent {channel="astro:sun:782f244e:set#start"} but this results in the following debug message: [DEBUG] [s.c.internal.items.ItemUpdater] - Received update of a not accepted type (DateTimeType) for item SunsetEvent

kaikreuzer commented 8 years ago

Correct, see https://community.openhab.org/t/astro-binding-issue/2011/6?u=kai.

kaikreuzer commented 7 years ago

@gerrieg Since a few weeks, we finally have "event trigger channels" available in ESH - see https://github.com/eclipse/smarthome/pull/1936 and https://www.eclipse.org/smarthome/documentation/development/bindings/thing-definition.html#channels (search for "trigger channel"). I would hope that this provides the functionality that is needed for the astro events. It would be great if you could have a look and check if that works for you - and to provide feedback if anything is still missing from your point of view! (fyi: I guess for the Homematic binding you might also need https://github.com/eclipse/smarthome/issues/2226, which still has to be discussed and implemented, but your feedback on it would also be welcome!).

gerrieg commented 7 years ago

Thank you Kai for the information, i will take a look at it.

micw commented 7 years ago

I'd like to test it. At the moment I run homeassistant for my astro stuff (my switches use mqtt, so oh2 and ha can co-exists). I'd like to switch the rules to oh2. Could you please provide an example, how to switch on a light 30 minutes before sun set now?

Edit: optimally the example can be found in https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.astro ;-)

Thank you!

kaikreuzer commented 7 years ago

@micw How do you want to test something that isn't yet implemented...?

micw commented 7 years ago

Sorry, I missunderstood this. Where can I find an example how to use the new event channel?

LeDumpier commented 7 years ago

@micw, I too would be interested in learning how to use this functionality. This difficulty is trying to find out if it's available yet, the information is often scattered.

Have you had any luck?

toby200 commented 7 years ago

@gerrieg is working on it, but these things take time! In the meantime you can workaround it by setting up rules to trigger your own internal switch, or just use the astro 1 binding. See eg. https://community.openhab.org/t/astro-binding-issue/2011/22

gerrieg commented 7 years ago

I've already created a PR that contains the triggers, see https://github.com/openhab/openhab2-addons/pull/1519

kaikreuzer commented 7 years ago

Yep, already on my todo list to test. Hopefully early next week!

staehler commented 7 years ago

Does astro binding (version for openhab2) switch the events in openhab2 RC1? My installation (RC1) doesn't switch the events, which I recognized today morning :-(. My openhab2 runs since yesterday.

Do I need to downgrade to openhab1 binding?

EDIT: sorry, I finally found this, which I first have to try. The Trigger has changed:

rule "example trigger rule" when Channel 'astro:sun:home:rise#event' triggered START then ... end

kaikreuzer commented 7 years ago

Right, this is by now implemented, so I close this issue.

@staehler Why are you using RC1 and not the final release?

staehler commented 7 years ago

@kaikreuzer I use this repo

deb http://dl.bintray.com/openhab/apt-repo2 testing main

This offers as latest version 2.0.0~RC1-1 Which would you recommend? Should I use the daily snapshot repo?

kaikreuzer commented 7 years ago

Better use stable or snapshot, at least until a new beta comes out.

@BClark09 & @theoweiss What is actually the best practice regarding apt repos there? Should the 2.0 release not better be available on testing as well, because otherwise, the version on testing is behind the latest version on stable...?

theoweiss commented 7 years ago

Sounds reasonable to me. @BClark09 what do you think?