# Adapter failing to pair?

**URL:** <https://discourse.mozilla.org/t/adapter-failing-to-pair/41686>\
**Category:** WebThings\
**Created:** [June 19, 2019, 9:09pm UTC](https://discourse.mozilla.org/t/adapter-failing-to-pair/41686 "2019-06-19T21:09:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgrgt](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jgrgt](https://discourse.mozilla.org/u/jgrgt)\
**Post date:** [June 19, 2019, 9:09pm UTC](https://discourse.mozilla.org/t/adapter-failing-to-pair/41686/1 "2019-06-19T21:09:58Z")

</div>

I’ve been trying to edit the gpio-adapter code into an adapter that reads mqtt messages sent by the rtl\_433 tool. So rtl\_433 will publish JSON messages onto an mqtt topic, and my addon will subscribe to that topic.

But I seem to be doing something wrong. I pushed my WIP code to [https://github.com/jgrgt/rtl-433-adapter](https://github.com/jgrgt/rtl-433-adapter) It’s quite crappy at the moment due to me trying all kinds of things to get it to work.

Also, right now I ‘test’ by coding straight on my raspberry pi and restarting the gateway after every edit. This is flawed in multiple ways (not a lot of useful logging, no debugging possible) so I’m looking for a better way?

Another question: how do I reset my gateway’s things (including logs) to ‘empty’? Right now I need to disable the addon, re-enable it and remove the thing using sqlite3…

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![dhylands](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/dhylands/32/20711_2.png) [@dhylands](https://discourse.mozilla.org/u/dhylands)\
**Post date:** [June 21, 2019, 11:55pm UTC](https://discourse.mozilla.org/t/adapter-failing-to-pair/41686/2 "2019-06-21T23:55:39Z")

</div>

What hardware does this connect to?

The gpio adapter doesn’t really pair. It just adds pins that are configured. When you hit + in the UI to initiate pairing it will present any devices that that adapter has advertised that aren’t currently in the DB.

I normally do my development on the PC. This works really well for any type of USB dongle.

You also don’t need to restart the gateway. You can disbale and re-enable the addon (in settings-\>Addons). This will cause the addon to be reloaded. I now add runtime configurable debug. The zwave and zigbee adapters have this.

---

<div class="post-metadata">

**Author:** ![dhylands](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/dhylands/32/20711_2.png) [@dhylands](https://discourse.mozilla.org/u/dhylands)\
**Post date:** [June 22, 2019, 5:07am UTC](https://discourse.mozilla.org/t/adapter-failing-to-pair/41686/3 "2019-06-22T05:07:47Z")

</div>

I created a PR: [https://github.com/jgrgt/rtl-433-adapter/pull/1](https://github.com/jgrgt/rtl-433-adapter/pull/1) which gets the adapter into a working state.

The biggest problem was that the TemperatureProperty needs units, minimum and maximum.

I also fleshed out the mqtt client portion and set things up so you could have multiple properties, each one subscribed to a different topic.

---

<div class="post-metadata">

**Author:** ![jgrgt](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jgrgt](https://discourse.mozilla.org/u/jgrgt)\
**Post date:** [June 24, 2019, 7:19am UTC](https://discourse.mozilla.org/t/adapter-failing-to-pair/41686/4 "2019-06-24T07:19:36Z")

</div>

@dhylands Thanks a lot! I merged your PR and gave I’m indeed getting temperatures in the UI now, which was not happening before.

Now it’s time to investigate some of the configurability options…
