icanos / hassio-plejd

Hass.io add-on for Plejd home automation devices
Apache License 2.0
126 stars 36 forks source link

DIM-2 and MQTT auto discover issue? #6

Closed mattiasjonsson closed 4 years ago

mattiasjonsson commented 4 years ago

MQTT auto discover does not list input 2 of DIM-2 devices. The MQTT broker does however receive topics/messages from both inputs of the device.

icanos commented 4 years ago

Are the inputs identically named in the Plejd app? Otherwise they should appear in HA.

mattiasjonsson commented 4 years ago

True. I checked the names and of course they had the same identical name. Sorry for bother you about this issue. I should have thought of that myself. ;)

Another question: Is it possible to add the entities by hand in the configuration.yaml? And If so, how would I go about doing that?

icanos commented 4 years ago

Nothing to worry about :) in what scenario do you need to add devices to the config? It would need to know the Plejd device id which is fetched from the API.

mattiasjonsson commented 4 years ago

I needed to be able to change the entity ids and have more overall control. I managed to solve it. Turned off MQTT auto discovery and just added the Plejd devices as MQTT lights like this:

light:
  platform: mqtt
  name: "plejd_kok_kokso"
  unique_id: "light.plejd.kok_kokso"
  state_topic: "homeassistant/light/plejd/18/state"
  command_topic: "homeassistant/light/plejd/18/set"
  brightness_state_topic: "homeassistant/light/plejd/18/brightness"
  brightness_command_topic: "homeassistant/light/plejd/18/setBrightness"
  payload_on: 1
  payload_off: 0
  optimistic: false
icanos commented 4 years ago

That's a neat solution, do you mind if I add that to the readme? :)

mattiasjonsson commented 4 years ago

Sure, go ahead :)