Giter VIP home page Giter VIP logo

st_anything's People

Contributors

bdwilson avatar bryant1410 avatar cookejames avatar danielogorchock avatar ddeloachwg avatar dennypage avatar indianaalbers avatar ingenium13 avatar jdeltoft avatar jonathanweinberg avatar lukmas avatar maksymovi avatar mikey887 avatar moosty-moo avatar ogiewon avatar ryancasler avatar vseven avatar zeron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

st_anything's Issues

Child devices not auto creating

After testing the NodeMCU, I've written some code and changed devices around.
Went to install and I am not getting any child devices created.
The Adrunio monitor and smartthings logs see temperature and buttons pressed and when I change settings these show in the device.
Ive tried uninstalling the parent and reinstalling but to no avail.

The Live Logging shows responses...

13:59:46: debug [name:temperature1, value:22, isStateChange:false, displayed:false, linkText:Alarm Panel, descriptionText:Alarm Panel temperature1 is 22]
13:59:46: debug isChild = true, but no child found - Auto Add it!
13:59:46: debug Parsing: temperature1 22
13:59:43: debug [name:button, value:pushed, data:[buttonNumber:1], descriptionText:button 1 was pushed , isStateChange:true, displayed:true, linkText:Alarm Panel]
13:59:43: debug Parsing: button1 pushed
13:59:30: debug [name:temperature1, value:22, isStateChange:false, displayed:false, linkText:Alarm Panel, descriptionText:Alarm Panel temperature1 is 22]
13:59:30: debug isChild = true, but no child found - Auto Add it!

Is this all due to the background changes??
Any thoughts?

Children not loading

I am also having an issue with Child Devices not listing under the Parent in the SmartThings webpage. I have tried the following:
Removing the Parent and all Children, rebooting the hub, removing all items from GitHub and reassigning them to my SmartThings hub. I am seeing that the refresh is causing the code in Arduino to refresh, but my individual smartThings "children" never add back into the device listing or under 'child devices"

How do I manually add a device back into a parent in the "My Devices"?

DHT22 DHT Timeout Error

I am getting a timeout error witha DHT 22 sensor. If I use the Adafruit DHT22 library, the sensor works fine. Any Ideas?

ESP32 thinks wifi is not connected, fails to start

I just flashed st_anything to my esp32 (using the sample st_anything_multiples_esp32wifi sketch), but it seems to not recognize that it's connected to wifi. The following shows in my serial monitor, with debug level set to verbose:

entry 0x40078a58
Everything: init started
Everything: Free RAM = -1
Disabling ESP32 WiFi Access Point

[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 2 - STA_START
[WiFi-event] event: 2
ESP32 station start

Initializing ESP32 WiFi network.  Please be patient...
Attempting to connect to WPA SSID: MUSHROOM-2.4
.......[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 7 - STA_GOT_IP
[WiFi-event] event: 7
WiFi connected
IP address: 
192.168.42.34
[D][WiFiGeneric.cpp:293] _eventCallback(): Event: 7 - STA_GOT_IP
[WiFi-event] event: 7
WiFi connected
IP address: 
192.168.42.34
....what is taking so long?
...........what is taking so long?
...........what is taking so long?
...........what is taking so long?
...........what is taking so long?
...........what is taking so long?
...........what is taking so long?

I can ping the esp32's IP from other devices on my network no problem. Looking at the code in SmartThingsESP32WiFi.cpp on line 135, it seems that this is caused by "WiFi.status() != WL_CONNECTED" always being true so it never exits the loop. However, wifi is indeed connected, and the device is accessible over the network.

Adding a line to print WiFi.status() returns 6, which seems to correspond to WL_DISCONNECTED.

Edit: Setting the sketch to use DHCP rather than a static IP causes it to work correctly.

Arduino ST Anything Requires Reboot Periodically - Stops Communicating Status

I have an Arduino Mega loaded with Ogorchock's ST Anything code (awesome BTW) to monitor dry contact sensors. The interface/communication with ST hub is via W5300 Ethernet shield. I've discovered that I periodically (every 1-4 days) have to reboot the Arduino due to failure to update contact sensor status. The Arduino shows active TX/RX, but ST app does not reflect current state. Once reboot occurs, system works flawless until the mentioned time lapses and then requiring another reboot. Is there a way to debug this issue or has anyone else experienced this problem?

Child creation failed

Hi,

As suggested in the title, I could not get any children to be created. Some info:

Board: Sonoff Basic ESP8266EX
Code Changes in Sketch: Only some to get pin assignments correct and some blink code to test. See attached. Any help would be appreciated. Thanks!
sketch.txt

The following is the log.

ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: error grails.validation.ValidationException: Validation Error(s) occurred during save():

  • Field error in object 'physicalgraph.device.Device' on field 'deviceNetworkId': rejected value [68C63A8B4187]; 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,68C63A8B4187]; default message [{0} must be unique]
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug Using ip: 192.168.2.230 and port: 8090 for device: ea0eff65-6229-4e01-b151-a1db54ff0be1
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug Executing 'sendEthernet' refresh
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug Executing 'refresh()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug setting deviceNetworkID = 68C63A8B4187
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug Executing 'updateDeviceNetworkID'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug Using ip: 192.168.2.230 and port: 8090 for device: ea0eff65-6229-4e01-b151-a1db54ff0be1
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug Executing 'sendEthernet' refresh
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:28 PM: debug Executing 'refresh()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:25 PM: debug Hub Port = 39500
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:25 PM: debug Hub IP Address = 192.168.2.140
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:25 PM: debug Executing 'updated()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:11 PM: debug Using ip: 192.168.2.230 and port: 39500 for device: ea0eff65-6229-4e01-b151-a1db54ff0be1
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:11 PM: debug Executing 'sendEthernet' refresh
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:43:11 PM: debug Executing 'refresh()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:37 PM: debug Using ip: 192.168.2.230 and port: 39500 for device: ea0eff65-6229-4e01-b151-a1db54ff0be1
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:37 PM: debug Executing 'sendEthernet' refresh
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:37 PM: debug Executing 'refresh()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:24 PM: debug Executing 'sendEthernet' refresh
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:24 PM: debug Using ip: 192.168.2.230 and port: 39500 for device: ea0eff65-6229-4e01-b151-a1db54ff0be1
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:21 PM: debug Hub Port = 39500
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:21 PM: debug Hub IP Address = 192.168.2.140
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:21 PM: debug Executing 'updated()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:21 PM: debug Executing 'updated()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:03 PM: error grails.validation.ValidationException: Validation Error(s) occurred during save():
  • Field error in object 'physicalgraph.device.Device' on field 'deviceNetworkId': rejected value [68C63A8B4187]; 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,68C63A8B4187]; default message [{0} must be unique]
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:03 PM: debug Using ip: 192.168.2.230 and port: 8090 for device: ea0eff65-6229-4e01-b151-a1db54ff0be1
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:03 PM: debug Executing 'refresh()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:03 PM: debug Executing 'sendEthernet' refresh
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:03 PM: debug Executing 'updateDeviceNetworkID'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:03 PM: debug setting deviceNetworkID = 68C63A8B4187
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:00 PM: debug Hub Port = 39500
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:00 PM: debug Hub IP Address = 192.168.2.140
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:42:00 PM: debug Executing 'updated()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:41:49 PM: debug Using ip: 192.168.2.230 and port: 8090 for device: ea0eff65-6229-4e01-b151-a1db54ff0be1
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:41:49 PM: debug Executing 'sendEthernet' refresh
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:41:49 PM: debug Executing 'refresh()'
    ea0eff65-6229-4e01-b151-a1db54ff0be1 5:41:49 PM: debug Executing 'refresh()'

Documentation Links and Additions?

Hello,

This looks like an awesome library, referenced by several projects. I'm still a little unclear on the exact architecture and operation however, and was curious if you could post some additional links that could address a few of these questions?

Just for context, my goal is to create a LAN device with a set of push buttons that can be used to trigger ST apps.

  1. Does ST detect this as a LAN device?
  2. Can this library be used to generate the "Button Press/Hold" events to the ST hub that ST will recognize in the ST apps?
  3. Are their links to any explanation or diagram of your library, and the "flow" of how it's working?
  4. Does everything route through the cloud?

I'm not sure that I'm even on track, but I'm very familiar with LAN communications, web services, and the Arduino/Ethernet/ESP8266 development world. I"m mostly unclear about how I can create a device that can interact with the ST hub locally on my LAN ... or can I?

Unable to compile

I'm trying to compile ST_Anything. But, I get the following error:

ST_Anything:93: error: 'namespacest' does not name a type
void setup()
^
exit status 1
'namespacest' does not name a type

Thingsshield - Dont see functioning buttons on phone

Loaded everything on an Uno, no errors, I only see "Refresh, Configure, and text called "1 buttons" because that's all I loaded on the seetings on App. Configure doesnt do anything.

I previously had Thingsshield running on the uno but with totally different code (examples online).

thanks

ESP32 WiFi Disconnect / Reconnect

