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

You can run sudo systemctl restart omnithing-webserver

To make sure it starts automatically on boot, run sudo systemctl enable omnithing-webserver

1 Like

Thanks for the reply! I may have gone backwards
 Didn’t have any luck running those commands so I decided to start over with a fresh install using NOOBS. In the previous attempt, I could see files in opt/omnithing but now I don’t even see the omnithing folder. I can confirm that the package is installed by looking at Remove/Install, but I’m still not able to get to the config page in the browser.
When I run the restart command I get this error:
Failed to restart omnithing-webserver.service: Unit omnithing-webserver.service not found.

Still trying, figure I’ll document things here for myself and anyone else that can benefit

When running sudo apt update, I get an error saying:
E: The repository 'http://omnithing.net/repository/rpi ./ Release' does not have a Release file.
Is this expected? Or is this a clue as to why I’m struggling to get it installed?

This got things running:
pi@raspberrypi:~/OmniThing $ sudo ./OmniThing /opt/omnithing/config.json
Still can’t see the config tool in the web browser using the IP address, but I can edit the config file and I hear the relay going on and off when I set up a trigger as a toggle.

Having trouble with setting up code/device to actually control the relay through smartthings, but it seems like I’m really close now.

Here is what I’m using for config.json. Any help greatly appreciated.
The poll function is working, I can see it updating in the terminal after I run config.json
Have not been able to control through smartthings app, nor do I see the switch update when the relay was set to toggle on and off.

{
"NetworkReceiver": {
    "type": "NetworkReceiverHttpLib",
    "port": 8090
},
"NetworkSender": {
    "type": "NetworkSenderHttpLib",
    "ip": "10.11.1.103",
    "port": 39500
},
"CompositePeriphs": [],
"Devices": [

    {
        "type": "Switch",
        "name": "testSwitch",
        "triggers": [
	 {"interval": 5000, "command": "poll"}
        ],
        "subscriptions": [
            {"source": "testSwitcht", "event": "changed", "command": "toggle"}
        ],
        "output": {
            "type":     "DigitalOutputPinRaspberryPi",
            "pin":     15,
            "initial":  false,
            "invert":   false
         },
        "invert":   false 
        "initial":  false
    }

]
}

The error about no release file is due to me not having set it up as a proper apt repo. Besides the warnings it hasn’t seemed to matter so far. I don’t think it’s the source of the issue you’re having.

Worst case scenario you can use the config tool at http://omnithing.net to generate the configuration file if you’re unable to get the webserver running.

From where you’re running the executable, it appears that you’ve cloned the repo. Are you building it from source? This shouldn’t be necessary when installing using the apt repo.

Have you tried removing the omnithing package and reinstalling it? It’s bizarre that it says it’s installed but with no /opt/omnithing directory. I admit that I haven’t tested the package installation for the last two releases, so it’s entirely possible that it’s broken. I’ll try to give it a go at some point this weekend.

Hello,

I’m newbie.
I’ll test with a simple ESP8266 but i have an error with the omni parent:
21:37:14: debug Executing ‘refresh’
21:37:14: debug Executing ‘updateDeviceNetworkID’ formattedMac == 5CCF7F0xxxx
21:37:14: debug Executing ‘configure’
21:37:14: debug Executing ‘configure’
21:36:46: debug Executing ‘refresh’
21:35:46: debug Searching for child device with network id: 5CCF7F0xxxx_PIR Salon
21:35:46: error Failed to create child device with error = groovy.lang.MissingPropertyException: No such property: key for class: java.lang.String
21:35:46: debug Attempting to create child with name=PIR Salon type=MotionSensor
21:35:46: debug child with name=PIR Salon does not exist.
21:35:46: debug Searching for child device with network id: 5CCF7F0xxxx_PIR Salon
21:35:46: debug Searching for child device with network id: 5CCF7F0xxxx_Armed
21:35:46: error Failed to create child device with error = groovy.lang.MissingPropertyException: No such property: key for class: java.lang.String
21:35:45: debug Attempting to create child with name=Armed type=ContactSensor
21:35:45: debug child with name=Armed does not exist.
21:35:45: debug Searching for child device with network id: 5CCF7F0xxxx_Armed
21:35:45: debug parsing updates array
21:35:45: debug [updates:[[contact:closed, name:Armed, type:ContactSensor], [motion:active, name:PIR Salon, type:MotionSensor]]]
21:35:45: debug received body:
{“updates”: [{“name”: “Armed”, “type”: “ContactSensor”, “contact”: “closed”},{“name”: “PIR Salon”, “type”: “MotionSensor”, “motion”: “active”}]}

And in the log of the child device
21:35:46: debug sending event: name=motion value=active
21:35:46: debug parsing [motion:active, name:PIR Salon, type:MotionSensor]
21:35:46: error groovy.lang.MissingPropertyException: No such property: key for class: java.lang.String @line 52 (parse)
21:35:46: debug parsing updated

Parent device and child device are created but i a java error in the log

the json of my ESP8266:
{
“NetworkReceiver”: {
“type”: “NetworkManagerEsp8266”,
“port”: 80,
“ssid”: “xxxxx”,
“password”: “xxxxx”
},
“NetworkSender”: {
“type”: “NetworkManagerEsp8266”,
“port”: 39500,
“ip”: “192.168.0.xxxx”,
“ssid”: “xxxx”,
“password”: “xxxx”
},
“CompositePeriphs”: ,
“Devices”: [
{
“triggers”: ,
“subscriptions”: [
{
“source”: “Armed”,
“event”: “changed”,
“command”: “poll”
}
],
“type”: “ContactSensor”,
“name”: “Armed”,
“input”: {
“type”: “DigitalInputPinArduino”,
“pin”: 1,
“invert”: true,
“pullup”: true
},
“invert”: true,
“constantPoll”: true
},
{
“triggers”: ,
“subscriptions”: [
{
“source”: “PIR Salon”,
“event”: “active”,
“command”: “poll”
}
],
“type”: “MotionSensor”,
“name”: “PIR Salon”,
“input”: {
“type”: “DigitalInputPinArduino”,
“pin”: 3,
“invert”: true,
“pullup”: true
},
“invert”: null,
“constantPoll”: null
}
]
}

Hey how is everything going
My OmniThing instance was working beautifully until yesterday and now i am not getting any feedback form it with the exception of the DHT sensor i get this on the logs

Error No Reply
and
Return value 202

omniError

What has changed?? I can not command the relays and the motion and sound sensors do not report status when everything was just excellent before

Denis

Looks like a networking issue between your pi and hub. Have you tried rebooting your hub and your pi? I’d also double check that neither your hub’s nor pi’s IP addresses have changed. That log actually indicates that everything is working until that Error: No reply. Might just be that omnithing needs a restart (easiest to just reboot the pi).

2 Likes

It worked 
 rebooting the SmartThings Hub did the trick 
i had already rebooted the Rpi a few times before posting 
 thank you as always
Denis

1 Like

Hey Guys -

I’ve been trying to get OmniThings working with a RaspBerry Pi Zero W & DHT22 for half a day without luck. Was hoping I could post what I’ve got and someone tell me what may be the culprit


My Issue
SmartThings lists my device as Offline. Think it may be something in my config file or server as when starting it via SSH, the echo mentions “ERROR: No config found for type: DhtReader” (Full echo below)

Hardware

  • RaspBerry Pi Zero W (Raspbian Lite image / 192.168.0.224)
  • DHT22 Connected to RasPi via default setup using 5V, Ground, & Pin 7 (GPIO 4) / Verified it reads temps using example scripts that come with it at default settings
  • SmartThings Hub + IDE Account

How I Set it Up

  • Installed Raspbian & by accessing via SSH, fully patched it
  • Used steps in GitHub to build OmniThings by mirroring repo, using cmake, then make
  • Using posts of this thread, created a config.json (below)
  • Started OmniThings via ssh by executing
    ./OmniThing /home/pi/config.json
    Echo of output is below, too
  • Added repo to SmartThings IDE then updated repo to add all parent/child device handlers except for one that failed as mentioned in prior Issues post which was told was unneeded
  • Added Device as described in GitHub with IP & MAC of RasbPi
  • Verified that I could access 3333 in web browser of RasbPi
  • Scanned ports for RasbPi and verified port 8090 was open (as well as 22, 3333, & 8888)

SSH Echo When Launching OmniThings
Which includes echo of config.json
pi@rastemp:~/OmniThing $ ./OmniThing /home/pi/config.json
Attempting to open configuration file: /home/pi/config.json
Parsing Json Config:
{
“NetworkReceiver”: {
“type”: “NetworkReceiverHttpLib”,
“port”: 8090
},
“NetworkSender”: {
“type”: “NetworkSenderHttpLib”,
“ip”: “192.168.0.224”,
“port”: 39500
},
“CompositePeriphs”: [
{
“type”: “DhtReader”,
“name”: “DHT22”,
“pin”: 4,
“pullup”: false,
“dht11”: false
}
],
“Devices”: [
{
“triggers”: [
{
“interval”: 150000,
“offset”: 1000,
“command”: “poll”
}
],
“subscriptions”: [
{
“source”: “timelapse_temperature”,
“event”: null,
“command”: “poll”
}
],
“type”: “TemperatureMeasurement”,
“name”: “timelapse_temperature”,
“input”: {
“type”: “InputFloatRef”,
“compositeName”: “DHT22”,
“paramName”: “temperature”
}
},
{
“triggers”: [
{
“interval”: 150000,
“offset”: 0,
“command”: “poll”
}
],
“subscriptions”: [
{
“source”: “timelapse_humidity”,
“event”: null,
“command”: “poll”
}
],
“type”: “RelativeHumidityMeasurement”,
“name”: “timelapse_humidity”,
“input”: {
“type”: “InputFloatRef”,
“compositeName”: “DHT22”,
“paramName”: “humidity”
}
}
]
}
Found NetworkReceiver entry
Found configuration
port=8090
Successfully created new {
“type”: “NetworkReceiverHttpLib”,
“port”: 8090
}
Found NetworkSender entry
Found configuration
ip=192.168.0.224 port=39500
Successfully created new {
“type”: “NetworkSenderHttpLib”,
“ip”: “192.168.0.224”,
“port”: 39500
}
ERROR: No config found for type: DhtReader

############# CONFIGURATIONS ##############
Device Configurations:
ContactSensor
Momentary
MotionSensor
RelativeHumidityMeasurement
Switch
SwitchLevel
TemperatureMeasurement
VoltageMeasurement

Composite Peripheral Configurations:

InputBool Configurations:
InputBoolRef
InputDebouncer
CommandReturnCode

InputFloat Configurations:
InputFloatRef
CommandParser

InputUInt Configurations:
InputUIntRef

OutputVoid Configurations:
TimedOutputBool
CommandExecuter

OutputBool Configurations:
OutputBoolToFloat
TimedOutputBool
CommandExecuterSwitch

OutputFloat Configurations:

OutputString Configurations:

NetworkReceiver Configurations:
NetworkReceiverHttpLib

NetworkSender Configurations:
NetworkSenderHttpLib

############# DEVICES ##############
Devices:

############# TRIGGERS ##############
Triggers:

############# SUBSCRIPTIONS ##############
Subscriptions:

Initializing devices

Initializing scheduler

Starting http server thread

Starting http server


IDE Live Logging for Device
I’ve opened the device’s config and verified everything in it including MAC plus tried to refresh it a couple of times yielding the below logging:
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:15:51 PM: debug Executing ‘refresh’
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:15:34 PM: debug Executing ‘refresh’
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:15:34 PM: debug Executing ‘updateDeviceNetworkID’ formattedMac == B827EBXXXXXX
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:15:34 PM: debug Executing updated()
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:04:26 PM: debug Executing ‘refresh’
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:04:26 PM: debug Executing ‘updateDeviceNetworkID’ formattedMac == B827EBXXXXXX
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:04:26 PM: debug Executing ‘configure’
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:04:25 PM: debug Executing ‘refresh’
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:04:25 PM: debug Executing ‘refresh’
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:04:06 PM: debug Executing ‘refresh’
186b9fea-8f78-4bc1-87d3-xxxxxxxxxxxx 1:04:06 PM: debug Executing ‘refresh’

Any suggestions? Thanks!

Update
I realized when reviewing that I had entered the IP of my RasbPi in the config and not the hub which is .200. I updated the config, restarted the web server, but got the same results :frowning:

Hi Ben,

It looks like you built OmniThing with the linux build target rather than the rpi target (this is why it doesn’t know how to handle the DHT or any GPIOs). If you rebuild it with cmake . -DBUILD_TARGET=rpi I think it will work properly for you.

That said, I highly recommend installing OmniThing on the raspberry pi using the package manager. This is described under “Installation Instructions” in the README. The advantage with this method is that you’ll receive updates every time you run apt update && apt upgrade if there has been a new OmniThing release. Building it from source yourself is only really beneficial if you are planning to make your own changes to the source code (or if you just prefer building from source).

1 Like

Hello,
I used Omnithing, it work fine.

Do you think add some device handler or insert the possibility to declare your own device handler in the Web Site?

For example; how to simulate a latch key for a doorgate?
Regards

Can you give more details on what you’re trying to achieve? Is it not something that can be modeled by the switch or contact sensor device types?

Dynamic device types can’t really be supported, since it would require a new groovy device handler per type.

Version 0.8.0 has just been released:

  • 0.8.0
    • Added CommandExecuterFloat OutputFloat type
      • sets the environment variable “OMNITHING_FLOAT_VAL” to the float value prior to running command
    • Added DimmerSwitch device type and handler
  • 0.7.3
    • Fix apt warnings due to OmniThing rpi repo missing files
1 Like

Hello,

When I press the switch, I want it to stay on for 1 to 2 seconds before going back off

Regards

You can achieve this by creating a “Momentary” device. For the output, select the TimedOutputBool. It allows you to set the duration that it will turn on the OutputBool you give it before turning back off. In the app, your device will be a button you can press.

Does that do everything you need?

Hi,

Is there any solution for the “error Failed to create child device” reported by Ej3359 ?

I am having the same issue and for my case it also creates a new device on my smartthings app every time a new sensor data arrives.
Perhaps is due to the fact that it cannot find the child device and hence it’s creating a new one all the time.

I am using omnithing for raspberry pi.
Here is my config:
{
“NetworkReceiver”: {
“type”: “NetworkReceiverHttpLib”,
“port”: 39000
},
“NetworkSender”: {
“type”: “NetworkSenderHttpLib”,
“ip”: “192.168.1.15”,
“port”: 39500
},
“CompositePeriphs”: ,
“Devices”: [
{
“triggers”: [
{
“interval”: 30000,
“offset”: 0,
“command”: “poll”
}
],
“subscriptions”: [
{
“source”: “temperature”,
“event”: null,
“command”: “poll”
}
],
“type”: “TemperatureMeasurement”,
“name”: “temperature”,
“input”: {
“type”: “CommandParser”,
“command”: “/home/pi/applications/bin/temperature -x”
}
}
]
}

Any help ?

Have you tried completely removing the omnithing parent device and re-adding it? I’d also be sure to hit the configure button in the app for the parent device and re-saving the configuration settings. Sometimes that gets rid of strange errors related to child device creation.

Can you show me your SmartThings logs of the failure if that still doesn’t solve things?

Hi,

I’ve just started tackling my next ST challenge - grabbing data from a wifi SD card. I’m planning to use a windows server to sit in the middle - I was starting to write a device handler to post the data to the ST Hub, when I realised I was basically trying to re-write ST_Anything (which I’m already using very successfully), only for Windows.

Then I bumped in to this


So, I’m embarking on setting up for Windows, and I’ve hit my first snag - http://www.omnithing.net/ is saying “refused to connect” - is it down for a while?

Thanks,

James

1 Like

Hi James,

Yes, I recently had to reformat the webserver I’ve been running the site on, and I haven’t reconfigured it yet. It should be up within the next few days, and I’ll post here once it’s fixed.