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
MaTyM

MaTy

@MaTy
About
Posts
14
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @martinhjelmare

    Hi,
    I checked my sketch once again, and confronted it with MySensors documentation, and I actually found the send message command in it. Should I change something to make it work properly with Hass.io

    void loop() {
      // Send locally attached sensor data here
      if (debouncer.update()) {
        // Get the update value.
        int value = debouncer.read();
        // Send in the new value.
        if(value == LOW){
             saveState(1, !loadState(1));
             digitalWrite(RELAY_1, loadState(1)?RELAY_ON:RELAY_OFF);
             send(msg.set(loadState(1)));
    
    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @martinhjelmare

    Should it be something like this added to my sketch?

    send(msg.set(RELAY_1;V_LIGHT)
    send(msg.set(RELAY_2;V_LIGHT)
    ...
    

    I ment BAUD_RATE defined in this sketch

    #if F_CPU == 8000000L
    #define MY_BAUD_RATE 38400
    #endif
    

    Once again, sorry for tons of noob questions. But I didn't write that sketch by myself, and my knowledge about programming is below basic.

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @martinhjelmare
    You mean in my sketch, something like this?

    void receive(const MyMessage &message) {
      // We only expect one type of message from controller. But we better check anyway.
      if (message.type==V_LIGHT) {
         // Change relay state
         digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
         // Store state in eeprom
         saveState(message.sensor, message.getBool());
         // Write some debug info
         Serial.print("Incoming change for sensor:");
         Serial.print(message.sensor);
         Serial.print(", New status: ");
         Serial.println(message.getBool());
    

    I had optimistic set false.

    BTW: Strange thing, baud rate in my sketch is 38400, but when I set it up in Hass.io, lights won't work, when I changed to 115200 in .yaml (in sketch is still 38400), all works fine, except the states update.

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    Yesterday I accidentally restarted Hass.io with all that errors in config. I was afraid that it'll crush after restart but it actually worked. After restart I turned on switch on the wall, and Switch (light relay) appeared on Hass.io home screen.

    There are still the same errors in config, and I have some issues with those light switches. Most annoying issue is that Hass.io doesn't update switch state after change via gui. Switch state changes in Hass.io when i use manual switch on the wall but when I use gui it doesn't
    http://ibb.co/f8Rvum

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @martinhjelmare
    I did It. resault But I'm still getting errors :/

    I guess I'm hopeless. It's probably sthg silly as always.

    update:
    after trying different solutions i typed hardware check command and new serial appeared 'AMA0' but I did nothing physically with RPi (din't attach any devices). I tried to check mysensors config with ttyAMA0 instead of USB0, but I still got the same resault.
    ps. of course when I was trying your command ($ curl -d '{"devices": ["ttyAMA0"]}' http://hassio/homeassistant/options), I did it with USB0 parameter, not AMA0.

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    After I disconnected gateway and connected it again, I checked command "dmesg | grep usb" and this showed up
    https://hastebin.com/leqocowaco.vbs before there was nothing after command. Command ls -l /dev/tty* still the same.

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @nelsonov resault
    https://ibb.co/cyPQqG

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @nelsonov
    when i use "hassio homeassistant hardware" command it displays only ttyUSB0 and ttyUSB1. I have RFLink connected to USB1 and it works great, so MySensors gateway must be the ttyUSB0.
    https://pastebin.com/wTn72d1D Am I right?

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @martinhjelmare

    Oh, sorry, im so confused after I moved from domoticz to Hass.io. But I don't need Z-wave. What I have is serial gateway based on arduino mega 2560, with a sketch (example) https://hastebin.com/cinokiraka.cpp which controles all lights in my house. The arduino mega is connected to my RPI3 (with Hass.io) via usb (ttyUSB0). It worked perfectly on Domoticz, all lights was discovered automatically. I've checked the documentation of MySensors implementation on Hass.io web site, and read plenty of forums and still nothing :/
    I'm still getting errors. https://pastebin.com/VDaVRKkV

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @tom-carpenter
    How did You make it? Is it via serial gateway?

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    I think i found the answer ... https://forum.mysensors.org/topic/7360/hass-io-and-ethernet-gateway-on-pi

    It looks like I need docker add-on to run MySensors gateway on Hass.io, and it doesn't exist so far, what a shame :(

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    Wait, do I need to install an addon from reposytory, to make it work? Isn't it included in Hass.io? I cant see any repo :/

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    @archiijs said in MySensor on Hass.io - can't get it work:

    @maty said in MySensor on Hass.io - can't get it work:

    e code isn't mine (made by my friend), I've been using it with Domoticz for almost a year, and it worked perfectly. But recently i decided to give a try to Hass.io, and I really like it. But I still have a problem with lights connected via MySensors (Arduino Mega conected to Rpi via USB), can't get it work with Hass.io. Config part in configuration.yaml look

    Hi @MaTy
    I have no experience with hass.io, but some comments arise.

    1. Your configuration.yaml file path seems to be incorrect. You have to edit this to real path, something like "/user/.homeassistant/mysensors.json" or whatever. The path should exist, file there will be created if it is correct and writeable.
    2. You should check if your USB port is really /dev/ttyUSB0 usually command "lsusb" is used, but I'm not sure how to do this in hass.io
    3. Also, check if USB port speed is the same as in mysensors gateway and your configuration. 38400 seems different than the standard what usually is 115200 if I'm not mistaken.
      EDIT: Ok, baud seems to match, so that should not be an issue.

    Ad.1. I tried different path too (default one '/config/mysensors.json') - still wrong. I'm not sure how these .json files works, so maybe I'm still makeing sthg wrong. (Maybe someone can share me a link with an explanation or write a few words about it?)
    Ad.2. USB is correct I checked (besides i have RFLink on the ttyUSB1 and it works great).
    Ad.3. As You said at the end ... baud should be OK.

    Home Assistant

  • MySensor on Hass.io - can't get it work
    MaTyM MaTy

    Hi! Can anyone help me with this code? https://pastebin.com/byb6BQZz The code isn't mine (made by my friend), I've been using it with Domoticz for almost a year, and it worked perfectly. But recently i decided to give a try to Hass.io, and I really like it. But I still have a problem with lights connected via MySensors (Arduino Mega conected to Rpi via USB), can't get it work with Hass.io. Config part in configuration.yaml looks like this https://pastebin.com/y3RDrCKQ
    I forgot about error log https://pastebin.com/WUMtMKfK

    I'll be gratefull for some hints.

    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