[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

Only you know that for sure. From what you’ve mentioned so far, the ST Hub can communicate with the Wemos. However, the Wemos is not communicating with the ST Hub. Did you power cycle the ST hub like I asked earlier?

What you’re seeing in the Live Log is all information from the manually created Parent device.

So… within the ST Web IDE, there are multiple tabs across the top. One of those is labeled “Devices” (not Device Handlers). Within that page, you’ll see each and every one of your ST Devices. Clicking on the Parent device for the Wemos D1 mini that you manually added, you will see all of its details, including the settings that you manually added via the Classic ST Mobile App. These are the device details I was hoping you could share.

# servo Device  *servo*

Name servo
Label servo
Type Parent_ST_Anything_Ethernet
Version Self-Published
Device Network Id ECFABC4C487A
Status ACTIVE
Hub [Nygata 101 Hub](https://graph-eu01-euwest1.api.smartthings.com/hub/show/1ebcd5ca-4170-44d0-84c9-e66ae5a78ebd)
Last Activity At 2020-03-24 8:48 PM CET
Date Created 2020-03-24 8:46 PM CET
Last Updated 2020-03-24 8:47 PM CET
Data No data found for device
Current States * [numberOfButtons](https://graph-eu01-euwest1.api.smartthings.com/device/states/15c2937b-ff13-4994-a4ea-6f35bb7bff67?attribute=numberOfButtons):  **0**
Preferences ([edit](https://graph-eu01-euwest1.api.smartthings.com/device/preference?deviceId=15c2937b-ff13-4994-a4ea-6f35bb7bff67)) Name Type Value
--- --- ---
ip text 192.168.1.73
mac text ECFABC4C487A
numButtons number 0
port text 8090
Execution Location Cloud
Events [List Events](https://graph-eu01-euwest1.api.smartthings.com/device/15c2937b-ff13-4994-a4ea-6f35bb7bff67/events)
In Use By

I did power off\ON my hub.
But I forgot to check battery (I cant remember if I use battery) but if that is a critical step, I will go right now And power it off, and make sure battery is out also.

Thanks :slight_smile:

Edit: Power ON\Off again , and I dont use batteries.

So I got no clue why the parent cant create any child device. (if that is the problem)

What model ST Hub is it? I know the V2 Hub has a built-in battery backup (4 AA batteries) that need to be removed for a full power down.

With the Live Logs tab open, power cycle the Wemos D1 board and copy the results back here in the forum. You should see something assuming the sketch was modified correctly to point at the proper IP address of your ST Hub and that it is trying to send to port 39500 (not 39501 which is used by Hubitat.)

I got nothing in LIVE when rebooting the Wemos, so there must be a bad code.
I changed noting inside the code, only the step that is needed.

String str_ssid     = "********";                           //  <---You must edit this line!
String str_password = "******";                   //  <---You must edit this line!
IPAddress ip(192, 168, 1, 73);       //Device IP Address       //  <---You must edit this line!
IPAddress gateway(192, 168, 1, 1);    //Router gateway          //  <---You must edit this line!
IPAddress subnet(255, 255, 255, 0);   //LAN subnet mask         //  <---You must edit this line!
IPAddress dnsserver(192, 168, 1, 1);  //DNS server              //  <---You must edit this line!
const unsigned int serverPort = 8090; // port to run the http server on

// Smartthings / Hubitat Hub TCP/IP Address
IPAddress hubIp(192, *******);    // smartthings/hubitat hub ip //  <---You must edit this line!
const unsigned int hubPort = 39500; // smartthings hub port


// SmartThings / Hubitat Hub TCP/IP Address: UNCOMMENT line that corresponds to your hub, COMMENT the other
//const unsigned int hubPort = 39500;   // smartthings hub port
//const unsigned int hubPort = 39501;   // hubitat hub port

//******************************************************************************************

I reply myself again, I have maybe discovered a BAD IP adress on my hub ! maybe that is why…
Testing it out now.

OK… my bad !
I discovered that the IP of my HUB was not the same as my old script. not sure how that have happend.

But the Wemos is now communicating with my HUB (thank you for indicating THAT, and finding the source of the problem)

I can now enter my child device.
But LIVE logging is popping in with another ERROR:

21:08:52: error java.lang.NullPointerException: Cannot invoke method toInteger() on null object @line 87 (setLevel)

This is when I turn it ON\OFF or try to set dimmer to 50%

I got this "Child Device creating failed, Please make sure that “null” is installed and published)

I got the child device, so not sure what is happening here.

It would help to see the preceding live log lines as they should contain the data sent from the Wemos D1.

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: debug ECFABC4C487A-servo2 - name: servo, value: 0:90:2000

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: debug Parsing: servo2 0:90:2000

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: debug [name:rssi, value:-42, displayed:false, linkText:servo, descriptionText:servo rssi is -42, isStateChange:true]

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: debug Parsing: rssi -42

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: debug [name:rssi, value:-42, displayed:false, linkText:servo, descriptionText:servo rssi is -42, isStateChange:true]

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: debug Parsing: rssi -42

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: debug [name:servo1, value:0:90:2000, linkText:servo, descriptionText:servo servo1 is 0:90:2000, isStateChange:false, displayed:false]

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:07: error Child device creation failed with error = grails.validation.ValidationException: Validation Error(s) occurred during save():
- Field error in object 'physicalgraph.device.Device' on field 'deviceNetworkId': rejected value [ECFABC4C487A-servo1]; codes [physicalgraph.device.Device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique.error,device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.error.deviceNetworkId,device.deviceNetworkId.unique.error.java.lang.String,device.deviceNetworkId.unique.error,physicalgraph.device.Device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique,device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.deviceNetworkId,device.deviceNetworkId.unique.java.lang.String,device.deviceNetworkId.unique,unique.physicalgraph.device.Device.deviceNetworkId,unique.deviceNetworkId,unique.java.lang.String,unique]; arguments [deviceNetworkId,class physicalgraph.device.Device,ECFABC4C487A-servo1]; default message [{0} must be unique]

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:06: trace createChildDevice: Creating Child Device 'servo (servo1)'

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:06: debug isChild = true, but no child found - Auto Add it!

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:06: debug Parsing: servo1 0:90:2000

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:06: debug Parsing: servo2 0:90:2000

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:05: debug [name:servo1, value:0:90:2000, linkText:servo, descriptionText:servo servo1 is 0:90:2000, isStateChange:false, displayed:false]

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:05: error Child device creation failed with error = grails.validation.ValidationException: Validation Error(s) occurred during save():
- Field error in object 'physicalgraph.device.Device' on field 'deviceNetworkId': rejected value [ECFABC4C487A-servo1]; codes [physicalgraph.device.Device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique.error,device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.error.deviceNetworkId,device.deviceNetworkId.unique.error.java.lang.String,device.deviceNetworkId.unique.error,physicalgraph.device.Device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique,device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.deviceNetworkId,device.deviceNetworkId.unique.java.lang.String,device.deviceNetworkId.unique,unique.physicalgraph.device.Device.deviceNetworkId,unique.deviceNetworkId,unique.java.lang.String,unique]; arguments [deviceNetworkId,class physicalgraph.device.Device,ECFABC4C487A-servo1]; default message [{0} must be unique]

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:05: trace createChildDevice: Creating Child Device 'servo (servo1)'

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:05: debug isChild = true, but no child found - Auto Add it!

[15c2937b-ff13-4994-a4ea-6f35bb7bff67](https://graph-eu01-euwest1.api.smartthings.com/ide/logs#15c2937b-ff13-4994-a4ea-6f35bb7bff67) 21:16:05: debug Parsing: servo1 0:90:2000

In the child servo device, configure its device settings. That should fix the .toInteger error.

1 Like

HAH ! :slight_smile:

It moves, it also move accordingly to the dimmer settings (I did not hope for that but YES)
After my self created problems you helped me to fix this.
Thank you very much, this save me alot of coding from arduino\sonoff\relay and more.

I can now control the servo from inside my ST with only a tiny wemos and 5v. ! wow !

I can share my project :slight_smile: my kid (5 year) have made I tiny tiny snowman.
I 3D print a tiny house, and then I use IFTTT and Weather Underground to give me report of SNOW next day.

IFTTT --> Snow —> Telling ST to move servo —> Servo is spinning the snowman outside to indicate that it will be snow :slight_smile:

I also have a cloud that will appear if there is rain, and a SUN (only a LED) turning ON if IFTTT report sun the next day.

All this would not be possible without your code
So thank you again for making this possible.

1 Like

Awesome, so glad it’s working.

1 Like

Everything works very well.
But I get this error every 2 minute.
Even the child is working.
Why is it trying to add one more?

I checked my device handlers in IDE, and there is double of all.
It’s also double of the Parent-St, can that do any trouble?

You should have ONE Parent Device for each Arduino/ESP8266 board. Each Parent Device will create a Child Device for each of the devices you have defined in your sketch.

Based on all of the various troubleshooting activities you’ve performed, you may have some duplicates. I would suggest deleting the Parent devices (not the Device Handler, the Device) for the new Wemos D1 board. That will also remove its child devices. Once you have things cleaned up, manually add the Parent Device again and configure it. The Child Devices will be created automagically and all should be well.

This is just a guess on my part. The specific error message shown above is not something I have seen before.

1 Like

I am having a new issue with some code I have been previously using. I am using the ST_anyting to measure the temperature from 2 DSB1820 sensors with an ESP8266 NodeMCU 12e. The temperature is read from the smartthings app and displayed on an OLED display. I have made 5 of these and they have been working fine. I used the same code as the last build and updated the ip address and other pertinent info for this new build. I am able to upload and run the code however after it connects to the router and takes one measurement it stops. I expect to see periodic readings from the serial plotter but it hangs until I reset. The ESP8266 is a different brand then the other builds. Is there something brand specific that I should do with the code or setting up the board? Is there a change tot he code that I am not aware of? The last line reads pm open type 2.0, The serial monitor output is:
19:47:41.518 -> RSSI = -50
19:47:41.518 -> hostName = ESP8266_840D8EA5796C
19:47:41.518 ->
19:47:41.518 -> SmartThingsESP8266WiFI: Intialized
19:47:41.518 ->
19:47:41.518 -> Disabling ESP8266 WiFi Access Point
19:47:41.518 ->
19:47:41.518 -> ArduinoOTA Ready
19:47:41.518 -> IP address: 192.168.1.500
19:47:41.518 -> ArduionOTA Host Name: ESP8266_840D8EA5796C
19:47:41.518 ->
19:47:41.518 -> Everything: init ended
19:47:41.551 -> Everything: Free RAM = 47808
19:47:41.551 -> Everything: adding sensor named temperature1
19:47:41.551 -> Everything: Free RAM = 47808
19:47:41.551 -> Everything: initDevices started
19:47:41.551 -> Everything: Free RAM = 45864
PS_DS18B20_Temperature::Requesting temperatures…DONE
19:47:42.055 -> PS_DS18B20_Temperature:: Temperature for the device # 1 is: -196.60
19:47:42.055 -> PS_DS18B20_Temperature:: Temperature for the device # 2 is: -196.60
19:47:42.055 -> Everything: Sending: temperature11 -196.60
pm open,type:2 0

Any insight is appreciated.

Thank you,

Chris

This is not normal. ST_Anything did not generate this Serial Monitor debug. I am not sure where it is coming from. Which version of the ESP8266 Arduino Board Manager are you using? How about the version of the Arduino IDE?

I am still using Arduino IDE 1.8.10 and ESP8266 2.6.2.

I am using ESP8266 2.6.3 and Arduino IDE 1.8.6. Before I posted here I tried searching for pm open,type:2 0 and I could not find much info. I tried removing the code for the wifi to see if it was a router issue. Obviously, it didn’t work as intended but I did not get the pm open, type:2.0.

Chris

Try reverting the ESP8266 Board Manager to 2.6.2 and see if that helps. Just a guess…

Im sure this might have been asked before but im having a hard time finding the answer

I would like a button that runs local on the esp to trigger the time relay.

I am using as a door lock and would like the request to exit button be as fast as possible.
right now i run a button that tells smartthings to turn on the time relay but it takes a second or two witch is annoying when standing at the door waiting to open.
Thanks in advance.

There is an example sketch in the GjtHub repo that demonstrates the use of a local momentary push button with a normal switch device. You should be able to easily tweak that sketch to used a timed relay instead.

thanks!! ill have a look at this and see what i can get going!

Forgive me … i have limited knowledge in this i have changed up the code but receive an error.
cannot convert ‘st::S_TimedRelay*’ to ‘st::EX_Switch*’ in assignment