How to fail a health check for a child device

for a direct connected device with children, how do I fail a health check for a child device?

Just to confirm, do you want to “fail the health check” to forcibly make a device offline?

Child device. Let me put this into context.

This is a pool controller. When the pump isn’t running, then the PH, ORB, and water temp readings are not valid. The water must be moving. Those sensors are all part of a child device “Water”. There’s still a “main” and other child devices.

1 Like

OK, so what do you want to do with the child device? It isn’t used as a component, is it?
If it’s a separate device (not a component), failing the health check would be setting it as offline, it is still pending to know if it’s possible.

If it’s a component, you could use the visibleCondition property. If the condition is not met, the tiles of those measures will be greyed out. If it’s met, they will appear colored. This gives a visual effect of something not being available at the moment, in the case of tiles where we can enter a value, the widget is also disabled.

I tried this, but I’m not seeing it in the phone app.

here’s just a section of the json.

{
  "component": "Pump",
  "capability": "switch",
  "version": 1,
  "values": [],
  "patch": []
},
{
  "component": "Pump",
  "capability": "switchLevel",
  "version": 1,
  "values": [],
  "patch": [],
  "visibleCondition": {
    "capability": "xxxxx.switch",
    "version": 1,
    "component": "Pump",
    "value": "off.value",
    "operator": "EQUALS",
    "operand": "disabled"
  }
},

Blockquote

I’m hoping you can see what I’m doing wrong.

are you using a custom capability? please, share its ID so I can check the configuration, also, the VID of the presentation you created would be really helpful

Not for this. It’s your std switch and switch level.

Oh, I got confused due to the xxxxx. here. If you’re using the stock capabilities, then, the references are incorrect, here’s an example of the correct configuration:

"visibleCondition": {
    "capability": "switch",
    "version": 1,
    "component": "main",
    "value": "switch.value",
    "operator": "EQUALS",
    "operand": "on"
}

However, I made some tests and it seems this property is being ignored in this case. I’m already checking that with the team, it seems some stock capabilities are experiencing this behavior, custom capabilities should work correctly.
Once I get more info, I’ll let you know.

Hi, @dcabot25.
I made new tests with the visibleCondition and it’s working properly, can you check the behavior in your case, and let me know, please?

Yes, it’s fixed now. Thanks!

1 Like