MQTT comunication between Indigo and Home assistant

User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

Post by FlyingDiver »

What's the command you're sending from MQTT Explorer (that works)?

And what does your configuration.yaml entry for the switch look like?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

If I subscribe to

Code: Select all

indigo/devices/1752710570/command/on
indigo/devices/1752710570/command/off
And I publish just indigo/devices/1752710570/command/on
without any payload the light goes on and off.

My switch config looks like this:

Code: Select all

  - platform: mqtt
    name: "Office desk switch"
    state_topic: "indigo/devices/1752710570/update"
    command_topic: "indigo/devices/1752710570/command"
    payload_on: "on"
    payload_off: "off"
    state_on: "True"
    state_off: "False"
    optimistic: false
    value_template: '{{value_json.states.onOffState}}'
    qos: 0
    retain: true
The state is working, so I get the correct updated state in HA
Attachments
Skjermbilde 2020-03-29 kl. 18.47.44.png
Skjermbilde 2020-03-29 kl. 18.47.44.png (18.39 KiB) Viewed 2933 times
Håvard
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

Post by FlyingDiver »

Change:

Code: Select all

    command_topic: "indigo/devices/1752710570/command"
to

Code: Select all

    command_topic: "indigo/devices/1752710570/command/set"
Per the available commands listed here: viewtopic.php?f=316&t=23764
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

Post by FlyingDiver »

haavarda wrote:If I subscribe to

Code: Select all

indigo/devices/1752710570/command/on
indigo/devices/1752710570/command/off
And don't subscribe to individual topics like that, it's really inefficient. Just use:

Code: Select all

indigo/devices/#
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

Will do :)
After changing the subscription to

Code: Select all

indigo/devices/#
and changing the command topic as you suggested I was able to get it to work.
And it seams that all devices now are available, and not only the ones that I publish the states to. But I assume that is the way it is supposed to be :)

Thanks a lot for your support. Now it is on to try to get the dimmer to work.
Håvard
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

I am realy struggeling to get my head around getting the dimmer to work. Since I am not that in to programming, I have spent a lot of time with trail and error... But no luck so far.
I am trying to get a dimmable light to be controlled by HA and get the correct states. As of now, I am able to control the light, but I am not able to pull the correct on/off or brightness state.

In basic I am using this info to configure my device:
https://www.home-assistant.io/integrati ... e_template

My dimmable light is sending this information over mqtt:

Code: Select all

{
    "name": "Light - Desk - Office",
    "deviceId": "1752710570",
    "model": "Ambiance Lights",
    "address": "192.168.2.41 (ID 15)",
    "states": {
        "alertMode": "none",
        "alertMode.ui": "none",
        "brightnessLevel": "100",
        "brightnessLevel.ui": "100",
        "colorMode": "ct",
        "colorMode.ui": "ct",
        "colorTemp": "2959",
        "colorTemp.ui": "2959",
        "effect": "none",
        "effect.ui": "none",
        "onOffState": "True",
        "online": "True",
        "online.ui": "True",
        "whiteLevel": "100.0",
        "whiteLevel.ui": "100",
        "whiteTemperature": "2959.0",
        "whiteTemperature.ui": "2959"
    }
}
And my attempt at config is as follows:

Code: Select all

  - platform: mqtt
    name: "Office desk light"
    state_topic: "indigo/devices/1752710570/update"
    command_topic: "indigo/devices/1752710570/command/set"
    brightness_state_topic: "indigo/devices/1752710570/update"
    brightness_command_topic: "indigo/devices/1752710570/command/brightness"
    state_value_template: "{{value_json.states.onOffState}}"
    brightness_value_template: "{{value_json.states.brightnessLevel}}"
    qos: 0
    payload_on: "on"
    payload_off: "off"
    optimistic: false
    brightness_scale: 100
    #on_command_type: brightness
Any idea on how to fix it?
Håvard
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

Post by FlyingDiver »

Did you say you have this working for a switch (relay type device)? If so, post the published message (and topic) and the config entry. I have an idea of what the problem is.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

After even more trail and error I found that this setting is sort of working:

Code: Select all

  - platform: mqtt
    name: "Office desk light"
    #state_topic: "indigo/devices/1752710570/update"
    command_topic: "indigo/devices/1752710570/command/set"
    brightness_state_topic: "indigo/devices/1752710570/update"
    brightness_command_topic: "indigo/devices/1752710570/command/brightness"
    #state_value_template: "{{value_json.states.onOffState}}"
    brightness_value_template: "{{value_json.states.brightnessLevel}}"
    #value_template: "{{value_json.states.brightnessLevel}}" #Temp
    qos: 0
    payload_on: "on"
    payload_off: "off"
    optimistic: false
    brightness_scale: 100
    on_command_type: brightness
I have commented out some commands, and now I think it is working. It is some strange behaviour related to on. As the device goes to 100 when I send on from HA.
Håvard
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

I now see that when I introduce this line:

Code: Select all

#state_topic: "indigo/devices/1752710570/update"
It stops working.
Håvard
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

After a lot of google I have been able to figure part of the dimming issue out.

The following config is working:

Code: Select all

  - platform: mqtt
    name: "Office desk light"
    state_topic: "indigo/devices/1752710570/update"
    command_topic: "indigo/devices/1752710570/command/set"
    brightness_state_topic: "indigo/devices/1752710570/update"
    brightness_command_topic: "indigo/devices/1752710570/command/brightness"
    state_value_template: '{{ "on" if value_json.states.onOffState == "True" else "off" }}'
    brightness_value_template: "{{value_json.states.brightnessLevel}}"
    #on_command_type: brightness
    qos: 0
    payload_on: "on"
    payload_off: "off"
    optimistic: false
    brightness_scale: 100
The only thing that is a bit strange now is that if I set the light to 50%, turn it off, then toggle it on, it will go to 100%. Not sure where this behaviour is configured? But I have tried with and without

Code: Select all

on_command_type: brightness
https://www.home-assistant.io/integrati ... mmand_type

Could this be related to how data is processed when received on the Indigo side? I can observe that when I set the light to 50%, then off, and then toggle, it will only be transmitted a mqtt on, not an updated brightness.
Attachments
Skjermbilde 2020-03-30 kl. 16.02.34.png
Skjermbilde 2020-03-30 kl. 16.02.34.png (71.51 KiB) Viewed 2836 times
Håvard
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

Post by FlyingDiver »

If you toggle it on and off using the Indigo controls (not MQTT from HA), does it behave correctly?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

Yes, it does.


Sent from my iPhone using Tapatalk
Håvard
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

Post by FlyingDiver »

I'll need to see the Indigo log for both methods of controlling the light. Basically, I need to see what commands are being sent to the plugin controlling that light, using both control methods. You might need to put the light's plugin in debug logging mode.

What kind of light is it, anyway?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

This is when I operate a z-wave device.
1 Set it to 66%
2 Turn off
3 Turn on --> Turns on to 66%
Last edited by haavarda on Mon Mar 30, 2020 10:54 am, edited 1 time in total.
Håvard
User avatar
haavarda
Posts: 702
Joined: Sat Aug 18, 2012 4:40 am
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Post by haavarda »

And from HA UI
1 Light is at 66&
2 Turn off
3 Turn on --> Turnes on to 100%
Last edited by haavarda on Mon Mar 30, 2020 10:54 am, edited 1 time in total.
Håvard
Post Reply

Return to “MQTT”