Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Espixelstick and Home Assistant

  1. #1
    Join Date
    Jan 2017
    Location
    Montreal, Canada
    Posts
    17
    Post Thanks / Like

    Question Espixelstick and Home Assistant

    Hi,

    I've decided to try and get my espixestick working with MQTT and home assistant. I don;t know much about HA or using MQTT, so this is what I have tried.

    I made an Ubuntu Server VM and installed HA following these instructions. Got it running no problems.

    I then added the following to configuration.yaml :

    Code:
    mqtt:
    
    light:
      - platform: mqtt
        name: "PixelStick01"
        state_topic: "matrix/esps/light/status"
        command_topic: "matrix/esps/light/switch"
        brightness_state_topic: "matrix/esps/brightness/status"
        brightness_command_topic: "matrix/esps/brightness/set"
        rgb_state_topic: "matrix/esps/rgb/status"
        rgb_command_topic: "matrix/esps/rgb/set"
        brightness_scale: 100
        optimistic: false
    Restarted HA and now I have the light button.

    I configured the espixelstick as follows:
    Capture.PNG

    However, when I try and turn on the light. nothing happens. The slider switch on the console goes on and then right back off. Any ideas? Something wrong with my config? I also don't seem to have a color picker.
    Capture2.PNG

    Thanks

  2. #2
    Join Date
    Jan 2017
    Location
    Montreal, Canada
    Posts
    17
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    I think I just found my problem, there was an extra "/" in my topic. I corrected it as follows and now it works!

    Capture3.PNG

  3. #3
    Join Date
    Oct 2015
    Posts
    12
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    Glad you got it working. I'm just beginning using pixel nodes and I want everything to run through Home Assistant. Thanks for your work.

  4. Likes studiopro liked this post
  5. #4
    Join Date
    Nov 2016
    Location
    Washington State
    Posts
    149
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    Hello, I have been working on this for some time and I could really use some help.
    In hassio I have created a binary sensor that communicates with a light sensor that can go into "isdark" state if the lux goes below 100.
    I then tried add an automation that when "isdark" activates it sends and on state to the EspixelStick and have lights come on. I can get my "isdark" state to on and I can manually turn on lights but can't get lights to trigger from "isdark".
    Below is parts of my config.yaml
    Code:
    light:  
    #espixelstick subnet 110
      - platform: mqtt
        name: "PixelStick01"
        state_topic: "matrix/esps/light/status"
        command_topic: "matrix/esps/light/switch"
        brightness_state_topic: "matrix/esps/brightness/status"
        brightness_command_topic: "matrix/esps/brightness/set"
        rgb_state_topic: "matrix/esps/rgb/status"
        rgb_command_topic: "matrix/esps/rgb/set"
        brightness: true
        flash: true
        rgb: true
        optimistic: false
        qos: 0
    	
    	sensor:
    #Light sensor
      - platform: mqtt  
        state_topic: "bruh/sensornode1"  
        name: "SN1 LDR"
        ##This sensor is not calibrated to actual LUX. Rather, this a map of the input voltage ranging from 0 - 1023.
        unit_of_measurement: "LUX"  
        value_template: '{{ value_json.ldr }}'  
        
    # Binary Sensors
    binary_sensor:
      - platform: threshold
        name: isdark
        entity_id: sensor.sn1_ldr
        lower: 100
        hidden: true
    	
    #Groups
    group:  
      sensor_node_1_card:  
        name: Sensor Node 1  
        entities:  
          - sensor.sn1_temperature  
          - sensor.sn1_humidity  
          - sensor.sn1_ldr  
          - light.sn1_led
    	
    automation:
    - alias: EspixelStick110 On       
      trigger:                               
        - platform: state                    
          entity_id: binary_sensor.isdark    
          to: 'on'                           
      condition:                             
        - condition: state                   
          entity_id: binary_sensor.isdark    
          state: 'on'                        
      action:                                
        - service: mqtt.publish              
          data_template:                     
            topic: "matrix/esps"         
            payload: '{"state":"ON"}'
                                                                       
    - alias: EspixelStick110 Off                                                         
      trigger:                                                                                  
        - platform: state                                                                       
          entity_id: binary_sensor.isdark                                                       
          to: 'off'                                                                             
      condition:                                                                                
        - condition: state                                                                      
          entity_id: binary_sensor.isdark
          state: 'on'                                                                           
      action:                                                                                   
        - service: mqtt.publish                                                                 
          data_template:                                                                        
            topic: "matrix/esps"                                               
            payload: '{"state":"OFF"}'                         
    script: !include scripts.yaml
    Any insight would be deeply appriciated

  6. #5
    Join Date
    Oct 2015
    Posts
    12
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    Quote Originally Posted by tecnageek View Post
    Hello, I have been working on this for some time and I could really use some help.
    In hassio I have created a binary sensor that communicates with a light sensor that can go into "isdark" state if the lux goes below 100.
    I then tried add an automation that when "isdark" activates it sends and on state to the EspixelStick and have lights come on. I can get my "isdark" state to on and I can manually turn on lights but can't get lights to trigger from "isdark".
    Below is parts of my config.yaml
    Code:
    light:  
    #espixelstick subnet 110
      - platform: mqtt
        name: "PixelStick01"
        state_topic: "matrix/esps/light/status"
        command_topic: "matrix/esps/light/switch"
        brightness_state_topic: "matrix/esps/brightness/status"
        brightness_command_topic: "matrix/esps/brightness/set"
        rgb_state_topic: "matrix/esps/rgb/status"
        rgb_command_topic: "matrix/esps/rgb/set"
        brightness: true
        flash: true
        rgb: true
        optimistic: false
        qos: 0
    	
    	sensor:
    #Light sensor
      - platform: mqtt  
        state_topic: "bruh/sensornode1"  
        name: "SN1 LDR"
        ##This sensor is not calibrated to actual LUX. Rather, this a map of the input voltage ranging from 0 - 1023.
        unit_of_measurement: "LUX"  
        value_template: '{{ value_json.ldr }}'  
        
    # Binary Sensors
    binary_sensor:
      - platform: threshold
        name: isdark
        entity_id: sensor.sn1_ldr
        lower: 100
        hidden: true
    	
    #Groups
    group:  
      sensor_node_1_card:  
        name: Sensor Node 1  
        entities:  
          - sensor.sn1_temperature  
          - sensor.sn1_humidity  
          - sensor.sn1_ldr  
          - light.sn1_led
    	
    automation:
    - alias: EspixelStick110 On       
      trigger:                               
        - platform: state                    
          entity_id: binary_sensor.isdark    
          to: 'on'                           
      condition:                             
        - condition: state                   
          entity_id: binary_sensor.isdark    
          state: 'on'                        
      action:                                
        - service: mqtt.publish              
          data_template:                     
            topic: "matrix/esps"         
            payload: '{"state":"ON"}'
                                                                       
    - alias: EspixelStick110 Off                                                         
      trigger:                                                                                  
        - platform: state                                                                       
          entity_id: binary_sensor.isdark                                                       
          to: 'off'                                                                             
      condition:                                                                                
        - condition: state                                                                      
          entity_id: binary_sensor.isdark
          state: 'on'                                                                           
      action:                                                                                   
        - service: mqtt.publish                                                                 
          data_template:                                                                        
            topic: "matrix/esps"                                               
            payload: '{"state":"OFF"}'                         
    script: !include scripts.yaml
    Any insight would be deeply appriciated
    I would suggest posting this question here https://www.reddit.com/r/homeassistant/ or on the official home assistant forums. They should easily be able to tell you what is going on. I'm still to new with home assistant to be of much help.

    I've found both to be great communities full of knowledge.

    I don't want to draw people away from this forum. I really think everyone's light setups should be combined with home automation software so any member of the house can start/stop/change the show.

  7. #6
    Join Date
    Dec 2011
    Posts
    5,800
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    Quote Originally Posted by tecnageek View Post
    Hello, I have been working on this for some time and I could really use some help.
    In hassio I have created a binary sensor that communicates with a light sensor that can go into "isdark" state if the lux goes below 100.
    I then tried add an automation that when "isdark" activates it sends and on state to the EspixelStick and have lights come on. I can get my "isdark" state to on and I can manually turn on lights but can't get lights to trigger from "isdark".
    Below is parts of my config.yaml
    Code:
    light:  
    #espixelstick subnet 110
      - platform: mqtt
        name: "PixelStick01"
        state_topic: "matrix/esps/light/status"
        command_topic: "matrix/esps/light/switch"
        brightness_state_topic: "matrix/esps/brightness/status"
        brightness_command_topic: "matrix/esps/brightness/set"
        rgb_state_topic: "matrix/esps/rgb/status"
        rgb_command_topic: "matrix/esps/rgb/set"
        brightness: true
        flash: true
        rgb: true
        optimistic: false
        qos: 0
    	
    	sensor: <<<<<<<<<
    #Light sensor
      - platform: mqtt  
        state_topic: "bruh/sensornode1"  
        name: "SN1 LDR"
        ##This sensor is not calibrated to actual LUX. Rather, this a map of the input voltage ranging from 0 - 1023.
        unit_of_measurement: "LUX"  
        value_template: '{{ value_json.ldr }}'  
        
    # Binary Sensors
    binary_sensor:
      - platform: threshold
        name: isdark
        entity_id: sensor.sn1_ldr
        lower: 100
        hidden: true
    	
    #Groups
    group:  
      sensor_node_1_card:  
        name: Sensor Node 1  
        entities:  
          - sensor.sn1_temperature  
          - sensor.sn1_humidity  
          - sensor.sn1_ldr  
          - light.sn1_led
    	
    automation:
    - alias: EspixelStick110 On       
      trigger:                               
        - platform: state                    
          entity_id: binary_sensor.isdark    
          to: 'on'                           
      condition:                             
        - condition: state                   
          entity_id: binary_sensor.isdark    
          state: 'on'                        
      action:                                
        - service: mqtt.publish              
          data_template:                     
            topic: "matrix/esps"         
            payload: '{"state":"ON"}'
                                                                       
    - alias: EspixelStick110 Off                                                         
      trigger:                                                                                  
        - platform: state                                                                       
          entity_id: binary_sensor.isdark                                                       
          to: 'off'                                                                             
      condition:                                                                                
        - condition: state                                                                      
          entity_id: binary_sensor.isdark
          state: 'on'                                                                           
      action:                                                                                   
        - service: mqtt.publish                                                                 
          data_template:                                                                        
            topic: "matrix/esps"                                               
            payload: '{"state":"OFF"}'                         
    script: !include scripts.yaml
    Any insight would be deeply appriciated
    is your sensor: in the correct location ?

    i know nothing about hassio , just curious as to why the indent

  8. #7
    Join Date
    Nov 2016
    Location
    Washington State
    Posts
    149
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    Yes, the indentation is correct. All sensors are working, just not able to get them to talk with the espixelstick.

  9. #8
    Join Date
    Nov 2016
    Location
    Washington State
    Posts
    149
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    So I was digging around and noticed the “The service dev tool” in Hassio and was able to come up with a working automation.
    Now I need to be able to figure out how to send a color, and possibly send different colors based on different environmental variables.


    Code:
    - alias: EspixelStick110 On       
      trigger:                               
        - platform: state                    
          entity_id: binary_sensor.isdark    
          to: 'on'                           
      action:                                
        - service: homeassistant.turn_on                                                                
          entity_id: 
            light.pixelstick110                                                                        
    
                                                                       
    - alias: EspixelStick110 Off                                                         
      trigger:                                                                                  
        - platform: state                                                                       
          entity_id: binary_sensor.isdark                                                       
          to: 'off'                                                                             
      action:                                                                                   
        - service: homeassistant.turn_off                                                                
          entity_id: 
            light.pixelstick110

  10. #9
    Join Date
    Aug 2008
    Location
    Columbus, OH
    Posts
    4,228
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    Can you only have two options?
    Why not tell Alexis: "turn lights green" instead of "saying turn lights on"
    Quote Originally Posted by tecnageek View Post
    So I was digging around and noticed the “The service dev tool” in Hassio and was able to come up with a working automation.
    Now I need to be able to figure out how to send a color, and possibly send different colors based on different environmental variables.


    Code:
    - alias: EspixelStick110 On       
      trigger:                               
        - platform: state                    
          entity_id: binary_sensor.isdark    
          to: 'on'                           
      action:                                
        - service: homeassistant.turn_on                                                                
          entity_id: 
            light.pixelstick110                                                                        
    
                                                                       
    - alias: EspixelStick110 Off                                                         
      trigger:                                                                                  
        - platform: state                                                                       
          entity_id: binary_sensor.isdark                                                       
          to: 'off'                                                                             
      action:                                                                                   
        - service: homeassistant.turn_off                                                                
          entity_id: 
            light.pixelstick110

  11. #10
    Join Date
    Dec 2013
    Location
    Williamsburg, VA
    Posts
    917
    Post Thanks / Like

    Default Re: Espixelstick and Home Assistant

    This is an interesting post. I'm setting up home assistant for my house, never thought of connecting to pixel controllers.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •