[RELEASE] OmniThing v0.8.2 - ESP8266/ESP32/RaspberryPi/Linux/Windows Web-based Configuration Tool

I’m not sure how good the built in pull up is on the gpio, I’d recommend adding a pull-up resistor (4.7k or 10k) between your data line on the sensor and Vcc

1 Like

Do you have a multimeter on hand?
Do you get any o/p from the sensor outside of omnithing? via a script

Bill,

Well…if you’re willing to hard wire some Cat5 to this device, then I would recommend you take a look at using an Arduino MEGA 2560 board + a W5100 (or W5500) Ethernet Shield, running ST_Anything. This combination is very stable and I have been using it in my garage for years to monitor magnetic reed switches from an old alarm system, plus it controls my garage doors, monitors for motion in the garage, and collects temperature and humidity data.

The Arduino MEGA 2560 has 54 Digital I/O pins, 16 Analog Inputs, and 4 HW Serial UARTs. And, it operates at 5v TTL logic levels.

You can buy clone MEGA 2560 boards for less than $20 on Amazon or eBay. I use this one without any issues whatsoever.

And here is a W5100 Ethernet Shield which stacks on the Arduino MEGA board above

https://www.amazon.com/SunFounder-Ethernet-Shield-W5100-Arduino/dp/B00HG82V1A/ref=sr_1_3?s=electronics&ie=UTF8&qid=1548964834&sr=1-3&keywords=W5100%2BShield&th=1

or you can buy a combo pack

https://www.amazon.com/SunFounder-Ethernet-Shield-W5100-Arduino/dp/B00N1SWEE8/ref=sr_1_3?s=electronics&ie=UTF8&qid=1548964834&sr=1-3&keywords=W5100%2BShield&th=1

1 Like

Haha, I have easy 1000+’ run throughout the house with switch in basement and another on second floor. Ive managed to get WiFi only on cell phones and tablets…

I’ll definitely be looking into that… I’ve done a ton with raspis up to this point. I work in R&D in the RF world, and I’ve even brought them into work making scopes,signal generators and various test equipment. But never really got into Arduino side of things… looks like it may be time…

1 Like

If you are trying to use the internal pullup on the pi’s pin, you will need to set the “pullup” option to true in your “dht7” composite peripheral. I would recommend following Bill’s advice though by using an external pullup. Be sure to pullup to 3.3V not 5V if you go this route.

2 Likes

Yeah I’ve got one but it doesn’t have digital readout.
o/p? Where should I be connecting the multimeter? In line while it’s connected? Which line?

O/p meaning output. That should be step 1 making sure it’s working on your pi, and help determine where your issue is.

With multimeter, verify the dht you have 5v on Vcc and 3.3v on the data line…

My suspicion is you have no voltage on your data line, since you didn’t wire a pull up resistor and apparently it’s an option you must set if you’re using the internal pull up as Daniel stated above.

Hello there I hope all is well it has been a while since our first few exchanges starting here and following: [RELEASE] OmniThing v0.6.1 - ESP8266/ESP32/RaspberryPi/Linux/Windows - A cross-platform successor to ST_Anything - Web-based Configuration Tool

Well its almost time to get the baby room ready, and after all the running around i am ready to get this project ready. A few posts up you asked me for the GPIO numbers on the Rpi that go with each sensor so you could write some json file.
here they are:

  1. sound sensor (GPIO 0)
  2. motion sensor (GPIO 5)
  3. vibration sensor (GPIO 26)
  4. soil sensor (GPIO 6)
  5. temperature/humidity sensor (GPIO 4)
  6. 2 X relays (GPIO 25 & 27)

Let me know what else do i need to do after please because i have no clue where to go from there again i have the Rpi st up and i got the OmniThing web interface up and also the ST IDE part done.
Thank you
Denis

Hi Denis,

Below is a JSON config that should be a decent starting point. Paste it into a text document, connect the the web configuration tool on your Raspberry Pi, and click on the Import Configuration button to import it.

{
    "NetworkReceiver": {
        "type": "NetworkReceiverHttpLib",
        "port": 8090
    },
    "NetworkSender": {
        "type": "NetworkSenderHttpLib",
        "ip": "192.168.1.200",
        "port": 39500
    },
    "CompositePeriphs": [
        {
            "type": "DhtReader",
            "name": "DHT22",
            "pin": 4,
            "pullup": false,
            "dht11": false
        }
    ],
    "Devices": [
        {
            "triggers": [
                {
                    "interval": 30000,
                    "offset": null,
                    "command": "poll"
                }
            ],
            "subscriptions": [],
            "type": "MotionSensor",
            "name": "Sound_Sensor",
            "input": {
                "type": "DigitalInputPinRaspberryPi",
                "pin": 0,
                "invert": false,
                "pinMode": "Pullup"
            },
            "invert": false,
            "constantPoll": true
        },
        {
            "triggers": [
                {
                    "interval": 30000,
                    "offset": 5000,
                    "command": "poll"
                }
            ],
            "subscriptions": [],
            "type": "MotionSensor",
            "name": "Motion_Sensor",
            "input": {
                "type": "DigitalInputPinRaspberryPi",
                "pin": 5,
                "invert": false,
                "pinMode": "Pullup"
            },
            "invert": false,
            "constantPoll": true
        },
        {
            "triggers": [
                {
                    "interval": 30000,
                    "offset": 10000,
                    "command": "poll"
                }
            ],
            "subscriptions": [],
            "type": "MotionSensor",
            "name": "Vibration_Sensor",
            "input": {
                "type": "DigitalInputPinRaspberryPi",
                "pin": 26,
                "invert": false,
                "pinMode": "Pullup"
            },
            "invert": false,
            "constantPoll": true
        },
        {
            "triggers": [
                {
                    "interval": 30000,
                    "offset": 15000,
                    "command": "poll"
                }
            ],
            "subscriptions": [],
            "type": "ContactSensor",
            "name": "Soil_Sensor",
            "input": {
                "type": "DigitalInputPinRaspberryPi",
                "pin": 6,
                "invert": false,
                "pinMode": "Pullup"
            },
            "invert": false,
            "constantPoll": true
        },
        {
            "triggers": [
                {
                    "interval": 60000,
                    "offset": null,
                    "command": "poll"
                }
            ],
            "subscriptions": [],
            "type": "Switch",
            "name": "Relay_1",
            "output": {
                "type": "DigitalOutputPinRaspberryPi",
                "initial": false,
                "invert": false,
                "pin": 25
            },
            "invert": false,
            "initial": false,
            "input": {},
            "ignoreRedundant": false
        },
        {
            "triggers": [
                {
                    "interval": 60000,
                    "offset": 45000,
                    "command": "poll"
                }
            ],
            "subscriptions": [],
            "type": "Switch",
            "name": "Relay_2",
            "output": {
                "type": "DigitalOutputPinRaspberryPi",
                "initial": false,
                "invert": false,
                "pin": 27
            },
            "invert": false,
            "initial": false,
            "input": {},
            "ignoreRedundant": false
        },
        {
            "triggers": [
                {
                    "interval": 10000,
                    "offset": 2000,
                    "command": "poll"
                }
            ],
            "subscriptions": [],
            "type": "TemperatureMeasurement",
            "name": "Temperature_Sensor",
            "input": {
                "type": "InputFloatRef",
                "compositeName": "DHT22",
                "paramName": "temperature"
            }
        },
        {
            "triggers": [
                {
                    "interval": 10000,
                    "offset": 7000,
                    "command": null
                }
            ],
            "subscriptions": [],
            "type": "RelativeHumidityMeasurement",
            "name": "Humidity_Sensor",
            "input": {
                "type": "InputFloatRef",
                "compositeName": "DHT22",
                "paramName": "humidity"
            }
        }
    ]
}

You will need to click on the Network Receiver tab and make sure you set that port equal to the value you chose in the SmartThings app when adding the OmniThing parent device. Also click on the Network Sender tab and change the IP to your hub’s IP address.

You may need to make minor changes to the devices in the Devices tab. Depending on the behavior of your sensors (active low/active high and whether they have pullups, pulldowns, or neither) you may need to alter the “pinMode” settings for each sensor’s “InputBool”.

Also, I assumed that your temperature sensor is a DHT22 (or a compatible device). Note that the DHT22 is the only currently supported temperature sensor by OmniThing, and it can be somewhat unreliable at the moment. I still have some kinks to work out with it.

Now you should be able to hit “Save Changes” followed by “Update Local Config”. You should then see the child devices appear in SmartThings.

If you find that the values you see in SmartThings are inverted (e.g. motion sensor inactive when it should be active), you can edit the “invert” option in the devices (Only change one of the invert options, not both. It’s kind of confusing since there’s one for the pin and one for the Motion/Contact sensor. It doesn’t matter which one you change, just that you don’t change both).

Let me know if you run into any trouble or have any questions.

2 Likes

On the rpi step to run omnithing it wants you to specify your path to config.json file. I found config_rpi.json and not sure if thats it but also not sure how to type in that section correctly. that file is in omnithing/webpage but cant figure out this step, help would be appreciated.


Hi Joe,

Are you running raspbian on your pi? If so, I’d recommend installing the omnithing package instead of building it from source. In the README, those instructions are found under “Installation Instructions” which are the section right before the “Build Instructions” which I believe you’re currently following.

If you’re using a different distro (or you’d rather build from source anyway) I’d recommend following the “Other Linux Platforms” subheading under “Installation Instructions”. That will install all the omnithing files to the relevant directories and let you enable a service so it will start automatically.

The webpage json configs are actually not the configs the OmniThing executable uses. They are used by the nodejs webserver which lets you configure the actual OmniThing json config.

Yes raspian. I did this


Then prerequisites. Then got stuck on last command line of rasp pi section right after that.

So you want me to use this, gotcha

Anyone got any ideas how to fix this? Is there a way to correct the issue or should I just ignore it? Keep in mind I’m still new to Linux.

Try running sudo apt-get update --allow-unauthenticated

Which part did you get stuck at? “Editing Configuration”?

I’d still recommend using the raspberry pi instructions over the “Other Linux Platforms” instructions, since it will be easier to keep OmniThing up to date.

I am now at the point of entering ips and ports and all that into the web app, i guess i didnt realize i had to create the config.json file first but i did go ahead with those linux instructions, so i guess ive gotten to the same point with both. I thiught the config.json file was somewhere already for that command but i didnt realize i had to do the webtool stuff first, was just teying to follow the instructions step by step as a noob.

Now that ive done both instructions im not sure where that puts me but ill make the config file and try the raspian command to point to the file and see what happens.

You shouldn’t need to manually run the ./OmniThing [path_to_file] command. If you’ve installed it, you can look in /opt/omnithing. That’s where it’s installed (and it would have installed with a default, empty config.json file in that folder). When you edit the config in the web interface and click the update button, OmniThing will automatically restart and use the updated config.

1 Like

Ok i was just following instruction