Giter VIP home page Giter VIP logo

Comments (28)

clsferguson avatar clsferguson commented on August 23, 2024

Yeah I have been getting this lots. It has not worked for me reliably.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

i'm trying this now.

#23 (comment)

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

I am also seeing this. Also it hangs with nothing in the logs..

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

I think I resolved it for me. it is a problem with the code in the rtl2mqtt.sh file. Just coded for an outdated version of rtl_433. Try this.

remove

/usr/local/bin/rtl_433 -F json -R $PROTOCOL -f $FREQUENCY -g $GAIN -p $OFFSET | while read line
do
  DEVICE="$(echo $line | jq --raw-output '.model' | tr -s ' ' '_')" # replace ' ' with '_'
  DEVICEID="$(echo $line | jq --raw-output '.id' | tr -s ' ' '_')"

  MQTT_PATH=$MQTT_TOPIC

  if [ ${#DEVICE} > 0 ]; then
    MQTT_PATH=$MQTT_PATH/"$DEVICE"
  fi
  if [ ${#DEVICEID} > 0 ]; then
    MQTT_PATH=$MQTT_PATH/"$DEVICEID"
  fi

  # Create file with touch /tmp/rtl_433.log if logging is needed
  [ -w /tmp/rtl_433.log ] && echo $line >> rtl_433.log
  echo $line | /usr/bin/mosquitto_pub -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASS -i RTL_433 -r -l -t $MQTT_PATH
done

replace it with (one line)
/usr/local/bin/rtl_433 -M newmodel -R $PROTOCOL -f $FREQUENCY -g $GAIN -p $OFFSET -F "mqtt://$MQTT_HOST:1883,user=$MQTT_USER,pass=$MQTT_PASS,retain=0,events=$MQTT_TOPIC[/model][/subtype][/id]"

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

I am trying this now. Looks like everything loaded successfully. I will see how long it stays running now. Thanks!!

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

This is not working for me. This changes the MQTT topic as well as the payload sent to MQTT. I have tried to modify my Node Red automations to the new topic, but does not ever trigger. I do see the messages are getting to the MQTT broker. Also when the add on fails to talk to the dongle, there are no messages. I have had to revert back to the previous lines that were removed.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

Bummer. Have you tried a ruibuild of the addon?

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

Yes, I have tried to rebuild as well. I am going to order another brand dongle to verify that I am not having hardware issues.

Looking at using this part on Amazon... B01GDN1T4S.

Thoughts on a good quality SDR dongle? I am using it on 319.5 Mhz.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

I am using this one on my pi3 b+ same frequency.

https://www.amazon.ca/dp/B00PAGS0HO/ref=cm_sw_r_other_apa_i_S13gEb9FEERHA

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

The command line I shared above you can modify to try and match your previous mqtt topics.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

Can you share the mqtt messages you receive and would like to keep receiving?

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

Thats the same dongle I am using, just different logo and brand. It's the same shape and color.

Here is what I am expecting.. on topic "homeassistant/sensor/Interlogix/aac6da"
{
"time": "2020-01-12 14:20:20",
"model": "Interlogix",
"device_type": "contact",
"id": "aac6da",
"battery": "OK",
"switch1": "OPEN",
"switch2": "OPEN",
"switch3": "CLOSED",
"switch4": "OPEN",
"switch5": "OPEN",
"raw_message": "8d14a4"
}

Here is the topic I was getting with your update.. " homeassistant/sensor/Interlogix-Security/contact/aac6da"

{
"time": "2020-01-12 14:23:08",
"model": "Interlogix-Security",
"subtype": "contact",
"id": "aac6da",
"battery_ok": 1,
"switch1": "OPEN",
"switch2": "OPEN",
"switch3": "CLOSED",
"switch4": "OPEN",
"switch5": "OPEN",
"raw_message": "cd15b4"
}

I think some of those other lines that I remarked out look to be modifying the model, but I am not that good with coding. I tried to just swap out the driver loading line with yours, but no luck as well...

Thanks for your help!!

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

Use this line.

/usr/local/bin/rtl_433 -R $PROTOCOL -f $FREQUENCY -g $GAIN -p $OFFSET -F "mqtt://$MQTT_HOST:1883,user=$MQTT_USER,pass=$MQTT_PASS,retain=0,events=$MQTT_TOPIC[/model][/id]"

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

With or without those additional lines that you had removed earlier?

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

I do not see the -M in your new line...

So I am getting the correct topic "homeassistant/sensor/Interlogix/aac6da"
and payload of..
{
"time": "2020-01-12 15:14:37",
"model": "Interlogix",
"device_type": "contact",
"id": "aac6da",
"battery": "OK",
"switch1": "OPEN",
"switch2": "OPEN",
"switch3": "CLOSED",
"switch4": "OPEN",
"switch5": "OPEN",
"raw_message": "cd15b4"
}

But for some reason Node Red is not acting on it. I even tried a complete reboot of Hassio.. Flipped back to original lines, and it works again.

Just an FYI, In node red, I am looking for the payload to contain "switch1": "OPEN" or "switch1": "CLOSED"

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

Yeah I removed the -M flag for your setup.

Weird though that node red doesn't see it.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

The new method changes the battery field still while using old models. Maybe that's why?

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

I'm not doing anything with that battery field..

Even then with the new line you sent, I am getting the exact same MQTT message and topic now. It should trigger without making any changes to node red.

Got me... I guess I will try a new dongle to see if it stays up and running longer than just a few hours.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

Copy that man. Good luck.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

I actually have the exact same setup. I made binary mqtt sensors in home assistant though to watch for those payloads.

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024
binary_sensor:
  - platform: mqtt
    device_class: door
    name: "Dining room door 433"
    state_topic: "RTL/sensor/Interlogix-Security/contact/adad73"
    qos: 0
    payload_on: "OPEN"
    payload_off: "CLOSED"
    value_template: '{{ value_json.switch1 }}'

  - platform: mqtt
    device_class: window
    name: "Kylee's bedroom window 433"
    state_topic: "RTL/sensor/Interlogix-Security/contact/a7974b"
    qos: 0
    payload_on: "OPEN"
    payload_off: "CLOSED"
    value_template: '{{ value_json.switch1 }}'

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

Cool let me know. I'm curious.

from hassio-addons.

clsferguson avatar clsferguson commented on August 23, 2024

is it working?

from hassio-addons.

ericreich avatar ericreich commented on August 23, 2024

from hassio-addons.

xKronyx avatar xKronyx commented on August 23, 2024

replacing with this line did the trick !

/usr/local/bin/rtl_433 -R $PROTOCOL -f $FREQUENCY -g $GAIN -p $OFFSET -F "mqtt://$MQTT_HOST:1883,user=$MQTT_USER,pass=$MQTT_PASS,retain=0,events=$MQTT_TOPIC[/model][/id]"

And comented the old one
#/usr/local/bin/rtl_433 -M newmodel -F json -R $PROTOCOL -f $FREQUENCY -g $GAIN -p $OFFSET | while read line

Thanks !

from hassio-addons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.