Maker API capabilities don't match what I see on device

On my maker api URL (hubitat-ip/apps/api/77/devices/11/capabilities), I see:

{"name":"Wally MultiSensor","label":"Basement bathroom sink","type":"Wally MultiSensor","id":"11","date":null,"model":null,"manufacturer":null,"room":null,"capabilities":["RelativeHumidityMeasurement","MotionSensor","Configuration","Refresh","Battery","WaterSensor","TemperatureMeasurement","Sensor"],"attributes":{"humidity":"54","dataType":"NUMBER","values":null,"battery":"100","water":"dry","motion":null,"temperature":"66.31"},"commands":[{"command":"configure"},{"command":"refresh"}]}

But when I go to view device information at hubitat-ip/device/edit/11, I see:

* endpointId: **01**
* application: **00**
* capabilities: **{"components":[{"attributes":{"humidity":{"enumCommands":[],"schema":{"additionalProperties":false,"properties":{"unit":{"default":"%","enum":["%"],"type":"string"},"value":{"maximum":100,"minimum":0,"type":"number"}},"required":["value"],"title":"Percent","type":"object"}}},"commands":{},"ephemeral":false,"id":"relativeHumidityMeasurement","name":"Relative Humidity Measurement","status":"live","version":1},{"attributes":{"battery":{"enumCommands":[],"schema":{"additionalProperties":false,"properties":{"unit":{"default":"%","enum":["%"],"type":"string"},"value":{"maximum":100,"minimum":0,"type":"integer"}},"required":["value"],"title":"IntegerPercent","type":"object"}}},"commands":{},"ephemeral":false,"id":"battery","name":"Battery","status":"live","version":1},{"attributes":{"temperature":{"enumCommands":[],"schema":{"additionalProperties":false,"properties":{"unit":{"enum":["F","C"],"type":"string"},"value":{"maximum":10000,"minimum":-460,"title":"TemperatureValue","type":"number"}},"required":["value","unit"],"type":"object"}},"temperatureRange":{"enumCommands":[],"schema":{"additionalProperties":false,"properties":{"unit":{"enum":["F","C"],"type":"string"},"value":{"additionalProperties":false,"properties":{"maximum":{"maximum":10000,"minimum":-460,"title":"TemperatureValue","type":"number"},"minimum":{"maximum":10000,"minimum":-460,"title":"TemperatureValue","type":"number"},"step":{"maximum":10000,"minimum":-460,"title":"TemperatureValue","type":"number"}},"required":["minimum","maximum"],"type":"object"}},"required":["value","unit"],"type":"object"}}},"commands":{},"ephemeral":false,"id":"temperatureMeasurement","name":"Temperature Measurement","status":"live","version":1},{"attributes":{"water":{"enumCommands":[],"schema":{"additionalProperties":false,"properties":{"value":{"enum":["dry","wet"],"title":"MoistureState","type":"string"}},"required":["value"],"type":"object"}}},"commands":{},"ephemeral":false,"id":"waterSensor","name":"Water Sensor","status":"live","version":1}]}**
* status: {"components":{"main":{"battery":{"battery":{"timestamp":"2024-08-19T22:59:03.950Z","unit":"%","value":100}},"relativeHumidityMeasurement":{"humidity":{"timestamp":"2024-08-19T22:59:02.143Z","unit":"%","value":50}},"temperatureMeasurement":{"temperature":{"timestamp":"2024-08-19T22:59:02.174Z","unit":"F","value":70},"temperatureRange":{"timestamp":"2024-08-19T22:58:56.743Z","unit":"F","value":{"maximum":2062.618031052927,"minimum":-175.70433435576444,"step":9412.28362744926}}},"waterSensor":{"water":{"timestamp":"2024-08-19T22:59:03.142Z","value":"dry"}}}}}

It seems maker API for some reason is advertising a MotionSensor capability, even though there isn't one

As an additional ask, would it be possible to add a config to maker api to mask specific capabilities (instead of just devices?) - not only would that be handy, it would allow for fixing this issue manually (by simply masking the MotionSensor capability)

Where are you seeing this? That is not a standard part of the device detail page (the /edit URL you mentioned). It could be something that particular driver is putting in the device data section -- a wild guess based on the other information you provided, impossible to say without a screenshot to know where it is for sure and knowing the specific (likely custom) driver you are actually using. What really matters are the capabilities declared in the driver code. If it's a custom driver, you should be able to see that; with any device/driver, you can make reasonable guesses based on the commands and attributes you see or prod at it with a custom app to see for sure.

What you do mean by this?

I believe it's a built-in driver by @mike.maxwell - it's the one from this discussion: Wally sensors - #20 by mike.maxwell

Assuming you mean the Wally MultiSensor driver, I'm still not seeing anything that should populate a JSON object anywhere like you have in your first post, as I mentioned above. Where on the device detail page are you seeing that information? (The other suggestions may also be helpful.)

The driver does declare the motion sensor capability, though I'm not sure I see that actually used anywhere. Maybe that was an accident. Is this not something the device actually supports?

He's using the driver/device via Maker API to feed Mira on the ST side. The Motion Sensor capability being exposed by Maker API makes Mira think its a motion sensor type device, when I think its actually a leak sensor (with temp and/or humidity).

Correct, it does not have a motion sensor.

It has:
Battery, Water, Humidity, Temperature, Contact - that's it

Where are you seeing this?

It was in hubitat-ip/device/edit/11, but I just came to the realization that those are coming from the hubithings app :man_facepalming:

Sincere apologies, I thought that was built-in hubitat capabilities that it was displaying

What I do see which seems to be built-in is:

Current States
battery : 100
humidity : 54
temperature : 66.31
water : dry

Shouldn't motion : inactive also show up there if the driver has that capability? :thinking: (interestingly, contact doesn't show up, even though it is a contact sensor - but I don't use that functionality so doesn't affect me :rofl:)

It will only show up after there is an actual 'motion' event generated. Since the device does not support motion, the state will never appear.

1 Like

If motion is never reported then you could put a // at the beginne of the line in the driver where the capability MotionSensor is specified. That will remove the capability from the device. Then the device page will have the related commands removed as well.

By specifying that capability you automatically add related commands and attributes. The attributes are normally populated for the first time either when the device initializes or the state is updated for the first time.

This is correct, so just re-iterating for the OP (unless, I suppose, the driver initializes the attribute to some default on install, generally not done for real-world devices).

The driver doesn't have the "ContactSensor" capability. I think this might have been a typo of sorts and this could all be fixed by replacing "MotionSensor" with "ContactSensor," which can be done in platform 2.4.0.

The explanation for where you are seeing the above makes a lot more sense now. :smiley: (Thanks!)

1 Like

Sounds good, thanks! Patiently will wait for the 2.4.0 platform update :pray:

Is there a place I can file the feature request I mentioned above for maker API?

I.e. it currently has a device selection mask - being able to mask capabilities would be pretty sweet, too

Posting it here is as good as anything, but my thoughts are that the driver is a better place to handle this and it's unlikely to get much traction beyond that. :smiley: (The above driver changes have also been submitted for the next release, BTW.)

2 Likes

Oh for sure, for this specific case fixing the driver to match the device is definately best :+1:

But in general, having the ability to mask both devices & their capabilities (i.e. higher granularity) seems like it could be generally useful for maker API (not just to work around bugs/issues like this one, but from a privacy/security perspective)