MySensors --> MQTT --X Home Assistant



    • The source of the data is a PVPowered Inverter
    • The PVM1010 MODULE in the inverter can send the data as UDP datagrams.
    • A TP-link micro router connects the module to a network
    • The network router provides module with an IP address via DHCP
    • An Arduino Uno with an W5100 ethernet shield and nRF24 Radio with MySensors and custom software acts as a go-between to an MQTT broker on the network.
    • Once the data is on the MQTT broker, Home Assistant picks up the data

    It is this last step that is not working. HA is just not seeing the new sensors, like they are not there. Has anyone else seen this? How do I get HA to see the new sensors?

    (Yes, this seems to be an HA issue, and I have the question asked there. I am in hopes that someone that has experienced this problem came up with a solution.)



  • @OldSurferDude can you post your sketch?
    Did you follow the presentation and first time sending procedure? https://www.home-assistant.io/integrations/mysensors/



  • @electrik

    Yes, I did. The data has been sent many times.

    I did think of something. This Arduino Uno formerly was another sensor and did connect to HA. I will try changing the node number by writing a different number in the first memory location of the Uno's EEPROM.

    Meanwhile:

    Here is my presentation code:

    void presentation()
    {
      char VERstr[10];
      dtostrf(VER,9,2,VERstr);
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Solar Monitor", VERstr);
    
      // Register this device as Water flow sensor
      present(CHILD_ID, S_POWER);
    }
    

    This partial image of MQTT Explorer shows that the data did arrive on the broker
    Image of MQTT explorer showing solar monitor data on the MQTT broker

    Your link suggest to turn on the debug logger.

    "
    If you experience dropped messages or that a device is not added to Home Assistant, please turn on debug logging for the mysensors integration and the mysensors package. This will help you see what is going on. Make sure you use these logging settings to collect a log sample if you report an issue about the mysensors integration in our GitHub issue tracker.

    logger:
      default: info
      logs:
        homeassistant.components.mysensors: debug
        mysensors: debug
    

    "

    I find this typical of HA, in its assumption that everyone knows everything about HA. I know very little of the in's and out's of HA. Where do I find this file that needs to be modified? Does HA have to be rebooted once the file is modified? Once the code is operational, where do I find the log file that will be generated when these commands are invoked? How do I get to the github issue tracker to report the issue?

    Thanks for the help!

    OSD



  • @electrik

    Changing the node number did it!

    New question! 😉 How do I remove a used node number from HA? (seriously!)

    OSD

    Code used to change node number:

    #define Ver 1.0
    
    #include <EEPROM.h>
    char inChar;
    
    
    // ------------------------------------------------------------------------------------clearSerialBuffer
    void clearSerialBuffer(){
      while(Serial.available()){
        Serial.read();
        delay(200);
      }
    }
    // ------------------------------------------------------------------------------------expressChar
    void expressChar(){
      Serial.print(inChar); Serial.print(F("'("));Serial.print(uint8_t(inChar));Serial.println(F(")"));
    }
    
    // ------------------------------------------------------------------------------------header
    void header(){
      inChar = EEPROM.read(0);
      Serial.print(F("Current character at address (0) is '"));
      expressChar();
      clearSerialBuffer();
      Serial.print("Enter a character: ");
    }
    
    // ------------------------------------------------------------------------------------setup
    void setup() {
      Serial.begin(115200); Serial.print("\n\rAddress As Character ver "); Serial.println(Ver);
      header();
    }
    // ------------------------------------------------------------------------------------loop
    void loop() {
      
      if (Serial.available()){
        inChar = Serial.read();
        if (inChar <= 32 || inChar >=127){
          Serial.print(F("I don't like '"));
          expressChar();
        }
        else {
          EEPROM.write(0,uint8_t(inChar));
        }
        header();
      }
    }
    


  • great it works!
    Here the steps to delete a node are described:
    https://forum.mysensors.org/topic/10898/can-t-remove-unused-sensors-from-ha/7


Log in to reply
 

Suggested Topics

  • 1
  • 1
  • 17
  • 3
  • 5

61
Online

11.4k
Users

11.1k
Topics

112.7k
Posts