# My custom device does not appear

**URL:** <https://discourse.mozilla.org/t/my-custom-device-does-not-appear/67907>\
**Category:** Developer Tools\
**Created:** [September 21, 2020, 6:55pm UTC](https://discourse.mozilla.org/t/my-custom-device-does-not-appear/67907 "2020-09-21T18:55:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![somewan](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@somewan](https://discourse.mozilla.org/u/somewan)\
**Post date:** [September 21, 2020, 6:55pm UTC](https://discourse.mozilla.org/t/my-custom-device-does-not-appear/67907/1 "2020-09-21T18:55:15Z")

</div>

Hi,

I have developed a custom device in a Ubuntu Server running on a Raspberry following the guide of [Webthings Framework](https://iot.mozilla.org/framework/) but when I use the Gateway to scan the network, it does not detect it and I do not why.

I leave here the code (Python btw) in case it helps:

```
from __future__ import division
from webthing import Action, Property, SingleThing, Thing, Value, WebThingServer
import logging
import uuid

"class ChangeBrightnessAction(Action):
    def __init__ (self, thing, input_):
        Action. __init__ (self, uuid.uuid4().hex, thing, 'change_brightness', input_=input_)

    def perform_action(self):
        self.thing.set_property('brightness', self.input['brightness'])

def initialize_thing():
    thing = Thing(
        'urn:dev:ops:smart_lamp_7256',
        'SLamp',
        ['OnOffSwitch', 'Light'],
        'A smart lamp connected to the web'
    )

    thing.add_property(
        Property(thing, 'on', Value(True), metadata={
            '@type': 'SwitchProperty',
            'title': 'On/Off',
            'type': 'boolean',
            'description': 'Shows if the lamp is on',
        })
    )

    thing.add_property(
        Property(thing, 'brightness', Value(50), metadata={
            '@type': 'BrightnessProperty',
            'title': 'Brightness',
            'type': 'integer',
            'description': 'The light level from 0 to 100',
            'minimum': 0,
            'maximum': 100,
            'unit': 'percent',
        })
    )

    thing.add_available_action(
        'change_brightness', {
            'title': 'Change Brightness',
            'description': "Change the lamp brightness to a given level",
            'input': {
                'type': 'object',
                'required': [
                    'brightness',
                ],
                'properties': {
                    'brightness': {
                        'type': 'integer',
                        'minimum': 0,
                        'maximum': 100,
                        'unit': 'percent',
                    },
                },
            },
        },
        ChangeBrightnessAction)

    return thing

def run_server():
    thing = initialize_thing()
    server = WebThingServer(SingleThing(thing), port=8888)
    server.start()
    # I close the server in another process

def decoy():
    logging.basicConfig(
        level=10,
        format="%(asctime)s %(filename)s:%(lineno)s %(levelname)s %(message)s"
    )
    run_server()
```

---

<div class="post-metadata">

**Author:** ![Nicolas\_Chevobbe](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/nicolas_chevobbe/32/28203_2.png) [@Nicolas\_Chevobbe](https://discourse.mozilla.org/u/Nicolas_Chevobbe)\
**Post date:** [September 22, 2020, 5:30am UTC](https://discourse.mozilla.org/t/my-custom-device-does-not-appear/67907/2 "2020-09-22T05:30:22Z")

</div>

Hello,

this category is for discussions on Firefox Developer Tools. You’d have better chance to get answer posting on the appropriate category (I guess [https://discourse.mozilla.org/c/iot/252](https://discourse.mozilla.org/c/iot/252) ?)

---

<div class="post-metadata">

**Author:** ![somewan](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@somewan](https://discourse.mozilla.org/u/somewan)\
**Post date:** [September 22, 2020, 5:38am UTC](https://discourse.mozilla.org/t/my-custom-device-does-not-appear/67907/3 "2020-09-22T05:38:28Z")

</div>

Thanks, I was not sure where to post it, I will change it and close this one.