So it turns out not only is the setAutoConnect(true) broke (which I think you knew) but the reason its broke it because it calls WiFi.Begin. WiFi.Begin, if it doesn't instantly see the AP, clears out the SSID and password so sequential attempts fail. I've been going back and forth, as have other people, on the ESP32 GitHub about this for almost three months now. (espressif/arduino-esp32#653)

Long story short they said the only reliable way to do this is to use the following instead of WiFi.Begin:

WiFi.disconnect(true);
WiFi.begin(ssid, passwd);

per the post here: espressif/arduino-esp32#653 (comment) . I was going to test this myself before putting in a pull request but wanted to give you a heads up.

Hub Version?

I tried finding this somewhere in the forum and your documentation, so I apologize if I'm blind and missed it, but does this only work on V2 hubs? or is it compatible with the original V1 hubs?

Trying to run the ST_anything_alarmpanel_ESP8266Wifi but only getting 1 way communication

Hi!

Brand new to this, and only been trying for about a week. I was able to follow instructions up to getting the sketch on my 8266, parent on my device list, and parents and children published on my device handlers. On the iPhone, I get the device "Test 1" which I have configured with IP and MAC. When I first start up the 8266 the serial console reports Everything: adding sensor named contact1, etc.

When I refresh device refresh button using the iPhone, I get messages on the serial console showing the status of the 5 contacts, alarm and free memory.

The problem is no child devices are created, and no messages appear to be coming back when from the device when I look on live logging. What should I try next?

Window Shade capability

I am looking to automate some roller blinds but it is very low level. Basically, ESP32 with a motor driver and a open and closed switch (probably hall sensors). I noticed ST has a Window Shade capability which would probably make sense for this application. I am new to ST_Anything and ST in general but I think I could get it working without too much fuss. Is there plans to have this capability or what do you think?

433MHZ Receiver

ability to add 433rx receiver and individually add the id's of each sensor. These sensors are super cheap and this would be a great addition.

RGBW Control - Send W as part of Hex or seperate command?

So the RGB device seems to work well and sends a standard color HEX through the new childSetColorRGB command in the parent. The question is for RGBW should it be a add on command called childSetColorRGBW or just a childSetWhiteLevel command? I would think the latter just so the color HEX can remain the standard #RRGGBB instead of having to send it as #RRGGBBWW. Either way its going to need another command (which is simple) and a new DTH that has a white level slider (already done...testing now).

Which would you guys prefer?

ENC28J60

Sorry wasnt really sure where else to ask, but is this ethernet interface supported? I tried to see if the ESP8266 would cover it but i came back with mixed answers.

if it is not supported what would it take to add support?

Thanks!

Can't get ESP8266 to show as "ThingShield"

For another project I am working on, I need my ESP8266 to be showing up as a "ThingShield" so I can change it's device handler to something else. How do I get it to do this? In your SmartThings Community Post, you said that it can be done through the Arduino\Sketches\ST_Anything Sketch. That sketch doesn't exist anymore. Any help is appreciated!

DHT library update

Newest stable version for both ARM + AVR processors (same as what you currently have but updated):

https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTstable

New version optimized for AVR (which fixed some of my issues):

https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTlib

Not sure if you could include both in your library and then in the PS_TemperatureHumidity files do a include based on processor architecture. Like if ARM add in DHTStable and otherwise add in DHTLib or something like that.

Support for PMW on ESP32?

Not really a issue but more of a FYI or possible improvement. As I was playing with the idea of controlling analog RGB lights I came across issues with AnalogWrite on the ESP32. I eventually figured it out and went on to try and create a RGB library based on your existing EX_Switch_Dim figuring it was the logical place to start (failing horrible but I'll keep trying). In your EX_Switch_Dim library I saw this:

#if defined(ARDUINO_ARCH_ESP32)
	if (st::Executor::debug) {
		Serial.println(F("EX_Switch_Dim:: analogWrite not currently supported on ESP32!"));
	}
#else
		analogWrite(m_nPinPWM, map(m_nCurrentLevel, 0, 100, 0, 255));
#endif

I have a fix if you want to implement it but there is a little setup and it can get messy so not sure if you want to bother or wait until they possible support a standard AnalogWrite (which I'm starting to doubt). But here is a short sketch that demonstrates using PWM on the ESP32 which you might be able to use since you are already checking for the existence of it:

uint8_t pwmPin = A4;
void setup()
{
// Attach the pin to a ledc "channel"
ledcAttachPin(pwmPin , 1);
// Set the channel frequency and resolution (12k hz and 8-bit here)
ledcSetup(1, 12000, 8);
}

void loop() {
//write a full on to channel 1
ledcWrite(1, 255);
delay(5000);
//write a full off to channel 1
ledcWrite(1, 0);
delay(5000);
}

There are 16 total channels for PWM so the above would work fine for one dimmer on a ESP32 but the second wouldn't work since the code would use the same channel. So the only way around that would be to have the ledc channel be a passed in as a optional variable when using a ESP32. (byte channelPWM maybe?)

I think that's what I'll have to do for a RGB device, pass in 3 pins and 3 optional channels for those pins. I'm also aiming to make my RGB device usable on both a ESP8266 that supports standard analogWrite and the ESP32 which does it like above so if a ESP32 it would do the assigning channels thing. At least that's the hope and use your code to determine if I'm on a ESP32 or not.

Simple Usage Question

So i'll start off by saying im not awesome with arduino but i am pretty decent at programming.

Im attempting to get the garage door setup working so I've followed the directions as best as possible and I've been able to get the unit up and running, with an IP and added in to smartthings with the devices available and apparently functioning.

I say apparently because according to the serial console its receiving and acting on commands but in the case of my garage door opener if i trigger it via the smart things app i see the serial monitor dump out state changes

Everything: Sending: doorControl1 closing
Everything: Sending: doorControl1 closed
Everything: Sending: doorControl1 open

It goes right back to open due to it being in a testing state on my desk (but it still sorta feels wrong), but from this i at least know that communication is all set.

So at this point I would expect to hear my relays trigger, but nothing.

For the code really all i did was rip out the unneeded stuff, essentially removing the pin variables and sensor interrupts.

//Define which Arduino Pins will be used for each device
//... RESERVED pins left alone
//Garage Door Pins
#define PIN_DOORCONTROL_CONTACT_1 6 //SmartThings Capabilty "Door Control"
#define PIN_DOORCONTROL_RELAY_1 7 //SmartThings Capabilty "Door Control"
#define PIN_DOORCONTROL_CONTACT_2 8 //SmartThings Capabilty "Door Control"
#define PIN_DOORCONTROL_RELAY_2 9 //SmartThings Capabilty "Door Control"
...
//Interrupt Sensors
static st::IS_DoorControl sensor15(F("doorControl1"), PIN_DOORCONTROL_CONTACT_1, LOW, true, PIN_DOORCONTROL_RELAY_1, LOW, true, 1000);
static st::IS_DoorControl sensor16(F("doorControl2"), PIN_DOORCONTROL_CONTACT_2, LOW, true, PIN_DOORCONTROL_RELAY_2, LOW, true, 1000);

So these were how it was in the repo, so, no big deal wired it based off those pin numbers. I currently have both relays and one button on 6 (meaning door 2 wont have the correct state, but for testing i dont care)

If I press the button i added, i would have expected the door state to change from open to closed, but no go on that either and no serial output.

Am I foolishly assuming the logic for these types of devices are there some place or do I have to write the logic for it? based on reading the repo and stuff it sort of seems like i just need to clean up the code and wire it up and the challenge should be with getting it added to the smart things app.

Arduino Wiring
https://photos.app.goo.gl/tfHJCDkG5Bjl140o2

Memory leak in polling sensor causing esp8266 to lock up

It seems there's a memory leak with the esp8266 when using a polling sensor. I'm using the ST_Anything_Multiples_ESP8266Wifi sketch with a single polling sensor as temphumid1.

When I add the polling sensor with an interval of once per minute, it leaks about 200-350 bytes per minute. Changing the poll interval to 15 seconds leaks 400-600+ bytes per minute. 5 minute interval leaks 50-200 bytes per minute (~50 bytes when there's no poll, ~200 bytes when a poll occurs). The esp8266 locks up once it has under 4KB free.

Debugging this is complicated by the fact that I just submitted a new pull request to add support for the Si7021 temperature and humidity sensor, and that's the only polling sensor I have to test with. The code is the existing DHT temperature and humidity code, with the addition of the Adafruit Si7021 class used in place of the DHT class. The Si7021 uses I2C to communicate.

Possible causes:

  • Arduino/esp8266 I2C library is leaking memory behind the scenes
  • Polling code is leaking memory
  • Si7021 library from Adafruit's github is leaking memory
  • Original ST_Anything_TemperatureHumidity code is leaking memory

I can attach the sketch I'm using if it would help. The same sketch (1 executor and 0 sensors) worked fine before I added the polling sensor.

Are there any tools that can debug what is actually consuming the memory? Do other polling sensors exhibit a similar issue on the esp8266? Are String objects perhaps causing the memory leak?

comm issue between Mega/ESP01 and Smartthings Device

I'm using a Mega with an ESP01. I've fired them up and verified them with AT commands and am now trying to use ST_Anything_Multiples_MEGAWiFiEsp.ino and run it with Smartthings. It connects to the access point (with a static IP) and initializes all the sensors, but reports errors every time it tries to send a message:
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] Data packet send error (1)

I can ping the ESP01 fine.

I have a device added, using the Parent_ST_Anything_Ethernet Device handler and the corresponding IP address, port, MAC and buttons configured on my mobile device. The Parent device seems to run OK, based on the Event log, but does not try to add any Child devices.

Any suggestions?

Button capability with analog input (for doorbell)

This project has everything needed but Arduino/Groovy is not my area of expertise. From reviewing the code and some testing the PS_Water and PS_Generic, they have the basis for sensing when my doorbell is pressed but those don't tie into the correct Groovy/Smartthings to map to a button press within Smartthings. IS_Button has the capabilities needed to track and sense a button being pressed but it ties to a digital input.

Would it be possible to tie a PS_Generic to an IS_Button or make a new hybrid type to handle this use case? I think others likely had some older components they want to integrate.

Virtual button press from digital logic

Let me start by saying thank you so much for all of your development. I definitely owe you guys a drink. It has been very helpful for me in getting started with all of my custom sensors and controllers. I am more of a hardware guy, so some of the programming is a little fuzzy. Is there a way currently to send a button state based off of logic? In my case, I have created a button panel of capacitive buttons. I would like to be able to toggle a variable to true and have it send a button push command to ST. I have gotten around it by assigning a pin to the value and reading the pin, but that's not very efficient especially when using the 8266.

Custom sensor types

I'm using ESP8266 with more than one analog sensor. So I use multiplexing (something like this). This means that in order to poll value from A0, I have to set another pin to HIGH, then do analog read.

I'm wondering what should I do in this case with the ST_Anything library. Should I create a new device type? For example, PS_Custom_Water, with the edited getData code:

	void PS_Custom_Water::getData()
	{
		digitalWrite(WATER_PIN, HIGH);
		int m_nSensorValue = analogRead(m_nAnalogInputPin);
		...

How would the link and automatic population of sensors on the SmartThings side be affected if I created a new sensor type. I'm not sure if there's a better way... and I don't think I really understand this:

//******************************************************************************************
  //Declare each Device that is attached to the Arduino
  //  Notes: - For each device, there is typically a corresponding "tile" defined in your
  //           SmartThings Device Hanlder Groovy code, except when using new COMPOSITE Device Handler
  //         - For details on each device's constructor arguments below, please refer to the
  //           corresponding header (.h) and program (.cpp) files.
  //         - The name assigned to each device (1st argument below) must match the Groovy
  //           Device Handler names.  (Note: "temphumid" below is the exception to this rule
  //           as the DHT sensors produce both "temperature" and "humidity".  Data from that
  //           particular sensor is sent to the ST Hub in two separate updates, one for
  //           "temperature" and one for "humidity")
  //         - The new Composite Device Handler is comprised of a Parent DH and various Child
  //           DH's.  The names used below MUST not be changed for the Automatic Creation of
  //           child devices to work properly.  Simply increment the number by +1 for each duplicate
  //           device (e.g. contact1, contact2, contact3, etc...)  You can rename the Child Devices
  //           to match your specific use case in the ST Phone Application.
  //******************************************************************************************

On another note, would it be possible to specify what prefix we'd like to use for the individual sensors ("X" instead of "ST", for example).

Thanks!

Cannot remove motion tile

as soon as I comment out "standardTile("motion"" in the device handler groovy line 89, the "arduino thingshield" is removed from the app. it seems like it's defaulting to a motion device, and therefore if there's no motion, no device.

Ay ideas what I'm missing here?

TCP messages

Hi
This is great and I have it all working with Smartthings and a ModeMCU board. I can do all sorts of switching and sensing in minutes.
What I want to do is create a way to send a Telnet message to a device like the TV to turn it off.
I have some base code for that and it works.
However, I am not sure of the best way to integrate it into your software and I am getting errors when I create a new switch (as an executor) with a different name so I can modify within that setting.
Can you add some instructions on how I can create a new executer or whether I should just add code in an existing switch to run extra code. (which it looks like would be in the EX_switch.h where I would call my new functions for the telenet call)

thanks
R.

Ardunio with smart things controlling 2 outputs

I'm having trouble with getting 2 outputs to work on the ardunio from the ST mobile platform. I'm not a programmer but I'm pretty certain that my code is correct. I think my trouble is in the device handler. Is it possible to have 2 outputs controlled by the same device handler? I can easily get one or the other to work but not both at the same time. I diffidently don't completely understand how the communication works between the mobile platform to the hub to the ardunio.

metadata {
definition (name: "Randall Shield", namespace: "smartthings", author: "SmartThings") {
capability "Actuator"
capability "Switch"
capability "Sensor"
}

// Simulator metadata
simulator {
	status "on":  "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
	status "off": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666"

	// reply messages
	reply "raw 0x0 { 00 00 0a 0a 6f 6e }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
	reply "raw 0x0 { 00 00 0a 0a 6f 66 66 }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666"
}

// UI tile definitions
tiles (scale: 2){
	standardTile( "switch", "device.switch", width: 3, height: 3, canChangeIcon: true, canChangeBackground: true) {
	state "on", label: 'On', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
	state "off", label: 'Operate Right Door', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
	}
    
   standardTile( "switch2", "device.switch", width: 3, height: 3, canChangeIcon: true, canChangeBackground: true) {
	state "onr", label: 'On', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
	state "offr", label: 'Operate Left Door', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
	}
    

	standardTile("contact", "device.contact", width: 3, height: 3) {
		state "open", label: '${name}', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
		state "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
	}
	
    standardTile("contact", "device.contact", width: 3, height: 3) {
		state "open", label: '${name}', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
		state "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
	}


	main "switch"
	details  "switch" , "switch2", "contact" , "contact2" 
}

}

// Parse incoming device messages to generate events
def parse(String description) {
def value = zigbee.parse(description)?.text
def name = value in ["on","off"] ? "switch" : null
def result = createEvent(name: name, value: value)
log.debug "Parse returned ${result?.descriptionText}"
return result
}

// Commands sent to the device

def on() {
zigbee.smartShield(text: "on").format()
}

def off() {
zigbee.smartShield(text: "off").format()
}

def onR() {
zigbee.smartShield(text: "onr").format()
}

def offR() {
zigbee.smartShield(text: "offr").format()
}

SmartThingsESP8266WiFi::send(String message) taking about 30 seconds to respond...

I have been successfully using ST_Anything for a few weeks. In the last few days, since I connected a second hub in another location, all my ST_Anything devices are not responding. Tracing this through the code,
there is a 30 delay in running the st_client.println command in SmartThingsESP8266WiFi::send(String message).
This results in my loop running every 30 seconds or so which of course means that it appears that everything hangs...
Any ideas?

Cant compile?

I've had working Thingsshield for awhile now, and trying to find better Smartthigns control, came across this. And I always seem to have problems getting Arduino code to compile from Github. What do you think Im doing wrong?

I copied all of the Shield Library.zip and ST_Anything-master.zip to the Libraries and Sketches folder, and am running Arudino 1.8.5 as well. Thanks for any help on this!

Arduino: 1.8.5 (Windows 10), Board: "Arduino Mega ADK"

C:\Users\Main\Documents\Arduino\Sketches\ST_Anything_Multiples_Thingshield\ST_Anything_Multiples_Thingshield.ino: In function 'void setup()':

ST_Anything_Multiples_Thingshield:259: error: no matching function for call to 'st::SmartThingsThingShield::SmartThingsThingShield(int, int, void (&)(String))'

 st::Everything::SmartThing = new st::SmartThingsThingShield(pinRX, pinTX, st::receiveSmartString);               //Software Serial

                                                                                                 ^

C:\Users\Main\Documents\Arduino\Sketches\ST_Anything_Multiples_Thingshield\ST_Anything_Multiples_Thingshield.ino:259:101: note: candidates are:

In file included from C:\Users\Main\Documents\Arduino\Sketches\ST_Anything_Multiples_Thingshield\ST_Anything_Multiples_Thingshield.ino:65:0:

C:\Users\Main\Documents\Arduino\libraries\SmartThings/SmartThingsThingShield.h:140:3: note: st::SmartThingsThingShield::SmartThingsThingShield(HardwareSerial*, void (*)(String), String, bool, int)

SmartThingsThingShield(HardwareSerial* hwSerialPort, SmartThingsCallout_t *callout, String shieldType = "ThingShield", bool enableDebug = false, int transmitInterval = 1000);

^

C:\Users\Main\Documents\Arduino\libraries\SmartThings/SmartThingsThingShield.h:140:3: note: no known conversion for argument 3 from 'SmartThingsCallout_t {aka void(String)}' to 'String'

C:\Users\Main\Documents\Arduino\libraries\SmartThings/SmartThingsThingShield.h:92:8: note: st::SmartThingsThingShield::SmartThingsThingShield(const st::SmartThingsThingShield&)

class SmartThingsThingShield: public SmartThings

    ^

C:\Users\Main\Documents\Arduino\libraries\SmartThings/SmartThingsThingShield.h:92:8: note: candidate expects 1 argument, 3 provided

exit status 1
no matching function for call to 'st::SmartThingsThingShield::SmartThingsThingShield(int, int, void (&)(String))'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Wondering about Presence Indicator

I have created a usb based esp8266. This will plugin to the usb port on to let me know when the tv is on. I was thinking a presence indicator would be a good fit. The thing to remember is when tv is off the sensor would be off, too.
Super simple device to see if the older kids turned off tv when you asked them to. ;-)

Ideas?

ESP32 WiFi compile issues

So I downloaded a fresh copy of the ST_Anything libraries and I cannot get existing sketches to compile against a ESP32 when the disconnectCounter is a member variable. I can get it to compile when the variable is defined within the cpp file but not in the header file like in my original commit. I'm not sure why or if I'm doing something wrong. I tried compiling against both a ESP32 DeV Module and a Node32s with the same error messages.

Moving it back to the cpp (whether right or wrong) allows it to compile and work properly.

ESP8266 with Relay Shield and IC2

I'm still learning all about Arduino, ESP8266, shields, etc and would appreciate some pointers/insights to see if I'm going in the right direction.

I'm using the following equipment:

  1. Wemos D1 Mini Pro
  2. Relay shield
  3. HC-SR501 PIR
  4. Wemos OLED Shield

I can get the Wemos D1 working with the relay shield and the PIR sensor. I'm struggling a bit to incorporate the OLED shield.

My thought process was this:

  1. In ESP8266_Wifi example, I disabled everything but sensor6 (relay) and executor2 (switch)
  2. I added 3 modules for the OLED shield
#include <Wire.h>  // Include Wire if you're using I2C
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>


  // and then Initialize WEMOS D1 mini Pro
  // D1 IO, SCL GPIO5 (original)
  // D2 IO, SDA GPIO4 (original)
  // D6 IO, GPIO12
  // D7 IO, GPIO13
  Wire.begin(12,13); //sda_pin D6 ,scl_pin D7

This works based on this post.

Am I heading down the right path? I was going to ask this, but my code is working great and all three components are acting as expected!

So my next question is how can I access the status of the switch/motion sensor? EG:

Everything: Sending: motion1 active
Everything: Sending: motion1 inactive
Everything: Received: switch1 on
EX_Switch::beSmart s = on

I'd like to ultimately have a timer that counts down 10 minutes since the motion sensor was last active (probably through a WebCore Piston) and display the sensor status/time remaining on the OLED screen. Just not really sure where to start with this one. Is there something like st::Everything::getStatus?? or is it better to just read the pin state directly (something like state = digitalRead(5);?

Thanks!
Tag

Gate control signal?

I have been playing with the IS_DoorControl device. We have a gate that functions somewhat like a garage door, but its signal response seems to be different than your sample garage doors. The gate takes around 20 seconds to close. Here's the signal input we have:

  • Open: 0V
  • Closed: +5V
  • Opening (going from closed to open): 0V
  • Closing (going from open to closed): blinking in a square wave with period 1 second, between 0V and +5V for 20 seconds while the gate is moving

How would you recommend altering the code to make this have the correct status (open/closed/opening/closing) shown on SmartThings? I made a custom IS_GateControl device that currently works the same as the IS_DoorControl device, but I am not yet sure how I should alter it.

I have played with the math of using exponential moving averages and triggering a state change at some cutoff values, but that was in a Python script that simply checked to see if it would be possible. The event-driven nature of the ST_Anything code has made this a little more difficult since I don't have a timed loop.

If you have suggestions on how to implement an exponential moving average or triggering state changes manually, that would be helpful.

If I understood the signal input of the sample garage doors, that might also be helpful.

Thank you for your help!

comm issue between Mega/ESP01 and Smartthings Device - Good News!

This is round two, since we closed the original issue, but I found what looks like the real problem and a potential solution. I'm opening a new issue rather than the pull request, because the workaround I found didn't require any immediate code changes (although it might suggest some improvement).

I was really bothered by the fact that my timeouts happened every time the ESP01 tried to send data. You had intermittent success that I had been unable to reproduce, with the unmodified project. I will probably move to the ESP01 standalone at some point, but I figured I had to at least get something going with the ESP01 before moving on. It was configuring fine and opening the connection successfully, but would always get a timeout on every sendData call. I turned up the log message level and could see that the ESP01 was responding with "ERROR" [apparently to the AT+CIPSEND]. So I went back to a simple sketch where I could issue the AT commands myself and see them echoed with their responses. Sure enough, I had the same results - I could go as far as opening a connection, but I always got ERROR for a response. I also saw that the reason why it responded with ERROR (and hence, the <> on ST_Anything) was because the connection would close on its own before I could deliver the AT+CIPSEND call. This was not apparent from the ST_Anything log messages (I don't know if the driver wasn't watching for a response after it saw the initial OK or if it just didn't generate a log message).

Anyway, it was obvious that the ESP01 was not able to keep the connection open long enough to send data. I also saw some characters dropped in the Serial Monitor when the ESP01 was responding with larger messages. These started to suggest possible hardware issues.

I was reading up on the 8266 and had an Ah Ha moment while reading Neil Kolban's book on the ESP8266 (a great read in general). He points out that the current draw of the chip goes from microamps to a couple hundred milliamps when transmitting and suggests putting a 10 uF cap on the the 3.3V supply near the ESP01. I've seen major issues with devices whose load varied a lot less, so I added both a 220uF cap and a .1 uF decoupling cap at the ESP01 connector on my prototype shield. When I ran ST_Anything again, I still had timeouts on all transfers for quite a while, but saw it actually recover later on and then work occasionally. I figured I was on the right track, so I hooked up a scope and saw significant swings not only on the 3.3 line (I had built my own 5V -> 3.3V regulator on the shield), but also saw smaller, but still disturbing shifts on the ground level at the ESP01. This suggested a couple of potential contributors. I realized that the small wires I used to connect everything, while very short, were undersized for the current load and I was also aware that all the ground pin connections on my prototype shield are not actually connected together on that board (they rely on the fact that they are all connected on the Arduino [Mega] I was using).

So then I ran heavy bus wires between all the ground pins I was using and the various key points of circuitry subject to the load variations. I also increased the wire delivering 5V to my regulator and 3.3 to the ESP01. Now, when I ran ST_Anything, I still saw timeouts for the first few transfers, but it recovered and actually worked well most of the time, but still with occasional timeouts.

Being further encouraged, I grabbed a larger capacitor (3300 uF was what I had on hand) and soldered it directly to the GND & 3.3V pins of the ESP01. I ran ST_Anything again and it was successful from the start. I've run it now for most of an hour and only seen 4 timeouts. These timeouts are not on the first send to a new connection and appear to be more random. It does not try to reopen and re-send the data from that specific device, but moves on to the next one, which is probably fine if they are very occasional.

My takeaway is that Neil hit it on the head with his observation, and has probably even understated the concern. His book shows an ESP01 connected to a breadboard with long jumper wires. I suggest anyone connecting this or any similar board use a large cap near the device, pay close attention to the size and length of conductors in the ground path and don't rely on multiple pins to connect various grounds. I also plan a minor mod to my 3.3V supply to minimize voltage shift under widely varying loads and I'll find a physically smaller cap to put by the ESP01 and still does the job.

It might be worth considering a code change that will re-connect and re-send a child device's message if it doesn't succeed. at would also be good to catch the unintended close of the connection and add a log message for it.

Feel free to close this second issue - I just wanted to pass on what I found.

Cheers,

Addressable / Programmable LED Support Issues

So I've spent way too much time on this. I coded a programmable LED library based on NeoPixel and I believe its correct. But using it causes my ESP32 to crash during the assignment of colors to the LEDS. If I set it for a ridiculously low number, 5 to 10 leds, I can get it to work. I had two other ST forum members try it on a ESP8266 and they had similar results. One could assign and show the colors but it would crash randomly above 58 leds and the other could assign the colors but it crashed on the show command.

After lots of research I found things saying its because the WS2812 that NeoPixels library uses is very sensitive to timing so it disables interrupts which then causes a watchdog time out on the ESP32 and other chips. I tried to adapt the FastLED library with the same results. Test sketches using the libraries without WiFi enabled work.

I'm thinking its a combination of WiFi and the way ST_Anything works since the timing is so precise. If you have time please take a look and/or test it....I've hit the limit of my knowledge with this and I'm starting to lean twords its not possible.

https://github.com/vseven/SmartThings_VSeven/blob/master/Modified_ST_Anything_Libraries/EX_RGBAddressable_Dim.h

https://github.com/vseven/SmartThings_VSeven/blob/master/Modified_ST_Anything_Libraries/EX_RGBAddressable_Dim.cpp

https://github.com/vseven/SmartThings_VSeven/blob/master/Modified_ST_Anything_Libraries/ST_Anything_AddressableRGB_ESP8266WiFi.ino

You also need the NeoPixel library, I used the one installable through Arduino. For testing I used the existing "Child RGB Switch" handler although if this actually worked I'd re-write a DTH for it with more options.

If this ends up not being possible within the confines of ST_Anything I might make a stand alone program to do it that accepts HTTP commands, there are lots of examples of that, and code a device handler for it that just sends the commands. Wouldn't be as pretty but it should work.

EX_RGBW_Dim truncate on string to long conversion

I was testing with the EX_RGBW_Dim class and it looks like the conversion from the hex string to long truncates the "R" value to a maximum of 127, in my local I changed it to an unsigned long and resolved the problem.

Relay Pulses on Power-up

I'm not really sure if this counts as an "issue" but here it goes. As suggested in a previous issue post, I'm using a modified Sonoff device to control a garage door and get back status. I am using the DoorControl function to accomplish this. Its working almost perfectly.

My only is that when the power cycles on the device, it pulses the relay, causing the garage door to open up. I'm not sure if this is something I can change in the code to avoid this because a power fluctuation will essentially cause my garage door to open up.

Im mostly using the code from a DoorControl example, not changing any of the default inputs other than whats required. I need to know which part of the code to focus in to keep the relay from pulsing on power up.

Thoughts?

Buttons not creating

Hello,

I'm using the ST_Anything_Multiples_ESP8266WiFi.ino sketch on a Huzzah Feather 8266 board. Everything except the buttons are showing up in my SmartThings app.

Is there any reason why the button devices would not populate while everything else does? I have searched the ST forums and not found anyone else with this issue.

Help with setup // limiting child devices

Hi @DanielOgorchock,
Great job on this! I just built my first Wemos D1 mini Pro with a Relay shield and came across your library for integrating it with SmartThings.

I tested my setup with the example code for the relay shield and it works fine. I then used your ST_Anything_Multiples_ESP8266WIFi with my network settings but everything else as default.

This worked great and Switch 1 (sensor4) turns my relay on/off. All of that background is just to show you it works and I am very excited at how easy it is.

My question is this - what is the proper way to limit the number of child devices to just my relay? I've tried a number of things but this seemed the most logical.

  1. In the Sketch I commented out all other devices:
 //*****************************************************************************
  //Add each sensor to the "Everything" Class
  //*****************************************************************************
//  st::Everything::addSensor(&sensor1);
//  st::Everything::addSensor(&sensor2);
//  st::Everything::addSensor(&sensor3);
  st::Everything::addSensor(&sensor4); 
//  st::Everything::addSensor(&sensor5); 
//  st::Everything::addSensor(&sensor6); 
//  st::Everything::addSensor(&sensor7);  
//  st::Everything::addSensor(&sensor8);  
      
  //*****************************************************************************
  //Add each executor to the "Everything" Class
  //*****************************************************************************
//  st::Everything::addExecutor(&executor1);
//  st::Everything::addExecutor(&executor2);
  1. The Wemos logging shows 1 sensor added:
ArduinoOTA Ready
IP address: 11.11.11.aa
ArduionOTA Host Name: ESP8266_2C3AE84aaaaaa

Everything: init ended
Everything: Free RAM = 40976
Everything: adding sensor named button1
Everything: Free RAM = 40976
Everything: initDevices started
  1. In the config for the Device I set the number of buttons = 1.

However, no child devices are created as per the screenshot:

There is also nothing of interest in the ST Logging or the Wemos logging.

I also tried setting sensor4 to sensor1 in case they needed to be added in order, but that was the same result. Before I start trying to dig into the code and debug this myself, can you let me know if I'm barking up the right tree with my though process or if I should be trying to limit the child devices to just the switch in another method?

regards,
Tag

Callbacks for messages/events received?

I am adding ST integration to an existing ESP8266 program and it works fine, but I don't see a way to set up callbacks to handle actions initiated from the web (like a switch turning on/off). The gpio changes state, but local code to handle the state change isn't notified like it is for http requests/websocket messages, unless polling is added to loop() to check for state changes (unless I missed how to set this up).

A generic 'all-message' callback and something like msgRcvd(msg) and onChange(newVal) for switches, etc. would be useful to manage devices where 2-way control is possible.

WiFi Auto Configure & SSDP Support for Device Discovery

I have recently started a very similar project on ESP-01 microchips. However, I have some different features that might be useful to optionally enable so that users will not need to re-flash the device when WiFi or Network configurations change. These features can be summarized as follows:

  1. I am using the WifiManager library (https://github.com/tzapu/WiFiManager) to handle auto-configuration of the WiFi settings. This library allows the device to host an AP and, using a smartphone (or some other WiFi client), you can open a browser and be routed to a configuration page to join the desired WiFi network. This is similar to how WiMo and various other consumer devices are configured. Additionally, the device saves the credentials in flash and I also have a "reset" button that can be used to reconfigure the device if it needs to switch networks.

  2. To handle device discovery with SmartThings, I am using a custom SmartApp as a Device Manager to handle the SSDP requests and responses for adding new devices. When a new device is located, the user can select it and it will be automatically configured and it's Device Types will be added. The SmartApp uses an HTTP API to detect exactly which Device Types should be enabled.

With my project, I do have some issues that mostly stem around handling UPnP NOTIFY events. I am pretty sure that I must have a parent Device Type that receives all UPnP events and forwards them to the appropriate device. I think you have already seen this issue and solved it with the parent Device Type.

Anywho, in a nutshell, enabling these features would eliminate the requirement for static IP addresses to be assigned to all devices and the hub. I think this greatly simplifies configuration and deployment of new devices. I am open to thoughts on if/how these features might be included into this project. I am also happy to help move the process along with my knowledge on the matter.

Thanks!

Child device creation failed.

My code used to use the multiplexer, but I am trying to upgrade it to work with the new parent/child interface. I keep seeing the message:

"Child device creation failed. Please make sure that the 'null' is installed and published."

If I log the error message that is being caught, I get the following:
physicalgraph.app.exception.UnknownDeviceTypeException: Device type 'Child Contact Sensor' in namespace 'ogiewon' not found.

I have added this repository (https://github.com/DanielOgorchock/ST_Anything) to the SmartThings IDE and published the devices as instructed in the README.

I tried following the forum post here but I couldn't make any of those suggestions work:
https://community.smartthings.com/t/release-st-anything-v2-8-arduino-esp8266-esp32-to-st-via-thingshield-ethernet-or-wifi/77707

Like the user Isometric_Penguin who faced this problem, I cannot get "Live Logging" to work on my computer. I am not sure what browser settings they changed, but I have tried multiple browsers on multiple computers and still can't get "Live Logging" to work.

I created a minimal example with one contact sensor. The error is being thrown for my single contact switch (deviceName is contact, deviceNumber is 1). My Arduino sketch is below.

#include <SmartThingsThingShield.h>    //Library to provide API to the SmartThings ThingShield

// ST_Anything Library 
#include <Constants.h>       //Constants.h is designed to be modified by the end user to adjust behavior of the ST_Anything library
#include <Device.h>          //Generic Device Class, inherited by Sensor and Executor classes
#include <Sensor.h>          //Generic Sensor Class, typically provides data to ST Cloud (e.g. Temperature, Motion, etc...)
#include <Executor.h>        //Generic Executor Class, typically receives data from ST Cloud (e.g. Switch)
#include <InterruptSensor.h> //Generic Interrupt "Sensor" Class, waits for change of state on digital input 
#include <PollingSensor.h>   //Generic Polling "Sensor" Class, polls Arduino pins periodically
#include <Everything.h>      //Master Brain of ST_Anything library that ties everything together and performs ST Shield communications

#include <IS_Contact.h>      //Implements an Interrupt Sensor (IS) to monitor the status of a digital input pin

//Digital Pins
#define PIN_CONTACT_1             53  //SmartThings Capability "Contact Sensor"

void callback(const String &msg){}

void setup()
{
  static st::IS_Contact             sensor01(F("contact1"), PIN_CONTACT_1, LOW, true, 500);
  st::Everything::debug=true;
  st::Executor::debug=true;
  st::Device::debug=true;
  st::PollingSensor::debug=true;
  st::InterruptSensor::debug=true;

  st::Everything::callOnMsgSend = callback;

  //Create the SmartThings Thingshield Communications Object based on Arduino Model
  #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) || defined(ARDUINO_AVR_MINI)   //Arduino UNO, NANO, MINI
    st::Everything::SmartThing = new st::SmartThingsThingShield(pinRX, pinTX, st::receiveSmartString);      //Use Software Serial
  #elif defined(ARDUINO_AVR_LEONARDO)  //Arduino Leonardo
    st::Everything::SmartThing = new st::SmartThingsThingShield(&Serial1, st::receiveSmartString);  //Use Hardware Serial
  #elif defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560)  //Arduino MEGA 1280 or 2560
    st::Everything::SmartThing = new st::SmartThingsThingShield(&Serial3, st::receiveSmartString);  //Use Hardware Serial
  #else  
    //assume user is using an UNO for the unknown case
    st::Everything::SmartThing = new st::SmartThingsThingShield(pinRX, pinTX, st::receiveSmartString);               //Software Serial
  #endif  

  //Run the Everything class' init() routine which establishes communications with SmartThings
  st::Everything::init();
  
  //*****************************************************************************
  //Add each sensor to the "Everything" Class
  //*****************************************************************************
  st::Everything::addSensor(&sensor01);
  
  //*****************************************************************************
  //Initialize each of the devices which were added to the Everything Class
  //*****************************************************************************
  st::Everything::initDevices();
}

//******************************************************************************************
//Arduino Loop() routine
//******************************************************************************************
void loop()
{
  st::Everything::run();
}

Can't get DHT22/ESP8266 to fully work

Commenting out all sensors in ST_Anything_Multiples_ESP8266WiFi and adding:
static st::PS_TemperatureHumidity sensor1(F("temphumid"), 120, 10, PIN_TEMPERATUREHUMIDITY, st::PS_TemperatureHumidity::DHT22);

I do get good temp & humidity readings in the serial console:

...
Everything: init ended
Everything: Free RAM = 43344
Everything: adding sensor named temphumid
Everything: Free RAM = 43344
Everything: initDevices started
Everything: Free RAM = 43344
First time through Humidity)
First time through Termperature)
Everything: Sending: temperature1 75.56
ST_Anything Callback: Sniffed data = temperature1 75.56
Everything: Sending: humidity1 40.70
ST_Anything Callback: Sniffed data = humidity1 40.70
Everything: initDevices ended
Everything: Free RAM = 43216

But neither humidity nor temp do show up in the Smartthings app for this device. They don't show up as a state in the ST web IDE. Sometimes RSSI shows up as a state but sometimes it doesn't (when I remove and re-add the device). Humidity & Temp never do.

The log shows:

269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:46 PM: debug [name:rssi, value:-49, displayed:false, isStateChange:true, linkText:DHT22_1, descriptionText:DHT22_1 rssi is -49]
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:46 PM: debug Parsing: rssi -49
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:46 PM: debug Parsing: rssi -49
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:33 PM: debug [name:humidity1, value:40.70, isStateChange:false, displayed:false, linkText:DHT22_1, descriptionText:DHT22_1 humidity1 is 40.70]
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:33 PM: debug isChild = true, but no child found - Auto Add it!
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:33 PM: debug Parsing: humidity1 40.70
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:32 PM: debug [name:temperature1, value:75.56, isStateChange:false, displayed:false, linkText:DHT22_1, descriptionText:DHT22_1 temperature1 is 75.56]
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:32 PM: debug isChild = true, but no child found - Auto Add it!
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:32 PM: debug Parsing: temperature1 75.56
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:10 PM: debug [name:rssi, value:-44, displayed:false, isStateChange:false, linkText:DHT22_1, descriptionText:DHT22_1 rssi is -44]
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:10 PM: debug Parsing: rssi -44
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:04:10 PM: debug Parsing: rssi -44
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug [name:humidity1, value:40.70, isStateChange:true, displayed:true, linkText:DHT22_1, descriptionText:DHT22_1 humidity1 is 40.70]
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug isChild = true, but no child found - Auto Add it!
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug Parsing: humidity1 40.70
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug isChild = true, but no child found - Auto Add it!
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug Parsing: humidity1 40.70
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug [name:temperature1, value:75.56, isStateChange:false, displayed:false, linkText:DHT22_1, descriptionText:DHT22_1 temperature1 is 75.56]
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug isChild = true, but no child found - Auto Add it!
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:55 PM: debug Parsing: temperature1 75.56
269620f6-219e-4d5e-b0cb-0a4de9dd759c  10:03:35 PM: debug [name:rssi, value:-44, displayed:false, isStateChange:true, linkText:DHT22_1, descriptionText:DHT22_1 rssi is -44]

In recently, it only shows the number of buttons being reported and it sometimes complains the device not being completely configured even though every field has data in it. And in the Web IDE, the 4 preferences are there.

Additional questions:
What does the configure button do in the iOS app for this device? Seems it does nothing for me.

Feedback issue

I have successfully uploaded this to my arduino uno R3 and everything seems to be working when I have my arduino connected directly to my router using the Ethernet shield. When I move the arduino to connect to a bridge if i enable to alarm it goes through but I dont get any feedback on status of anything and I cannot turn the alarm off. I have opened ports 8090 and 39500 on my router, the bridge does not have many settings but I was able to add the mac address I assigned to the white listed devices list. When looking at wire shark looks like the protocol is arp, not sure if there is another port to open? Am I missing something here?

Thanks!

Cannot add device handlers through smartthings ide

After the update just a few hours ago the method of adding smartthings device handlers through the github integration is now empty.
Ie this does not work any longer:
• Click on "Settings" from the menu and add my GitHub Repository to your account
○ Owner: DanielOgorchock
○ Name: ST_Anything
○ Branch: master
○ Click on "Update From Repo" from the menu
○ Select "ST_Anything (master)" from the list
○ Select all of the Parent and Child Device Handlers
○ Check the "Publish" check box and click "Execute Update"
○ You should now have all of the necessary Device Handlers added to your account

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.