Announcement

Collapse
No announcement yet.

HomeSeer MQTT plugin.

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

    #61
    Originally posted by taylormia View Post
    Attached is a guide on integrating the Itead Sonoff S20 WiFi Smart Socket with HS3 using the MQTT Plugin and the Tasmota firmware. Hope you find this useful.
    Thank you so much for that. The last few steps there have been the real puzzle. The big question I have now is how to integrate settings that use non-binary values. E.g. RGB values for strip lighting.

    I'll need to sit down in the next week and try to work through it, I know there have been several discussions on it w/o clear answers.

    Comment


      #62
      I have an MQTT broker that works when I publish a topic/payload to turn off and on a Sonoff S20 plug with MQTT firmware.

      But I have tried various things to be able to control a non-MQTT (i.e Zwave) device by publishing the default topic "homeseer/device reference ID/value" and payload/message=99 to turn the switch on, with no luck.

      I'm not sure what I'm missing.

      My device is a Homeseer Dimmer Zwave switch with Reference ID 182. I also have a websockets MQTT client to publish control topics and subscribe to status messages.

      Can someone tell me the steps to take in HS3 to be able to turn on/off this switch by publishing an MQTT topic/message?

      Thanks

      Comment


        #63
        Originally posted by taylormia View Post
        I have an MQTT broker that works when I publish a topic/payload to turn off and on a Sonoff S20 plug with MQTT firmware.

        But I have tried various things to be able to control a non-MQTT (i.e Zwave) device by publishing the default topic "homeseer/device reference ID/value" and payload/message=99 to turn the switch on, with no luck.

        I'm not sure what I'm missing.

        My device is a Homeseer Dimmer Zwave switch with Reference ID 182. I also have a websockets MQTT client to publish control topics and subscribe to status messages.

        Can someone tell me the steps to take in HS3 to be able to turn on/off this switch by publishing an MQTT topic/message?

        Thanks


        Easily done if the device publishing the topic is not HomeSeer. In other words HomeSeer subscribes to the topic and triggers the Z-wave controller to control the switch.
        There is on option in the events for HomeSeer listening in a two way state to control the devices directly! (e.g "Topic published")
        If you look at the EventGhost plugin, the author did exactly what you are asking for.


        Examples : Node-RED and or Z-wave>Me can publish mqtt topics which HomeSeer can subscribe to and thus virtual devices are created then you use the Events to control any other devices in HomeSeer based on them.

        Images below: Node-RED, Zwave>Me and EventGhost ====>This way you can interlink different systems with HomeSeer. (Useful say if you don't have a certain plugin in HomeSeer)


        Eman.
        Attached Files
        Last edited by Eman; December 4, 2017, 02:58 PM.
        TinkerLand : Life's Choices,"No One Size Fits All"

        Comment


          #64
          Thanks Eman for the response. I have created a subscription in HS3 for the light switch I want to control and have created an event with "Publish Custom Topic" to manually turn off the light. When I trigger the event, I see it in the log but the light does not turn off. What am I missing? See screenshots below.



          This is the device I want to control that I have created a subscription for:





          Here is the subscription for the above device:





          Here is the event to turn off the light by publishing the topic of the subscription above:





          Here is the log showing that the pubished topic was received with a payload of "0" i.e. Off.


          Comment


            #65
            Originally posted by taylormia View Post
            Thanks Eman for the response. I have created a subscription in HS3 for the light switch I want to control and have created an event with "Publish Custom Topic" to manually turn off the light. When I trigger the event, I see it in the log but the light does not turn off. What am I missing? See screenshots below.



            This is the device I want to control that I have created a subscription for:





            Here is the subscription for the above device:





            Here is the event to turn off the light by publishing the topic of the subscription above:





            Here is the log showing that the pubished topic was received with a payload of "0" i.e. Off.


            That results in a miss because the author never clearly defined how you could do that.

            Here is what is defined:

            "Description:
            The MQTT Plug-in for Homeseer 3 enables to subscribe to MQTT topics and to publish MQTT topics on device status/values changes.

            General: MQTT plugin supports script capabilities.
            Supported script functions: publish a MQTT topic
            Parameters: object array containing 2 parameters; topic, value
            Function name: publish
            Example: hs.PluginFunction("MQTT", "", "publish", {"/tmp/myTopic", "1234"})
            where "/tmp/topic" is the topic to publish, and "1234" is the value.

            General: Added event actions
            Description: 2 actions are introduced
            - publish device value
            - publish custom topic and message

            Bug fixes:
            A device value update resulted in logging a 'publish' message, even if no mqtt publish settings have been defined. Now only a 'publish' message is logged, when there is really something published.

            Ignore exceptions when publishing and there is no MQTT publish configuration defined."

            I only use the "Publish Custom Topic" to remote mqtt server which relays the messages to the connected mqtt clients and everything works fine. I don't do scripting.

            You can also add/publish the devices you have already in HomeSeer as mqtt devices to remote clients to react when their status or values change.

            The messages are broadcasted to all interested mqtt clients to react on them.

            What I have not tested is the localhost as the broker.

            Please contact the author about this.


            Eman.
            TinkerLand : Life's Choices,"No One Size Fits All"

            Comment


              #66
              Eman, I am confused. If the method above is not supported by the plugin - how exactly can a non-MQTT enabled Homeseer device be controlled via MQTT? or, is this not possible.

              Comment


                #67
                Originally posted by taylormia View Post
                Eman, I am confused. If the method above is not supported by the plugin - how exactly can a non-MQTT enabled Homeseer device be controlled via MQTT? or, is this not possible.
                They can if you look again at my first response. The plugin interlinks the systems together but not fully integrated in Homeseer thus can't detect the devices but can be controlled trough events. I explained that if you look at the EventGhost plugin, what you are asking can easily be done because it's a two way communication setting. But the mqtt plugin can just directly communicate to mqtt enabled clients. Because your zwave switch is not mqtt enabled then couldn't be able know what's going on from the plugin. But that doesn't mean you can't control it through events. I asked the author about the custom topic and he included it. The publish custom topic can be anything you can think of! But there is also publishing the devices (any) you already have which in turn creates virtual devices you can base your events on.
                Image below.
                The author stated on Domotica that he was working on a new version of the plugin so if you asked this could be included if it's not to much work.



                Eman.
                Attached Files
                TinkerLand : Life's Choices,"No One Size Fits All"

                Comment


                  #68
                  If you have control of the values published to HS3, another way is to link the HS3 subscription device to the Zwave device. You would need to send 0/255 (off/on) as the values.

                  Z

                  Comment


                    #69
                    Eman, I think I understand what you're getting at..but the event does not trigger the light to turn off. What am I missing?

                    I have Node-Red publishing the topic "familyroom/light" with payload "0" to the MQTT Broker here:





                    I have the Eventghost MQTT Client subscribing to the same topic on HomeSeer:





                    I have an event with the Eventghost "Network Event" condition of "MQTT.familyroom/light.0" and an action to turn "Off" the HS3 Zwave switch "Familiy Room Light"

                    Comment


                      #70
                      @taylormia,

                      EventGhost was just an example of what a two way event communication within HomeSeer can do. You don't need it in this case.
                      In Node-RED mqtt node, don't fill in any info. just the QOS and the IP of MQTT server. The Topic comes from the injector nodes like what you did.Then go to HomeSeer and subscribe to whatever message you are sendind from whatever mqtt enabled device you have.
                      In my case I have zwaveMe, kodi, zanzito......etc.

                      When click the add button on the subscription page the virtual devices are created in HomeSeer device page. Those are what you base your events on.

                      Images below:
                      Attached Files
                      TinkerLand : Life's Choices,"No One Size Fits All"

                      Comment


                        #71
                        @taylormia,

                        In addition to my post at #70 the LightWave Dimmer is being triggered by what's happening in Kodi.
                        Note: In this case I have used the Easy Trigger plugin so the event is based on string contains...........
                        That's just an example of triggering a non mqtt based switch.


                        Image below:

                        Eman.
                        Attached Files
                        TinkerLand : Life's Choices,"No One Size Fits All"

                        Comment


                          #72
                          @Eman

                          I get what you say and show about using events to control MQTT based devices or use status of MQTT based devices to control non-MQTT based HS3 devices. I have already done these things with my Sonoff S20.

                          I'm now trying to control my Zwave HS3 device (light switch) using an MQTT topic published from outside of HS3. I used Eventghost based on your suggestion. Is the process I show in post #69 correct? What am I doing wrong there?

                          Thanks.

                          Comment


                            #73
                            Originally posted by taylormia View Post
                            @Eman

                            I get what you say and show about using events to control MQTT based devices or use status of MQTT based devices to control non-MQTT based HS3 devices. I have already done these things with my Sonoff S20.

                            I'm now trying to control my Zwave HS3 device (light switch) using an MQTT topic published from outside of HS3. I used Eventghost based on your suggestion. Is the process I show in post #69 correct? What am I doing wrong there?

                            Thanks.

                            Take EventGhost out of the equation for now and base your event on what's being detected from the virtual device you created when you subscribed to the message from Node-RED. I forgot to notify you that it's the zwave controller which turn on/off the light in your case. When you look at my post at #71, it's the RFXCom which is controlling the LightWave switch to trigger the lights.

                            EventGhost involves setting some ports. If you make mistakes it won't work. And indeed you don't need it in this case.

                            Eman.
                            TinkerLand : Life's Choices,"No One Size Fits All"

                            Comment


                              #74
                              Finally, I have been able to control an HS3 Zwave device via MQTT from an external source. Thanks to @Eman for his patience and pointing me in the right direction.
                              The HS3 device I want to control is a HS3 HS-WD100+ which is controlled by a Homeseer ZNET.


                              First I add a Manual Subscription in the HS3 MQTT Plugin for the topic "familyroom/light" which creates a virtual MQTT subscription device you see below:


                              Then, I create an Event that uses the payload value of the MQTT "familyroom/light" subscription device as a trigger to cause the action of turning off the Zwave HS3 switch device "Family Room Light"


                              The external source for the MQTT message is Node-Red where I inject i.e Publish the "familyroom/light" topic to the MQTT broker with a payload of "0".


                              HS3 by way of the MQTT Plugin subscribes to this topic via the subscription device "familyroom/light" and the Event "Turn Family Room Light Off" causes the HS3 Zwave switch to be turned Off
                              Last edited by taylormia; December 5, 2017, 05:43 PM.

                              Comment


                                #75
                                Here's another use case for the MQTT Plugin: Integrate the Amazon Dash Button with HS3:
                                https://forums.homeseer.com/showthread.php?t=192565

                                Comment

                                Working...
                                X