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
A

acmbc68

@acmbc68
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Home Assistant - How to recognize MySensors nodes
    A acmbc68

    Ok.
    First of all - still no joy. Can't get any communications from MySensors to homeassistant.

    Trying to tackle this bottom up. Thought it might be an issue with PySerial, but that reads data OK from the serial port:

    import serial as serial
    print ("starting")
    ser = serial.Serial (
        port='COM4',
        baudrate=115200,
        parity=serial.PARITY_NONE,
        stopbits=serial.STOPBITS_ONE,
        bytesize=serial.EIGHTBITS
    )
    
    ser.flushInput()
    ser.flushOutput()
    
    print("connected to: " + ser.portstr)
    count=1
    
    while True:
            try:
                    data_raw = ser.readline()
                    print(data_raw)
            except serial.SerialException:
                    print ("SERIAL ERROR")
                    exit(1)
    

    This results in what is expected:

    starting
    connected to: COM4
    b'0;0;3;0;14;Gateway startup complete.\n'
    b'0;0;3;0;9;read: 1-1-0 s=2,c=1,t=23,pt=2,l=2:0\n'
    b'1;2;1;0;23;0\n'
    b'0;0;3;0;9;read: 1-1-0 s=1,c=1,t=0,pt=7,l=5:25.0\n'
    b'1;1;1;0;0;25.0\n'
    b'0;0;3;0;9;read: 1-1-0 s=0,c=1,t=1,pt=7,l=5:84.0\n'
    b'1;0;1;0;1;84.0\n'
    b'0;0;3;0;9;read: 1-1-0 s=3,c=1,t=16,pt=0,l=1:0\n'
    b'1;3;1;0;16;0\n'
    

    (this is a four sensor node - Temp, Humidity, light level and presence detection)

    I am trying to test the pymysensors (mysensors.mysensors) and I believe that is where the situation may originate.

    Basically, pymysensors just hangs there on calling gw.start() in the code below:

    
    import mysensors.mysensors as mysensors
    import logging
    
    def event(type, nid):
        print(type+" "+str(nid))
    
    gw = mysensors.SerialGateway('COM4', event)
    logging.warning("Created SerialGateway")
    print (gw)
    gw.start()
    

    Trying to wrangle through the pymysensors code...Could it be the windows threading implementation (gw.start()) causing some type of hung access to the serial port? Unfortunately, no messages (print or logging) that I put in the pymysensors actually get printed out (maybe due to being in a background thread?

    Home Assistant home assistant

  • Home Assistant - How to recognize MySensors nodes
    A acmbc68

    Thanks @martinhjelmare

    As per https://home-assistant.io/blog/posts/2/, all the components should be under the homeassistant install, so it shouldn't be a brain-wrecker to change those out.

    I'll start giving it a whirl tonight.

    Home Assistant home assistant

  • Home Assistant - How to recognize MySensors nodes
    A acmbc68

    Hi,

    I've been following this thread for a few days, as I am in the same situation and kielnino - I can see the MySensors component get loaded and then....silence....I know the MySensors GW and nodes are working from testing with serial monitors and another controller app (MySController).

    Will probably be spending some time tracing through the pymysensors code tonight to see what gives. I do have debug enabled on homeassistant, but still no joy.

    One thought - shouldn't MySensors on homeassistant be implemented as a platform (and not a sensor) much like MQTT.

    I have got readings to work through MQTT (in my case, patched a node-red flow together to read the serial line and publish to a local mosquitto), but this is like driving around the city to get to the store next door...

    Any further thoughts/hints as to where to start looking?

    Thanks!

    Home Assistant home assistant
  • Login

  • Don't have an account? Register

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