Hi , i’new for Openhab, but using Home Assistant for several years, i have an MQTT server configured, there are some entities in HA being auto discovered
Now i have setup Openhab on docker , configured with host mode, and make sure the correct lan adapter is setup in Openhab
So installed an MQTT broker in HA, its in online state
if i do a “scan” here, shouldnt it not find the entities ? the audo discovery is turned on in the broker setting:
above screenshot with channel is being created automaticly
Now what? what do i have todo now to get it on the UI? i think i need to click on “add equipment to model” , but then i get error below? why cant i select the channel being created in above screenshot?
for the light i entered manually in openhab, when i turn it on, seems i see it in the log
now how do i add that manually added mqtt light to the UI?
2022-07-04 17:02:27.657 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{"state": "ON", "color_mode": "onoff"}' from channel 'mqtt:homeassistant:2693a81a59:mqtt_5Flight_2Ebadkamer#light' not supported by type 'ColorValue': {"state": "ON", "color_mode": "onoff"} is not a valid string syntax
It sounds like you have one broker, which is just as it should be.
The ‘broker Bridge Thing’ in openHAB is just a pointer to some external MQTT service, where openHAB can subscribe to MQTT topics.
Okay, so the link to broker is good.
Are these devices actually sending messages in HomeAssistant self-identifying format?
Yes, these entities are being discovered in HA without an issue…
If discovery doesn’t work I can live with that, how to proceed manually? I’m also stuck here… See my first post, not sure what I need to do with the channel/model part
Hi
I think you should study the concepts of Thing, channels and items first (this is a different concept than Home assistant uses as far as I know)
In brief. Example: You have a Philips Hue lamp.
To use these you need the Philips Hue binding to make Openhab and Hue speak the same language.
then you create a Thing (or it is automatically detected) this is a virtual representation of the physical lamp within Openhab
This lamp has an on and off function and a dimmer function, which we call Channels. So the Thing has a dimmer and an on-off (switch) channel.
To display a Channel on a UI you need to create an Item associated with Channel.
An item has a type, name, label, etc.
For example, a type can be a switch, color or player.
This might be confusing at first, but it’s all well documented
Hey @micware , i’m back from vacation, want to start working on it again, but still stuckj on channels
Openhab found a lot of mqtt lights and i see them all in inbox (44 items)
I added one as a test from inbox, looks like:
Next, added a model (groundfloor) , but now i’m stuck
when i “create equipment from thing” or "create points from thing’, i always get error…
What am i missing?
What i do see in log, when i goto model => create points from thing, i see this in log:
2022-07-26 17:44:47.491 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{"state": "OFF"}' from channel 'mqtt:homeassistant_mqtt_5Flight_2Ewasplaats:e94f1500bd:mqtt_5Flight_2Ewasplaats:mqtt_5Flight_2Ewasplaats#light' not supported by type 'ColorValue': {"state": "OFF"} is not a valid string syntax
2022-07-26 17:47:02.634 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{"state": "OFF"}' from channel 'mqtt:homeassistant_mqtt_5Flight_2Ewasplaats:e94f1500bd:mqtt_5Flight_2Ewasplaats:mqtt_5Flight_2Ewasplaats#light' not supported by type 'ColorValue': {"state": "OFF"} is not a valid string syntax
2022-07-26 17:50:24.625 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{"state": "OFF"}' from channel 'mqtt:homeassistant_mqtt_5Flight_2Ewasplaats:e94f1500bd:mqtt_5Flight_2Ewasplaats:mqtt_5Flight_2Ewasplaats#light' not supported by type 'ColorValue': {"state": "OFF"} is not a valid string syntax
seems its indeed related to colorvalue, i now added a thing from inbox, like a switch instead of light, without colorvalue, that seems to work without an issue
so its related indeed to colorvalue, but how to fix?
Hi
I think you need to look at the channel configuration (YAML part) of the thing that is not working.
From the error message I conclude that he wants to send an on-off command but color is expected
below you see an example of one of my MQTT things (a lamp)
There is a switch channel (for on/off)
There is a Dimmer channel
There is a color temperature channel
for a switch channel you create a switch item that you can display and control via a UI and for the dimmer channel and dimmer item
in my example you see channelTypeUID: mqtt:switch because it points to a commandTopic (MQTT) that accepts an on or off command. If I make this a channelTypeUID of “Color” you probably get an error.
I’m not an expert in this area, hopefully someone will correct me if I’m explaining it all wrong
I am now experimenting with Home assistant and running into the opposite. I don’t use MQTT topics according to the naming convention that home assistant automatically understands. So now I have to learn/find out how home assistant deals with this.
it seems the mqtt home assistant binding , doesnt need any yaml at all, its probably somekind of builtin, but it just doesnt work for lights…
i really hoped openHab was a stable system
Whether it has the features that you want or not, has little to do with stability.
I think it would be fair to say that the Home Assistant discovery part of the MQTT binding has received less development from volunteer developers than say the Homie version. That would reflect the interest of the developers.
I wouldn’t be surprised if it does not include support for every combination, which is what you seem to be looking at.
You can contribute yourself, or persuade someone who can (there is a bounty scheme for enhancement requests)
Or, the MQTT binding is flexible and allows you to manually define all the Things and channels that you’d like. That’s more work than auto-discovery, of course.