Announcement

Collapse
No announcement yet.

How to make some off the payloads status only

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

    How to make some off the payloads status only

    Hi,

    First of: great plugin, many thinks for this !
    I am completely new to MQTT, but I really like the possilities it provides together with your plugin.

    Using MicroPython I wrote a program to control my garagedoor. It publishes the state with following payloads:
    - OPEN
    - CLOSED
    - OPENING
    - CLOSING
    - INTERMEDIATE

    Also it has a LWT set to OFFLINE.

    All of these are marked as status and control in HS. I've set em to status only once, but it got reset for some reason ...
    I added 2 control button as well "Open" and "Close", but they got removed too.

    How should I handle this particular situation ?

    #2
    Here is the process I followed to create a device that has multiple status states and two control states. In my case for testing it was Stat10, Stat11, Stat12 for the status states and Open, Close for the control states. This will be a mcsMQTT devices so it is initiated by the Accept activity.

    Before the acceptance it is easiest to have all the status status states having been seen by mcsMQTT. In your case it would be the 5. If this is not done then it needs to be done manually on the Edit tab for VSP after the topic is accepted. The attached figure shows how my test device was setup. Two entries were needed after Accept. One was the publish topic. If not entered then it will publish on the receive topic. The second is the Radio to select List type. Note the VSP entries should have all status status now or can be entered manually now. This will create a HS device with three (five in your case) value status pair as status only devices.

    Next go to Device Management for the newly created device and select the Status/Graphics tab. Add two new entries with the type being Control. The original set of thee/five should set to status only.

    This will create a Device Management GUI with two buttons and a Status display of whatever has been received via MQTT topic. If one of the buttons is clicked then the MQTT topic will be published and one then expects the receive MQTT topic to be updated as the door moves through its states.

    If you edit that device again in mcsMQTT then you will need to go through the manual process again of adding the control states.
    Attached Files

    Comment


      #3
      Ok, clear. Thanks !

      But this means that I can't change the status texts, right ? E.g.: the status is reported in english, but I have a dutch customer (for example ...). I can't change the status text without modifying the mqtt publisher on the sonoff.

      Comment


        #4
        I have not tried this, but you should be able to edit the status text in HS. mcsMQTT will only change it if you change the device type. When mcsMQTT receives "OPENING", for examaple, it will store 2 in DeviceValue and whatever text you have in VSP in HS (not in mcsMQTT VSP) will show up in HS status for the device.

        Comment

        Working...
        X