Calling Thing Actions from a blockly rule

Hi,

I have a bluelink Car connected to my openhab and would like to start the heating/ cooling from a blockly rule.

The Car only accepts thing actions to do that. When calling the actions directly from the thing page everything works. How can I integrate this action into a switch in the UI?

You don’t need to write a script to run a Thing action at all. Just add an action to the rule, and click “Show All”:

This will display a list of all available actions, including those provided by Things:

Just pick the action you want the rule to use, fill in the parameters, and save.

Thank you. That was the solution I was looking for. However due to some reason unknown to me I get an error message when I add the action.

If I execute the same action directly from the thing it works. Can someone help me or could this be a problem with the binding?

Problem when calling the action from a rule

Calling the action directly from the thing works with the same parameters

This is actually both interesting and scary. Internally in rules, there are “inputs” and “outputs” that are mapped between different “modules” (triggers, conditions and actions are all modules). This system is complicated, and I’m not sure if any of the people familiar with all the details are still around. I know that the code is there, but I’ve never known exactly how to manage it.

Inputs and outputs are mapped automatically by an “algorithm”. This is the first time I’ve seen it fail, but it appears to be what has happened here. To try to understand what happens, can you go to the “Code” tab of the rule, and select YAML + “Show All”. Then copy/paste the YAML of the rule here. I don’t think it will show any information about the automatic mapping, because that’s not stored in the rule, but it might shed some light on what potentially confuses the automatic mapping.

In the YAML view, it’s also possible to manually map this, but again, I’ve never figured out exactly how that mapping is supposed to look (syntax-wise). I don’t quite understand why a condition needs an input mapping, but if you show the rule, perhaps it will become clearer.

Sorry it took me so long to answer.

The Rule is quite simple it just send the item command when an item switches on.

version: 1
rules:
a48400b614:
label: Auto temperieren
actions:

  • id: “3”
    config:
    defrost: false
    temperature: 21
    heating: false
    config: bluelink:vehicle:40503f141c
    igniOnDuration: 10
    type: bluelink.climateStart#645f0b54040069ac647e6eb2cc2cefb6
    triggers:
  • id: “1”
    config:
    itemName: KlimaanlageIoniq6
    command: “ON”
    type: ItemReceivedCommand

This one gives me the above shown error message.

When I remove the trigger the rule is set as valid, but it does not send the command when I trigger it.

When I trigger the command from the item itself everything works fine.

I’m sorry, I can’t quite figure out the posted rule. Can you please post it surrounded by triple backticks (```) and with the indentation intact? You have managed to somehow strip the indentation levels, and as they are essential for YAML, I can’t quite tell how the rule looks. There’s something very strange going on the the action, as it seems to have two config sections. But, I can’t tell if it’s a config within a config, or if they are somehow “siblings” (which should be impossible).