Basics: how to distinguish between input and output channels

Hej openHAB community,

I have now searched for a while in doc and forums but I was not able to find an explanation for a way to find out if a channel is an input or an output. For example, I am discussing the possibility to connect a tesla for a friend and I would like to know if the channel “batterycurrent” can be used to set the battery current or if it is only showing at which rate the battery is actually charged. In the explanations of the binding, for some channels it says “indicating” in the description but I was not able to find a systematic way to find out, if I can write to the channel. Is there a good way to get this info?

Looking at the doc’s batterycurrent is an indication only but you can use this input in a rule to charge the battery at a given set point e.g. use the charge channel.

Thanks for the answer! May I ask how you know it is an indication only? The description says “Current (Ampere) floating into (+) or out (-) of the battery”. From this, it might also be a setpoint…

The item type is just a number that will display the current (indication only). If you want a setpoint then you will need a rule that triggers when the number item gets updated then evaluate it to whatever setpoint value you choose. If the value is lower than you like and charging is needed have the rule use a Switch item (charge) to start a charge.

Here’s an example rule that checks power average and controls a switch:

rule "TurnOffCatGeniePower"

	Time cron "0 54 13 ? * *" or 
	Item CatGeniePower changed 
//    Add persistence to CatGeniePower item 
    if(CatGeniePower.averageSince(now.minusMinutes(3)) > 1){     // adjust time and watts as needed
        CatGenieTimer.sendCommand(ON)    	// turn on timer with expire binding for 20 min
//		Thread::sleep(1000)                 // add if needed to allow switch state to update
    else if(CatGenieTimer.state == OFF){
        CatGenieSwitch.sendCommand(OFF)   		// turn power off if no cleaning cycle

rule "TurnOnCatGeniePower"
	Time cron "0 0 9 ? * *"    				// power on at 9am every day

Hej H102,

thanks for your comments and the solution oriented example!

Two thoughts from my side:

I have this tesla task (that’s in fact a real task) just as an example. The question if the variable is IN or OUT (read or write) occurs regularly to me. Is this just a value I get from the device or am I actually able to set it? I understand from your explanations that the chargecurrent is a purely readable value but that it cannot be set. I am however still in doubt, how you found out about this. Did you test this on a real tesla? Or did you read the source code? Or maybe a reasonable guess? A certain location in the documentation?

Please allow me also to explain why it would be relevant to set a variable that is not Boolean (ON/OFF):
While your ON/OFF example is a good solution it does not solve the following scenario that might have a general relevance but also a very specific one for the tesla case: Let’s say I only want to charge my friend’s car with the amount of power that his solar power installation produces. Then the two point controller that you describe would have the result that the car is not charged at all when the solar power is less than the charging power of the car.

Looking forward to reading your comments!

I have not tested this on a Tesla as I do not own one. As for the chargecurrent item it’s a number that is read only. All number items such as these are read only per the doc’s description.

“chargecurrent Number:ElectricCurrent Charge Current Current (Ampere) requested from the charger

The doc’s may seem a bit fuzzy at first, but after working with OH for a while it will become easier to understand. Once you have the binding installed, your vehicle connected and the Thing created you will see all the channels available. Add the channel for charge current and you should get only a value.

You will need an ON/OFF, at some point, if you want to start/stop something based on a certain value.

Are you able to get this value from the solor charger into OH?

The rule above is just an example and not something that will work as is. I might be able to help with a rule, something more suitable, if you can provide what information (things/items) that OH has access to.

You can also use other bindings to get additional info that might help to make your solar charging rule more efficient e.g. a weather binding to check if it’s cloudy or the astro binding for determining the sun’s rise/set time.


thanks for your answers. To follow up on the three subjects:

Thanks for your patience here - I will see if I see the light at a later point. Perhaps someone else from the community has a different angle on the subject to give me a new chance…

I completely agree to this part. My target though is not to do “ON/OFF” but setting a specific value.

Yep: for example pGrid from

If the solar charger will accept a certain value and take care of turning on/off itself then you can send this as a number item from OH.

I’m actually aiming at the inverse: setting the charge power depending on the inverter power. The reason is that the sun decides the available power. In pseudo-code this would be:
availablePower = inverter.actualPower()

I don’t see why that wouldn’t work in OH with a rule, just need to create the Thing/Items and post them here and we can help with the rule.

Thanks, H102, I will return once I get in trouble with this specific example with my friend.

Concerning the main subject, to

I would at the moment conclude that this aspect is not directly visible in the documentation, that the description column in the doc might give an indication and that testing the functionality or reading the source code are the way to go.