Announcement

Collapse
No announcement yet.

Expose Scene as a feature in JowiHue child device

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Expose Scene as a feature in JowiHue child device

    Wim,

    So i took your comments to heart and tried recreating the features for color lights that I use in Phoscon, but doing the same in JowiHue. I did like we discussed and used the Phoscon scene editor (because of the sliders and immediate visual feedback) and then took snapshots to create presets in JowiHue. So far so good.

    I recreated three presets and then assigned them to three different scenes in JowiHue.
    What I wanted to do next is create the Phoscon feature that allows you to use the Aqara cube to cycle through all your scenes. Here is the setup as follows:
    Click image for larger version  Name:	Capture1.PNG Views:	0 Size:	64.7 KB ID:	1422349

    It seems the only JowiHue action in an event I can do is set one scene:
    Click image for larger version  Name:	Capture2.PNG Views:	0 Size:	26.4 KB ID:	1422350

    But then I thought, "aha! The Easy Trigger plugin has a toggle action that allows you to cycle through as many feature values needed. I already use this to toggle Hue lights On and Off from the same cube switch action"

    Click image for larger version  Name:	Capture3.PNG Views:	0 Size:	25.2 KB ID:	1422351

    The problem is I can't use this feature to cycle the scenes because they are not exposed as "values" in any of the child device features that are created, like hue, sat, CT, etc.

    Thoughts?

    #2
    TC,

    Not 100% sure what you want? There is the animation that will cycle through scenes in the configuration/sequence you want. Or there is the scripting part of the plugin, that gives you control what the next preset/scene or animation is going to be. Phoscon is giving you a "next scene option here. But what is that 'next' scene? If you want to be sure of that, use animations. If you do not need to know, select a random preset in the JowiHue actions. Or use scripting to cycle through a list of scenes or presets and choose one of your liking?

    It wil never match Phoscon, each will have its own options that can be favored.

    I am using the cube too here, especially with light effects and speech for the grandchildren. Each time they come, they play with it. Really fun!.

    Wim
    -- Wim

    Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

    1210 devices/features ---- 392 events ----- 40 scripts

    Comment


      #3
      I simply want to be able to cycle through a set of scenes, one at a time manually, by activating an event.

      Let's say I have a Z-wave scene capable dimmer and I make an event that triggers on a tap of the up paddle.
      Let's say I have three Scenes, 1 , 2 and 3.
      I activate the event from the dimmer and Scene 1 is sent to the lights.
      I'm not in the mood for Scene 1 so I tap the paddle again to see Scene 2.
      Don't like that one, so I tap the paddle again to see Scene 3.
      Changed my mind, want Scene 1, so I tap the paddle again.

      The idea is from an event I'm able to cycle through a predetermined set of scenes so I can pick the one I want, without having to have a separate event for each scene. Phoscon has that ability (associate a switch action with manually cycling through the scenes), and as I showed Easy Trigger gives HS4 events the ability to cycle/toggle through a list of values as long as they are exposed as a value of a child device.

      Hopefully this was clearer? If there's a way of doing this in JowiHue I'm all for it

      Comment


        #4
        It is not ready made available in the plugin. But you can do this using the scripting functions of the plugin for sure. When you call the script through an event you indeed would need only one event. I have one here using the preset (randomized). Guess it can be changed to use a set of scenes. Can make you a rough sample which you would have to finetune to your situation.

        Is Phoscon accepting a predetermined set of scenes for a switch? I checked long ago on Phoscon (not using it here) but thought it could only cycle throug all scenes.

        Wim

        -- Wim

        Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

        1210 devices/features ---- 392 events ----- 40 scripts

        Comment


          #5
          You are correct, Phoscon cycles through all scenes.

          I agree your with your statement that you made the other day to me, I'd rather keep all the logic on HS and JowiHue, which would allow for more cross-technology integrations (like using a Z-wave dimmer to control a Zigbee light). So any examples you could share I'd be appreciative

          Comment


            #6
            Here is a sample script I created to use a selected set of scenes to cyclye through. You can use any scene, the names you want to use are case sensitive. Remember to update the maximum number of scenes if it differs from the three I prepared.
            Save the code in a <yournaming>.vb file and place this in the scripts subdirectory. I copied an image of an sample event you could use to call the script.

            Code:
            Imports System.Collections.Generic
            
            Sub Main(ByVal parms As Object)
            
            Static LastPointCycle As Integer = 0
            
            ' Fill Scenes with the scenes you want to use - Case Sensitive!!
            Dim Scenes As New List(Of String) From {
            "Scene1",
            "Scene2",
            "Scene3"
            }
            Dim MaxScenes As Integer = 3 'Set this value to the number of scenes used
            Try
            hs.writelogex("SceneSwitch", "Starting " & Scenes(LastPointCycle), "")
            If Not hs.PluginFunction("JowiHue", "", "StartScene", {Scenes(LastPointCycle)}) Then
            hs.writelogex("SceneSwitch", Scenes(LastPointCycle) & " was not found, check the scenes?", "")
            End If
            LastPointCycle += 1
            If LastPointCycle > MaxScenes - 1 Then LastPointCycle = 0
            Catch ex As Exception
            hs.writelogex("SceneSwitch", "Error " & ex.message, "")
            End Try
            End Sub
            Click image for larger version

Name:	2020-09-28 22_24_38-Event.png
Views:	166
Size:	171.2 KB
ID:	1422627
            -- Wim

            Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

            1210 devices/features ---- 392 events ----- 40 scripts

            Comment


              #7
              Just read through the code, though I'm rusty, I think I get what is going on here. The one thing I don't see/understand is how does this execute specific to a particular lighting group? Or i guess i'm unsure how to integrate this into an event for a specific lighting group.

              Comment


                #8
                Now you make me wonder, a scene for the plugin is a set of settings, where each setting (a color or color temperature setting) is assigned to lights or groups of lights. So, you know which lights are involved when you start a scene. It is the same as in Phoscon, a scene is assiging lights to the scene setting.

                A preset is a setting, not assigned to any light and can be activated by using a scene or calling it in JowiHue actions.
                A animation is a sequence of scenes that can change overtime to another scene and eventually loop over the steps in the animation to create a mood effect.

                Now I am wondering if we had a confusion on scenes here? The script I posted is using the scenes, so you would know which lights are included?

                The event I posted is a manually tirggered event, but ofcourse for you the IF would change into IF Zwave switch button 1 is pressed, etc
                -- Wim

                Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                1210 devices/features ---- 392 events ----- 40 scripts

                Comment


                  #9
                  Yep, that straightens me out. I did not realize that Scenes are actually attached to light groups. It's all clear for me now. .

                  Thanks for being patient with me!

                  Comment


                    #10
                    No problem!
                    -- Wim

                    Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                    1210 devices/features ---- 392 events ----- 40 scripts

                    Comment

                    Working...
                    X