Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Change PT=1 to PT=0 when changing a sensor state.

Change PT=1 to PT=0 when changing a sensor state.

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 3 Posters 1.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PSteward
    wrote on last edited by
    #1

    Hello,

    I recently jumped into the mysensors world and have the following set up so far:
    D1 Mini as Gateway with NRF24L01+ and on board IR outputs (GatewayESP8266 + kakopappa Alexa Multi Switch + IR Mods)
    Nano with NRF24L01+ as door locker (Just running the example version of RelayActuator for now)

    Currently, I'm running mycontroller so monitor states of things and also have loaded up Alexa control on my D1 Mini.
    My IR outputs on my D1 Mini trigger an AC unit and a light, when I use Alexa they work and update the status of each on mysensors/mycontroller too.

    bool updateState(uint8_t SENSOR_ID, uint8_t STATE_VALUE){
      MyMessage msg(SENSOR_ID, V_STATUS);
     send(msg.set(STATE_VALUE), false); 
    }
    

    However with my sensor/door locker it does work with Alexa but I cannot get it to update it's status.

    bool changeState(uint8_t SENSOR_ID, uint8_t STATE_VALUE){
      MyMessage msg(SENSOR_ID, V_STATUS);
     msg.setDestination(1);
     send(msg.set(STATE_VALUE)); 
    }
    

    The only difference between me triggering it from mycontroller and Alexa is the following:

    Alexa trigger:

    TSF:MSG:SEND,0-0-1-1,s=3,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:0
    

    Mycontroller trigger:

    TSF:MSG:SEND,0-0-1-1,s=3,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=OK:0
    

    Showing the only different variable that I can see is PT=0 vs PT=1.
    How can I change the PT=1 to PT=0? Is that what is causing it to change but not update?

    Thanks!

    1 Reply Last reply
    0
    • JohnRobJ Offline
      JohnRobJ Offline
      JohnRob
      wrote on last edited by
      #2

      HI,

      I cannot answer your question but if you go to log parser you can see one is sending a string, the other is sending a byte.

      Perhaps this will help.

      John

      P 1 Reply Last reply
      1
      • JohnRobJ JohnRob

        HI,

        I cannot answer your question but if you go to log parser you can see one is sending a string, the other is sending a byte.

        Perhaps this will help.

        John

        P Offline
        P Offline
        PSteward
        wrote on last edited by
        #3

        @JohnRob
        Thanks for the link! I modified the "byte" into a string and both received commands are identical but the sensor status on mycontroller still doesn't update (the button shows off even though it's on...).

        I'll keep digging!

        Thanks!

        mfalkviddM 1 Reply Last reply
        0
        • P PSteward

          @JohnRob
          Thanks for the link! I modified the "byte" into a string and both received commands are identical but the sensor status on mycontroller still doesn't update (the button shows off even though it's on...).

          I'll keep digging!

          Thanks!

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @psteward your logs say that the same node (0) is the source in both cases, and the same node (1) is the destination. But from your description, the ac is controlled from the gateway (node 0) and the door is controlled from node 1. That doesn't add up. What am I missing?

          1 Reply Last reply
          0
          • P Offline
            P Offline
            PSteward
            wrote on last edited by PSteward
            #5

            I have the gateway (d1 mini) and the node/sensor (nano). The sensors attached locally update properly (d1 mini), but when I trigger the remote node/sensor (nano) it does not update the status when it runs the command.
            To rephrase:
            I trigger the remote sensor from the gateway via mycontroller and it works ---and the button on mycontroller shows an updated status of on (I did click it after all).
            I trigger the remote sensor from the gateway via an Alexa function and it works ---and the button on mycontroller still shows off. (<---This is the problem, it doesn't change the status reflecting the change I made, even though it received the signal and made the pin output high with the same function that works via mycontroller!)
            And:
            I trigger a local sensor (on a pin of the gateway) from the gateway via an Alexa function and it works --- and the button on mycontroller shows an updated status of on.

            mfalkviddM 1 Reply Last reply
            0
            • P PSteward

              I have the gateway (d1 mini) and the node/sensor (nano). The sensors attached locally update properly (d1 mini), but when I trigger the remote node/sensor (nano) it does not update the status when it runs the command.
              To rephrase:
              I trigger the remote sensor from the gateway via mycontroller and it works ---and the button on mycontroller shows an updated status of on (I did click it after all).
              I trigger the remote sensor from the gateway via an Alexa function and it works ---and the button on mycontroller still shows off. (<---This is the problem, it doesn't change the status reflecting the change I made, even though it received the signal and made the pin output high with the same function that works via mycontroller!)
              And:
              I trigger a local sensor (on a pin of the gateway) from the gateway via an Alexa function and it works --- and the button on mycontroller shows an updated status of on.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by mfalkvidd
              #6

              @psteward thanks for clarifying.

              So if I understand correctly, the non-Alexa path is controller->gateway->door-node, and the Alexa path is Alexa->gateway->door-node. The Alexa path does not update the controller? Is that correct?

              If that's the case, the answer is simple: the controller is not involved in the Alexa path. Since the controller is not involved, it is not updated.

              I think a possible solution is to let the door-node send it's status to the gateway whenever the door-node status is updated. See the loop in https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/RelayWithButtonActuator/RelayWithButtonActuator.ino for an example.

              But it could also be the case that I don't understand how your Alexa integration works.

              P 1 Reply Last reply
              0
              • mfalkviddM mfalkvidd

                @psteward thanks for clarifying.

                So if I understand correctly, the non-Alexa path is controller->gateway->door-node, and the Alexa path is Alexa->gateway->door-node. The Alexa path does not update the controller? Is that correct?

                If that's the case, the answer is simple: the controller is not involved in the Alexa path. Since the controller is not involved, it is not updated.

                I think a possible solution is to let the door-node send it's status to the gateway whenever the door-node status is updated. See the loop in https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/RelayWithButtonActuator/RelayWithButtonActuator.ino for an example.

                But it could also be the case that I don't understand how your Alexa integration works.

                P Offline
                P Offline
                PSteward
                wrote on last edited by
                #7

                @mfalkvidd

                Running the Alexa items directly on the gateway does update the controller, it's just the node/sensor that doesn't update.
                When I execute the code through Alexa to trigger the sensor how can I force an update to the status as well?
                Mycontroller thinks that I never executed the command (mymessage), and I have to send ON (via the interface) again to be able to turn it off, perhaps it's related to the savestate?

                mfalkviddM 1 Reply Last reply
                0
                • P PSteward

                  @mfalkvidd

                  Running the Alexa items directly on the gateway does update the controller, it's just the node/sensor that doesn't update.
                  When I execute the code through Alexa to trigger the sensor how can I force an update to the status as well?
                  Mycontroller thinks that I never executed the command (mymessage), and I have to send ON (via the interface) again to be able to turn it off, perhaps it's related to the savestate?

                  mfalkviddM Offline
                  mfalkviddM Offline
                  mfalkvidd
                  Mod
                  wrote on last edited by mfalkvidd
                  #8

                  @psteward I don't know. I don't seem to be able to grasp the setup. Sorry.

                  But savestate is not related. It saves the value to eeprom on the node.

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    PSteward
                    wrote on last edited by
                    #9

                    For a different approach, how would you manually force a sensor to change it's state (for a binary sensor) from the gateway?

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    29

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular