MQTT Controller and extended capabilities
-
I'm a little bit confused how to configure extended capabilities for the entities in the MQTTController.
mqtt_cababilities.yaml states that: "...You can add your own capabilities by adding a "capabilities" section to your own local_mqtt_capabilities.yaml file in your config directory."
So I did this in my local_mqtt_capabilities.yaml in the config directory:
version: 22353 revision: 1 format: 1 capabilities: x_my_config: attributes: partyMode: type: bool actions: some_action: topic: '%topic/write' payload: "some value"
And in my reactor.yaml I have following configuration entry:
my-config: name: 'My custom configuration' topic: 'my-config' query: "%topic%/read" init: "%topic%/read" capabilities: - x_my_config primary_attribute: x_my_config.partyMode events: "%topic%/status": "x_my_config.partyMode": json_payload: true expr: "payload.partyMode"
This sort of works but not quite. The partyMode attribute gets updated when messages arrive for that specific topic, so that's fine. But I don't see x_my_config capability in the Capabilities list in the UI and also the some_action is missing.
Addition to that the primary value is not set and I'm getting the following error:
Have I completely misunderstood the idea behind the capability extension and the attributes? If so, could someone point me to the right direction with few explanatory example configs.
What I'm trying to achieve is a set of configuration options that could be updated thru the MQTT, and also provide some actions that the rules could invoke.
Reactor (Multi-hub) latest-23063-c464b685 + MQTTController [0.1.23010]
br,
mgvra -
@toggledbits any comments on this?
-
Local capabilities aren't working in the current release, and you probably don't need one anyway. This looks like a virtual switch application, for which the
power_switch
capability is probably sufficient. See the Capability List for details.Even if local capabilities were working, your action still wouldn't work because it's not properly structured. What you have in the capability should be in the entity config (with at least one other error corrected), and the local capability definition would need different data. But that's neither here nor there at the moment, because local capability definition is broken. I'll fix it in a future build, but given how few people have complained, nobody seems to be much missing it, and for your application I'm thinking
power_switch
is a better option anyway. -
T toggledbits locked this topic on
-
C Crille referenced this topic on