Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Vorace
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Vorace

    @Vorace

    0
    Reputation
    1
    Posts
    93
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Vorace Follow

    Best posts made by Vorace

    This user hasn't posted anything yet.

    Latest posts made by Vorace

    • RE: 💬 Relay

      Hi
      Using Home assistant, and Optimistic set to false in the mysensors config, the switch in homeassistant would turn the relay on, but in the view in homeassistant the flip switch jumped off straight after switching on. It was solved by adding the following line to the sketch, ensuring that hassio knows that the actuator actually have received the command. Not sure if this is a good way of doing it, but it seems to work for me.
      send(msg.set(state)); // Send new state and request ack back
      in:
      void receive(const MyMessage &message) {
      // We only expect one type of message from controller. But we better check anyway.
      if (message.isAck()) {
      Serial.println("This is an ack from gateway");
      }

      if (message.type == V_LIGHT) {
      // Change relay state
      state = message.getBool();
      digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
      // Store state in eeprom
      saveState(CHILD_ID, state);

       // Write some debug info
       Serial.print("Incoming change for sensor:");
       Serial.print(message.sensor);
       Serial.print(", New status: ");
       Serial.println(message.getBool());
       send(msg.set(state)); // Send new state and request ack back
      

      }
      }

      Thanks

      posted in Announcements
      Vorace
      Vorace