Device Statuses - ON/OFF vs ON/OFF/OFFLINE

The Smartthings app seems to believe the state of a device is the last command that the hub sent to it. The device states are ON/OFF. The Hue Bridge on the other hand has three states for bulbs ON/OFF/OFFLINE. This is because bulbs are often turned on and off from old fashion switches, bulbs die or loosen, outlets can lose power, and cords can become unplugged.

We often combine manual light switching with app/Alexa-driven state changes for several reasons:

  • not everyone has a smartphone in their hand
  • sometimes we forget to tell Alexa to do it
  • it’s faster and more expedient if you’re standing next to the switch/lamp to switch it on/off
  • one switch controls multiple devices
  • my parents come to visit and they are old fashioned
  • old habits
  • my 11 year old wants to disable the motion detection in her room
  • we rent and cannot install connected switches or outlets
  • we don’t have remote control outside of Alexa or smartphones
  • ETC

For the Hue Bridge, offline is a state which indicates that the hub cannot currently reach the bulb. Smartthings really needs a third state.

Currently, the Smarrthings device state is often wrong. If someone turns the light off from a switch, the app says it is ‘ON’. If someone then turns on a light that was off from a switch, the app says it is ‘OFF’. If a bulb was last switched manually, I to click the on/off button in the app several times to get the app to sync up with the actual state of a bulb. This is also true with other devices. I have a Aeon Labs switch which is currently unplugged and not utilized. But Smartthings happily thinks it is On and working.

Furthermore, a status of OFFLINE would let me know there is an issue with one of my devices. Today a bulb became loose in it’s fixture. It wasn’t turning on. I would not have known it unless I was standing in the room because the Smartthings app kept telling me it was ON and then OFF depending on what message it sent to the bulb last.

I’m surprised that the hub doesn’t not ping devices periodically and reflect ON/OFF/OFFLINE. Showing if any devices are offline seems like a primary feature in a connected home.

4 Likes

You can always swap out wired switches for zwave or zigbee switches - that’s what I did.

Then ST knows when the switch is on or off. If you are putting a smart bulb into a dumb socket that’s also controlled by a physical switch, you’ll always have this problem. Far better to use a dumb bulb and make the switch smart :smile:

Polling isn’t done because zwave/zigbee is designed to be very very very low power, so battery operated things can last months/years on a battery. They do that by being off 99.999% of the time. Polling would kill the batteries of any device that had to constantly wake up to listen for, and then respond to a ping.

That’s why there is no ping.

1 Like

I cannot do that. Much as I would love to, I mentioned above that I am renting so I cannot install switches.

I get that they are low power, but polling occasionally (even once or twice per day) would use negligible power. Especially since the hub and the bulbs all have power. Additionally, what you’re saying is that devices have to wake up to listen for a command. If they have to do that, then they would have to wake up to listen for an on/off command as well which doesn’t make sense. They clearly have to be in an always listening mode to respond to on/off commands.

It might be that my solution is to move all my bulbs back over to the Hue bridge which does detect offline states. The hue is clearly pinging devices and that seems to not be an issue. They use zigbee.

1 Like

Smartthings is supposed to be polling the Hue bridge every five minutes according to the staff engineer who occasionally posts in the forums . I’m not sure if this is working correctly. It’s a bit odd because the Bridge itself only polls its bulbs every 15 minutes.

So there is some Hue polling being done. Whether it’s working correctly is a different issue.

It makes sense that ST would have to poll Hue since it knows for those devices there are multiple ways to turn them on/off. The bulb is not a slave of a single master. So it has to poll to get the state. I just tested it and if I manually change the state to ‘ON’, ST will pick it up. I cannot verify the frequency of polling but it picked it up within a few minutes.

For my Cree bulbs (or other devices) connected directly to ST, ST doesn’t expect there to be any other way to change the state other than through ST. So perhaps ST decided not to poll?

And in both cases, it doesn’t support a third state of ‘Offline’. It maps a Hue state of ‘Offline’ to the ST state of ‘OFF’.

I had another use case this morning. My daughter wasn’t getting up. So I turned on her light from my phone using ST. I was downstairs riding a bike. When I came upstairs, I discovered the light did not go on because it was offline. It was a bulb on the Hue Bridge so I should have looked there because it clearly told me the bulb was offline and that turning it on was not going to help get her out of bed.

I am having the same frustrations. I recently got an echo and have been creating several virtual dimmers and switches to have the echo do everything. plus have my harmony hub linked with a virtual switch to turn it on and off with the echo.

they are constantly getting out of sync because either we turn the lights off with the hue tap, or the physical switch. and the tv, if you use the remote.

I have been trying to think of a way to have these stay in sync but hue doesn’t report my bulb state at all that I have seen when I tested it the other day. IFTTT hue integration doesn’t seem to be working as you cant create a rule with hue as the IF portion. my thought was to have it where if a bulb in the room was in the off state, that it turned the virtual switch off. then if you went to turn the virtual switch on, in theory it should be in synch. then Alexa can take over and have it be right.

If the Hue Bridge knows it is offline and this information is available to the published Hue API, then a SmartApp can be written to detect offline bulbs (and the Device Type for Hue Bulbs can be enhanced to indicate this status).

It may require polling of the Hue Bridge, but… That’s all.

Part of this is the nature of mesh, with or without SmartThings. Unlike Wi-Fi, Zigbee and zwave are not designed for constant communication between hub and devices. Instead, they are designed to keep the total cost of running the installation down in both energy draw and dollar spent per device, well being able to cover a pretty large area (house instead of a room) . So they use a concept called “sampling” where communication is very small, as infrequent as possible, and polling is kept to a minimum. This is why you can get a $25 zigbee motion sensor with batteries that last two or three years. A Wi-Fi based motion sensor will cost three times that, and if it’s battery-operated, may only last a few months.

The Hue bridge polls its own bulbs about once every 15 minutes. So it can get out of synch with the Tap, but it should catch up again eventually.

A controller, like the smartthings hub, has two ways to deal with the synch issue.

One) it can check the status it has on file for the device, and not send the command if it believes the device is already in the requested state.

Two) it can ignore the status it has on file for the device, and send the requested command anyway.

If it’s just a matter of toggling a lightbulb, then the second option usually works better. It doesn’t add much traffic to the network, and it makes sure that whatever the person requested does get done.

However, as soon as you start adding all kinds of conditional logic, like modes and smart apps, and the "do this unless… " kind of decision structure, then you can’t ignore the status you have on file, or you’ll be triggering stuff the person didn’t want triggered.

This is the challenge that Smartthings faces. There is no easy resolution.

Apple decided to go a completely different direction with HomeKit, and not use mesh. It’s using Wi-Fi and Bluetooth in a bridge and tunnel structure. Which should mean everything always stays in sync. But it also means each individual via device will be much more expensive in terms of both dollars and energy draw. (well, the Bluetooth devices will not be more expensive in terms of energy draw, but the network as a whole will be.) but now they’ve added the Phillips hue bridge as well, and to be honest, I think they’re going to have some of the same synchronization issues with it. If you use a tap and a Hue bridge it won’t matter whether there’s a HomeKit component or not. Sometimes The bridge won’t know what state the Bulb is in.

However, I think it’s possible that the new Hue dimmer switch Will update the bridge status when it operates. I don’t have one yet so I don’t know for sure. If it does though, then I expect the tap to be deprecated eventually.

Anyway, all of this is one of the main reasons why the Hue IFTTT channel doesn’t allow the use of the bulb coming on as a trigger. My guess is Phillips realized they would be too many sync issues to keep people happy.

3 Likes

Excellent post as usual @JDRoberts

I guess I will just live with it as it is for now. In waiting to get some hue dimmers myself and then they probably will replace my taps.

1 Like

I was thinking about this as well. I wanted to have something where I had a smartBulb at the top of my basement stairs that when I switched it on, the other smart lights in the basement would go on. When I was done and switched off the top of the top bulb (at the dumb switch) it would turn everything off. The problem is that SmartThings doesn’t know when the power is cut to the smartbulb.

Now while I understand that devices aren’t polled because of power saving, bulbs should be different as they have a constant power source. How hard would it be to see that a thing is a bulb and have it poll? I mean, the relay switches you can put in know when the power is off already right?

Even if we had to manually put a rule in place (perhaps using Rule Machine) to allow for this type of polling, I’d be fine with that. Smart Bulbs are 1/2 the cost of a smart switch these days, so it could make automating things much cheaper.

1 Like

Mesh devices, including zwave or Zigbee smart bulbs, just aren’t designed for frequent polling, for all the reasons given above. It can kill your network and prevent other messages from getting through. The architecture of these networks is based on the idea that there will be only a few very small messages from the devices.

if you want continuous monitoring, consider wifi devices.

Or alternatively don’t use a dumb switch to turn off the first smart bulb. (It’s not good for the smart bulb anyway.) instead, you can leave the original switch in place with a child safety lock and have it always turned on. Then add a second battery operated switch (the Philip Hues one costs $25 and can dim as well as toggle. Also one switch can control up to 10 bulbs as a group).

For a minimal cost it’s very easy to control the bulbs and you also improve the life of each bulb because you’re not regularly cutting current to it. :sunglasses:

There are also a number of other possible options that community members use for switches with smart bulbs discussed in the following thread:

1 Like

Thanks for the detailed response @JDRoberts ! So the Hue switch would work right out the box with SmartThings? I didn’t see it listed on the compatibility chart. I’m not against putting in a smart switch, I was just trying to find the most cost effective option at the end of the day. Mainly because I know that the wife would go in and try to toggle the dumb switch when she does head to the basement. I figured if I could have the “master” bulb act as the event trigger, that it would make the most sense , seeing how the basement only gets used maybe once per day.

I originally had it where if the motion sensor I have down there stopped detecting motion, that it would turn the lights off after 5 minutes. The problem with that was, if I was working down there for a while, there’s a dead spot where the motion can’t see, so I would be working in the dark haha! So the idea with this is, if the main light to the basement was “on”, it wouldn’t trigger the 5 minute motion delay.

And to your point, you don’t want to “clog” the network, but it would be nice to have the option to be able turn on a polling option for a smart bulb, not as default, but on a per thing basis. Just my 2c in the matter :smiley:

Smartthings polls the hue bridge for the status of those bulbs about every five minutes. So it does update the status, it just doesn’t do anything with it. That’s a separate issue and I agree it would be nice if there were someway to do something with that information, but it’s done on the platform level and I don’t think smart apps can get to it.

However, it does give us a plus as far as using the Hue dimmer switch. Essentially you can use the switch as a parallel means of control. Use the switch to turn the lights on or off, and then the status gets updated to SmartThings about five minutes later when the bridge gets polled. We use these at my house and really like them as an intuitive switch for guests and other visitors. But It can also work very well in a situation like you described. So in that sense it works right out of the box, you just associate it with your Hue bridge and the bulbs you want it to control.

There are community members working on connecting it directly to the smart things hub, but they run into some problems with it. You can look for those threads if you’re interested.

But meanwhile, it’s easy. Put a child lock on the existing switch, so people remember not to use it but it can still be used in an emergency if your home automation system is not working. Add the battery-operated switch next to it. You still have full SmartThings functionality with each smart bulb, but you also have a wall switch that can control a group of Bulbs as well. Choice is good. :sunglasses:

The bottom line here is that the polling between ST and the Hue Bridge doesn’t seem to work. I think that STs having a 3rd state for Hue bulbs would be nice, but at the end of the day, the basics don’t work. If you control a Hue bulb from outside of ST, then STs never gets in sync (at least for me).

I’ve read in several places that STs polls the Hue Bridge every 5 mins, but mine doesn’t and it looks like lots of other people’s don’t either.

I’ve written to STs support who tried to help, but we still haven’t got it to work. Not seeing much in the logs to help me out either. I would have thought that ST would ask the Hue Hub what the status of the lights were every 5 mins, but looking at the logs, I’m not seeing any activity like that.

If polling is working for someone in here, could you give me a pointer as to what I should be seeing in the device logs?

1 Like