Adding ledstrip to Home Assistant HASSIO


#1

Hey,

I’m looking for the script to add the MK smarthouse ledstrip to my hassio.
There are only scripts for openhab.

Can someone help me please? Can’t figure it out…

I was trying it with this config:

light:

  • platform: mqtt
    name: “Led Strip”
    state_topic: “stat/Ledstrip1/POWER”
    state_value_template: “{{ value }}”
    command_topic: “cmnd/Ledstrip1/POWER”
    brightness_state_topic: “stat/Ledstrip1/DIMMER”
    brightness_command_topic: “cmnd/Ledstrip1/Dimmer”
    brightness_value_template: “{{ value_json.Dimmer }}”
    brightness_scale: 100
    rgb_state_topic: “stat/Ledstrip1/COLOR”
    rgb_command_topic: “cmnd/Ledstrip1/Color2”
    rgb_value_template: “{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}”
    effect_command_topic: “cmnd/Ledstrip1/Scheme”
    effect_state_topic: “stat/Ledstrip1/SCHEME”
    effect_value_template: “{{ value.Scheme }}”
    effect_list:

Thanks a lot! and best wishes for 2019 :slight_smile:


[FIXED] Door sensor home assistant
#2

Hello, Here is the code

light LED:
  - platform: mqtt
    name: "Desk LED Strip"
    state_topic: "MK-SmartHouse/lights/MK-LEDStripControl1/state"
    command_topic: "MK-SmartHouse/lights/MK-LEDStripControl1"
    brightness_state_topic: "MK-SmartHouse/lights/MK-LEDStripControl1/state/speed"
    brightness_command_topic: "MK-SmartHouse/lights/MK-LEDStripControl1"
    brightness_scale: 100
    rgb_command_template: '{{red / 2.55}};{{green / 2.55}};{{blue / 2.55}};'
    rgb_state_topic: "MK-SmartHouse/lights/MK-LEDStripControl1/state/color"
    rgb_command_topic: "MK-SmartHouse/lights/MK-LEDStripControl1"
    effect_command_topic: "MK-SmartHouse/lights/MK-LEDStripControl1"
    effect_state_topic: "MK-SmartHouse/lights/MK-LEDStripControl1/state/effect"
    state_value_template: "{{ value_json.state }}"
    brightness_value_template: "{{ value_json.Dimmer }}"
    effect_value_template: "{{ value_json.scheme }}"
    effect_list:
        - NONE
        - FADE
        - POLICE
        - COLD
        - WARM
        - BREATH
        - RAINBOW
    retain: true
    qos: 1
    payload_on: "ON"
    payload_off: "0;0;0;"

#3

Dave,
I do not use MK’s strip lights. I use McLighting for my LED Strip light control. But most MQTT devices work in a similar fashion and I find that Home Assistants docs to be pretty explanatory. The challenge in most cases is lining up all the MQTT pub/sub topics.

I assume that your sample code came from a Tasmota forum or site. Tasmota tends to use cmnd and stat as common MQTT topic prefixes.

In MK’s code it looks like common mqtt topic structure is
(mqtt_topic) + “/state”
(mqtt_topic) + “/state/color”, stringOne;
(String(mqtt_topic) + “/state/speed”, String(aSpeed);
(String(mqtt_topic) + “/state/effect”, “BREATH”);

While I am not any sort of Home Assistant pro, i am intrigued and will spend some time with the INO (MK’s firmware code) to see if I can come back to this topic with an answer to try in Home Assistant.

I will be getting all my cues from https://www.home-assistant.io/components/light.mqtt/ and comparing to what I use for McLighting (https://github.com/toblum/McLighting/blob/master/clients/HomeAssistant/light.yaml) . I do recommend that you also check out the Home Assistant MQTT discovery feature. It has saved me tons of headaches as i add devices to my IoT network (https://www.home-assistant.io/docs/mqtt/discovery/) and while not permanent between restarts, it is easy to permanently add MQTT devices after they have been discovered.

Hopefully back at you with some yaml code to try out in a bit.


#4

Well…gee…never mind. I see MK has added some YAML to try out. Back to my previously scheduled hacking :smile:


#5

This could be inaccurate, but according to Home Assistant docs the effect is FALSE by default. Maybe having the effects_list makes that bool true, but if you have problems with the effects working just add the following right above the effects_list and you should be good.

effect: true

Matt, thanks for jumping in and providing us Home Assistant users with some love and attention.