I have a couple of http items that are working fine when invoked by rules, but I can’t seem to link my remote controls to the actions. If I go into one of the remote control things, where I would select the item, the http items show up along with the others, but there is no ‘Command’ heading, or anything, that all the other items seem to have. And if I try linking anyway, the config screen is blank and nothing works.
Do I need to define anything extra in my http items config, or what am I doing wrong?
Yes, the channels. If I try to edit the item for the remote, it’s all greyed out (see attached). JFI it’s button 2 on a 433Mhz remote that is picked up by the RFXCom binding. The HTTP item sends a rest command to an IR device.
I actually get really confused about the differences between things and items. My remote control shows up as a thing, but I have to make it an item? And surely if I list the ‘studyFan’ as the item to trigger under the ‘studyDeskRemote2’ thing, that should do it?
From the OH cli, this works fine:
smarthome:send studyFan ON
In my log, when I press the remote, I see: 2018-09-30 20:09:32.832 [vent.ItemStateChangedEvent] - StudyDeskRemote2_Command changed from OFF to ON
So on the suggestion that I create a rule, I have:
rule "Remote control of ceiling fan on"
when
Item StudyDeskRemote2_Command received command ON
then
studyFan.sendCommand ON
end
rule "Remote control of ceiling fan off"
when
Item StudyDeskRemote2_Command received command OFF
then
studyFan.sendCommand OFF
end
Linking the studyFan item to the StudyDeskRemote2_Command channel doesn’t turn it on when the button is pressed.
And if I should be referring to the remote as a channel, why does the log say ‘ItemStateChangedEvent’ (which leads me to believe it’s an item? I also tried changing the event in the rule to:
Ok so this is with the remote (which isn’t working): 2018-09-30 23:38:11.785 [vent.ItemStateChangedEvent] - StudyDeskRemote2_Command changed from ON to OFF
And this is the same action from HabPanel (which works fine): 2018-09-30 23:38:31.760 [ome.event.ItemCommandEvent] - Item 'studyFan' received command OFF 2018-09-30 23:38:31.768 [vent.ItemStateChangedEvent] - studyFan changed from ON to OFF
The HTTP binding is a 1.x version binding. Things and Channels are only available for 2.x version bindings.
You don’t link Channels to Items with 1.x bindings, you write a binding config on the Item itself. This means you need to create a .items file and manually create the Item and it’s config in the .items file. See https://www.openhab.org/addons/bindings/http1/#http-binding.
Furthermore, PaperUI’s Control tab will only show Items that are linked to Channels. Since there are no Channels or Things for HTTP binding, you will not find the Items configured with the HTTP binding there.
Yes. The Thing represents the device to OH. A Thing will have one or more Channels and each Channel represents a piece of data that device reports or something you can control on that device.
The Item represents the piece of data or control to the rest of OH. Things are very specific to the device. Items are generic and allow all the rest of OH to receive data from and send data to, show on your UIs, save to the database, or write Rules about in a uniform and abstract manner. Your Rules shouldn’t have to care that it is connecting to a Hue light bulb to turn something ON. It just needs to know that it is a Switch and it doesn’t care whether it is a Hue light bulb, a power outlet, or a flag used internally.
Items is also where you model your home automation. The device may be zwave:dongle:node12:alarm which is pretty meaningless. But when you link the Item Switch Door_Sensor "The door is [MAP(doors.map)]:%s" <door> { channel="zwave:dongle:node12:alarm" } now you know that this sensor is a binary sensor (Switch), control how it looks on the UI (label and icon), and that this device represents a door sensor.
If all you are seeing in the log is “StudyDeskRemote2_Command changed …” then when you press the remote OH is receiving an update, not a command. Change your Rule trigger to “received update”.