Offline devices and SmartThings integration

Hi.

I’m in the process of moving my automations from Webcore on SmartThings to Node Red. My devices are all still connected using the HA smartthings integration.

One of my most important automations is a process that lets me know if a device goes offline. (For example, if a smartplug in my garage goes offline then it’s highly possible that the power to the garage has gone out - which could lead to a freezer full of defrosted food.)

I’ve looked through a few debug outputs from the current state node, but it doesn’t look like HA can tell if a smartthings device goes offline. Last_changed/Last_updated don’t help as there’s no refresh. If a device doesn’t change state, then there’s no update ping to confirm the device is online.

Looking for suggestions, as this will be a big hole in my plans to move my automations to node red on HA.

secondary question: does this issue go away if/when i migrate devices into HA directly rather than through smartthings?

Thanks

Do you have any tasmota devices, They work directly with HA and have integration(smart app) for ST. Doing the same, getting all automation to run locally but i love webcore and nodered i just cant wrap my brain around yet.

1 Like

Take a look at my post on the Smartthings forum about a way to get Webcore and Node Red to work together - For a few months I was in the same place you are and ran both, before ultimately moving everything to Home Assistant. Hopefully this can get you through temporarily until you just get everything off Smartthings and moved over.

Also, try and look at the Samsung Automation studio node - which is another way to get Smartthings devices directly into Node Red. Haven’t used that myself but there may be more of an option to run automations with those nodes if devices are offline versus the Home Assistant Smartthings integration.

Ultimately I would just work to get off of Smartthings and get everything over to Home Assistant. I did that back in March and am relieved I don’t have to worry about the chaos going on over there anymore. Its a sinking ship and best to get out while you can. You will also be amazed at how much quicker everything runs with the local control.

Once your devices are on Home Assistant, it should be easy enough to setup notifications for when they go offline - see this post/thread Notify when a device goes offline - #7 by Burningstone

2 Likes

yeah - I’m still keeping one foot in the smartthings camp. Won’t take much to push me over, but they’ve not managed to p*** me off sufficiently yet to go out and buy z-wave and zigbee hardware yet.

If the new automation platform doesn’t fill the gap left by webcore or they start charging monthly end user fees above what nabu casa would cost then that might push me across. My reasons for running HA in parallel is the learning curve for HA. If samsung suddenly decide that ST isn’t worth the hassle, I don’t want to be in a position where I have to start learning it from scratch while my house isn’t working.

One thing that puts me off is how much background material for HA revolves around MQTT. I’ve had bad experiences with message queuing in the past and don’t want to introduce it into my system if there’s another way around. Message queuing is what everyone was doing before webhooks took over.

Thanks for the links. Maybe the way forwards is a webcore routine that sends a webhook any time a device goes on/offline, and keeping a record of those devices within node red?

Regards

For me, I already had the Zwave stick because I had to update firmware in the past and Smartthings couldn’t do that. I tried to stick with Smarthings but someone on their forum basically convinced me that the latency of controlling zigbee and zwave using a cloud based system to a local based system like Home Assistant didn’t make sense. At that point, I had already moved all automations off webcore to Node Red and Home Assistant as well so the Smarrthings hub was a glorified Zigbee/Zwave stick. But, if you don’t already have the two sticks and have both zwave/zigbee, its definitely an added cost to consider before completely making the switch so I definitely get that.

The new ZwaveJS integration (which is a HUGE improvement and one of the reasons I fully switched) can be configured to use websockets or MQTT. I’m configured with the websockets, and a lot more things on Home Assistant are transitioning to websockets vs MQTT. My Zigbee does use MQTT and I haven’t had any issues. People seem to love or hate MQTT, but I’m still thinking local MQTT will definitely outperform a cloud based system. But you’re definitely right on the learning curve, it is huge for Home Assistant for any new user.

I think that’s the way to go. You can either create flow variables in Node Red for each device, or create an input boolean in home assistant that toggles on or off to keep track of its state.

Screenshot from 2021-07-29 10-36-18

[{"id":"84f07b234a519992","type":"http in","z":"f57ef424.8dce68","name":"Receive Webhook","url":"/endpoint/createsomethingrandomhere988788","method":"post","upload":false,"swaggerDoc":"","x":170,"y":1560,"wires":[["294dfd466d2cd91f","e7fe277816f3fcb6"]]},{"id":"e7fe277816f3fcb6","type":"api-call-service","z":"f57ef424.8dce68","name":"Change Boolean","server":"ae531ce.a39906","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.something","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":1520,"wires":[[]]},{"id":"294dfd466d2cd91f","type":"template","z":"f57ef424.8dce68","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n    <head></head>\n    <body>\n        <h1>Message Received</h1>\n    </body>\n</html>","x":350,"y":1580,"wires":[["5462c8a74730cde0"]]},{"id":"5462c8a74730cde0","type":"http response","z":"f57ef424.8dce68","name":"","statusCode":"","headers":{},"x":490,"y":1580,"wires":[]},{"id":"ae531ce.a39906","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

To create the input boolean in Home Assistant (basically a virtual switch) go to configuration, helpers, click “add helper”, then click toggle and create a name for the input boolean. That boolean would then be selectable as an entity in Node Red.

1 Like

A cheap hack I used for Ledvance wifi lights which integrate into HA via smartthings is to detect if they are “home” or “away” at the router level.
This was simple and straightforward with my Deco mesh using the Deco integration.
Of course it’s only possible if your device connects to the WiFi, not sure how it would work if you are going through a hub but I can’t imagine it being difficult?