Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Harmony Hub: Logging starting of activity #1390

Closed
derFrink opened this issue Nov 4, 2016 · 7 comments
Closed

Harmony Hub: Logging starting of activity #1390

derFrink opened this issue Nov 4, 2016 · 7 comments

Comments

@derFrink
Copy link

derFrink commented Nov 4, 2016

The Actual Binding (binding-harmonyhub - 2.0.0.SNAPSHOT) creates only one Channel for the Harmony Hub (Current Activity). It changes the State from "PowerOff" to "WatchTV" after the hub finished all operations (same if i use the channel "activity".
I moved over from FHEM and there the Channel "current Activity" also showed if a Action is starting..

for example you can see it in this logfile: http://www.meintechblog.de/wordpress/wp-content/uploads/2015/08/FHEM-Eventmonitor-starting.jpg

i realy need the information when a activity is starting, because i´m switching my socket to on with this information.

@prawnde
Copy link

prawnde commented Aug 25, 2017

Im looking for a solution to the exact same issue:

Harmony bindings "current activity" Channel is updated AFTER the harmony remote has finished changing the activity.
I want to switch on a powersocket with openhab with the trigger of the current activity on the harmony binding:

Turn on Activity "Fernsehen" (on Harmony Remote) -> Switch powersocket on to get power on tv and AV-Receiver (with openHAB) -> Harmony Hub Switches TV and AVR in and in right Channel.

Has anyone an idea for getting along with this issue?

Thanks very much!

@ppieczul
Copy link
Contributor

Hi,
Harmony hub binding uses an external library whistlingfish to talk to the hub.
This library currently supports only end-of-activity-change events.
It misses the support for state digest notifications, but it has been on its TODO list (for 3 years now).
Matt Tucker @tuck182 is the author of the library, its last commit is from April. Matt - could you share the status of your library? Any plans to implement the feature?
Thanks
Pawel

@ppieczul
Copy link
Contributor

Not sure if the whistlingfish library is still alive. I thought I could try to add this feature, but I just can't get to run a clean harmonyhub binding under IDE.

I am getting exception from xmpp library about unresolvable class com.google.common.io.BaseEncoding.

All the committed libs are on the classpath, guava shows in plug-in dependencies and com.google.common.io is on imported packages.

Any ideas how to get over that?

Exception in thread "Smack Packet Writer (0)" java.lang.NoClassDefFoundError: com/google/common/io/BaseEncoding
	at net.whistlingfish.harmony.protocol.MessageAuth$AuthRequest.generateUniqueId(MessageAuth.java:40)
	at net.whistlingfish.harmony.protocol.MessageAuth$AuthRequest.getChildElementPairs(MessageAuth.java:35)
	at net.whistlingfish.harmony.protocol.OAStanza.getIQChildElementBuilder(OAStanza.java:61)
	at org.jivesoftware.smack.packet.IQ.getChildElementXML(IQ.java:158)
	at org.jivesoftware.smack.packet.IQ.toXML(IQ.java:139)
	at org.jivesoftware.smack.packet.IQ.toXML(IQ.java:42)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter.writePackets(XMPPTCPConnection.java:1447)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter.access$3300(XMPPTCPConnection.java:1244)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter$1.run(XMPPTCPConnection.java:1292)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.google.common.io.BaseEncoding cannot be found by org.openhab.binding.harmonyhub_2.2.0.qualifier
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:382)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)

@ppieczul
Copy link
Contributor

ppieczul commented Sep 5, 2017

@prawnde @derFrink I finally added support for state digest into whistlingfish library. In the meantime until this gets merged, could you please advise how you would like to have this exposed into openHAB?
Library will notify binding about following situations:
a) activity is starting
b) activity is started
c) hub is powering off (when power off is pressed)
d) hub is powered off

Which channels do you envision and with what information?

Thanks
Pawel

@digitaldan
Copy link
Contributor

hi @ppieczul thanks for adding the additional state functionality !

a) activity is starting
b) activity is started

