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. Home Assistant HVAC Serial gateway (fan speed)

Home Assistant HVAC Serial gateway (fan speed)

Scheduled Pinned Locked Moved Troubleshooting
1 Posts 1 Posters 16 Views 1 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.
  • Willie-wortelW Offline
    Willie-wortelW Offline
    Willie-wortel
    wrote on last edited by
    #1

    Hi there,

    Can someone confirm that a setup with Serial Gateway using local connected HVAC sensor should work in Home Assistant? Especially in regards to the V_HVAC_SPEED variable?

    Also, I'm using an Arduino micro (Atmega32u4) to test this. Sometimes I see that a heater entity is added, but it does not support V_HVAC_SPEED variable, only the HVAC state.

    It seems the same problem as described here: link!

    The code I'm using:

    // Enable serial gateway
    #define MY_GATEWAY_SERIAL
    #define MY_BAUD_RATE 38400
    
    #include <MySensors.h>
    #define CHILD_ID_HVAC 0
    
    #define SN "Test sketch"
    #define SV "2.3.2"
    
    MyMessage msgHVACSpeed(CHILD_ID_HVAC, V_HVAC_SPEED);
    MyMessage msgHVACSetPointC(CHILD_ID_HVAC, V_HVAC_SETPOINT_COOL);
    MyMessage msgHVACFlowState(CHILD_ID_HVAC, V_HVAC_FLOW_STATE);
    
    String  MODE_STATE_TXT;
    String  FAN_STATE_TXT;
    int     FAN_STATE;
    int     TEMP_STATE;
    bool    initialValueSent = false;
    
    void setup()
    {
      // Setup locally attached sensors
      //pinMode(LED_BUILTIN, OUTPUT);
    }
    
    void presentation()
    {
      // Present locally attached sensors
      sendSketchInfo(SN, SV);
      present(CHILD_ID_HVAC, S_HVAC, "Thermostat");  
    }
    
    void loop()
    {
      // Send locally attached sensor data here
      
      if (!initialValueSent) 
      {
        FAN_STATE_TXT = "Min";         // default fan start state
        TEMP_STATE = 20;               // default start temperature
        MODE_STATE_TXT = "CoolOn";     // default mode state
    
        send(msgHVACSpeed.set(FAN_STATE_TXT.c_str()));
        send(msgHVACSetPointC.set(TEMP_STATE));
        send(msgHVACFlowState.set(MODE_STATE_TXT.c_str()));
        
        initialValueSent = true;
      }
      
      //wait(1000);
     
    }
    
    void receive(const MyMessage &message) 
    {
      if (message.isAck()) 
      {
         //Serial.println("This is an ack from gateway");
         return;
      }
    
      //Serial.print("Incoming message for: ");
      //Serial.print(message.sensor);
    
      String recvData = message.data;
      recvData.trim();
    
      //Serial.print(", New status: ");
      //Serial.println(recvData);
      switch (message.type) 
      {
        case V_HVAC_SPEED:
          //Serial.println("V_HVAC_SPEED");
    
          if(recvData.equalsIgnoreCase("auto")) FAN_STATE = 0;
          else if(recvData.equalsIgnoreCase("min")) FAN_STATE = 1;
          else if(recvData.equalsIgnoreCase("normal")) FAN_STATE = 2;
          else if(recvData.equalsIgnoreCase("max")) FAN_STATE = 3;
          FAN_STATE_TXT = recvData;
        break;
      }
      //sendHeatpumpCommand(); // apply setting!
      sendNewStateToGateway();
    }
    
    void sendNewStateToGateway() 
    {
      /*
      Serial.println("Status update send to HA:");
      Serial.println("*************************");
      Serial.println("Mode = " + MODE_STATE_TXT + "(" + (String)MODE_STATE + ")");
      Serial.println("Fan = " + FAN_STATE_TXT + "(" + (String)FAN_STATE + ")");
      Serial.println("Temp = " + (String)TEMP_STATE);
      */
      
      send(msgHVACSpeed.set(FAN_STATE_TXT.c_str()));
    
    }
    
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    12

    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