I’m working on this OpenTherm Gateway binding and the device reports a lot of information like temperatures, water pressure, burner status etc. It’s quite logical to add a channel for each one of them and have the binding update the value as it receives them from the actual device.
The OTGW also accepts commands, from which I’ve only implemented three so far (TT, TC and SW) but I would like to add more in the future. For now, I have added a channel for each one of them but that seems a bit odd. The commands you send the to OTGW don’t really represent a state or a value or anything. They are just instructions that change the behavior of the device, but the response to a command itself is nothing more than a message to let the sender know the command was received succesfully or not.
So, is there a different, better approach to sending instructions to a binding (and then to the device) without using channels or items? Something that just accepts the message, but doesn’t represent a state or a value that you would link to an item ?
No. Bindings interact with openHAB via items. Items are linked to channels and the binding passes on or takes in the channel value from the thing (device) to or from the items.
Well, it depends on how the command is sent. You could use one Item to send different commands.
As I can’t see any OpenThermGateway Binding: how do you connect the gateway to openHAB? http Binding?
Thanks for the responses.
I already thought of a common channel to send commands to the OTGW, but because I don’t really have a return value to show or anything, I was wondering if there was perhaps a different way. Something like a write-only channel. But I guess I’ll just create a channel for this purpose and have it return an empty string.
@Udo_Hartmann the binding I referred to is this: https://community.openhab.org/t/39160 but the question about sending commands was more general.
Ah, I see… You are writing your own Binding!
Well, take a look at the exec2 Binding, there is a set of 5 channels per thing https://www.openhab.org/addons/bindings/exec/#channels and you can control input and output and use one channel to trigger the execution (or auto execute when input channel is set). So, I think it would be ok to define a write only channel for commands and only send a “OK” or “Not OK” as an answer to an “acknowledge” Channel.