Navigation

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

    Johan

    @Johan

    0
    Reputation
    5
    Posts
    207
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Johan Follow

    Best posts made by Johan

    This user hasn't posted anything yet.

    Latest posts made by Johan

    • RE: Battery level report in MQTT?

      Another update...

      Yesterday I switched to using the MQTTClientGateway from tomkxy's branch. It is acting as a MQTT client instead of as a broker, as I think it should. I mean, if you have installed Openhab and thinking of using MQTT instead of serial as communication I think installing a Mosquitto broker (for example) probably is not a big deal. 🙂
      There are obvious benefits to using a "real" broker in that you can have several clients subscribing to the messages at once. This also lets you monitor the messages sent through the broker.

      It works great and I now get all the values to Openhab without problems. It even runs on my UNO with the Ethernet shield, even though several persons have said the memory would not be sufficient. Thanks tomkxy!

      /Johan

      posted in Troubleshooting
      Johan
      Johan
    • RE: Battery level report in MQTT?

      Update...

      I have figured out why the MQTT message looks strange. In the MyMQTT.h file there are an array that translates the variable type to the string that should be sent in the MQTT message. The value for the battery level I get from my sensor is 50 and that translation translates to "", and thus the message obviously becomes just V_.
      It is an easy fix to fix my message but maybe the whole translation table should be updated by someone who know more about all the various other variable types. As I am sort of new to MySensors, what is the proper way to get this fixed? Create an issue in Git?

      /Johan

      posted in Troubleshooting
      Johan
      Johan
    • Battery level report in MQTT?

      Hi

      I have added battery level reporting for a temperature sensor. It sends that to a MQTT gateway connected to Openhab. I see the battery level report go from the sensor, to the gateway but then it looks sort of funny when I look at the MQTT message.
      I want to pick the message up in Openhab to get a status of the battery level there but I don't get Openhab to receive it.

      In the Serial monitor for the gateway it look like this:

      0;0;3;0;9;read: 20-20-0 s=255,c=3,t=0,pt=1,l=1,sg=0:95
      MyMQTT/20/255/V_

      I tried to read that value in Openhab, without success (It looks weird so I guess it's wrong) , with this item:

      Number Batteri_Kvar_Inne "Batteri kvar [%.1f %]" <battery> {mqtt="<[nuc:MyMQTT/20/255/V_:state:default]"}

      Anyone have experience from visualising the battery level on Openhab with MQTT and have any idea what's going on and how to pick it up in Openhab?

      /Johan

      posted in Troubleshooting
      Johan
      Johan
    • RE: LCD display for MQTT gateway

      That explains a lot. 🙂

      I moved the 12 and 11 pins to 9 and 8 and it works! Thanks for the tip! 🙂

      /Johan

      posted in Troubleshooting
      Johan
      Johan
    • LCD display for MQTT gateway

      Hi

      I have a MQTT gateway on an Uno with the ethernet shield up and running. I works just fine getting sensor data and forwarding them to the Openhab controller. I run OSX, have Arduino IDE 1.6.4, and MySensors 1.5. But I had to remove the Liquid Display library from MySensors as I got a duplicate library error when trying to use the LCD.

      Now I am trying to get two sensor nodes to communicate with each other without luck. I thought that it would be nice if the gateway had a display where the MQTT messages are shown as they fly by. I only have a "Arduino starter kit" display with 16 x 2 characters but it is better than nothing as I only want to see the messages.

      My problem is that when I add this display to my Uno it does not output anything at all. It lights up but no text. I have succeeded with uploading a sketch with only the display code and that works, so the wirings seem fine.
      I have also commented out the definitions for the extra blinking led displays that is in the example sketch for the MQTT gateway.

      I'm using pin 12, 11, 10, 4, 3, 2 as the Arduino LCD examples does.
      Is there something I have missed in the MySensors library that disturbs the LCD to not work? Or is it the Ethernet shield that uses the pins so they are occupied?

      Any tips or suggestions would be much appreciated.

      /Johan

      posted in Troubleshooting
      Johan
      Johan