MQTT comunication between Indigo and Home assistant

Posted on
Sun Mar 29, 2020 10:38 am
FlyingDiver offline
User avatar
Posts: 7257
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Sun Mar 29, 2020 10:45 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

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 2221 times

Håvard

Posted on
Sun Mar 29, 2020 10:48 am
FlyingDiver offline
User avatar
Posts: 7257
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Sun Mar 29, 2020 10:50 am
FlyingDiver offline
User avatar
Posts: 7257
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Sun Mar 29, 2020 11:03 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Mon Mar 30, 2020 2:16 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

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/integrations/light.mqtt/#brightness_value_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

Posted on
Mon Mar 30, 2020 5:15 am
FlyingDiver offline
User avatar
Posts: 7257
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Mon Mar 30, 2020 5:36 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Mon Mar 30, 2020 5:44 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

I now see that when I introduce this line:
Code: Select all
#state_topic: "indigo/devices/1752710570/update"

It stops working.

Håvard

Posted on
Mon Mar 30, 2020 7:34 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

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/integrations/light.mqtt/#on_command_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 2124 times

Håvard

Posted on
Mon Mar 30, 2020 8:56 am
FlyingDiver offline
User avatar
Posts: 7257
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Mon Mar 30, 2020 8:57 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

Yes, it does.


Sent from my iPhone using Tapatalk

Håvard

Posted on
Mon Mar 30, 2020 8:59 am
FlyingDiver offline
User avatar
Posts: 7257
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Mon Mar 30, 2020 10:42 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

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

Posted on
Mon Mar 30, 2020 10:46 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: MQTT comunication between Indigo and Home assistant

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

Who is online

Users browsing this forum: No registered users and 2 guests