One thought I have is to have a trigger channel for each state that would send the name of the activity. Triggers are nice for changes which are intended to trigger rules, but do not really update the state of an item (and they are not tied to items). So for example, a rule would look like:

rule "TV Starting"
    when
        Channel "harmonyhub:hub:GreatRoom:activityStarting" triggered  "Watch TV"
    then
        logInfo("TEST","TV activity is starting!");
end

Thoughts?

@ppieczul
Copy link
Contributor

ppieczul commented Sep 5, 2017

Indeed, I forgot about the trigger channels and it looks they are really well suited for that purpose.

The activity starting sequence looks like that (and I suppose this is what we expected):

  • NEW STATUS: Watch TV, ACTIVITY_IS_STARTING --> trigger activityStarting
  • NEW STATUS: Watch TV, ACTIVITY_IS_STARTED --> trigger activityStarted
  • NEW ACTIVITY: Watch TV --> current activity channel value changed

The question is what do we do with power off sequence, which looks like that:

  • NEW STATUS: Watch TV, HUB_IS_TURNING_OFF
  • NEW STATUS: PowerOff, HUB_IS_OFF
  • NEW ACTIVITY: PowerOff --> current activity channel value changed

I think it is equally useful to know when hub is going off, but for some unknown reasons there are different status values for that.

My proposal would be to do the same as above - make HUB_IS_TURNING_OFF trigger activityStarting but replace activity name with PowerOff (take name from id=-1) and HUB_IS_OFF trigger activityStarted. Users will figure out that it is going down by the name of the activity.

@derFrink
Copy link
Author

derFrink commented Sep 6, 2017 via email

ppieczul added a commit to ppieczul/openhab2-addons that referenced this issue Sep 7, 2017
…b#1390 and openhab#2497.

Added trigger channels for activity starting and activity started events from the hub (state digest).
Additionally fixed whatever static code analyzer complained about.

Signed-off-by: Pawel Pieczul <pieczul@gmail.com> (github: ppieczul)
@martinvw martinvw closed this as completed Sep 8, 2017
martinvw pushed a commit that referenced this issue Sep 8, 2017
…and #2497. (#2678)

Added trigger channels for activity starting and activity started events from the hub (state digest).
Additionally fixed whatever static code analyzer complained about.

Signed-off-by: Pawel Pieczul <pieczul@gmail.com> (github: ppieczul)
Markinus pushed a commit to Markinus/openhab2-addons that referenced this issue Sep 8, 2017
…b#1390 and openhab#2497. (openhab#2678)

Added trigger channels for activity starting and activity started events from the hub (state digest).
Additionally fixed whatever static code analyzer complained about.

Signed-off-by: Pawel Pieczul <pieczul@gmail.com> (github: ppieczul)
hillmanr pushed a commit to hillmanr/openhab2-addons-pollytts that referenced this issue Dec 6, 2017
…b#1390 and openhab#2497. (openhab#2678)

Added trigger channels for activity starting and activity started events from the hub (state digest).
Additionally fixed whatever static code analyzer complained about.

Signed-off-by: Pawel Pieczul <pieczul@gmail.com> (github: ppieczul)
aogorek pushed a commit to aogorek/openhab2-addons that referenced this issue Jan 14, 2018
…b#1390 and openhab#2497. (openhab#2678)

Added trigger channels for activity starting and activity started events from the hub (state digest).
Additionally fixed whatever static code analyzer complained about.

Signed-off-by: Pawel Pieczul <pieczul@gmail.com> (github: ppieczul)
Flole998 pushed a commit to Flole998/openhab-addons that referenced this issue Dec 30, 2021
For ESH it made sense to use this but nowadays these UIs are no longer part of openhab-core and the demo app used for development is in openhab-distro.
Furthermore it provides links to UIs that are no longer part of OH3, uses ESH logos and the new Default UI is also using / so it throws exceptions.

See: openhab/openhab-distro#1084 (comment)

Signed-off-by: Wouter Born <github@maindrain.net>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants